E2TaskManager::E2TaskManager(QWidget* par) : E2PopupFrame(par) { QVBoxLayout* vlayout = new QVBoxLayout(this); QLabel* label = new QLabel(this); label->setText(tr("System Memory Status")); vlayout->addWidget(label); m_memoryBar = new E2MemoryBar(this); vlayout->addWidget(m_memoryBar); memoryUpdate(); // force update m_memoryTimer = new QTimer(this); m_memoryTimer->setInterval(30000); connect(m_memoryTimer, SIGNAL(timeout()), this, SLOT(memoryUpdate())); m_taskList = new QTreeWidget(this); m_taskList->header()->setResizeMode(QHeaderView::Interactive); m_taskList->setRootIsDecorated(false); m_taskList->setItemsExpandable(false); QStringList labels; labels << QString("") << QString(tr("Name")) << QString(""); m_taskList->setHeaderLabels(labels); m_taskList->header()->setDefaultAlignment(Qt::AlignCenter); m_taskList->header()->setStretchLastSection(true); vlayout->addWidget(m_taskList); m_bar = new E2Bar(this); m_bar->setFixedHeight(24); vlayout->addWidget(m_bar); E2Button* button = new E2Button(m_bar); button->setText(tr("Switch", "Switch task")); connect(button, SIGNAL(clicked()), this, SLOT(switchToTask())); m_bar->addButton(button,0); button = new E2Button(m_bar); button->setText(tr("End", "End task")); connect(button, SIGNAL(clicked()), this, SLOT(endTask())); m_bar->addButton(button,0); button = new E2Button(m_bar); button->setText(tr("Cancel")); connect(button, SIGNAL(clicked()), this, SLOT(close())); m_bar->addButton(button,0); QObject::connect(&m_appMonitor, SIGNAL(applicationRunning(QString)), this, SLOT(doUpdate())); QObject::connect(&m_appMonitor, SIGNAL(applicationClosed(QString)), this, SLOT(doUpdate())); }
void Axis::processInteraction( ::scene2D::data::Event::sptr _event) { if( _event->getType() == ::scene2D::data::Event::Resize) { doUpdate(); } }
void AppLinkProvider::update() { emit aboutToBeChanged(); QHash<QString, AppLinkItem*> newItems; doUpdate(mXdgMenu->xml().documentElement(), newItems); { QMutableListIterator<CommandProviderItem*> i(*this); while (i.hasNext()) { AppLinkItem *item = static_cast<AppLinkItem*>(i.next()); AppLinkItem *newItem = newItems.take(item->command()); if (newItem) { *(item) = *newItem; // Copy by value, not pointer! delete newItem; } else { i.remove(); delete item; } } } { QHashIterator<QString, AppLinkItem*> i(newItems); while (i.hasNext()) { append(i.next().value()); } } emit changed(); }
void OverlayCategory::update() { if ( getOverlay().isVisible() ) { OverlayRendererSPtr renderer = getOverlay().getEngine()->getOverlayCache().getRenderer(); if ( renderer ) { if ( isPositionChanged() || renderer->isSizeChanged() ) { doUpdatePosition(); } if ( isSizeChanged() || renderer->isSizeChanged() ) { doUpdateSize(); } if ( isChanged() || isSizeChanged() || renderer->isSizeChanged() ) { doUpdate(); doUpdateBuffer( renderer->getSize() ); } m_positionChanged = false; m_sizeChanged = false; } } }
void SelfUpdater::askForUpdate() { QString t("A new version of the Server Control Panel is available:" "<p><b><FONT COLOR='#a9a9a9' FONT SIZE = 4>" "%1 v%2." "</b></p></br>"); QString text = t.arg( versionInfo["software_name"].toString(), versionInfo["latest_version"].toString() ); QString infoText = "Do you want to update now?"; QPixmap iconPixmap = QIcon(":/update").pixmap(80,80); QMessageBox msgBox; msgBox.setIconPixmap(iconPixmap); msgBox.setWindowTitle("WPN-XM Server Control Panel - Self Updater"); msgBox.setText(text); msgBox.setInformativeText(infoText); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setButtonText(QMessageBox::Yes, tr("Update")); msgBox.setButtonText(QMessageBox::No, tr("Continue")); msgBox.setDefaultButton(QMessageBox::Yes); if(msgBox.exec() == QMessageBox::Yes) { doUpdate(); } }
int database::dbPrivate::baseRecord::doSave() { int err=saveAllRelated(); if(err!=Basic::OK) { setError("some related enties couldn't save its value"); return err; } if(_hasChanged ) { if(_id.isNull() || _needNewId ) { int err=selectFromUnique(); if(err==Basic::NOTINDB) { err=doInsert(); return err; } } else { return doUpdate(); } } return Basic::OK; }
void E2TaskManager::showEvent(QShowEvent* e) { m_memoryTimer->start(); memoryUpdate(); E2PopupFrame::showEvent(e); doUpdate(); }
/* the test: insert some data, update it and finally delete it */ static sword doWork(char op, char *arg, OCISvcCtx *svcCtx, OCIStmt *stmthp, OCIError *errhp, test_req_t *resp) { sword status = OCI_SUCCESS; int empno; btlogger_debug( "TxLog doWork op=%c arg=%s", op, arg); empno = (*arg ? atoi(arg) : 8000); (resp->data)[0] = 0; if (op == '0') { status = doInsert(svcCtx, stmthp, errhp, empno); } else if (op == '1') { int rcnt = 0; // no of matching records status = doSelect(svcCtx, stmthp, errhp, empno, &rcnt); btlogger_snprintf(resp->data, sizeof (resp->data), "%d", rcnt); } else if (op == '2') { status = doUpdate(svcCtx, stmthp, errhp, empno); } else if (op == '3') { status = doDelete(svcCtx, stmthp, errhp, empno); } if (status != OCI_SUCCESS) get_error(resp, errhp, status); return status; }
void VibratoSpeedWidget::setUseProny(bool value) { useProny = value; prevVibratoSpeed = -999; prevVibratoWidth = -999; doUpdate(); }
// == Widget UpdateRoutines void DeviceWidget::UpdateDevice(bool ismounted){ //This is the full device update routine - usually only needs to be run on init (except for CD devices) isMounted = ismounted; //save this for later quickupdates = false; QTimer::singleShot(0,this, SLOT(doUpdate())); //allow the main process to continue on }
/** Score due to flip. Again, left and right refer to order on the <emph>target</emph> side. */ void DiscriminativeLMBigramFeatureFunction::doFlipUpdate(const TranslationOption* leftOption,const TranslationOption* rightOption, const TargetGap& leftGap, const TargetGap& rightGap, FVector& scores) { if (leftGap.segment.GetEndPos()+1 == rightGap.segment.GetStartPos()) { //contiguous Phrase gapPhrase(leftOption->GetTargetPhrase()); gapPhrase.Append(rightOption->GetTargetPhrase()); TargetGap gap(leftGap.leftHypo, rightGap.rightHypo, WordsRange(leftGap.segment.GetStartPos(), rightGap.segment.GetEndPos())); doUpdate(gapPhrase,gap,scores); } else { //discontiguous doUpdate(leftOption->GetTargetPhrase(), leftGap,scores); doUpdate(rightOption->GetTargetPhrase(), rightGap,scores); } }
void Axis::doReceive( ::fwServices::ObjectMsg::csptr _msg) throw( ::fwTools::Failed) { if( _msg->hasEvent( ::scene2D::data::ViewportMsg::VALUE_IS_MODIFIED) ) { doUpdate(); } }
LocalUpdateHandler::LocalUpdateHandler(UpdateListener *externalUpdateListener, LogWriter *log) : m_externalUpdateListener(externalUpdateListener), m_fullUpdateRequested(false) { // FIXME: Maybe the UpdateKeeper constructor can be empty? m_updateKeeper = new UpdateKeeper(); m_screenDriver = ScreenDriverFactory::createScreenDriver(m_updateKeeper, this, &m_backupFrameBuffer, &m_fbLocMut, log); m_updateKeeper->setBorderRect(&m_screenDriver->getScreenDimension().getRect()); m_mouseDetector = new MouseDetector(m_updateKeeper, this, log); m_mouseShapeDetector = new MouseShapeDetector(m_updateKeeper, this, &m_mouseGrabber, &m_mouseGrabLocMut, log); m_updateFilter = new UpdateFilter(m_screenDriver, &m_backupFrameBuffer, &m_fbLocMut, log); executeDetectors(); // Force first update with full screen grab m_absoluteRect = m_screenDriver->getScreenBuffer()->getDimension().getRect(); m_updateKeeper->addChangedRect(&m_absoluteRect); doUpdate(); }
void TabView::visibleRectChangedSlot(TabWidget* tw) { if (0) qDebug("%s: %svisible !", tw->name(), tw->hasVisibleRect() ? "":"un"); if (tw->hasVisibleRect()) doUpdate(0); }
Json::Value PathRequest::doCreate (Ledger::ref lrLedger, RippleLineCache::ref& cache, const Json::Value& value, bool& valid) { Json::Value status; if (parseJson (value, true) != PFR_PJ_INVALID) { bValid = isValid (cache); if (bValid) status = doUpdate (cache, true); else status = jvStatus; } else { bValid = false; status = jvStatus; } if (m_journal.debug) { if (bValid) { m_journal.debug << iIdentifier << " valid: " << raSrcAccount.humanAccountID (); m_journal.debug << iIdentifier << " Deliver: " << saDstAmount.getFullText (); } else m_journal.debug << iIdentifier << " invalid"; } valid = bValid; return status; }
UpdateHandlerImpl::UpdateHandlerImpl(UpdateListener *externalUpdateListener, ScreenDriverFactory *scrDriverFactory, LogWriter *log) : m_externalUpdateListener(externalUpdateListener), m_fullUpdateRequested(false), m_log(log) { m_screenDriver = scrDriverFactory->createScreenDriver(&m_updateKeeper, this, &m_backupFrameBuffer, &m_fbLocMut, log); // At this point the screen driver must contain valid screen properties. m_backupFrameBuffer.assignProperties(m_screenDriver->getScreenBuffer()); m_updateKeeper.setBorderRect(&m_screenDriver->getScreenDimension().getRect()); m_updateFilter = new UpdateFilter(m_screenDriver, &m_backupFrameBuffer, &m_fbLocMut, log); // At this point all common resources will be covered the mutex for changes. m_screenDriver->executeDetection(); // Force first update with full screen grab m_absoluteRect = m_backupFrameBuffer.getDimension().getRect(); m_updateKeeper.addChangedRect(&m_absoluteRect); doUpdate(); }
void IRCDDBApp::msgChannel (IRCMessage * m) { if (m->getPrefixNick().StartsWith(wxT("s-")) && (m->numParams >= 2)) // server msg { doUpdate(m->params[1]); } }
/** Score due to two segments. The left and right refer to the target positions.**/ void DiscriminativeLMBigramFeatureFunction::doContiguousPairedUpdate (const TranslationOption* leftOption,const TranslationOption* rightOption, const TargetGap& gap, FVector& scores) { Phrase gapPhrase(leftOption->GetTargetPhrase()); gapPhrase.Append(rightOption->GetTargetPhrase()); doUpdate(gapPhrase,gap,scores); }
KbMode::KbMode(Kb* parent, const KeyMap& keyMap, const KbMode& other) : QObject(parent), _name(other._name), _id(other._id), _light(new KbLight(this, keyMap, *other._light)), _bind(new KbBind(this, parent, keyMap, *other._bind)), _perf(new KbPerf(this, *other._perf)), _needsSave(true) { connect(_light, SIGNAL(updated()), this, SLOT(doUpdate())); }
void Entity::update(QueuedScene* qscene, Plane::Side side) { m_cullSide = side; doUpdate(qscene); doCalculateLod(qscene); if (!m_viewDistCulled && !m_queryCulled && m_world) m_visFrameId = m_world->getVisFrameId(); }
void inv::GameState::update(float dt) { doGameLogic(dt); doUpdate(dt); doCollisions(); doRemoval(); for(Entity* e : pushQueue) entities.push_back(e); pushQueue.clear(); }
void UpdateHandlerImpl::onUpdate() { UpdateContainer updCont; m_updateKeeper.getUpdateContainer(&updCont); if (!updCont.isEmpty()) { doUpdate(); } }
void AppLinkProvider::update() { emit aboutToBeChanged(); QHash<QString, AppLinkItem*> newItems; #ifdef HAVE_MENU_CACHE // libmenu-cache is available, use it to get cached app list GSList* apps = menu_cache_list_all_apps(mMenuCache); for(GSList* l = apps; l; l = l->next) { MenuCacheApp* app = MENU_CACHE_APP(l->data); AppLinkItem *item = new AppLinkItem(app); AppLinkItem *prevItem = newItems[item->command()]; if(prevItem) delete prevItem; // delete previous item; newItems.insert(item->command(), item); menu_cache_item_unref(MENU_CACHE_ITEM(app)); } g_slist_free(apps); #else // use libqtxdg XdgMenu to get installed apps doUpdate(mXdgMenu->xml().documentElement(), newItems); #endif { QMutableListIterator<CommandProviderItem*> i(*this); while (i.hasNext()) { AppLinkItem *item = static_cast<AppLinkItem*>(i.next()); AppLinkItem *newItem = newItems.take(item->command()); if (newItem) { *(item) = *newItem; // Copy by value, not pointer! // After the item is copied, the original "updateIcon" call queued // on the newItem object is never called since the object iss going to // be deleted. Hence we need to call it on the copied item manually. // Otherwise the copied item will have no icon. // FIXME: this is a dirty hack and it should be made cleaner later. if(item->icon().isNull()) QMetaObject::invokeMethod(item, "updateIcon", Qt::QueuedConnection); delete newItem; } else { i.remove(); delete item; } } } { QHashIterator<QString, AppLinkItem*> i(newItems); while (i.hasNext()) { append(i.next().value()); } } emit changed(); }
void TEditor::unlock() { if( lockCount > 0 ) { lockCount--; if( lockCount == 0 ) doUpdate(); } }
TunerView::TunerView( int viewID_, QWidget *parent ) : ViewWidget( viewID_, parent) { //setCaption("Chromatic Tuner"); Q3GridLayout *layout = new Q3GridLayout(this, 9, 3, 2); layout->setResizeMode(QLayout::SetNoConstraint); // Tuner widget goes from (0, 0) to (0, 8); //tunerWidget = new TunerWidget(this); tunerWidget = new VibratoTunerWidget(this); layout->addMultiCellWidget(tunerWidget, 0, 0, 0, 8); // Slider goes from (2,0) to (2,9) //slider = new QwtSlider(this, "slider", Qt::Horizontal, QwtSlider::Bottom, QwtSlider::BgTrough); #if QWT_VERSION == 0x050000 slider = new QwtSlider(this, Qt::Horizontal, QwtSlider::Bottom, QwtSlider::BgTrough); #else slider = new QwtSlider(this, Qt::Horizontal, QwtSlider::BottomScale, QwtSlider::BgTrough); #endif slider->setRange(0, 2); slider->setReadOnly(false); layout->addMultiCellWidget(slider, 1, 1, 0, 8); QToolTip::add(slider, "Increase slider to smooth the pitch over a longer time period"); ledBuffer = new QPixmap(); leds.push_back(new LEDIndicator(ledBuffer, this, "A")); leds.push_back(new LEDIndicator(ledBuffer, this, "B")); leds.push_back(new LEDIndicator(ledBuffer, this, "C")); leds.push_back(new LEDIndicator(ledBuffer, this, "D")); leds.push_back(new LEDIndicator(ledBuffer, this, "E")); leds.push_back(new LEDIndicator(ledBuffer, this, "F")); leds.push_back(new LEDIndicator(ledBuffer, this, "G")); leds.push_back(new LEDIndicator(ledBuffer, this, "#")); // Add the leds for note names into the positions (1, 0) to (1, 6) for (int n = 0; n < 7; n++) { layout->addWidget(leds.at(n), 2, n); } // (1, 7) is blank // Add the flat led layout->addWidget(leds.at(7), 2, 8); layout->setRowStretch( 0, 4 ); layout->setRowStretch( 1, 1 ); layout->setRowStretch( 2, 0 ); //connect(gdata->view, SIGNAL(onFastUpdate(double)), this, SLOT(update())); //connect(gdata, SIGNAL(onChunkUpdate()), tunerWidget, SLOT(doUpdate())); connect(gdata, SIGNAL(onChunkUpdate()), this, SLOT(doUpdate())); connect(tunerWidget, SIGNAL(ledSet(int, bool)), this, SLOT(setLed(int, bool))); }
void sched_write_back_all(char * cfgfile, void * shm_addr, void * SOHandle) { int x; struct service * services; int (*doUpdate)(struct service *,char *); //int (*doUpdateTrap)(struct trap *, char *); char * dlmsg; gshm_hdr=bartlby_SHM_GetHDR(shm_addr); //just to be sure ;) services=bartlby_SHM_ServiceMap(shm_addr); LOAD_SYMBOL(doUpdate,SOHandle, "doUpdate"); for(x=0; x<gshm_hdr->svccount; x++) { //Do not writeback services that came in via an orch-node if(bartlby_orchestra_belongs_to_orch(&services[x], cfgfile) < 0) { continue; } if(doUpdate(&services[x], cfgfile) != 1) { _log(LH_SCHED, B_LOG_CRIT, "doUpdate() failed in sched_writeback_all() '%s` for service id: %d", strerror(errno), services[x].service_id); } } _log(LH_SCHED, B_LOG_DEBUG,"wrote back %d services!", x); /* for(x=0; x<gshm_hdr->trapcount; x++) { //Do not writeback services that came in via an orch-node if(bartlby_orchestra_trap_belongs_to_orch(&traps[x], cfgfile) < 0) { continue; } if(doUpdateTrap(&traps[x], cfgfile) != 1) { _log(LH_SCHED, B_LOG_CRIT, "doUpdateTrap() failed in sched_writeback_all() '%s` for trap id: %d", strerror(errno), traps[x].trap_id); } } _log(LH_SCHED, B_LOG_DEBUG,"wrote back %d traps!", x); */ /* for(x=0; x<gshm_hdr->srvcount; x++) { doUpdateServer(&servers[x], cfgfile); } _log("wrote back %d servers!", x); */ }
//Bouton tour void CChronometreMFCDlg::OnBnClickedButton4() { doUpdate(); v_parcours->tour(); wstring str; string etape = v_parcours->getLastEtape(); str.assign(etape.begin(), etape.end()); m_listBox.InsertString(0,str.c_str()); UpdateData(FALSE); }
void MainWindowImpl::onHideRestore(void) { if (isVisible()) { hide(); actionHideRestore->setText(tr("&Restore")); } else { showNormal(); actionHideRestore->setText(tr("&Hide")); doUpdate(); } }
void CChronometreMFCDlg::OnTimer(UINT_PTR nIDEvent) { // TODO: Add your message handler code here and/or call default CDialog::OnTimer(nIDEvent); if(v_parcours != NULL){ doUpdate(); } UpdateData(FALSE); }
KbMode::KbMode(Kb* parent, const KeyMap& keyMap, const QString &guid, const QString& modified) : QObject(parent), _name("Unnamed"), _id(guid, modified), _light(new KbLight(this, keyMap)), _bind(new KbBind(this, parent, keyMap)), _perf(new KbPerf(this)), _needsSave(true) { connect(_light, SIGNAL(updated()), this, SLOT(doUpdate())); if(_id.guid.isNull()) _id.guid = QUuid::createUuid(); }