void CamTab::stop() { if (!timer->isActive()) { statusText("Not recording..."); return; } statusText("Recording stoped"); timer->stop(); }
// Cam Operation void CamTab::start() { if (timer->isActive()) { statusText("Already started..."); return; } statusText("Recording started"); timer->start(settings->getInterval()); execute(); }
gboolean ShortcutChooser::onShortcutKeyPress(GtkWidget* widget, GdkEventKey* event, ShortcutChooser* self) { std::string statusText(""); /** greebo: Workaround for allowing Shift+TAB as well (Tab becomes ISO_Left_Tab in that case) */ if (event->keyval == GDK_ISO_Left_Tab) { event->keyval = GDK_Tab; } // Store the shortcut string representation into the GtkEntry field gtk_entry_set_text(GTK_ENTRY(widget), GlobalEventManager().getGDKEventStr(event).c_str()); // Store this key/modifier combination for later use (UPPERCASE!) self->_keyval = gdk_keyval_to_upper(event->keyval); self->_state = event->state; IEvent* foundEvent = GlobalEventManager().findEvent(event); // Only display the note if any event was found and it's not the "self" event if (foundEvent != NULL && foundEvent != self->_event) { statusText = "Note: This is already assigned to: <b>"; statusText += GlobalEventManager().getEventName(foundEvent) + "</b>"; } gtk_label_set_markup(GTK_LABEL(self->_statusWidget), statusText.c_str()); return true; }
void Response::populateWebServiceWorkerResponse(blink::WebServiceWorkerResponse& response) { response.setStatus(status()); response.setStatusText(statusText()); response.setHeaders(m_headers->headerMap()); response.setBlobDataHandle(m_blobDataHandle); }
bool ShortcutChooser::onShortcutKeyPress(GdkEventKey* ev) { std::string statusText(""); /** greebo: Workaround for allowing Shift+TAB as well (Tab becomes ISO_Left_Tab in that case) */ if (ev->keyval == GDK_ISO_Left_Tab) { ev->keyval = GDK_Tab; } // Store the shortcut string representation into the Entry field _entry->set_text(GlobalEventManager().getGDKEventStr(ev)); // Store this key/modifier combination for later use (UPPERCASE!) _keyval = gdk_keyval_to_upper(ev->keyval); _state = ev->state; IEventPtr foundEvent = GlobalEventManager().findEvent(ev); // Only display the note if any event was found and it's not the "self" event if (!foundEvent->empty() && foundEvent != _event) { statusText = (boost::format(_("Note: This is already assigned to: <b>%s</b>")) % GlobalEventManager().getEventName(foundEvent)).str(); } _statusWidget->set_markup(statusText); return true; // don't propagate }
void MouseEventManager::updateStatusText(GdkEventKey* event) { _activeFlags = _modifiers.getKeyboardFlags(event->state); std::string statusText(""); if (_activeFlags != 0) { for (ButtonIdMap::iterator it = _buttonId.begin(); it != _buttonId.end(); ++it) { // Look up an event with this button ID and the given modifier ui::XYViewEvent xyEvent = findXYViewEvent(it->second, _activeFlags); if (xyEvent != ui::xyNothing) { statusText += _modifiers.getModifierStr(_activeFlags, true) + "-"; statusText += getShortButtonName(it->first) + ": "; statusText += printXYViewEvent(xyEvent); statusText += " "; } // Look up an event with this button ID and the given modifier ui::ObserverEvent obsEvent = findObserverEvent(it->second, _activeFlags); if (obsEvent != ui::obsNothing) { statusText += _modifiers.getModifierStr(_activeFlags, true) + "-"; statusText += getShortButtonName(it->first) + ": "; statusText += printObserverEvent(obsEvent); statusText += " "; } } } GlobalRadiant().setStatusText(statusText); }
void CamTab::updateInterval() { if (!timer->isActive()) return; statusText(QString("Interval Changed to %1 seconds. Resetting timer...").arg(settings->getInterval()/1000)); timer->start(settings->getInterval()); execute(); }
void CamTab::updateViewPort() { viewPort->load(getCurrentCam()); QString stxt(getCurrentCam()); stxt += " - "; stxt += QDateTime::currentDateTime().toString(); statusText(stxt); }
// Constructeur. Editeur::Editeur(Graph* graph) : mGraph(graph), mLayout(new QGridLayout(this)), mCombo(new QComboBox), mStackedWidget(new QStackedWidget), mEditPolygone(new EditPolygone), mEditObstacles(new EditObstacles(mEditPolygone)), mEditPopulations(new EditPopulations(mEditPolygone)), mEditPistons(new EditPistons(mEditPolygone)), mEditTransformations(new EditTransformations), mEditCourbes(new EditCourbes), mEditDivers(new EditDivers) { // Création de l'interface graphique. mCombo->addItem("obstacles"); mCombo->addItem("populations"); mCombo->addItem("pistons"); mCombo->addItem("transformations"); mCombo->addItem("curves"); mCombo->addItem("misc"); mStackedWidget->addWidget(mEditObstacles); mStackedWidget->addWidget(mEditPopulations); mStackedWidget->addWidget(mEditPistons); mStackedWidget->addWidget(mEditTransformations); mStackedWidget->addWidget(mEditCourbes); mStackedWidget->addWidget(mEditDivers); mLayout->setMargin(0); mLayout->addWidget(mCombo, 0, 0); mLayout->addWidget(mStackedWidget, 1, 0); mLayout->addWidget(mEditPolygone, 2, 0); // Connexion des signaux et slots. QObject::connect(mCombo, SIGNAL(activated(int)), this, SLOT(activate(int))); QObject::connect(mEditPolygone, SIGNAL(modified(Polygone, QSet<unsigned int>)), this, SLOT(setPolygone(Polygone, QSet<unsigned int>))); QObject::connect(mEditPolygone, SIGNAL(statusText(QString)), this, SIGNAL(statusText(QString))); // activate 0 QObject::connect(mEditObstacles, SIGNAL(polygones(QList<Polygone>)), this, SLOT(setPolygones(QList<Polygone>))); }
// Constructeur. Document::Document() : mUntitled(true), mModified(false), mReady(false), mSimulMode(true), mPlaying(false), mLayout(new QVBoxLayout(this)), mSplitter(new QSplitter), mGraph(new Graph(mConfig)), mStackedWidget(new QStackedWidget), mSimulateur(new Simulateur(mConfig)), mEditeur(new Editeur(mGraph)), mConfig() { // Le widget est détruit à sa fermeture. this->setAttribute(Qt::WA_DeleteOnClose); // Création de l'interface graphique. mSplitter->addWidget(mGraph); mSplitter->addWidget(mStackedWidget); mStackedWidget->addWidget(mSimulateur); mStackedWidget->addWidget(mEditeur); mLayout->setMargin(5); mLayout->addWidget(mSplitter); // Connexion des signaux et slots. QObject::connect(mSplitter, SIGNAL(splitterMoved(int, int)), this, SLOT(resizeGraph(int, int))); QObject::connect(mSimulateur, SIGNAL(draw()), this, SLOT(draw())); QObject::connect(mSimulateur, SIGNAL(fullDraw()), this, SLOT(fullDraw())); QObject::connect(mSimulateur, SIGNAL(statusText(QString)), this, SIGNAL(statusText(QString))); QObject::connect(mEditeur, SIGNAL(draw()), this, SLOT(draw())); QObject::connect(mEditeur, SIGNAL(fullDraw()), this, SLOT(fullDraw())); QObject::connect(mEditeur, SIGNAL(statusText(QString)), this, SIGNAL(statusText(QString))); QObject::connect(mGraph, SIGNAL(draw()), this, SLOT(draw())); QObject::connect(mGraph, SIGNAL(fullDraw()), this, SLOT(fullDraw())); // Zoom initial. mGraph->setZoom(0); }
QString Holding::toString() const { return QString("Holding: T:%1 Min:%2/Nm:%3 " "St:%4 Ent:%5 TTrack:%6deg/L:%7 ela:%8s"). arg(m_holding_track). arg(m_hold_leg_length_min, 2, 'f', 1). arg(m_hold_leg_length_nm, 2, 'f', 1). arg(statusText(m_status)). arg(entryTypeText(m_entry_type)). arg(m_true_target_track). arg(m_turn_to_target_track_with_left_turn). arg(m_timer.elapsed()/1000); }
void LLFloaterPathfindingConsole::updatePathTestStatus() { std::string statusText(""); LLStyle::Params styleParams; switch (LLPathfindingPathTool::getInstance()->getPathStatus()) { case LLPathfindingPathTool::kPathStatusUnknown : statusText = getString("pathing_unknown"); styleParams.color = mErrorColor; break; case LLPathfindingPathTool::kPathStatusChooseStartAndEndPoints : statusText = getString("pathing_choose_start_and_end_points"); styleParams.color = mWarningColor; break; case LLPathfindingPathTool::kPathStatusChooseStartPoint : statusText = getString("pathing_choose_start_point"); styleParams.color = mWarningColor; break; case LLPathfindingPathTool::kPathStatusChooseEndPoint : statusText = getString("pathing_choose_end_point"); styleParams.color = mWarningColor; break; case LLPathfindingPathTool::kPathStatusHasValidPath : statusText = getString("pathing_path_valid"); break; case LLPathfindingPathTool::kPathStatusHasInvalidPath : statusText = getString("pathing_path_invalid"); styleParams.color = mErrorColor; break; case LLPathfindingPathTool::kPathStatusNotEnabled : statusText = getString("pathing_region_not_enabled"); styleParams.color = mErrorColor; break; case LLPathfindingPathTool::kPathStatusNotImplemented : statusText = getString("pathing_library_not_implemented"); styleParams.color = mErrorColor; break; case LLPathfindingPathTool::kPathStatusError : statusText = getString("pathing_error"); styleParams.color = mErrorColor; break; default : statusText = getString("pathing_unknown"); styleParams.color = mErrorColor; break; } mPathTestingStatus->setText((LLStringExplicit)statusText, styleParams); }
int StatusBar::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: statusText((*reinterpret_cast< QString(*)>(_a[1]))); break; } _id -= 1; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { _id -= 1; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: statusText(*reinterpret_cast< QString*>(_v)); break; } _id -= 1; } else if (_c == QMetaObject::ResetProperty) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 1; } #endif // QT_NO_PROPERTIES return _id; }
void ResourceResponse::platformLazyInit() { if (m_isUpToDate) return; m_isUpToDate = true; if (m_isNull) { ASSERT(!m_cfResponse.get()); return; } // FIXME: We may need to do MIME type sniffing here (unless that is done in CFURLResponseGetMIMEType). m_url = CFURLResponseGetURL(m_cfResponse.get()); m_mimeType = CFURLResponseGetMIMEType(m_cfResponse.get()); m_expectedContentLength = CFURLResponseGetExpectedContentLength(m_cfResponse.get()); m_textEncodingName = CFURLResponseGetTextEncodingName(m_cfResponse.get()); m_lastModifiedDate = toTimeT(CFURLResponseGetLastModifiedDate(m_cfResponse.get())); RetainPtr<CFStringRef> suggestedFilename(AdoptCF, CFURLResponseCopySuggestedFilename(m_cfResponse.get())); m_suggestedFilename = suggestedFilename.get(); CFHTTPMessageRef httpResponse = CFURLResponseGetHTTPResponse(m_cfResponse.get()); if (httpResponse) { m_httpStatusCode = CFHTTPMessageGetResponseStatusCode(httpResponse); RetainPtr<CFStringRef> statusLine(AdoptCF, CFHTTPMessageCopyResponseStatusLine(httpResponse)); String statusText(statusLine.get()); int spacePos = statusText.find(' '); // Remove the status code from the status text. spacePos = statusText.find(' ', spacePos + 1); statusText = statusText.substring(spacePos + 1); m_httpStatusText = statusText; RetainPtr<CFDictionaryRef> headers(AdoptCF, CFHTTPMessageCopyAllHeaderFields(httpResponse)); CFIndex headerCount = CFDictionaryGetCount(headers.get()); Vector<const void*, 128> keys(headerCount); Vector<const void*, 128> values(headerCount); CFDictionaryGetKeysAndValues(headers.get(), keys.data(), values.data()); for (int i = 0; i < headerCount; ++i) m_httpHeaderFields.set((CFStringRef)keys[i], (CFStringRef)values[i]); } else m_httpStatusCode = 0; }
void MouseEventManager::updateStatusText(wxKeyEvent& ev) { unsigned int newFlags = _modifiers.getKeyboardFlags(ev); // Only do this if the flags actually changed if (newFlags == _activeFlags) { return; } _activeFlags = newFlags; std::string statusText(""); if (_activeFlags != 0) { for (ButtonIdMap::iterator it = _buttonId.begin(); it != _buttonId.end(); it++) { // Look up an event with this button ID and the given modifier ui::XYViewEvent xyEvent = findXYViewEvent(it->second, _activeFlags); if (xyEvent != ui::xyNothing) { statusText += _modifiers.getModifierStr(_activeFlags, true) + "-"; statusText += getShortButtonName(it->first) + ": "; statusText += printXYViewEvent(xyEvent); statusText += " "; } // Look up an event with this button ID and the given modifier ui::ObserverEvent obsEvent = findObserverEvent(it->second, _activeFlags); if (obsEvent != ui::obsNothing) { statusText += _modifiers.getModifierStr(_activeFlags, true) + "-"; statusText += getShortButtonName(it->first) + ": "; statusText += printObserverEvent(obsEvent); statusText += " "; } } } // Pass the call GlobalUIManager().getStatusBarManager().setText(STATUSBAR_COMMAND, statusText); }
void ControlPanel::setPlayer(const UserInfo &ui) { userName->setText(ui.name); aliasName->setText(ui.name); authority->setText(authorityText(ui.auth)); status->setText(statusText(ui)); ip->setText(ui.ip); lastAp->setText(ui.date); mute->setDisabled(true); if (!ui.online()) { kick->setDisabled(true); pm->setDisabled(true); } else { kick->setEnabled(true); pm->setEnabled(true); } }
void LinkStatus::save(QDomElement& element) const { QDomElement child_element = element.ownerDocument().createElement("link"); // <url> QDomElement tmp_1 = element.ownerDocument().createElement("url"); tmp_1.appendChild(element.ownerDocument().createTextNode(absoluteUrl().prettyURL())); child_element.appendChild(tmp_1); // <status> tmp_1 = element.ownerDocument().createElement("status"); tmp_1.setAttribute("broken", ResultView::displayableWithStatus(this, ResultView::bad) ? "true" : "false"); tmp_1.appendChild(element.ownerDocument().createTextNode(statusText())); child_element.appendChild(tmp_1); // <label> tmp_1 = element.ownerDocument().createElement("label"); tmp_1.appendChild(element.ownerDocument().createTextNode(KCharsets::resolveEntities(label()))); child_element.appendChild(tmp_1); // <referers> tmp_1 = element.ownerDocument().createElement("referrers"); for(QValueVector<KURL>::const_iterator it = referrers_.begin(); it != referrers_.end(); ++it) { QDomElement tmp_2 = element.ownerDocument().createElement("url"); tmp_2.appendChild(element.ownerDocument().createTextNode(it->prettyURL())); tmp_1.appendChild(tmp_2); } Q_ASSERT(!referrers_.isEmpty()); child_element.appendChild(tmp_1); element.appendChild(child_element); }
void Editor::setupToolbar() { topToolbar = new KToolBar(this, "editToolBar"); topToolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); actionCollection = new KActionCollection(this); // new game QAction *newBoard = actionCollection->addAction(QLatin1String("new_board")); newBoard->setIcon(KIcon(QLatin1String("document-new"))); newBoard->setText(i18n("New board")); connect(newBoard, SIGNAL(triggered(bool)), SLOT(newBoard())); topToolbar->addAction(newBoard); // open game QAction *openBoard = actionCollection->addAction(QLatin1String("open_board")); openBoard->setIcon(KIcon(QLatin1String("document-open"))); openBoard->setText(i18n("Open board")); connect(openBoard, SIGNAL(triggered(bool)), SLOT(loadBoard())); topToolbar->addAction(openBoard); // save game QAction *saveBoard = actionCollection->addAction(QLatin1String("save_board")); saveBoard->setIcon(KIcon(QLatin1String("document-save"))); saveBoard->setText(i18n("Save board")); connect(saveBoard, SIGNAL(triggered(bool)), SLOT(saveBoard())); topToolbar->addAction(saveBoard); // NOTE dimsuz: how to port this? is it even needed? //topToolbar->setButtonIconSet(ID_TOOL_SAVE,loader->loadIconSet("document-save", KIconLoader::Toolbar)); topToolbar->addSeparator(); #ifdef FUTURE_OPTIONS // Select QAction *select = actionCollection->addAction(QLatin1String("select")); select->setIcon(KIcon(QLatin1String("rectangle_select"))); select->setText(i18n("Select")); topToolbar->addAction(select); // NOTE: use kstandarddactions? QAction *cut = actionCollection->addAction(QLatin1String("edit_cut")); cut->setIcon(KIcon(QLatin1String("edit-cut"))); cut->setText(i18n("Cut")); topToolbar->addAction(cut); QAction *copy = actionCollection->addAction(QLatin1String("edit_copy")); copy->setIcon(KIcon(QLatin1String("edit-copy"))); copy->setText(i18n("Copy")); topToolbar->addAction(copy); QAction *paste = actionCollection->addAction(QLatin1String("edit_paste")); paste->setIcon(KIcon(QLatin1String("edit-paste"))); paste->setText(i18n("Paste")); topToolbar->addAction(paste); topToolbar->addSeparator(); QAction *moveTiles = actionCollection->addAction(QLatin1String("move_tiles")); moveTiles->setIcon(KIcon(QLatin1String("move"))); moveTiles->setText(i18n("Move tiles")); topToolbar->addAction(moveTiles); #endif KToggleAction *addTiles = new KToggleAction(KIcon(QLatin1String("draw-freehand")), i18n("Add ti" "les"), this); actionCollection->addAction(QLatin1String("add_tiles"), addTiles); topToolbar->addAction(addTiles); KToggleAction *delTiles = new KToggleAction(KIcon(QLatin1String("edit-delete")), i18n("Remove t" "iles" ), this); actionCollection->addAction(QLatin1String("del_tiles"), delTiles); topToolbar->addAction(delTiles); QActionGroup *radioGrp = new QActionGroup(this); radioGrp->setExclusive(true); radioGrp->addAction(addTiles); addTiles->setChecked(true); #ifdef FUTURE_OPTIONS radioGrp->addAction(moveTiles); #endif radioGrp->addAction(delTiles); connect(radioGrp, SIGNAL(triggered(QAction*)), SLOT(slotModeChanged(QAction*))); // board shift topToolbar->addSeparator(); // NOTE: maybe join shiftActions in QActionGroup and create one slot(QAction*) instead of 4 slots? ;) // Does this makes sense? dimsuz QAction *shiftLeft = actionCollection->addAction(QLatin1String("shift_left")); shiftLeft->setIcon(KIcon(QLatin1String("go-previous"))); shiftLeft->setText(i18n("Shift left")); connect(shiftLeft, SIGNAL(triggered(bool)), SLOT(slotShiftLeft())); topToolbar->addAction(shiftLeft); QAction *shiftUp = actionCollection->addAction(QLatin1String("shift_up")); shiftUp->setIcon(KIcon(QLatin1String("go-up"))); shiftUp->setText(i18n("Shift up")); connect(shiftUp, SIGNAL(triggered(bool)), SLOT(slotShiftUp())); topToolbar->addAction(shiftUp); QAction *shiftDown = actionCollection->addAction(QLatin1String("shift_down")); shiftDown->setIcon(KIcon(QLatin1String("go-down"))); shiftDown->setText(i18n("Shift down")); connect(shiftDown, SIGNAL(triggered(bool)), SLOT(slotShiftDown())); topToolbar->addAction(shiftDown); QAction *shiftRight = actionCollection->addAction(QLatin1String("shift_right")); shiftRight->setIcon(KIcon(QLatin1String("go-next"))); shiftRight->setText(i18n("Shift right")); connect(shiftRight, SIGNAL(triggered(bool)), SLOT(slotShiftRight())); topToolbar->addAction(shiftRight); topToolbar->addSeparator(); QAction *quit = actionCollection->addAction(KStandardAction::Quit, QLatin1String("quit"), this, SLOT(close())); topToolbar->addAction(quit); // status in the toolbar for now (ick) QWidget *hbox = new QWidget(topToolbar); QHBoxLayout *layout = new QHBoxLayout(hbox); layout->setMargin(0); layout->setSpacing(0); layout->addStretch(); theLabel = new QLabel(statusText(), hbox); layout->addWidget(theLabel); topToolbar->addWidget(hbox); topToolbar->adjustSize(); setMinimumWidth(topToolbar->width()); }
void Editor::statusChanged() { bool canSave = ((numTiles != 0) && ((numTiles & 1) == 0)); theLabel->setText(statusText()); actionCollection->action("save_board")->setEnabled(canSave); }
void ForwardRules::buildDefaultRules(const char* domain, const char* hostname, const char* ipAddress, const char* fqhn, int localPort, TiXmlDocument& xmlDoc) { // Note: fqhn == fully qualified host name UtlString hostnamePort(hostname ? hostname : "localhost"); UtlString domainPort(domain ? domain : ""); UtlString ipAddressPort(ipAddress ? ipAddress : "127.0.0.1"); UtlString fqhnPort(fqhn ? fqhn : "localhost"); if(localPort == 5060) localPort = PORT_NONE; if(portIsValid(localPort)) { char portString[40]; sprintf(portString,":%d", localPort); hostnamePort.append(portString); domainPort.append(portString); ipAddressPort.append(portString); fqhnPort.append(portString); } UtlString sdsAddress(fqhn); sdsAddress.append(":5090"); UtlString statusAddress(fqhn); statusAddress.append(":5110"); UtlString regAddress(fqhn); regAddress.append(":5070"); UtlString configAddress("sipuaconfig"); UtlString configFqhnAddress(configAddress); configFqhnAddress.append("."); configFqhnAddress.append(domain); TiXmlElement routes("routes"); TiXmlElement route("route"); route.SetAttribute("mappingType", "local"); TiXmlElement routeFromDomain("routeFrom"); TiXmlText domainText(domainPort.data()); TiXmlElement routeFromFqhn("routeFrom"); TiXmlText fqhnText(fqhnPort.data()); TiXmlElement routeFromHost("routeFrom"); TiXmlText hostText(hostnamePort.data()); TiXmlElement routeFromIp("routeFrom"); TiXmlText ipText(ipAddressPort.data()); TiXmlElement methodMatch("methodMatch"); TiXmlElement methodPattern("methodPattern"); TiXmlText subscribe("SUBSCRIBE"); TiXmlElement fieldMatchConfig("fieldMatch"); fieldMatchConfig.SetAttribute("fieldName", "Event"); TiXmlElement fieldPatternConfig("fieldPattern"); TiXmlText configEvent("sip-config"); TiXmlElement routeToSds("routeTo"); TiXmlText sdsText(sdsAddress.data()); TiXmlElement fieldMatchStatus("fieldMatch"); fieldMatchStatus.SetAttribute("fieldName", "Event"); TiXmlElement fieldPatternStatus("fieldPattern"); TiXmlText mwiEvent("message-summary*"); TiXmlElement routeToStatus("routeTo"); TiXmlText statusText(statusAddress.data()); TiXmlElement routeToReg("routeTo"); TiXmlText regText(regAddress.data()); TiXmlElement routeConfig("route"); TiXmlElement routeFromFqhnConfig("routeFrom"); TiXmlText fqhnConfigText(configFqhnAddress.data()); TiXmlElement routeFromConfig("routeFrom"); TiXmlText configText(configAddress.data()); // Link everything up in reverse order as it TinyXml // makes copies routeFromDomain.InsertEndChild(domainText); route.InsertEndChild(routeFromDomain); routeFromHost.InsertEndChild(hostText); route.InsertEndChild(routeFromHost); routeFromFqhn.InsertEndChild(fqhnText); route.InsertEndChild(routeFromFqhn); routeFromIp.InsertEndChild(ipText); route.InsertEndChild(routeFromIp); methodPattern.InsertEndChild(subscribe); methodMatch.InsertEndChild(methodPattern); fieldPatternStatus.InsertEndChild(mwiEvent); fieldMatchStatus.InsertEndChild(fieldPatternStatus); routeToStatus.InsertEndChild(statusText); fieldMatchStatus.InsertEndChild(routeToStatus); methodMatch.InsertEndChild(fieldMatchStatus); fieldPatternConfig.InsertEndChild(configEvent); fieldMatchConfig.InsertEndChild(fieldPatternConfig); routeToSds.InsertEndChild(sdsText); fieldMatchConfig.InsertEndChild(routeToSds); methodMatch.InsertEndChild(fieldMatchConfig); routeToReg.InsertEndChild(regText); methodMatch.InsertEndChild(routeToReg); route.InsertEndChild(methodMatch); route.InsertEndChild(routeToReg); routeFromFqhnConfig.InsertEndChild(fqhnConfigText); routeConfig.InsertEndChild(routeFromFqhnConfig); routeFromConfig.InsertEndChild(configText); routeConfig.InsertEndChild(routeFromConfig); routeConfig.InsertEndChild(routeToReg); routes.InsertEndChild(route); routes.InsertEndChild(routeConfig); xmlDoc.InsertEndChild(routes); }
void OPackageManager::loadInstalledPackages() { OConfItemList *destList = m_ipkg.destinations(); if ( destList ) { // Initialize status messaging emit initStatus( destList->count() ); int destCount = 0; bool categoryAdded = false; for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) { OConfItem *destination = destIt.current(); // Process destination only if it is active if ( destination->active() ) { // Update status QString status = tr( "Reading installed packages:\n\t" ); status.append( destination->name() ); emit statusText( status ); ++destCount; emit statusBar( destCount ); qApp->processEvents(); OPackageList *packageList = m_ipkg.installedPackages( destination->name(), destination->value() ); if ( packageList ) { for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) { OPackage *package = packageIt.current(); OPackage *currPackage = m_packages[package->name()]; if ( currPackage ) { // Package is in a current feed, update installed version, destination currPackage->setVersionInstalled( package->versionInstalled() ); currPackage->setDestination( package->destination() ); delete package; } else { // Package isn't in a current feed, add to list m_packages.insert( package->name(), package ); // Add category to list if it doesn't already exist if ( m_categories.grep( package->category() ).isEmpty() ) { m_categories << package->category(); categoryAdded = true; } } } } } } delete destList; // Sort category list if categories were added if ( categoryAdded ) m_categories.sort(); } }
void OPackageManager::loadAvailablePackages() { m_packages.clear(); OConfItemList *serverList = m_ipkg.servers(); if ( serverList ) { // Initialize status messaging emit initStatus( serverList->count() ); int serverCount = 0; bool categoryAdded = false; for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) { OConfItem *server = serverIt.current(); // Process server only if it is active if ( server->active() ) { // Update status QString status = tr( "Reading available packages:\n\t" ); status.append( server->name() ); emit statusText( status ); ++serverCount; emit statusBar( serverCount ); qApp->processEvents(); OPackageList *packageList = m_ipkg.availablePackages( server->name() ); if ( packageList ) { for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) { OPackage *package = packageIt.current(); // Load package info if ( !m_packages.find( package->name() ) ) m_packages.insert( package->name(), package ); else { // If new package is newer version, replace existing package OPackage *currPackage = m_packages[package->name()]; if ( compareVersions( package->version(), currPackage->version() ) == 1 ) m_packages.replace( package->name(), package ); } // Add category to list if it doesn't already exist if ( m_categories.grep( package->category() ).isEmpty() ) { m_categories << package->category(); categoryAdded = true; } } } } } delete serverList; // Sort category list if categories were added if ( categoryAdded ) m_categories.sort(); } }
void EditorWidget::displayStatusText(const std::string& s) { emit statusText(s); }
void AccountsListDelegate::updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const { // draws: // AccountName // Checkbox | Icon | | ConnectionIcon | ConnectionState // errorMessage if (!index.isValid()) { return; } Q_ASSERT(widgets.size() == 6); // Get the widgets QCheckBox* checkbox = qobject_cast<QCheckBox*>(widgets.at(0)); ChangeIconButton* changeIconButton = qobject_cast<ChangeIconButton*>(widgets.at(1)); QLabel *statusTextLabel = qobject_cast<QLabel*>(widgets.at(2)); QLabel *statusIconLabel = qobject_cast<QLabel*>(widgets.at(3)); EditDisplayNameButton *displayNameButton = qobject_cast<EditDisplayNameButton*>(widgets.at(4)); QLabel *connectionErrorLabel = qobject_cast<QLabel*>(widgets.at(5)); Q_ASSERT(checkbox); Q_ASSERT(changeIconButton); Q_ASSERT(statusTextLabel); Q_ASSERT(statusIconLabel); Q_ASSERT(displayNameButton); Q_ASSERT(connectionErrorLabel); bool isSelected(itemView()->selectionModel()->isSelected(index) && itemView()->hasFocus()); bool isEnabled(index.data(KTp::AccountsListModel::EnabledRole).toBool()); KIcon accountIcon(index.data(Qt::DecorationRole).value<QIcon>()); KIcon statusIcon(index.data(KTp::AccountsListModel::ConnectionStateIconRole).value<QIcon>()); QString statusText(index.data(KTp::AccountsListModel::ConnectionStateDisplayRole).toString()); QString displayName(index.data(Qt::DisplayRole).toString()); QString connectionError(index.data(KTp::AccountsListModel::ConnectionErrorMessageDisplayRole).toString()); Tp::AccountPtr account(index.data(KTp::AccountsListModel::AccountRole).value<Tp::AccountPtr>()); if (!account->isEnabled()) { connectionError = i18n("Click checkbox to enable"); } QRect outerRect(0, 0, option.rect.width(), option.rect.height()); QRect contentRect = outerRect.adjusted(m_hpadding,m_vpadding,-m_hpadding,-m_vpadding); //add some padding // checkbox if (isEnabled) { checkbox->setChecked(true);; checkbox->setToolTip(i18n("Disable account")); } else { checkbox->setChecked(false); checkbox->setToolTip(i18n("Enable account")); } int checkboxLeftMargin = contentRect.left(); int checkboxTopMargin = (outerRect.height() - checkbox->height()) / 2; checkbox->move(checkboxLeftMargin, checkboxTopMargin); // changeIconButton changeIconButton->setIcon(accountIcon); changeIconButton->setAccount(account); // At the moment (KDE 4.8.1) decorationSize is not passed from KWidgetItemDelegate // through the QStyleOptionViewItem, therefore we leave default size unless // the user has a more recent version. if (option.decorationSize.width() > -1) { changeIconButton->setButtonIconSize(option.decorationSize.width()); } int changeIconButtonLeftMargin = checkboxLeftMargin + checkbox->width(); int changeIconButtonTopMargin = (outerRect.height() - changeIconButton->height()) / 2; changeIconButton->move(changeIconButtonLeftMargin, changeIconButtonTopMargin); // statusTextLabel QFont statusTextFont = option.font; QPalette statusTextLabelPalette = option.palette; if (isEnabled) { statusTextLabel->setEnabled(true); statusTextFont.setItalic(false); } else { statusTextLabel->setDisabled(true); statusTextFont.setItalic(true); } if (isSelected) { statusTextLabelPalette.setColor(QPalette::Text, statusTextLabelPalette.color(QPalette::Active, QPalette::HighlightedText)); } statusTextLabel->setPalette(statusTextLabelPalette); statusTextLabel->setFont(statusTextFont); statusTextLabel->setText(statusText); statusTextLabel->setFixedSize(statusTextLabel->fontMetrics().boundingRect(statusText).width(), statusTextLabel->height()); int statusTextLabelLeftMargin = contentRect.right() - statusTextLabel->width(); int statusTextLabelTopMargin = (outerRect.height() - statusTextLabel->height()) / 2; statusTextLabel->move(statusTextLabelLeftMargin, statusTextLabelTopMargin); // statusIconLabel statusIconLabel->setPixmap(statusIcon.pixmap(KIconLoader::SizeSmall)); statusIconLabel->setFixedSize(statusIconLabel->minimumSizeHint()); int statusIconLabelLeftMargin = contentRect.right() - statusTextLabel->width() - statusIconLabel->width() - 6; int statusIconLabelTopMargin = (outerRect.height() - statusIconLabel->height()) / 2; statusIconLabel->move(statusIconLabelLeftMargin, statusIconLabelTopMargin); QRect innerRect = contentRect.adjusted(changeIconButton->geometry().right() - contentRect.left(), 0, -statusTextLabel->width() - statusIconLabel->width() - 6, 0); // rect containing account name and error message // displayNameButton QFont displayNameButtonFont = option.font; QPalette displayNameButtonPalette = option.palette; if (isEnabled) { displayNameButtonPalette.setColor(QPalette::WindowText, displayNameButtonPalette.color(QPalette::Active, QPalette::Text)); displayNameButtonFont.setBold(true); } else { displayNameButtonFont.setItalic(true); // NOTE: Flat QPushButton use WindowText instead of ButtonText for button text color displayNameButtonPalette.setColor(QPalette::WindowText, displayNameButtonPalette.color(QPalette::Disabled, QPalette::Text)); } if (isSelected) { // Account is selected displayNameButtonPalette.setColor(QPalette::WindowText, displayNameButtonPalette.color(QPalette::Active, QPalette::HighlightedText)); } displayNameButton->setFont(displayNameButtonFont); displayNameButton->setPalette(displayNameButtonPalette); QString displayNameButtonText = displayNameButton->fontMetrics().elidedText(displayName, Qt::ElideRight, innerRect.width() - (m_hpadding*2)); displayNameButton->setText(displayNameButtonText); displayNameButton->setFixedSize(displayNameButton->fontMetrics().boundingRect(displayNameButtonText).width() + (m_hpadding*2), displayNameButton->minimumSizeHint().height()); displayNameButton->setAccount(account); int displayNameButtonLeftMargin = innerRect.left(); int displayNameButtonTopMargin = innerRect.top(); displayNameButton->move(displayNameButtonLeftMargin, displayNameButtonTopMargin); // connectionErrorLabel QFont connectionErrorLabelFont = option.font; QPalette connectionErrorLabelPalette = option.palette; if (isEnabled) { connectionErrorLabelPalette.setColor(QPalette::WindowText, connectionErrorLabelPalette.color(QPalette::Active, QPalette::Text)); } else { connectionErrorLabelFont.setItalic(true); connectionErrorLabelPalette.setColor(QPalette::Text, connectionErrorLabelPalette.color(QPalette::Disabled, QPalette::Text)); } if (isSelected) { // Account is selected connectionErrorLabelPalette.setColor(QPalette::Text, connectionErrorLabelPalette.color(QPalette::Active, QPalette::HighlightedText)); } connectionErrorLabel->setFont(connectionErrorLabelFont); connectionErrorLabel->setPalette(connectionErrorLabelPalette); QString connectionErrorLabelText = connectionErrorLabel->fontMetrics().elidedText(connectionError, Qt::ElideRight, innerRect.width() - (m_hpadding*2)); connectionErrorLabel->setText(connectionErrorLabelText); connectionErrorLabel->setFixedSize(connectionErrorLabel->fontMetrics().boundingRect(connectionErrorLabelText).width(), displayNameButton->height()); int connectionErrorLabelLeftMargin = innerRect.left() + m_hpadding; int connectionErrorLabelTopMargin = contentRect.bottom() - displayNameButton->height(); connectionErrorLabel->move(connectionErrorLabelLeftMargin, connectionErrorLabelTopMargin); }
void LLFloaterPathfindingObjects::updateMessagingStatus() { std::string statusText(""); LLColor4 color; switch (getMessagingState()) { case kMessagingUnknown: statusText = getString("messaging_initial"); color = mErrorTextColor; break; case kMessagingGetRequestSent : statusText = getString("messaging_get_inprogress"); color = mWarningTextColor; break; case kMessagingGetError : statusText = getString("messaging_get_error"); color = mErrorTextColor; break; case kMessagingSetRequestSent : statusText = getString("messaging_set_inprogress"); color = mWarningTextColor; break; case kMessagingSetError : statusText = getString("messaging_set_error"); color = mErrorTextColor; break; case kMessagingComplete : if (mObjectsScrollList->isEmpty()) { statusText = getString("messaging_complete_none_found"); } else { S32 numItems = mObjectsScrollList->getItemCount(); S32 numSelectedItems = mObjectsScrollList->getNumSelected(); LLLocale locale(LLStringUtil::getLocale()); std::string numItemsString; LLResMgr::getInstance()->getIntegerString(numItemsString, numItems); std::string numSelectedItemsString; LLResMgr::getInstance()->getIntegerString(numSelectedItemsString, numSelectedItems); LLStringUtil::format_map_t string_args; string_args["[NUM_SELECTED]"] = numSelectedItemsString; string_args["[NUM_TOTAL]"] = numItemsString; statusText = getString("messaging_complete_available", string_args); } color = LLUI::sColorsGroup->getColor("PathfindingGoodColor"); break; case kMessagingNotEnabled : statusText = getString("messaging_not_enabled"); color = mErrorTextColor; break; default: statusText = getString("messaging_initial"); color = mErrorTextColor; llassert(0); break; } mMessagingStatus->setText((LLStringExplicit)statusText); mMessagingStatus->setColor(color); }
void Subscriptions::setStatusText(const QString &t) { if (t != statusText()) { m_statusText = t; emit statusTextChanged(t); } }
void PsiContactListViewDelegate::drawContact(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { drawBackground(painter, option, index); const QPixmap statusPixmap = this->statusPixmap(index); const QSize pixmapSize = statusPixmap.size(); const QRect avatarRect = relativeRect(option, pixmapSize, QRect()); painter->drawPixmap(avatarRect.topLeft(), statusPixmap); QRect r = relativeRect(option, QSize(), avatarRect, 3); QColor textColor; if(index.data(ContactListModel::IsAnimRole).toBool()) { if(index.data(ContactListModel::PhaseRole).toBool()) { textColor = ColorOpt::instance()->color("options.ui.look.colors.contactlist.status-change-animation2"); } else { textColor = ColorOpt::instance()->color("options.ui.look.colors.contactlist.status-change-animation1"); } } else { if (statusType(index) == XMPP::Status::Away || statusType(index) == XMPP::Status::XA) textColor = ColorOpt::instance()->color("options.ui.look.colors.contactlist.status.away"); else if (statusType(index) == XMPP::Status::DND) textColor = ColorOpt::instance()->color("options.ui.look.colors.contactlist.status.do-not-disturb"); else if (statusType(index) == XMPP::Status::Offline) textColor = ColorOpt::instance()->color("options.ui.look.colors.contactlist.status.offline"); else textColor = ColorOpt::instance()->color("options.ui.look.colors.contactlist.status.online"); } QStyleOptionViewItemV2 o = option; o.font = *font_; o.fontMetrics = *fontMetrics_; QPalette palette = o.palette; palette.setColor(QPalette::Text, textColor); o.palette = palette; QString text = nameText(o, index); if (showStatusMessages_ && !statusText(index).isEmpty()) { if(!statusSingle_) { text = tr("%1 (%2)").arg(text).arg(statusText(index)); drawText(painter, o, r, text, index); } else { QRect txtRect(r); txtRect.setHeight(r.height()*2/3); drawText(painter, o, txtRect, text, index); QString statusMsg = statusText(index); palette.setColor(QPalette::Text, ColorOpt::instance()->color("options.ui.look.colors.contactlist.status-messages")); o.palette = palette; txtRect.moveTopRight(txtRect.bottomRight()); txtRect.setHeight(r.height() - txtRect.height()); o.font.setPointSize(qMax(o.font.pointSize()-2, 7)); o.fontMetrics = QFontMetrics(o.font); drawText(painter, o, txtRect, statusMsg, index); } } else { if(showStatusMessages_ && statusSingle_) r.setHeight(r.height()*2/3); drawText(painter, o, r, text, index); } #if 0 int x; if (d->status_single) x = widthUsed(); else { QFontMetrics fm(p->font()); const QPixmap *pix = pixmap(column); x = fm.width(text(column)) + (pix ? pix->width() : 0) + 8; } if (d->u) { UserResourceList::ConstIterator it = d->u->priority(); if (it != d->u->userResourceList().end()) { if (d->u->isSecure((*it).name())) { const QPixmap &pix = IconsetFactory::iconPixmap("psi/cryptoYes"); int y = (height() - pix.height()) / 2; p->drawPixmap(x, y, pix); x += 24; } } } #endif }
void Editor::statusChanged() { bool canSave = ((numTiles !=0) && ((numTiles & 1) == 0)); theLabel->setText(statusText()); topToolbar->setItemEnabled( ID_TOOL_SAVE, canSave); }
// --------------------------------------------------------- void Editor::setupToolbar() { KIconLoader *loader = KGlobal::iconLoader(); topToolbar = new KToolBar( this, "editToolBar" ); KToolBarRadioGroup *radio = new KToolBarRadioGroup(topToolbar); // new game topToolbar->insertButton(loader->loadIcon("filenew", KIcon::Toolbar), ID_TOOL_NEW, true, i18n("New board")); // open game topToolbar->insertButton(loader->loadIcon("fileopen", KIcon::Toolbar), ID_TOOL_LOAD, true, i18n("Open board")); // save game topToolbar->insertButton(loader->loadIcon("filesave", KIcon::Toolbar), ID_TOOL_SAVE, true, i18n("Save board")); topToolbar->setButtonIconSet(ID_TOOL_SAVE,loader->loadIconSet("filesave", KIcon::Toolbar)); #ifdef FUTURE_OPTIONS // Select topToolbar->insertSeparator(); topToolbar->insertButton(loader->loadIcon("rectangle_select", KIcon::Toolbar), ID_TOOL_SELECT, true, i18n("Select")); topToolbar->insertButton(loader->loadIcon("editcut", KIcon::Toolbar), ID_TOOL_CUT, true, i18n("Cut")); topToolbar->insertButton(loader->loadIcon("editcopy", KIcon::Toolbar), ID_TOOL_COPY, true, i18n("Copy")); topToolbar->insertButton(loader->loadIcon("editpaste", KIcon::Toolbar), ID_TOOL_PASTE, true, i18n("Paste")); topToolbar->insertSeparator(); topToolbar->insertButton(loader->loadIcon("move", KIcon::Toolbar), ID_TOOL_MOVE, true, i18n("Move tiles")); #endif topToolbar->insertButton(loader->loadIcon("pencil", KIcon::Toolbar), ID_TOOL_ADD, true, i18n("Add tiles")); topToolbar->insertButton(loader->loadIcon("editdelete", KIcon::Toolbar), ID_TOOL_DEL, true, i18n("Remove tiles")); topToolbar->setToggle(ID_TOOL_ADD); topToolbar->setToggle(ID_TOOL_MOVE); topToolbar->setToggle(ID_TOOL_DEL); topToolbar->toggleButton(ID_TOOL_ADD); radio->addButton(ID_TOOL_ADD); #ifdef FUTURE_OPTIONS radio->addButton(ID_TOOL_MOVE); #endif radio->addButton(ID_TOOL_DEL); // board shift topToolbar->insertSeparator(); topToolbar->insertButton(loader->loadIcon("back", KIcon::Toolbar), ID_TOOL_LEFT, true, i18n("Shift left")); topToolbar->insertButton(loader->loadIcon("up", KIcon::Toolbar), ID_TOOL_UP, true, i18n("Shift up")); topToolbar->insertButton(loader->loadIcon("down", KIcon::Toolbar), ID_TOOL_DOWN, true, i18n("Shift down")); topToolbar->insertButton(loader->loadIcon("forward", KIcon::Toolbar), ID_TOOL_RIGHT, true, i18n("Shift right")); topToolbar->insertSeparator(); topToolbar->insertButton(loader->loadIcon("exit", KIcon::Toolbar), ID_META_EXIT, true, i18n("Exit")); // status in the toolbar for now (ick) theLabel = new QLabel(statusText(), topToolbar); int lWidth = theLabel->sizeHint().width(); topToolbar->insertWidget(ID_TOOL_STATUS,lWidth, theLabel ); topToolbar->alignItemRight( ID_TOOL_STATUS, true ); //addToolBar(topToolbar); connect( topToolbar, SIGNAL(clicked(int) ), SLOT( topToolbarOption(int) ) ); topToolbar->updateRects(0); topToolbar->setFullSize(true); topToolbar->setBarPos(KToolBar::Top); // topToolbar->enableMoving(false); topToolbar->adjustSize(); setMinimumWidth(topToolbar->width()); }
void Job::jobFinished(Report& report, bool b) { setStatus(b ? Success : Error); emit progress(numSteps()); emit finished(); report.setStatus(i18nc("@info/plain job status (error, warning, ...)", "%1: %2", description(), statusText())); }