void DeviceWidget::confirmCB(int value) { updateButtons(true); }
QT_BEGIN_NAMESPACE FindWidget::FindWidget(QWidget *parent) : QWidget(parent) , appPalette(qApp->palette()) { TRACE_OBJ installEventFilter(this); QHBoxLayout *hboxLayout = new QHBoxLayout(this); QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); #ifndef Q_OS_MAC hboxLayout->setMargin(0); hboxLayout->setSpacing(6); resourcePath.append(QLatin1String("win")); #else resourcePath.append(QLatin1String("mac")); #endif toolClose = setupToolButton(QLatin1String(""), resourcePath + QLatin1String("/closetab.png")); hboxLayout->addWidget(toolClose); connect(toolClose, SIGNAL(clicked()), SLOT(hide())); editFind = new QLineEdit(this); hboxLayout->addWidget(editFind); editFind->setMinimumSize(QSize(150, 0)); connect(editFind, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); connect(editFind, SIGNAL(returnPressed()), this, SIGNAL(findNext())); connect(editFind, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); toolPrevious = setupToolButton(tr("Previous"), resourcePath + QLatin1String("/previous.png")); connect(toolPrevious, SIGNAL(clicked()), this, SIGNAL(findPrevious())); hboxLayout->addWidget(toolPrevious); toolNext = setupToolButton(tr("Next"), resourcePath + QLatin1String("/next.png")); hboxLayout->addWidget(toolNext); connect(toolNext, SIGNAL(clicked()), this, SIGNAL(findNext())); checkCase = new QCheckBox(tr("Case Sensitive"), this); hboxLayout->addWidget(checkCase); labelWrapped = new QLabel(this); labelWrapped->setScaledContents(true); labelWrapped->setTextFormat(Qt::RichText); labelWrapped->setMinimumSize(QSize(0, 20)); labelWrapped->setMaximumSize(QSize(105, 20)); labelWrapped->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); labelWrapped->setText(tr("<img src=\":/trolltech/assistant/images/wrap.png\"" "> Search wrapped")); hboxLayout->addWidget(labelWrapped); QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem); setMinimumWidth(minimumSizeHint().width()); labelWrapped->hide(); updateButtons(); }
void frmSetLimit::on_btnF_clicked() { m1.setPerHi(1); m1.setPerLo(-1); updateButtons(); }
NotificationsConfig::NotificationsConfig( QWidget* parent ) : ConfigDialogBase( parent ) , m_oldAlignment( static_cast<OSDWidget::Alignment>( AmarokConfig::osdAlignment() ) ) , m_oldYOffset( AmarokConfig::osdYOffset() ) { setupUi( this ); connect( this, SIGNAL(changed()), parent, SLOT(updateButtons()) ); m_osdPreview = new OSDPreviewWidget( this ); //must be child!!! m_osdPreview->setAlignment( static_cast<OSDWidget::Alignment>( AmarokConfig::osdAlignment() ) ); m_osdPreview->setYOffset( AmarokConfig::osdYOffset() ); m_osdPreview->setFontScale( AmarokConfig::osdFontScaling() ); m_osdPreview->setTranslucent( AmarokConfig::osdUseTranslucency() ); #ifdef Q_WS_MAC QCheckBox* growl = new QCheckBox( i18n( "Use Growl for notifications" ), this ); growl->setChecked( AmarokConfig::growlEnabled() ); gridLayout_5->addWidget( growl, 2, 0, 1, 1 ); connect( growl, SIGNAL(toggled(bool)), this, SLOT(setGrowlEnabled(bool)) ); #endif // Enable/disable the translucency option depending on availablity of desktop compositing kcfg_OsdUseTranslucency->setEnabled( KWindowSystem::compositingActive() ); connect( m_osdPreview, SIGNAL(positionChanged()), SLOT(slotPositionChanged()) ); const int numScreens = QApplication::desktop()->numScreens(); for( int i = 0; i < numScreens; i++ ) kcfg_OsdScreen->addItem( QString::number( i ) ); connect( kcfg_OsdTextColor, SIGNAL(changed(QColor)), m_osdPreview, SLOT(setTextColor(QColor)) ); connect( kcfg_OsdUseCustomColors, SIGNAL(toggled(bool)), this, SLOT(useCustomColorsToggled(bool)) ); connect( kcfg_OsdScreen, SIGNAL(activated(int)), m_osdPreview, SLOT(setScreen(int)) ); connect( kcfg_OsdEnabled, SIGNAL(toggled(bool)), m_osdPreview, SLOT(setVisible(bool)) ); connect( kcfg_OsdUseTranslucency, SIGNAL(toggled(bool)), m_osdPreview, SLOT(setTranslucent(bool)) ); connect( kcfg_OsdFontScaling, SIGNAL(valueChanged(int)), m_osdPreview, SLOT(setFontScale(int)) ); /* Amarok::QStringx text = i18n( "<h3>Tags Displayed in OSD</h3>" "You can use the following tokens:" "<ul>" "<li>Title - %1" "<li>Album - %2" "<li>Artist - %3" "<li>Genre - %4" "<li>Bitrate - %5" "<li>Year - %6" "<li>Track Length - %7" "<li>Track Number - %8" "<li>Filename - %9" "<li>Directory - %10" "<li>Type - %11" "<li>Comment - %12" "<li>Score - %13" "<li>Playcount - %14" "<li>Disc Number - %15" "<li>Rating - %16" "<li>Elapsed Time - %17" "</ul>" "If you surround sections of text that contain a token with curly-braces, that section will be hidden if the token is empty, for example:" "<pre>%18</pre>" "Will not show <b>Score: <i>%score</i></b> if the track has no score." ); */ }
void UserAgentDlg::deleteAllPressed() { dlg->lvDomainPolicyList->clear(); updateButtons(); configChanged(); }
void QDesignerQ3WidgetStack::showEvent(QShowEvent *e) { Q3WidgetStack::showEvent(e); updateButtons(); }
void KCommonDecoration::activeChange() { updateButtons(); widget()->update(); // do something similar to updateCaption here }
/* * This deals with updating the 'board' and the 'interface handler' with the data * stored in the tree at the move place. * This involves calling and update for the board stones, and * an update of the interface */ void BoardHandler::updateMove(Move *m, bool /*ignore_update*/) { if (m == NULL) { m = tree->getCurrent(); } //qDebug("BoardHandler::updateMove(Move *m)"); /* // Fastloading. Create matrix for current move and insert marks if (!m->checked) { qDebug("NOT CHECKED"); if (m->parent != NULL) { #ifndef NO_DEBUG if (tree->getCurrent()->getMatrix() != NULL) { qFatal("MOVE HAS A MATRIX BUT SHOULD NOT!"); } #endif Matrix *dad = m->parent->getMatrix(); Matrix *neu = new Matrix(*dad); m->setMatrix(neu); } addStoneSGF(m->getColor(), m->getX(), m->getY()); QIntDict<FastLoadMark> *d = m->fastLoadMarkDict; if (d != NULL && !d->isEmpty()) { QIntDictIterator<FastLoadMark> it(*d); while (it.current()) { m->getMatrix()->insertMark(it.current()->x, it.current()->y, it.current()->t); if (it.current()->t == markText && !(it.current()->txt).isNull()) m->getMatrix()->setMarkText(it.current()->x, it.current()->y, it.current()->txt); ++it; } delete d; m->fastLoadMarkDict = NULL; } m->checked = true; } *//* FIXME We can set the color from the SGFParser to black and that * will fix the cursor color but it doesn't fix the move that's played * which means its a deeper issue. This had to do with getBlackTurn() * in qgoboard.cpp which thought that the root had something to * do with who's turn it is. But move color and cursor color * should be linked somehow, encapsulated, etc.. */ /**/ Q_CHECK_PTR(m); // int currentMove = m->getMoveNumber(); // int brothers = getNumBrothers(); // Update slider branch length boardwindow->getInterfaceHandler()->setSliderMax(m->getMoveNumber() + tree->getBranchLength()); // Display move data and comment in the GUI // if (m->getGameMode() == modeNormal) boardwindow->getInterfaceHandler()->setMoveData( m->getMoveNumber(), (m->getColor() != stoneBlack), m->getNumBrothers(), m->getNumSons(), m->hasParent(), m->hasPrevBrother(), m->hasNextBrother(), m->getX(), m->getY()); // else // board->getInterfaceHandler()->setMoveData(currentMove, getBlackTurn(), brothers, getNumSons(), // hasParent(), hasPrevBrother(), hasNextBrother()); // if (board->get_isLocalGame()) // Update comment if normal game (if observe or match, the comment zone is kept as is) if (boardwindow->getGameMode() == modeNormal) boardwindow->getInterfaceHandler()->displayComment(m->getComment()); // Get rid of the varation ghosts // if (setting->readIntEntry("VAR_GHOSTS"))//TODO board->removeGhosts(); // Get rid of all marks except the last-move-mark // board->hideAllMarks(); // Remove territory marks // if (tree->getCurrent()->isTerritoryMarked()) // { // tree->getCurrent()->getMatrix()->clearTerritoryMarks(); // tree->getCurrent()->setTerritoryMarked(false); // } // Unshade dead stones // if (markedDead) // { board->removeDeadMarks(); // markedDead = false; // } updateAll(m); // if (m->getGameMode() == modeNormal || m->getGameMode() == modeObserve ) //SL add eb 8 // If the node is in normal mode, show the circle to mark the last move board->updateLastMove(m); // else // ... if node is in edit mode, just delete that circle // { // board->removeLastMoveMark(); // board->setCurStoneColor(); // } updateButtons(m->getColor()); updateCursor(m->getColor()); //FIXME what about moveControl ? // board->setCursorType(cur); // Update the ghosts indicating variations if (m->getNumBrothers())// && setting->readIntEntry("VAR_GHOSTS")) TODO updateVariationGhosts(m); // Oops, something serious went wrong if (m->getMatrix() == NULL) qFatal(" *** Move returns NULL pointer for matrix! ***"); // Synchronize the board with the current nodes matrix, provided we want to // if (!ignore_update) //SL added eb 9 - this if we are browsing an observing game and an undo incomes // updateAll(m->getMatrix()); //FIXME this should probably be above in the code // Display captures or score in the GUI // if (m->isScored()) // This move has been scored // board->getInterfaceHandler()->setCaptures(m->getScoreBlack(), m->getScoreWhite(), true); // else boardwindow->getInterfaceHandler()->setCaptures(m->getCapturesBlack(), m->getCapturesWhite()); // Display times if(boardwindow->getGameMode() == modeNormal) { if(m->getMoveNumber() == 0) { GameData * gameData = boardwindow->getGameData(); if (gameData->timelimit == 0) boardwindow->getClockDisplay()->setTimeInfo(0, -1, 0, -1); else boardwindow->getClockDisplay()->setTimeInfo(gameData->timelimit, -1, gameData->timelimit, -1); } else if(m->getTimeinfo()) { int other_time, other_stones_periods; if(m->parent && m->parent->getMoveNumber() != 0 && m->parent->getTimeinfo()) { other_time = (int)m->parent->getTimeLeft(); other_stones_periods = (m->parent->getOpenMoves() == 0 ? -1 : m->parent->getOpenMoves()); } else { other_time = 0; other_stones_periods = -1; } if(!boardwindow->qgoboard->getBlackTurn()) boardwindow->getClockDisplay()->setTimeInfo((int)m->getTimeLeft(), m->getOpenMoves() == 0 ? -1 : m->getOpenMoves(), other_time, other_stones_periods); else boardwindow->getClockDisplay()->setTimeInfo(other_time, other_stones_periods, (int)m->getTimeLeft(), m->getOpenMoves() == 0 ? -1 : m->getOpenMoves()); } } //board->updateCanvas(); }
void MainDlg::OnLbxRuleItemSelect(wxCommandEvent& event) { updateButtons(); }
KSegSelectionGroupDialog::KSegSelectionGroupDialog(KSegView *view, vector<KSegSelectionGroup *> &inGroups, KSegDocument *inDoc) : QDialog(view), justMade(true), doc(inDoc), groups(inGroups) { QHBoxLayout *hbl = new QHBoxLayout(this); groupLBox = new QListWidget(this); groupLBox->setMinimumSize(140, 300); hbl->addWidget(groupLBox); hbl->addSpacing(8); QVBoxLayout *vbl = new QVBoxLayout(); selectBut = new QPushButton(tr("Select"), this); deselectBut = new QPushButton(tr("Deselect"), this); newBut = new QPushButton(tr("New Group"), this); deleteBut = new QPushButton(tr("Delete Group"),this); closeBut = new QPushButton(tr("Close"), this); affectInvisible = new QCheckBox(tr("Affect\nInvisible\nItems"), this); QToolTip::add(selectBut, tr("Hold SHIFT and click to add to current selection")); selectBut->installEventFilter(this); QToolTip::add(affectInvisible, tr("Whether the \"All <Type>\" groups also (de)select invisible objects")); vbl->addSpacing(8); vbl->addWidget(selectBut); vbl->addWidget(deselectBut); vbl->addWidget(newBut); vbl->addWidget(deleteBut); vbl->addWidget(closeBut); vbl->addSpacing(16); vbl->addWidget(affectInvisible); vbl->addItem(new QSpacerItem(0, 0)); hbl->addLayout(vbl); hbl->addSpacing(8); //now set up items properties connect(groupLBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons())); connect(doc, SIGNAL(documentChanged()), this, SLOT(updateButtons())); connect(selectBut, SIGNAL(clicked()), this, SLOT(select())); connect(deselectBut, SIGNAL(clicked()), this, SLOT(deselect())); connect(newBut, SIGNAL(clicked()), this, SLOT(newGroup())); connect(deleteBut, SIGNAL(clicked()), this, SLOT(deleteGroup())); connect(closeBut, SIGNAL(clicked()), this, SLOT(close())); groupLBox->setSelectionMode(QAbstractItemView::ExtendedSelection); groupLBox->addItem("*" + tr("All Points")); groupLBox->addItem("*" + tr("All Segments")); groupLBox->addItem("*" + tr("All Rays")); groupLBox->addItem("*" + tr("All Lines")); groupLBox->addItem("*" + tr("All Circles")); groupLBox->addItem("*" + tr("All Arcs")); groupLBox->addItem("*" + tr("All Polygons")); groupLBox->addItem("*" + tr("All Circle Interiors")); groupLBox->addItem("*" + tr("All Arc Sectors")); groupLBox->addItem("*" + tr("All Arc Segments")); groupLBox->addItem("*" + tr("All Loci")); groupLBox->addItem("*" + tr("All Measurements")); groupLBox->addItem("*" + tr("All Calculations")); numFixedGroups = groupLBox->count(); int i; for(i = 0; i < (int)groups.size(); ++i) { groupLBox->addItem(" " + groups[i]->getName()); } }
AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConfigSkeleton *config ) : KConfigDialog( parent, name, config ) , m_engineConfig( 0 ) , m_opt4( 0 ) { setWFlags( WDestructiveClose ); // IMPORTANT Don't simply change the page names, they are used as identifiers in other parts of the app. m_opt1 = new Options1( 0, "General" ); m_opt2 = new Options2( 0, "Appearance" ); m_opt4 = new Options4( 0, "Playback" ); Options5 *opt5 = new Options5( 0, "OSD" ); QVBox *opt6 = new QVBox; m_opt7 = new Options7( 0, "Collection" ); Options8 *opt8 = new Options8( 0, "Scrobbler" ); QVBox *opt9 = new QVBox; // Sound System opt6->setName( "Engine" ); opt6->setSpacing( KDialog::spacingHint() ); QWidget *groupBox, *aboutEngineButton; groupBox = new QGroupBox( 2, Qt::Horizontal, i18n("Sound System"), opt6 ); m_engineConfigFrame = new QGroupBox( 1, Qt::Horizontal, opt6 ); m_soundSystem = new QComboBox( false, groupBox ); aboutEngineButton = new QPushButton( i18n("About"), groupBox ); QToolTip::add( m_soundSystem, i18n("Click to select the sound system to use for playback.") ); QToolTip::add( aboutEngineButton, i18n("Click to get the plugin information.") ); /// Populate the engine selection combo box KTrader::OfferList offers = PluginManager::query( "[X-KDE-amaroK-plugintype] == 'engine'" ); KTrader::OfferList::ConstIterator end( offers.end() ); for( KTrader::OfferList::ConstIterator it = offers.begin(); it != end; ++it ) { // Don't list the <no engine> (void engine) entry if it's not currenty active, // cause there's no point in choosing this engine (it's a dummy, after all). if( (*it)->property( "X-KDE-amaroK-name" ).toString() == "void-engine" && AmarokConfig::soundSystem() != "void-engine" ) continue; m_soundSystem->insertItem( (*it)->name() ); // Save name properties in QMap for lookup m_pluginName[(*it)->name()] = (*it)->property( "X-KDE-amaroK-name" ).toString(); m_pluginAmarokName[(*it)->property( "X-KDE-amaroK-name" ).toString()] = (*it)->name(); } // Collection #if !defined(USE_MYSQL) && !defined(USE_POSTGRESQL) m_opt7->databaseBox->hide(); #endif #ifndef USE_MYSQL //FIXME we do this because this widget breaks the Apply button (always enabled). //It breaks because it is set to type="password" in the .kcfg file. Setting to //type="string" also fixes this bug, but means the password is stored in plain //text. This is a temporary fix so that the majority of users get a fixed Apply //button. delete m_opt7->dbSetupFrame->kcfg_MySqlPassword2; #endif m_opt7->collectionFoldersBox->setColumns( 1 ); new CollectionSetup( m_opt7->collectionFoldersBox ); //TODO this widget doesn't update the apply/ok buttons // Media Devices opt9->setName( "Media Devices" ); opt9->setSpacing( KDialog::spacingHint() ); QVBox *topbox = new QVBox( opt9 ); topbox->setSpacing( KDialog::spacingHint() ); QGroupBox *mediaBox = new QGroupBox( 2, Qt::Horizontal, i18n("Media Devices"), topbox ); mediaBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); QVBox *vbox = new QVBox( mediaBox ); vbox->setSpacing( KDialog::spacingHint() ); m_deviceManager = new MediumPluginManager( vbox ); QHBox *hbox = new QHBox( topbox ); hbox->setSpacing( KDialog::spacingHint() ); hbox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); KPushButton *autodetect = new KPushButton( i18n( "Autodetect Devices" ), hbox ); autodetect->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( autodetect, SIGNAL(clicked()), m_deviceManager, SLOT(redetectDevices()) ); KPushButton *add = new KPushButton( i18n( "Add Device..." ), hbox ); add->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( add, SIGNAL(clicked()), m_deviceManager, SLOT(newDevice()) ); QFrame *frame = new QFrame( topbox ); frame->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); // add pages addPage( m_opt1, i18n( "General" ), "misc", i18n( "Configure General Options" ) ); addPage( m_opt2, i18n( "Appearance" ), "colors", i18n( "Configure amaroK's Appearance" ) ); addPage( m_opt4, i18n( "Playback" ), "kmix", i18n( "Configure Playback" ) ); addPage( opt5, i18n( "OSD" ), "tv", i18n( "Configure On-Screen-Display" ) ); addPage( opt6, i18n( "Engine" ), "amarok", i18n( "Configure Engine" ) ); addPage( m_opt7, i18n( "Collection" ), amaroK::icon( "collection" ), i18n( "Configure Collection" ) ); addPage( opt8, i18n( "last.fm" ), "audioscrobbler", i18n( "Configure last.fm Support" ) ); addPage( opt9, i18n( "Media Devices" ), amaroK::icon( "device" ), i18n( "Configure Portable Player Support" ) ); // Show information labels (must be done after insertions) QObjectList *list = queryList( "QLabel", "infoPixmap" ); for( QObject *label = list->first(); label; label = list->next() ) static_cast<QLabel*>(label)->setPixmap( QMessageBox::standardIcon( QMessageBox::Information ) ); delete list; //stop KFont Requesters getting stupidly large list = queryList( "QLabel", "m_sampleLabel" ); for( QObject *label = list->first(); label; label = list->next() ) static_cast<QLabel*>(label)->setMaximumWidth( 250 ); delete list; connect( m_deviceManager, SIGNAL(changed()), SLOT(updateButtons()) ); connect( m_soundSystem, SIGNAL(activated( int )), SLOT(updateButtons()) ); connect( aboutEngineButton, SIGNAL(clicked()), SLOT(aboutEngine()) ); connect( opt5, SIGNAL(settingsChanged()), SLOT(updateButtons()) ); //see options5.ui.h connect( m_opt2->styleComboBox, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); connect( m_opt7->dbSetupFrame->databaseEngine, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); connect( m_opt1->kComboBox_browser, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); connect( m_opt1->kLineEdit_customBrowser, SIGNAL( textChanged( const QString& ) ), SLOT( updateButtons() ) ); }
void DlgVideo::slotSettingsChanged() { m_IsChanged = true; emit updateButtons(); slotReloadPreview(); }
void ResourceManager::displayLanguages() { // Download details.json DownloadUtils js(this); js.setTarget(baseAddr() + "languages/details.json"); js.download(); QByteArray json = js.returnData(); qDebug() << json; // parse the json file QJsonParseError err; QJsonDocument result = QJsonDocument::fromJson(json, &err); if (err.error != QJsonParseError::NoError || !result.isObject()) { qDebug("An error occurred during parsing"); return; } int rowCount = result.object().keys().size(); rowCount -= 2; //version and type languagesTable->setRowCount(rowCount); int row = 0; int col = 0; #if (!defined (_MSCVER) && !defined (_MSC_VER)) QPushButton* updateButtons[rowCount]; #else // MSVC does not support VLA. Replace with std::vector. If profiling determines that the // heap allocation is slow, an optimization might be used. std::vector<QPushButton*> updateButtons(rowCount); #endif QPushButton* temp; languagesTable->verticalHeader()->show(); // move current language to first row QStringList langs = result.object().keys(); QString lang = mscore->getLocaleISOCode(); int index = langs.indexOf(lang); if (index < 0 && lang.size() > 2) { lang = lang.left(2); index = langs.indexOf(lang); } if (index >= 0) { QString l = langs.takeAt(index); langs.prepend(l); } for (QString key : langs) { if (!result.object().value(key).isObject()) continue; QJsonObject value = result.object().value(key).toObject(); col = 0; QString test = value.value("file_name").toString(); if(test.length() == 0) continue; QString filename = value.value("file_name").toString(); QString name = value.value("name").toString(); QString fileSize = value.value("file_size").toString(); QString hashValue = value.value("hash").toString(); languagesTable->setItem(row, col++, new QTableWidgetItem(name)); languagesTable->setItem(row, col++, new QTableWidgetItem(filename)); languagesTable->setItem(row, col++, new QTableWidgetItem(tr("%1 kB").arg(fileSize))); updateButtons[row] = new QPushButton(tr("Update")); temp = updateButtons[row]; languageButtonMap[temp] = "languages/" + filename; languageButtonHashMap[temp] = hashValue; languagesTable->setIndexWidget(languagesTable->model()->index(row, col++), temp); // get hash mscore and instruments QJsonObject mscoreObject = value.value("mscore").toObject(); QString hashMscore = mscoreObject.value("hash").toString(); QString filenameMscore = mscoreObject.value("file_name").toString(); bool verifyMScore = verifyLanguageFile(filenameMscore, hashMscore); QJsonObject instrumentsObject = value.value("instruments").toObject(); QString hashInstruments = instrumentsObject.value("hash").toString(); QString filenameInstruments = instrumentsObject.value("file_name").toString(); bool verifyInstruments = verifyLanguageFile(filenameInstruments, hashInstruments); QJsonObject toursObject = value.value("tours").toObject(); QString hashTours = toursObject.value("hash").toString(); QString filenameTours = toursObject.value("file_name").toString(); bool verifyTours = verifyLanguageFile(filenameTours, hashTours); if (verifyMScore && verifyInstruments && verifyTours) { // compare local file with distant hash temp->setText(tr("Updated")); temp->setDisabled(1); } else { connect(temp, SIGNAL(clicked()), this, SLOT(downloadLanguage())); } row++; } }
/** Sends a firmware to the device */ void DeviceWidget::uploadFirmware() { // clear progress bar now // this avoids displaying an error message and the progress at 100% at the same time setProgress(0); updateButtons(false); if (!m_dfu->devices[deviceID].Writable) { status("Device not writable!", STATUSICON_FAIL); updateButtons(true); return; } bool verify = false; /* TODO: does not work properly on current Bootloader! if (m_dfu->devices[deviceID].Readable) verify = true; */ QByteArray desc = loadedFW.right(100); if (desc.startsWith("OpFw")) { descriptionArray = desc; // Now do sanity checking: // - Check whether board type matches firmware: int board = m_dfu->devices[deviceID].ID; int firmwareBoard = ((desc.at(12)&0xff)<<8) + (desc.at(13)&0xff); if((board == 0x401 && firmwareBoard == 0x402) || (board == 0x901 && firmwareBoard == 0x902) || // L3GD20 revo supports Revolution firmware (board == 0x902 && firmwareBoard == 0x903)) // RevoMini1 supporetd by RevoMini2 firmware { // These firmwares are designed to be backwards compatible } else if (firmwareBoard != board) { status("Error: firmware does not match board", STATUSICON_FAIL); updateButtons(true); return; } // Check the firmware embedded in the file: QByteArray firmwareHash = desc.mid(40,20); QByteArray fileHash = QCryptographicHash::hash(loadedFW.left(loadedFW.length()-100), QCryptographicHash::Sha1); if (firmwareHash != fileHash) { status("Error: firmware file corrupt", STATUSICON_FAIL); updateButtons(true); return; } } else { // The firmware is not packaged, just upload the text in the description field // if it is there. descriptionArray.clear(); } status("Starting firmware upload", STATUSICON_RUNNING); emit uploadStarted(); // We don't know which device was used previously, so we // are cautious and reenter DFU for this deviceID: if(!m_dfu->enterDFU(deviceID)) { emit uploadEnded(false); status("Error:Could not enter DFU mode", STATUSICON_FAIL); updateButtons(true); return; } OP_DFU::Status ret=m_dfu->StatusRequest(); qDebug() << m_dfu->StatusToString(ret); m_dfu->AbortOperation(); // Necessary, otherwise I get random failures. connect(m_dfu, SIGNAL(progressUpdated(int)), this, SLOT(setProgress(int))); connect(m_dfu, SIGNAL(operationProgress(QString)), this, SLOT(dfuStatus(QString))); connect(m_dfu, SIGNAL(uploadFinished(OP_DFU::Status)), this, SLOT(uploadFinished(OP_DFU::Status))); bool retstatus = m_dfu->UploadFirmware(filename, verify, deviceID); if (!retstatus) { emit uploadEnded(false); status("Could not start upload!", STATUSICON_FAIL); updateButtons(true); return; } status("Uploading, please wait...", STATUSICON_RUNNING); }
void QDesignerQ3WidgetStack::childEvent(QChildEvent *e) { Q3WidgetStack::childEvent(e); updateButtons(); }
void LLPanelBlockedList::draw() { updateButtons(); LLPanel::draw(); }
void QDesignerQ3WidgetStack::resizeEvent(QResizeEvent *e) { Q3WidgetStack::resizeEvent(e); updateButtons(); }
void EnrichmentDialog::initTextPage() { QGroupBox *gb1 = new QGroupBox(); QGridLayout * gl1 = new QGridLayout(gb1); gl1->addWidget(new QLabel(tr("Color")), 0, 0); textColorBtn = new ColorButton(); connect(textColorBtn, SIGNAL(colorChanged()), this, SLOT(textFormatApplyTo())); gl1->addWidget(textColorBtn, 0, 1); textFontBtn = new QPushButton(tr( "&Font" )); connect(textFontBtn, SIGNAL(clicked()), this, SLOT(customFont())); gl1->addWidget(textFontBtn, 0, 2); gl1->addWidget(new QLabel(tr("Background")), 1, 0); textBackgroundBtn = new ColorButton(); connect(textBackgroundBtn, SIGNAL(colorChanged()), this, SLOT(textFormatApplyTo())); gl1->addWidget(textBackgroundBtn, 1, 1); gl1->addWidget(new QLabel(tr("Opacity")), 2, 0); boxBackgroundTransparency = new QSpinBox(); boxBackgroundTransparency->setRange(0, 255); boxBackgroundTransparency->setSingleStep(5); boxBackgroundTransparency->setWrapping(true); boxBackgroundTransparency->setSpecialValueText(tr("Transparent")); connect(boxBackgroundTransparency, SIGNAL(valueChanged(int)), this, SLOT(updateTransparency(int))); gl1->addWidget(boxBackgroundTransparency, 2, 1); gl1->addWidget(new QLabel(tr("Rotate (deg.)")), 3, 0); boxTextAngle = new QSpinBox(); boxTextAngle->setRange(-360, 360); boxTextAngle->setSingleStep(45); boxTextAngle->setWrapping(true); connect(boxTextAngle, SIGNAL(valueChanged(int)), this, SLOT(textFormatApplyTo())); gl1->addWidget(boxTextAngle, 3, 1); autoUpdateTextBox = new QCheckBox(tr("Auto-&update")); gl1->addWidget(autoUpdateTextBox, 1, 2); texOutputBox = new QCheckBox(tr("TeX &Output")); gl1->addWidget(texOutputBox, 2, 2); connect(texOutputBox, SIGNAL(clicked()), this, SLOT(updateButtons())); gl1->setColumnStretch(4, 1); QVBoxLayout *vl = new QVBoxLayout(); textDefaultBtn = new QPushButton( tr( "Set As &Default" ) ); connect(textDefaultBtn, SIGNAL(clicked()), this, SLOT(setTextDefaultValues())); vl->addWidget(textDefaultBtn); textApplyToBtn = new QPushButton(tr("Apply format &to...")); connect(textApplyToBtn, SIGNAL(clicked()), this, SLOT(textFormatApplyTo())); vl->addWidget(textApplyToBtn); textApplyToBox = new QComboBox(); textApplyToBox->insertItem(tr("Object")); textApplyToBox->insertItem(tr("Layer")); textApplyToBox->insertItem(tr("Window")); textApplyToBox->insertItem(tr("All Windows")); vl->addWidget(textApplyToBox); vl->addStretch(); QHBoxLayout *hl = new QHBoxLayout(); hl->addWidget(gb1); hl->addLayout(vl); textEditBox = new QTextEdit(); textEditBox->setTextFormat(Qt::PlainText); formatButtons = new TextFormatButtons(textEditBox, TextFormatButtons::Legend); setFocusPolicy(Qt::StrongFocus); setFocusProxy(textEditBox); textPage = new QWidget(); QVBoxLayout* ml = new QVBoxLayout(textPage); ml->addLayout(hl); ml->addWidget(formatButtons); ml->addWidget(textEditBox, 1); tabWidget->addTab(textPage, tr( "&Text" ) ); }
long Viewport::onCmdSnap(FXObject* , FXSelector, void* ) { RenderMode.SnapToGrid = !RenderMode.SnapToGrid; updateButtons(); return 1; }
void EnrichmentDialog::setWidget(QWidget *w) { if (!w) return; ApplicationWindow *app = (ApplicationWindow *)parent(); if (!app) return; d_widget = w; FrameWidget *fw = qobject_cast<FrameWidget *>(d_widget); if (fw){ frameBox->blockSignals(true); frameBox->setCurrentIndex(fw->frameStyle()); frameBox->blockSignals(false); frameColorBtn->blockSignals(true); frameColorBtn->setColor(fw->frameColor()); frameColorBtn->blockSignals(false); boxFrameLineStyle->blockSignals(true); boxFrameLineStyle->setStyle(fw->framePen().style()); boxFrameLineStyle->blockSignals(false); boxFrameWidth->blockSignals(true); if (d_widget_type == Ellipse) boxFrameWidth->setValue(fw->framePen().widthF()); else boxFrameWidth->setValue(fw->framePen().width()); boxFrameWidth->blockSignals(false); unitBox->setCurrentIndex(app->d_frame_geometry_unit); attachToBox->setCurrentIndex((int)fw->attachPolicy()); displayCoordinates(app->d_frame_geometry_unit); } else { unitBox->setCurrentIndex(FrameWidget::Pixel); displayCoordinates(FrameWidget::Pixel); } if (d_widget_type == Text){ LegendWidget *l = qobject_cast<LegendWidget *>(d_widget); if (l){ setText(textEditBox, l->text()); textFont = l->font(); QFont fnt = textFont; fnt.setPointSize(QFont().pointSize() + 2); textEditBox->setFont(fnt); textColorBtn->blockSignals(true); textColorBtn->setColor(l->textColor()); textColorBtn->blockSignals(false); QColor bc = l->backgroundColor(); boxBackgroundTransparency->blockSignals(true); boxBackgroundTransparency->setValue(bc.alpha()); boxBackgroundTransparency->blockSignals(false); textBackgroundBtn->blockSignals(true); textBackgroundBtn->setEnabled(bc.alpha()); textBackgroundBtn->setColor(bc); textBackgroundBtn->blockSignals(false); boxTextAngle->blockSignals(true); boxTextAngle->setValue(l->angle()); boxTextAngle->blockSignals(false); autoUpdateTextBox->setChecked(l->isAutoUpdateEnabled()); texOutputBox->setChecked(l->hasTeXOutput()); updateButtons(); } } else if (d_widget_type == Tex){ TexWidget *tw = qobject_cast<TexWidget *>(d_widget); if (tw){ setText(equationEditor, tw->formula()); outputLabel->setPixmap(tw->pixmap()); bestSizeButton->show(); } return; } else if (d_widget_type == Image){ ImageWidget *i = qobject_cast<ImageWidget *>(d_widget); if (i){ imagePathBox->setText(i->fileName()); boxSaveImagesInternally->blockSignals(true); boxSaveImagesInternally->setChecked(i->saveInternally()); boxSaveImagesInternally->blockSignals(false); } } else if (d_widget_type == Frame){ RectangleWidget *r = qobject_cast<RectangleWidget *>(d_widget); if (r){ backgroundColorBtn->blockSignals(true); backgroundColorBtn->setColor(r->backgroundColor()); backgroundColorBtn->blockSignals(false); boxTransparency->blockSignals(true); boxTransparency->setValue(r->backgroundColor().alpha()); boxTransparency->blockSignals(false); patternBox->blockSignals(true); patternBox->setPattern(r->brush().style()); patternBox->blockSignals(false); patternColorBtn->blockSignals(true); patternColorBtn->setColor(r->brush().color()); patternColorBtn->blockSignals(false); } } else if (d_widget_type == Ellipse){ EllipseWidget *r = qobject_cast<EllipseWidget *>(d_widget); if (r){ backgroundColorBtn->blockSignals(true); backgroundColorBtn->setColor(r->backgroundColor()); backgroundColorBtn->blockSignals(false); boxTransparency->blockSignals(true); boxTransparency->setValue(r->backgroundColor().alpha()); boxTransparency->blockSignals(false); patternBox->blockSignals(true); patternBox->setPattern(r->brush().style()); patternBox->blockSignals(false); patternColorBtn->blockSignals(true); patternColorBtn->setColor(r->brush().color()); patternColorBtn->blockSignals(false); } } }
ColorDialog::ColorDialog(const Map& map, const MapColor& source_color, QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f), map(map), source_color(source_color), color(source_color), color_modified(false), react_to_changes(true) { setWindowTitle(tr("Edit map color")); setSizeGripEnabled(true); color_preview_label = new QLabel(); mc_name_edit = new QLineEdit(); prof_color_layout = new QGridLayout(); int col = 0; prof_color_layout->setColumnStretch(col, 1); prof_color_layout->setColumnStretch(col+1, 3); int row = 0; prof_color_layout->addWidget(Util::Headline::create("Spot color printing"), row, col, 1, 2); QButtonGroup* spot_color_options = new QButtonGroup(this); ++row; full_tone_option = new QRadioButton(tr("Defines a spot color:")); spot_color_options->addButton(full_tone_option, MapColor::SpotColor); prof_color_layout->addWidget(full_tone_option, row, col, 1, 2); ++row; sc_name_edit = new QLineEdit(); prof_color_layout->addWidget(sc_name_edit, row, col, 1, 2); ++row; composition_option = new QRadioButton(tr("Mixture of spot colors (screens and overprint):")); spot_color_options->addButton(composition_option, MapColor::CustomColor); prof_color_layout->addWidget(composition_option, row, col, 1, 2); int num_components = 0 /*color.getComponents().size()*/; // FIXME: cleanup components_row0 = row+1; components_col0 = col; component_colors.resize(num_components+1); component_halftone.resize(num_components+1); for (int i = 0; i <= num_components; i++) { ++row; component_colors[i] = new ColorDropDown(&map, &color, true); component_colors[i]->removeColor(&source_color); prof_color_layout->addWidget(component_colors[i], row, col); component_halftone[i] = Util::SpinBox::create(1, 0.0, 100.0, tr("%"), 10.0); prof_color_layout->addWidget(component_halftone[i], row, col+1); } ++row; knockout_option = new QCheckBox(tr("Knockout: erases lower colors")); prof_color_layout->addWidget(knockout_option, row, col, 1, 2); knockout_option->setEnabled(false); row = 0, col += 2; prof_color_layout->setColumnStretch(col, 1); const int spacing = style()->pixelMetric(QStyle::PM_LayoutTopMargin); prof_color_layout->addItem(new QSpacerItem(3*spacing, spacing), row, col, 7, 1); row = 0, col +=1; prof_color_layout->setColumnStretch(col, 1); prof_color_layout->setColumnStretch(col+1, 3); prof_color_layout->addWidget(Util::Headline::create("CMYK"), row, col, 1, 2); QButtonGroup* cmyk_color_options = new QButtonGroup(this); ++row; cmyk_spot_color_option = new QRadioButton(tr("Calculate from spot colors")); cmyk_color_options->addButton(cmyk_spot_color_option, MapColor::SpotColor); prof_color_layout->addWidget(cmyk_spot_color_option, row, col, 1, 2); ++row; evaluate_rgb_option = new QRadioButton(tr("Calculate from RGB color")); cmyk_color_options->addButton(evaluate_rgb_option, MapColor::RgbColor); prof_color_layout->addWidget(evaluate_rgb_option, row, col, 1, 2); ++row; custom_cmyk_option = new QRadioButton(tr("Custom process color:")); cmyk_color_options->addButton(custom_cmyk_option, MapColor::CustomColor); prof_color_layout->addWidget(custom_cmyk_option, row, col, 1, 2); ++row; c_edit = Util::SpinBox::create(1, 0.0, 100.0, tr("%"), 10.0); prof_color_layout->addWidget(new QLabel(tr("Cyan")), row, col); prof_color_layout->addWidget(c_edit, row, col+1); ++row; m_edit = Util::SpinBox::create(1, 0.0, 100.0, tr("%"), 10.0); prof_color_layout->addWidget(new QLabel(tr("Magenta")), row, col); prof_color_layout->addWidget(m_edit, row, col+1); ++row; y_edit = Util::SpinBox::create(1, 0.0, 100.0, tr("%"), 10.0); prof_color_layout->addWidget(new QLabel(tr("Yellow")), row, col); prof_color_layout->addWidget(y_edit, row, col+1); ++row; k_edit = Util::SpinBox::create(1, 0.0, 100.0, tr("%"), 10.0); prof_color_layout->addWidget(new QLabel(tr("Black")), row, col); prof_color_layout->addWidget(k_edit, row, col+1); ++row; stretch_row0 = row; stretch_col0 = col; stretch = new QWidget(); prof_color_layout->addWidget(stretch, row, col); prof_color_layout->setRowStretch(row, 1); QWidget* prof_color_widget = new QWidget(); prof_color_widget->setLayout(prof_color_layout); prof_color_widget->setObjectName(QString::fromLatin1("professional")); QGridLayout* desktop_layout = new QGridLayout(); col = 0; desktop_layout->setColumnStretch(col, 1); desktop_layout->setColumnStretch(col+1, 3); row = 0; desktop_layout->addWidget(Util::Headline::create("RGB"), row, col, 1, 2); QButtonGroup* rgb_color_options = new QButtonGroup(this); ++row; rgb_spot_color_option = new QRadioButton(tr("Calculate from spot colors")); rgb_color_options->addButton(rgb_spot_color_option, MapColor::SpotColor); desktop_layout->addWidget(rgb_spot_color_option, row, col, 1, 2); ++row; evaluate_cmyk_option = new QRadioButton(tr("Calculate from CMYK color")); rgb_color_options->addButton(evaluate_cmyk_option, MapColor::CmykColor); desktop_layout->addWidget(evaluate_cmyk_option, row, col, 1, 2); ++row; custom_rgb_option = new QRadioButton(tr("Custom RGB color:")); rgb_color_options->addButton(custom_rgb_option, MapColor::CustomColor); desktop_layout->addWidget(custom_rgb_option, row, col, 1, 2); ++row; r_edit = Util::SpinBox::create(1, 0.0, 255.0, {}, 5); desktop_layout->addWidget(new QLabel(tr("Red")), row, col); desktop_layout->addWidget(r_edit, row, col+1); ++row; g_edit = Util::SpinBox::create(1, 0.0, 255.0, {}, 5); desktop_layout->addWidget(new QLabel(tr("Green")), row, col); desktop_layout->addWidget(g_edit, row, col+1); ++row; b_edit = Util::SpinBox::create(1, 0.0, 255.0, {}, 5); desktop_layout->addWidget(new QLabel(tr("Blue")), row, col); desktop_layout->addWidget(b_edit, row, col+1); ++row; html_edit = new QLineEdit(); desktop_layout->addWidget(new QLabel(tr("#RRGGBB")), row, col); desktop_layout->addWidget(html_edit, row, col+1); ++row; desktop_layout->addWidget(new QWidget(), row, col); desktop_layout->setRowStretch(row, 1); row = 0, col += 2; desktop_layout->setColumnStretch(col, 7); desktop_layout->addItem(new QSpacerItem(3*spacing, spacing), row, col, 7, 1); QWidget* desktop_color_widget = new QWidget(); desktop_color_widget->setLayout(desktop_layout); desktop_color_widget->setObjectName(QString::fromLatin1("desktop")); properties_widget = new QTabWidget(); properties_widget->addTab(desktop_color_widget, tr("Desktop")); properties_widget->addTab(prof_color_widget, tr("Professional printing")); QDialogButtonBox* button_box = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok | QDialogButtonBox::Reset | QDialogButtonBox::Help); ok_button = button_box->button(QDialogButtonBox::Ok); reset_button = button_box->button(QDialogButtonBox::Reset); connect(button_box, SIGNAL(rejected()), this, SLOT(reject())); connect(button_box, SIGNAL(accepted()), this, SLOT(accept())); connect(reset_button, SIGNAL(clicked(bool)), this, SLOT(reset())); connect(button_box->button(QDialogButtonBox::Help), SIGNAL(clicked(bool)), this, SLOT(showHelp())); QGridLayout* layout = new QGridLayout(); layout->addWidget(color_preview_label, 0, 0); layout->addWidget(mc_name_edit, 0, 1); layout->addWidget(properties_widget, 1, 0, 1, 2); layout->addWidget(button_box, 2, 0, 1, 2); layout->setColumnStretch(1, 1); setLayout(layout); updateWidgets(); updateButtons(); connect(mc_name_edit, SIGNAL(textChanged(QString)), this, SLOT(mapColorNameChanged())); connect(spot_color_options, SIGNAL(buttonClicked(int)), this, SLOT(spotColorTypeChanged(int))); connect(sc_name_edit, SIGNAL(textChanged(QString)), this, SLOT(spotColorNameChanged())); for (int i = 0; i < (int)component_colors.size(); i++) { connect(component_colors[i], SIGNAL(currentIndexChanged(int)), this, SLOT(spotColorCompositionChanged())); connect(component_halftone[i], SIGNAL(valueChanged(double)), this, SLOT(spotColorCompositionChanged())); } connect(knockout_option, SIGNAL(clicked(bool)), this, SLOT(knockoutChanged())); connect(cmyk_color_options, SIGNAL(buttonClicked(int)), this, SLOT(cmykColorTypeChanged(int))); connect(c_edit, SIGNAL(valueChanged(double)), this, SLOT(cmykValueChanged())); connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(cmykValueChanged())); connect(y_edit, SIGNAL(valueChanged(double)), this, SLOT(cmykValueChanged())); connect(k_edit, SIGNAL(valueChanged(double)), this, SLOT(cmykValueChanged())); connect(rgb_color_options, SIGNAL(buttonClicked(int)), this, SLOT(rgbColorTypeChanged(int))); connect(r_edit, SIGNAL(valueChanged(double)), this, SLOT(rgbValueChanged())); connect(g_edit, SIGNAL(valueChanged(double)), this, SLOT(rgbValueChanged())); connect(b_edit, SIGNAL(valueChanged(double)), this, SLOT(rgbValueChanged())); QSettings settings; settings.beginGroup(QString::fromLatin1("ColorDialog")); QString default_view = settings.value(QString::fromLatin1("view")).toString(); settings.endGroup(); properties_widget->setCurrentWidget(properties_widget->findChild<QWidget*>(default_view)); }
void TFileOpen::updateFileName() { SetDlgItemText(hWindow, id_FName, AnsiLower(pathName)); SendDlgItemMessage(hWindow, id_FName, CB_SETEDITSEL, 0, MAKELONG( 0, -1)); updateButtons(); }
void SocialWindow::postInit() { setWindowName("Social"); setVisible(false); setSaveVisible(true); setResizable(true); setSaveVisible(true); setCloseButton(true); setStickyButtonLock(true); setMinWidth(120); setMinHeight(55); setDefaultSize(590, 200, 180, 300); if (setupWindow) setupWindow->registerWindowForReset(this); place(0, 0, mCreateButton); place(1, 0, mInviteButton); place(2, 0, mLeaveButton); place(0, 1, mCountLabel); place(0, 2, mTabs, 4, 4); widgetResized(Event(nullptr)); loadWindowState(); mTabs->addTab(mPlayers, mPlayers->mScroll); mTabs->addTab(mFriends, mFriends->mScroll); mTabs->addTab(mNavigation, mNavigation->mScroll); if (config.getBoolValue("enableAttackFilter")) { mAttackFilter = new SocialAttackTab(this, getOptionBool("showtabbackground")); mTabs->addTab(mAttackFilter, mAttackFilter->mScroll); } else { mAttackFilter = nullptr; } if (config.getBoolValue("enablePickupFilter")) { mPickupFilter = new SocialPickupTab(this, getOptionBool("showtabbackground")); mTabs->addTab(mPickupFilter, mPickupFilter->mScroll); } else { mPickupFilter = nullptr; } if (player_node && player_node->getParty()) addTab(player_node->getParty()); if (player_node && player_node->getGuild()) addTab(player_node->getGuild()); enableVisibleSound(true); updateButtons(); player_relations.addListener(this); }
void ReorderFieldsDialog::OnListBoxSelChange(wxCommandEvent& WXUNUSED(event)) { updateButtons(); }
QgsRelationEditorWidget::QgsRelationEditorWidget( QWidget* parent ) : QgsCollapsibleGroupBox( parent ) , mViewMode( QgsDualView::AttributeEditor ) , mVisible( false ) { QVBoxLayout* topLayout = new QVBoxLayout( this ); topLayout->setContentsMargins( 0, 9, 0, 0 ); setLayout( topLayout ); // buttons QHBoxLayout* buttonLayout = new QHBoxLayout(); buttonLayout->setContentsMargins( 0, 0, 0, 0 ); // toogle editing mToggleEditingButton = new QToolButton( this ); mToggleEditingButton->setObjectName( "mToggleEditingButton" ); mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.svg" ) ); mToggleEditingButton->setText( tr( "Toggle editing" ) ); mToggleEditingButton->setEnabled( false ); mToggleEditingButton->setCheckable( true ); mToggleEditingButton->setToolTip( tr( "Toggle editing mode for child layer" ) ); buttonLayout->addWidget( mToggleEditingButton ); // save Edits mSaveEditsButton = new QToolButton( this ); mSaveEditsButton->setIcon( QgsApplication::getThemeIcon( "/mActionSaveEdits.svg" ) ); mSaveEditsButton->setText( tr( "Save child layer edits" ) ); mSaveEditsButton->setToolTip( tr( "Save child layer edits" ) ); mSaveEditsButton->setEnabled( true ); buttonLayout->addWidget( mSaveEditsButton ); // add feature mAddFeatureButton = new QToolButton( this ); mAddFeatureButton->setIcon( QgsApplication::getThemeIcon( "/mActionNewTableRow.png" ) ); mAddFeatureButton->setText( tr( "Add child feature" ) ); mAddFeatureButton->setToolTip( tr( "Add child feature" ) ); mAddFeatureButton->setObjectName( "mAddFeatureButton" ); buttonLayout->addWidget( mAddFeatureButton ); // delete feature mDeleteFeatureButton = new QToolButton( this ); mDeleteFeatureButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteSelected.svg" ) ); mDeleteFeatureButton->setText( tr( "Delete child feature" ) ); mDeleteFeatureButton->setToolTip( tr( "Delete child feature" ) ); mDeleteFeatureButton->setObjectName( "mDeleteFeatureButton" ); buttonLayout->addWidget( mDeleteFeatureButton ); // link feature mLinkFeatureButton = new QToolButton( this ); mLinkFeatureButton->setIcon( QgsApplication::getThemeIcon( "/mActionLink.svg" ) ); mLinkFeatureButton->setText( tr( "Link existing features" ) ); mLinkFeatureButton->setToolTip( tr( "Link existing child features" ) ); mLinkFeatureButton->setObjectName( "mLinkFeatureButton" ); buttonLayout->addWidget( mLinkFeatureButton ); // unlink feature mUnlinkFeatureButton = new QToolButton( this ); mUnlinkFeatureButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnlink.svg" ) ); mUnlinkFeatureButton->setText( tr( "Unlink feature" ) ); mUnlinkFeatureButton->setToolTip( tr( "Unlink child feature" ) ); mUnlinkFeatureButton->setObjectName( "mUnlinkFeatureButton" ); buttonLayout->addWidget( mUnlinkFeatureButton ); // spacer buttonLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding ) ); // form view mFormViewButton = new QToolButton( this ); mFormViewButton->setText( tr( "Form view" ) ); mFormViewButton->setToolTip( tr( "Switch to form view" ) ); mFormViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ) ); mFormViewButton->setCheckable( true ); mFormViewButton->setChecked( mViewMode == QgsDualView::AttributeEditor ); buttonLayout->addWidget( mFormViewButton ); // table view mTableViewButton = new QToolButton( this ); mTableViewButton->setText( tr( "Table view" ) ); mTableViewButton->setToolTip( tr( "Switch to table view" ) ); mTableViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionOpenTable.svg" ) ); mTableViewButton->setCheckable( true ); mTableViewButton->setChecked( mViewMode == QgsDualView::AttributeTable ); buttonLayout->addWidget( mTableViewButton ); // button group mViewModeButtonGroup = new QButtonGroup( this ); mViewModeButtonGroup->addButton( mFormViewButton, QgsDualView::AttributeEditor ); mViewModeButtonGroup->addButton( mTableViewButton, QgsDualView::AttributeTable ); // add buttons layout topLayout->addLayout( buttonLayout ); mRelationLayout = new QGridLayout(); mRelationLayout->setContentsMargins( 0, 0, 0, 0 ); topLayout->addLayout( mRelationLayout ); mDualView = new QgsDualView( this ); mDualView->setView( mViewMode ); mFeatureSelectionMgr = new QgsGenericFeatureSelectionManager( mDualView ); mDualView->setFeatureSelectionManager( mFeatureSelectionMgr ); mRelationLayout->addWidget( mDualView ); connect( this, SIGNAL( collapsedStateChanged( bool ) ), this, SLOT( onCollapsedStateChanged( bool ) ) ); connect( mViewModeButtonGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( setViewMode( int ) ) ); connect( mToggleEditingButton, SIGNAL( clicked( bool ) ), this, SLOT( toggleEditing( bool ) ) ); connect( mSaveEditsButton, SIGNAL( clicked() ), this, SLOT( saveEdits() ) ); connect( mAddFeatureButton, SIGNAL( clicked() ), this, SLOT( addFeature() ) ); connect( mDeleteFeatureButton, SIGNAL( clicked() ), this, SLOT( deleteFeature() ) ); connect( mLinkFeatureButton, SIGNAL( clicked() ), this, SLOT( linkFeature() ) ); connect( mUnlinkFeatureButton, SIGNAL( clicked() ), this, SLOT( unlinkFeature() ) ); connect( mFeatureSelectionMgr, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ), this, SLOT( updateButtons() ) ); // Set initial state for add/remove etc. buttons updateButtons(); }
QgsVectorLayerProperties::QgsVectorLayerProperties( QgsVectorLayer *lyr, QWidget * parent, Qt::WFlags fl ) : QDialog( parent, fl ), layer( lyr ), mRendererDialog( 0 ) { setupUi( this ); connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( this, SIGNAL( accepted() ), this, SLOT( apply() ) ); connect( mAddAttributeButton, SIGNAL( clicked() ), this, SLOT( addAttribute() ) ); connect( mDeleteAttributeButton, SIGNAL( clicked() ), this, SLOT( deleteAttribute() ) ); connect( mToggleEditingButton, SIGNAL( clicked() ), this, SLOT( toggleEditing() ) ); connect( this, SIGNAL( toggleEditing( QgsMapLayer* ) ), QgisApp::instance(), SLOT( toggleEditing( QgsMapLayer* ) ) ); connect( layer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) ); connect( layer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) ); connect( layer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) ); connect( layer, SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) ); mAddAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) ); mDeleteAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) ); mToggleEditingButton->setIcon( QgisApp::getThemeIcon( "/mActionToggleEditing.png" ) ); // Create the Label dialog tab QVBoxLayout *layout = new QVBoxLayout( labelOptionsFrame ); layout->setMargin( 0 ); labelDialog = new QgsLabelDialog( layer->label(), labelOptionsFrame ); layout->addWidget( labelDialog ); labelOptionsFrame->setLayout( layout ); connect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) ); // Create the Actions dialog tab QVBoxLayout *actionLayout = new QVBoxLayout( actionOptionsFrame ); actionLayout->setMargin( 0 ); const QgsFieldMap &fields = layer->pendingFields(); actionDialog = new QgsAttributeActionDialog( layer->actions(), fields, actionOptionsFrame ); actionLayout->addWidget( actionDialog ); reset(); if ( layer->dataProvider() )//enable spatial index button group if supported by provider { int capabilities = layer->dataProvider()->capabilities(); if ( !( capabilities&QgsVectorDataProvider::CreateSpatialIndex ) ) { pbnIndex->setEnabled( false ); } } updateButtons(); leSpatialRefSys->setText( layer->srs().toProj4() ); leSpatialRefSys->setCursorPosition( 0 ); connect( sliderTransparency, SIGNAL( valueChanged( int ) ), this, SLOT( sliderTransparency_valueChanged( int ) ) ); tabWidget->setCurrentIndex( 0 ); } // QgsVectorLayerProperties ctor
void frmSetLimit::on_btnM_clicked() { m1.setPerHi(20); m1.setPerLo(-20); updateButtons(); }
void LLFloaterMute::selectMute(const LLUUID& mute_id) { mMuteList->selectByID(mute_id); updateButtons(); }
void frmSetLimit::on_btnD_clicked() { m1.setPerHi(0.5); m1.setPerLo(-0.5); updateButtons(); }
/** Freezes the contents of the widget so that a user cannot try to modify the contents */ void DeviceWidget::freeze() { updateButtons(false); }