void AStylePreferences::load(const KDevelop::SourceFormatterStyle &style) { if(!style.content().isEmpty()) m_formatter->loadStyle(style.content()); else m_formatter->predefinedStyle(style.name()); updateWidgets(); updatePreviewText(); }
void TrackToolTip::clear() { m_pos = 0; m_cover = QString::null; m_tooltip = i18n( "Amarok - rediscover your music" ); m_tags = MetaBundle(); m_tags.setUrl( KURL() ); updateWidgets(); }
void LightSourceProperty::setLightPos(const tgt::vec4& lightPos) { if(getCamera()) { const tgt::Camera& camera = getCamera()->get(); set(tgt::vec4((camera.getViewMatrixInverse().getRotationalPart() * lightPos).xyz() + getCamera()->getTrackball().getCenter(), 1.f)); } else { set(lightPos); } lightPos_ = lightPos; updateWidgets(); }
void LightSourceProperty::setCamera(CameraProperty* cam) { camProp_ = cam; if(camProp_) { camProp_->onChange(CallMemberAction<LightSourceProperty>(this, &LightSourceProperty::cameraUpdate)); curCenter_ = camProp_->getTrackball().getCenter(); maxDist_ = camProp_->getMaxValue() / 50.f; updateWidgets(); cameraUpdate(); } }
void QFPLayerControls::createWidgets() { QGridLayout* lay=new QGridLayout(); setLayout(lay); QToolButton* btn=new QToolButton(this); btn->setDefaultAction(actRewind); lay->addWidget(btn, 0, 0); btn=new QToolButton(this); btn->setDefaultAction(actPlayPause); lay->addWidget(btn, 0, 1); QWidget* w=new QWidget(this); w->setMinimumWidth(10); lay->addWidget(w, 0, 2); btn=new QToolButton(this); btn->setDefaultAction(actPrevMoreFrame); lay->addWidget(btn, 0, 3); btn=new QToolButton(this); btn->setDefaultAction(actPrevFrame); lay->addWidget(btn, 0, 4); btn=new QToolButton(this); btn->setDefaultAction(actNextFrame); lay->addWidget(btn, 0, 5); btn=new QToolButton(this); btn->setDefaultAction(actNextMoreFrame); lay->addWidget(btn, 0, 6); lay->addItem(new QSpacerItem(20,5), 0, 7); chkReplay=new QCheckBox(tr("replay"), this); chkReplay->setChecked(true); lay->addWidget(chkReplay, 0, 8); lay->addItem(new QSpacerItem(5,5, QSizePolicy::Expanding), 0, 9); label=new QLabel("", this); label->setAlignment(Qt::AlignVCenter|Qt::AlignRight); label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred); lay->addWidget(label, 0, 10, 1, 3); slider=new QSlider(this); slider->setOrientation(Qt::Horizontal); slider->setTickPosition(QSlider::TicksBelow); connect(slider, SIGNAL(valueChanged(int)), this, SLOT(sliderMoved(int))); lay->addWidget(slider, 1, 0, 1, 10); spinFPS=new QDoubleSpinBox(this); spinFPS->setRange(0.1, 100); spinFPS->setValue(10); connect(spinFPS, SIGNAL(valueChanged(double)), this, SLOT(updateWidgets())); lay->addWidget(new QLabel(tr("FPS:"), this), 1, 10); lay->addWidget(spinFPS, 1, 11); lay->addItem(new QSpacerItem(10,5,QSizePolicy::MinimumExpanding,QSizePolicy::Preferred), 1,12); updateWidgets(); }
SelectCRSDialog::SelectCRSDialog( const Georeferencing& georef, QWidget* parent, GeorefAlternatives alternatives, const QString& description ) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint) , georef(georef) { setWindowModality(Qt::WindowModal); setWindowTitle(tr("Select coordinate reference system")); crs_selector = new CRSSelector(georef, nullptr); if (georef.isLocal()) crs_selector->clear(); if (alternatives.testFlag(TakeFromMap) && !georef.isLocal()) { crs_selector->addCustomItem(tr("Same as map"), SpecialCRS::SameAsMap); crs_selector->setCurrentIndex(0); // TakeFromMap } if (alternatives.testFlag(Local) || georef.isLocal()) { crs_selector->addCustomItem(tr("Local"), SpecialCRS::Local); crs_selector->setCurrentIndex(0); // TakeFromMap or Local, both is fine. } if (alternatives.testFlag(Geographic) && !georef.isLocal()) crs_selector->addCustomItem(tr("Geographic coordinates (WGS84)"), SpecialCRS::Geographic); status_label = new QLabel(); button_box = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); auto form_layout = new QFormLayout(); if (!description.isEmpty()) { form_layout->addRow(new QLabel(description)); form_layout->addItem(Util::SpacerItem::create(this)); } form_layout->addRow(QCoreApplication::translate("GeoreferencingDialog", "&Coordinate reference system:"), crs_selector); form_layout->addRow(tr("Status:"), status_label); form_layout->addItem(Util::SpacerItem::create(this)); crs_selector->setDialogLayout(form_layout); auto layout = new QVBoxLayout(); layout->addLayout(form_layout, 1); layout->addWidget(button_box, 0); setLayout(layout); connect(crs_selector, &CRSSelector::crsChanged, this, &SelectCRSDialog::updateWidgets); connect(button_box, &QDialogButtonBox::accepted, this, &SelectCRSDialog::accept); connect(button_box, &QDialogButtonBox::rejected, this, &SelectCRSDialog::reject); updateWidgets(); }
DisplayFilterExpressionDialog::DisplayFilterExpressionDialog(QWidget *parent) : GeometryStateDialog(parent), ui(new Ui::DisplayFilterExpressionDialog), ftype_(FT_NONE), field_(NULL) { ui->setupUi(this); if (parent) loadGeometry(parent->width() * 2 / 3, parent->height()); setWindowTitle(wsApp->windowTitleString(tr("Display Filter Expression"))); setWindowIcon(wsApp->normalIcon()); proto_initialize_all_prefixes(); ui->fieldTreeWidget->setToolTip(ui->fieldLabel->toolTip()); ui->searchLineEdit->setToolTip(ui->searchLabel->toolTip()); ui->relationListWidget->setToolTip(ui->relationLabel->toolTip()); ui->valueLineEdit->setToolTip(ui->valueLabel->toolTip()); ui->enumListWidget->setToolTip(ui->enumLabel->toolTip()); ui->rangeLineEdit->setToolTip(ui->rangeLabel->toolTip()); // Relation list new QListWidgetItem("is present", ui->relationListWidget, present_op_); new QListWidgetItem("==", ui->relationListWidget, eq_op_); new QListWidgetItem("!=", ui->relationListWidget, ne_op_); new QListWidgetItem(">", ui->relationListWidget, gt_op_); new QListWidgetItem("<", ui->relationListWidget, lt_op_); new QListWidgetItem(">=", ui->relationListWidget, ge_op_); new QListWidgetItem("<=", ui->relationListWidget, le_op_); new QListWidgetItem("contains", ui->relationListWidget, contains_op_); new QListWidgetItem("matches", ui->relationListWidget, matches_op_); value_label_pfx_ = ui->valueLabel->text(); connect(ui->valueLineEdit, SIGNAL(textEdited(QString)), this, SLOT(updateWidgets())); connect(ui->rangeLineEdit, SIGNAL(textEdited(QString)), this, SLOT(updateWidgets())); // Trigger updateWidgets ui->fieldTreeWidget->selectionModel()->clear(); QTimer::singleShot(0, this, SLOT(fillTree())); }
CommandWidget::CommandWidget(QWidget *parent) : QWidget(parent) , ui(new Ui::CommandWidget) { ui->setupUi(this); connect(ui->lineEditName, &QLineEdit::textChanged, this, &CommandWidget::onLineEditNameTextChanged); connect(ui->buttonIcon, &IconSelectButton::currentIconChanged, this, &CommandWidget::onButtonIconCurrentIconChanged); connect(ui->checkBoxShowAdvanced, &QCheckBox::stateChanged, this, &CommandWidget::onCheckBoxShowAdvancedStateChanged); for (auto checkBox : findChildren<QCheckBox *>()) { connect(checkBox, &QCheckBox::stateChanged, this, &CommandWidget::updateWidgets); } for (auto lineEdit : findChildren<QLineEdit *>()) { connect(lineEdit, &QLineEdit::textEdited, this, &CommandWidget::updateWidgets); } connect(ui->shortcutButtonGlobalShortcut, &ShortcutButton::shortcutAdded, this, &CommandWidget::updateWidgets); connect(ui->shortcutButtonGlobalShortcut, &ShortcutButton::shortcutRemoved, this, &CommandWidget::updateWidgets); connect(ui->commandEdit, &CommandEdit::changed, this, &CommandWidget::updateWidgets); connect(ui->commandEdit, &CommandEdit::commandTextChanged, this, &CommandWidget::onCommandEditCommandTextChanged); updateWidgets(); #ifdef NO_GLOBAL_SHORTCUTS ui->checkBoxGlobalShortcut->hide(); ui->shortcutButtonGlobalShortcut->hide(); #else ui->checkBoxGlobalShortcut->setIcon(iconShortcut()); #endif ui->checkBoxAutomatic->setIcon(iconClipboard()); ui->checkBoxInMenu->setIcon(iconMenu()); ui->checkBoxIsScript->setIcon(iconScript()); ui->checkBoxDisplay->setIcon(iconDisplay()); // Add tab names to combo boxes. initTabComboBox(ui->comboBoxCopyToTab); initTabComboBox(ui->comboBoxOutputTab); if ( !createPlatformNativeInterface()->canGetWindowTitle() ) ui->lineEditWindow->hide(); }
// Set mode of file selector void FileSelectorWidget::setMode(FileSelectorWidget::SelectionMode mode, QDir startingDir) { mode_ = mode; // Set relevant selection mode for file view if (mode_ == FileSelectorWidget::OpenMultipleMode) ui.FileView->setSelectionMode(QTableView::ExtendedSelection); else ui.FileView->setSelectionMode(QTableView::SingleSelection); setCurrentDirectory(startingDir.absolutePath()); updateWidgets(); }
void TrackToolTip::slotCoverChanged( const QString &artist, const QString &album ) { if( artist == m_tags.artist() && album == m_tags.album() ) { m_cover = CollectionDB::instance()->albumImage( m_tags ); if( m_cover == CollectionDB::instance()->notAvailCover() ) m_cover = QString::null; updateWidgets(); } }
void WirelessFrame::on_fcsComboBox_activated(int index) { QString cur_iface = ui->interfaceComboBox->currentText(); if (cur_iface.isEmpty()) return; if (ws80211_set_fcs_validation(cur_iface.toUtf8().constData(), (enum ws80211_fcs_validation) index) != 0) { QString err_str = tr("Unable to set FCS validation behavior."); emit pushAdapterStatus(err_str); } updateWidgets(); }
void PrinterSettings::delProfile() { if (ui->profilesList->count() == 1) { QMessageBox::warning(this, windowTitle(), "I can't remove last profile."); return; } delete currentItem(); updateWidgets(); }
CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) : GeometryStateDialog(parent), ui(new Ui::CaptureInterfacesDialog) { ui->setupUi(this); loadGeometry(); setWindowTitle(wsApp->windowTitleString(tr("Capture Interfaces"))); stat_timer_ = NULL; stat_cache_ = NULL; ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start")); // Start out with the list *not* sorted, so they show up in the order // in which they were provided ui->interfaceTree->sortByColumn(-1, Qt::AscendingOrder); ui->interfaceTree->setItemDelegateForColumn(col_interface_, &interface_item_delegate_); ui->interfaceTree->setItemDelegateForColumn(col_traffic_, new SparkLineDelegate()); ui->interfaceTree->setItemDelegateForColumn(col_link_, &interface_item_delegate_); ui->interfaceTree->setItemDelegateForColumn(col_snaplen_, &interface_item_delegate_); #ifdef SHOW_BUFFER_COLUMN ui->interfaceTree->setItemDelegateForColumn(col_buffer_, &interface_item_delegate_); #else ui->interfaceTree->setColumnHidden(col_buffer_, true); #endif #ifndef SHOW_MONITOR_COLUMN ui->interfaceTree->setColumnHidden(col_monitor_, true); #endif ui->interfaceTree->setItemDelegateForColumn(col_filter_, &interface_item_delegate_); interface_item_delegate_.setTree(ui->interfaceTree); ui->filenameLineEdit->setPlaceholderText(tr("Leave blank to use a temporary file")); // Changes in interface selections or capture filters should be propagated // to the main welcome screen where they will be applied to the global // capture options. connect(this, SIGNAL(interfacesChanged()), ui->captureFilterComboBox, SIGNAL(interfacesChanged())); connect(ui->captureFilterComboBox, SIGNAL(captureFilterSyntaxChanged(bool)), this, SLOT(updateWidgets())); connect(ui->captureFilterComboBox->lineEdit(), SIGNAL(textEdited(QString)), this, SLOT(filterEdited())); connect(ui->captureFilterComboBox->lineEdit(), SIGNAL(textEdited(QString)), this, SIGNAL(captureFilterTextEdited(QString))); connect(&interface_item_delegate_, SIGNAL(filterChanged(QString)), ui->captureFilterComboBox->lineEdit(), SLOT(setText(QString))); connect(&interface_item_delegate_, SIGNAL(filterChanged(QString)), this, SIGNAL(captureFilterTextEdited(QString))); connect(this, SIGNAL(ifsChanged()), this, SLOT(refreshInterfaceList())); connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(updateLocalInterfaces())); connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); updateWidgets(); }
void MainWindowPreferencesFrame::on_foStyleSpecifiedPushButton_clicked() { QString specified_dir = QFileDialog::getExistingDirectory(this, tr("Open Files In")); if (specified_dir.isEmpty()) return; ui->foStyleSpecifiedLineEdit->setText(specified_dir); prefs_set_string_value(pref_fileopen_dir_, specified_dir.toStdString().c_str(), pref_stashed); prefs_set_enum_value(pref_fileopen_style_, FO_STYLE_SPECIFIED, pref_stashed); updateWidgets(); }
void ColumnPreferencesFrame::on_deleteToolButton_clicked() { if (ui->columnTreeWidget->topLevelItemCount() < 2) return; QTreeWidgetItem *item = ui->columnTreeWidget->currentItem(); if (item) { ui->columnTreeWidget->invisibleRootItem()->removeChild(item); } updateWidgets(); }
void MainWindowPreferencesFrame::on_foStyleSpecifiedPushButton_clicked() { QString specified_dir = QFileDialog::getExistingDirectory(this, tr("Open Files In")); if (specified_dir.isEmpty()) return; ui->foStyleSpecifiedLineEdit->setText(specified_dir); g_free(pref_fileopen_dir_->stashed_val.string); pref_fileopen_dir_->stashed_val.string = g_strdup(specified_dir.toUtf8().constData()); pref_fileopen_style_->stashed_val.enumval = FO_STYLE_SPECIFIED; updateWidgets(); }
/* tab changed */ void MainWindow::tabChanged(int index) { PTNtab * tab = qobject_cast<PTNtab*>(tabWidget->widget(index)); int mode = tab->getMode(); graphDock->setGraph(tab->getGraphVis()); updateWidgets (mode); QAbstractButton * button = buttonGroup->button (mode); button->setChecked(true); slider->setValue(tab->scaleValue()); }
// Set the toggled state to true/false, according to <toggled> and update // any associated widgets or notify any callbacks. bool Toggle::setToggled(const bool toggled) { if (_callbackActive) { return false; } // Update the toggle status and export it to the GTK button _toggled = toggled; updateWidgets(); return true; }
void TransFuncProperty::notifyChange() { executeLinks(); // check if conditions are met and exec actions for (size_t j = 0; j < conditions_.size(); ++j) conditions_[j]->exec(); updateWidgets(); // invalidate owner: invalidateOwner(); }
void PlotPredicateProperty::notifyAll() { std::vector<std::pair<int, PlotPredicate*> > cpy = value_; // check if conditions are met and exec actions for (size_t j = 0; j < conditions_.size(); ++j) conditions_[j]->exec(); updateWidgets(); // invalidate owner: invalidateOwner(); }
void CQFontChooser:: setFixedWidth(bool fixedWidth) { if (fixedWidth == fixedWidth_) return; fixedWidth_ = fixedWidth; updateWidgets(); nameChanged(); }
void CaptureInterfacesDialog::interfaceSelected() { InterfaceTree::updateGlobalDeviceSelections(ui->interfaceTree, col_interface_); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled((global_capture_opts.num_selected > 0) ? true: false); emit interfacesChanged(); updateSelectedFilter(); updateWidgets(); }
ProfileDialog::ProfileDialog(QWidget *parent) : GeometryStateDialog(parent), pd_ui_(new Ui::ProfileDialog), ok_button_(NULL) { GList *fl_entry; profile_def *profile; const gchar *profile_name = get_profile_name(); pd_ui_->setupUi(this); loadGeometry(); setWindowTitle(wsApp->windowTitleString(tr("Configuration Profiles"))); ok_button_ = pd_ui_->buttonBox->button(QDialogButtonBox::Ok); // XXX - Use NSImageNameAddTemplate and NSImageNameRemoveTemplate to set stock // icons on macOS. // Are there equivalent stock icons on Windows? #ifdef Q_OS_MAC pd_ui_->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); pd_ui_->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); pd_ui_->copyToolButton->setAttribute(Qt::WA_MacSmallSize, true); pd_ui_->infoLabel->setAttribute(Qt::WA_MacSmallSize, true); #endif init_profile_list(); fl_entry = edited_profile_list(); pd_ui_->profileTreeWidget->blockSignals(true); while (fl_entry && fl_entry->data) { profile = (profile_def *) fl_entry->data; QTreeWidgetItem *item = new QTreeWidgetItem(pd_ui_->profileTreeWidget); item->setText(0, profile->name); item->setData(0, Qt::UserRole, VariantPointer<GList>::asQVariant(fl_entry)); if (profile->is_global || profile->status == PROF_STAT_DEFAULT) { QFont ti_font = item->font(0); ti_font.setItalic(true); item->setFont(0, ti_font); } else { item->setFlags(item->flags() | Qt::ItemIsEditable); } if (!profile->is_global && strcmp(profile_name, profile->name) == 0) { pd_ui_->profileTreeWidget->setCurrentItem(item); } fl_entry = g_list_next(fl_entry); } pd_ui_->profileTreeWidget->blockSignals(false); connect(pd_ui_->profileTreeWidget->itemDelegate(), SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), this, SLOT(editingFinished())); updateWidgets(); }
void SBI_NetworkIconDialog::addProxy() { const QString name = QInputDialog::getText(this, tr("Add proxy"), tr("Name of proxy:")); if (name.isEmpty() || ui->comboBox->findText(name) > -1) { return; } ui->comboBox->addItem(name); ui->comboBox->setCurrentIndex(ui->comboBox->count() - 1); updateWidgets(); }
void ColorCalibrationWidget::currentCalibrationChanged() { if(currentColor < FieldColors::numOfNonColors) { historyBasic.add(colorCalibrationView.console.colorCalibration.copyBasicParameters()); } else historyColors[currentColor - FieldColors::numOfNonColors].add(colorCalibrationView.console.colorCalibration[currentColor]); updateWidgets(currentColor); setUndoRedo(); }
autoCategoriesEditor CategoriesEditor_create (const char32 *title, Categories data) { try { autoCategoriesEditor me = Thing_new (CategoriesEditor); Editor_init (me.peek(), 20, 40, 600, 600, title, data); my history = CommandHistory_create (100); update (me.peek(), 0, 0, nullptr, 0); updateWidgets (me.peek()); return me; } catch (MelderError) { Melder_throw (U"Categories window not created."); } }
static void insert (CategoriesEditor me, int position) { autostring32 text = GuiText_getString (my text); if (str32len (text.peek()) != 0) { autoSimpleString str = SimpleString_create (text.peek()); autoCategoriesEditorInsert command = CategoriesEditorInsert_create (me, str.move(), position); Command_do (command.peek()); if (my history) { CommandHistory_insertItem_move (my history.peek(), command.move()); } updateWidgets (me); } }
/* Precondition: contiguous selection */ static void gui_button_cb_moveDown (CategoriesEditor me, GuiButtonEvent /* event */) { long posCount; autoNUMvector<long> posList (GuiList_getSelectedPositions (my list, & posCount), 1); if (posCount > 0) { autoCategoriesEditorMoveDown command = CategoriesEditorMoveDown_create (me, posList.peek(), posCount, posList[posCount] + 1); Command_do (command.peek()); if (my history) { CommandHistory_insertItem_move (my history.peek(), command.move()); } updateWidgets (me); } }
void ProfileDialog::editingFinished() { QTreeWidgetItem *item = pd_ui_->profileTreeWidget->currentItem(); if (item) { profile_def *profile = (profile_def *) item->data(0, Qt::UserRole).value<GList *>()->data; if (item->text(0).compare(profile->name) != 0) { g_free(profile->name); profile->name = qstring_strdup(item->text(0)); } } updateWidgets(); }
void FindFilesDialog::slotTemplateActivated(int index) { if (index < KileGrep::tmEnv) { m_TemplateList[m_lastTemplateIndex] = template_edit->text(); template_edit->setText(m_TemplateList[index]); } else { template_edit->setText(QString()); } m_lastTemplateIndex = index; updateWidgets(); }