KonviConfigDialog::KonviConfigDialog( QWidget *parent, const char *name, KConfigSkeleton *config, DialogType dialogType, int dialogButtons, ButtonCode defaultButton, bool modal ) : KDialogBase( dialogType, Qt::WStyle_DialogBorder, parent, name, modal, i18n("Configure"), dialogButtons, defaultButton ), d(new KConfigDialogPrivate(dialogType)) { if ( name ) { openDialogs.insert(name, this); } else { QCString genericName; genericName.sprintf("SettingsDialog-%p", this); openDialogs.insert(genericName, this); setName(genericName); } connect(this, SIGNAL(okClicked()), this, SLOT(updateSettings())); connect(this, SIGNAL(applyClicked()), this, SLOT(updateSettings())); connect(this, SIGNAL(applyClicked()), this, SLOT(updateButtons())); connect(this, SIGNAL(defaultClicked()), this, SLOT(updateWidgetsDefault())); connect(this, SIGNAL(defaultClicked()), this, SLOT(updateButtons())); d->manager = new KConfigDialogManager(this, config); setupManagerConnections(d->manager); enableButton(Apply, false); }
KOIncidenceEditor::KOIncidenceEditor(const QString &caption, Calendar *calendar, QWidget *parent) : KDialogBase(Tabbed, caption, Ok | Apply | Cancel | Default, Ok, parent, 0, false, false), mAttendeeEditor(0), mIsCounter(false) { // Set this to be the group leader for all subdialogs - this means // modal subdialogs will only affect this dialog, not the other windows setWFlags(getWFlags() | WGroupLeader); mCalendar = calendar; if(KOPrefs::instance()->mCompactDialogs) { showButton(Apply, false); showButton(Default, false); } else { setButtonText(Default, i18n("&Templates...")); } connect(this, SIGNAL(defaultClicked()), SLOT(slotManageTemplates())); connect(this, SIGNAL(finished()), SLOT(delayedDestruct())); }
KWConfigureDialog::KWConfigureDialog(KWView* parent) : KPageDialog(parent) { setFaceType(List); setCaption(i18n("Configure")); setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel | KDialog::Default); setDefaultButton(KDialog::Ok); m_miscPage = new KoConfigMiscPage(parent->koDocument(), parent->canvasBase()->shapeController()->resourceManager()); KPageWidgetItem *item = addPage(m_miscPage, i18n("Misc")); item->setHeader(i18n("Misc")); item->setIcon(koIcon("preferences-other")); m_gridPage = new KoConfigGridPage(parent->koDocument()); item = addPage(m_gridPage, i18n("Grid")); item->setHeader(i18n("Grid")); item->setIcon(koIcon("grid")); connect(m_miscPage, SIGNAL(unitChanged(KoUnit)), m_gridPage, SLOT(slotUnitChanged(KoUnit))); m_docPage = new KoConfigDocumentPage(parent->koDocument()); item = addPage(m_docPage, i18nc("@title:tab Document settings page", "Document")); item->setHeader(i18n("Document Settings")); item->setIcon(koIcon("document-properties")); m_authorPage = new KoConfigAuthorPage(); item = addPage(m_authorPage, i18nc("@title:tab Author page", "Author")); item->setHeader(i18n("Author")); item->setIcon(koIcon("user-identity")); connect(this, SIGNAL(okClicked()), this, SLOT(slotApply())); connect(this, SIGNAL(defaultClicked()), this, SLOT(slotDefault())); connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()) ); connect(this, SIGNAL(changed()), parent, SLOT(slotUpdateAuthorProfileActions())); }
ResizeRow::ResizeRow(QWidget* parent, Selection* selection) : KDialog(parent) { setCaption(i18n("Resize Row")); setModal(true); setButtons(Ok | Cancel | Default); m_selection = selection; const KCRowFormat* rl = m_selection->activeSheet()->rowFormat(selection->lastRange().top()); rowHeight = rl->height(); QWidget *page = new QWidget(); setMainWidget(page); QGridLayout* gridLayout = new QGridLayout(page); gridLayout->setColumnStretch(1, 1); QLabel * label1 = new QLabel(page); label1->setText(i18n("Height:")); gridLayout->addWidget(label1, 0, 0); m_pHeight = new KoUnitDoubleSpinBox(page); m_pHeight->setValue(rowHeight); m_pHeight->setUnit(m_selection->canvas()->unit()); gridLayout->addWidget(m_pHeight, 0, 1); m_pHeight->setFocus(); //store the visible value, for later check for changes rowHeight = m_pHeight->value(); connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); connect(this, SIGNAL(defaultClicked()), this, SLOT(slotDefault())); }
KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KPageDialog( 0 ) { setFaceType( KPageDialog::List ); setWindowTitle( i18n( "Preferences" ) ); setButtons( Help|Default|Ok|Apply|Cancel ); setDefaultButton( Ok ); setModal( true ); showButtonSeparator( true ); // ok i need some stuff in that pref dlg... //setIconListAllVisible(true); m_viewPage = new ViewPage(); KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) ); item->setIcon( KIcon( "preferences-desktop-theme" ) ); item->setHeader( i18n( "View Settings" ) ); m_viewPage->setSettings( viewSets ); m_diffPage = new DiffPage(); item = addPage( m_diffPage, i18n( "Diff" ) ); item->setIcon( KIcon( "text-x-patch" ) ); item->setHeader( i18n( "Diff Settings" ) ); m_diffPage->setSettings( diffSets ); // frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) ); connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) ); connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) ); connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) ); connect( this, SIGNAL(okClicked()), SLOT(slotOk()) ); connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) ); adjustSize(); }
void RemoveRedEyesWindow::slotButtonClicked(int button) { emit buttonClicked(static_cast<KDialog::ButtonCode> (button)); switch (button) { case User2: // testrun emit user2Clicked(); break; case User1: // correction emit user1Clicked(); break; case Cancel: emit cancelClicked(); break; case Close: emit myCloseClicked(); break; case Help: emit helpClicked(); break; case Default: emit defaultClicked(); break; } }
ResizeColumn::ResizeColumn(QWidget* parent, Selection* selection) : KDialog(parent) { setCaption(i18n("Resize Column")); setModal(true); setButtons(Ok | Cancel | Default); m_selection = selection; const KCColumnFormat* cl = m_selection->activeSheet()->columnFormat(selection->lastRange().left()); columnWidth = cl->width(); QWidget *page = new QWidget(); setMainWidget(page); QGridLayout* gridLayout = new QGridLayout(page); gridLayout->setColumnStretch(1, 1); QLabel * label1 = new QLabel(page); label1->setText(i18n("Width:")); gridLayout->addWidget(label1, 0, 0); m_pWidth = new KoUnitDoubleSpinBox(page); m_pWidth->setValue(columnWidth); m_pWidth->setUnit(m_selection->canvas()->unit()); gridLayout->addWidget(m_pWidth, 0, 1); m_pWidth->setFocus(); //store the visible value, for later check for changes columnWidth = m_pWidth->value(); connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); connect(this, SIGNAL(defaultClicked()), this, SLOT(slotDefault())); }
StyleConfigDialog::StyleConfigDialog(QWidget *parent, QString styleName) : KDialogBase(parent, "StyleConfigDialog", true, /*modal*/ i18n("Configure %1").arg(styleName), KDialogBase::Default | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Cancel) { m_dirty = false; connect(this, SIGNAL(defaultClicked()), this, SIGNAL(defaults())); connect(this, SIGNAL(okClicked()), this, SIGNAL(save())); }
void KonviConfigDialog::setupManagerConnections(KConfigDialogManager *manager) { connect(manager, SIGNAL(settingsChanged()), this, SLOT(settingsChangedSlot())); connect(manager, SIGNAL(widgetModified()), this, SLOT(updateButtons())); connect(this, SIGNAL(okClicked()), manager, SLOT(updateSettings())); connect(this, SIGNAL(applyClicked()), manager, SLOT(updateSettings())); connect(this, SIGNAL(defaultClicked()), manager, SLOT(updateWidgetsDefault())); }
KKeyDialog::KKeyDialog(bool bAllowLetterShortcuts, QWidget *parent, const char *name) : KDialogBase(parent, name ? name : "kkeydialog", true, i18n("Configure Shortcuts"), Default | Ok | Cancel, Ok) { m_pKeyChooser = new KKeyChooser(this, KKeyChooser::Application, bAllowLetterShortcuts); setMainWidget(m_pKeyChooser); connect(this, SIGNAL(defaultClicked()), m_pKeyChooser, SLOT(allDefault())); KConfigGroup group(KGlobal::config(), "KKeyDialog Settings"); QSize sz = size(); resize(group.readSizeEntry("Dialog Size", &sz)); }
KNotesKeyDialog( KActionCollection *globals, QWidget *parent ) : KDialog( parent ) { setCaption( i18n( "Configure Shortcuts" ) ); setButtons( Default | Ok | Cancel ); m_keyChooser = new KShortcutsEditor( globals, this ); setMainWidget( m_keyChooser ); connect( this, SIGNAL(defaultClicked()), m_keyChooser, SLOT(allDefault()) ); }
void KNoteBook::setDefaultButton(const char *name) { if(!pnote->def) { pnote->def = new QPushButton(name, this); pnote->def->show(); connect( pnote->def, SIGNAL(clicked()), SLOT(defaultClicked())); } else pnote->def->setText(name); setSizes(); }
StyleConfigDialog::StyleConfigDialog(QWidget* parent, QString styleName) : KDialog( parent ) { setObjectName( "StyleConfigDialog" ); setModal( true ); setCaption( i18n( "Configure %1", styleName ) ); setButtons( Default | Ok | Cancel ); setDefaultButton( Cancel ); m_dirty = false; connect( this, SIGNAL(defaultClicked()), this, SIGNAL(defaults())); connect( this, SIGNAL(okClicked()), this, SIGNAL(save())); }
KSwitchLanguageDialog::KSwitchLanguageDialog( QWidget *parent ) : KDialog(parent), d(new KSwitchLanguageDialogPrivate(this)) { setCaption(i18n("Switch Application Language")); setButtons(Ok | Cancel | Default); setDefaultButton(Ok); connect(this, SIGNAL(okClicked()), SLOT(slotOk())); connect(this, SIGNAL(defaultClicked()), SLOT(slotDefault())); d->page = new QWidget( this ); setMainWidget(d->page); QVBoxLayout *topLayout = new QVBoxLayout( d->page ); topLayout->setMargin( 0 ); QLabel *label = new QLabel( i18n("Please choose the language which should be used for this application:"), d->page ); topLayout->addWidget( label ); QHBoxLayout *languageHorizontalLayout = new QHBoxLayout(); topLayout->addLayout(languageHorizontalLayout); d->languagesLayout = new QGridLayout(); languageHorizontalLayout->addLayout(d->languagesLayout); languageHorizontalLayout->addStretch(); const QStringList defaultLanguages = d->applicationLanguageList(); int count = defaultLanguages.count(); for (int i = 0; i < count; ++i) { QString language = defaultLanguages[i]; bool primaryLanguage = (i == 0); d->addLanguageButton(language, primaryLanguage); } if (!count) { d->addLanguageButton(KGlobal::locale()->defaultLanguage(), true); } QHBoxLayout *addButtonHorizontalLayout = new QHBoxLayout(); topLayout->addLayout(addButtonHorizontalLayout); KPushButton *addLangButton = new KPushButton(i18n("Add Fallback Language"), d->page); addLangButton->setToolTip(i18n("Adds one more language which will be used if other translations do not contain a proper translation.")); connect(addLangButton, SIGNAL(clicked()), this, SLOT(slotAddLanguageButton())); addButtonHorizontalLayout->addWidget(addLangButton); addButtonHorizontalLayout->addStretch(); topLayout->addStretch(10); }
KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const QString& title, QWidget* parent, bool modal) : KPageDialog(parent), d( new KGameDialogPrivate ) { setCaption(title); setButtons(Ok|Default|Apply|Cancel); setDefaultButton(Ok); setFaceType(KPageDialog::Tabbed); setModal(modal); init(g, owner); connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(defaultClicked()),this,SLOT(slotDefault())); connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply())); }
IntegrationPreferences::IntegrationPreferences(KConfigDialog *parent, Qt::WindowFlags f) : QWidget(parent, f) { ui.setupUi(this); //AutoPaste stuff ui.type->addItem(KIcon("list-add"), i18n("Include"), AutoPasteModel::Include); ui.type->addItem(KIcon("list-remove"), i18n("Exclude"), AutoPasteModel::Exclude); ui.patternSyntax->addItem(i18n("Escape sequences"), AutoPasteModel::Wildcard); ui.patternSyntax->addItem(i18n("Regular expression"), AutoPasteModel::RegExp); ui.add->setGuiItem(KStandardGuiItem::add()); ui.remove->setGuiItem(KStandardGuiItem::remove()); ui.increase->setIcon(KIcon("arrow-up")); ui.decrease->setIcon(KIcon("arrow-down")); m_model = new AutoPasteModel(this); m_model->load(); ui.list->setModel(m_model); AutoPasteDelegate *delegate = new AutoPasteDelegate(ui.type->model(), ui.patternSyntax->model(), this); ui.list->setItemDelegate(delegate); QByteArray loadedState = QByteArray::fromBase64(Settings::autoPasteHeaderState().toAscii()); if (Settings::autoPasteHeaderState().isEmpty()) { ui.list->resizeColumnToContents(AutoPasteModel::Type); } else if (!loadedState.isNull()) { ui.list->header()->restoreState(loadedState); } connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); connect(ui.list->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotUpdateButtons())); connect(ui.pattern, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateButtons())); connect(ui.pattern, SIGNAL(returnPressed(QString)), this, SLOT(slotAddItem())); connect(ui.add, SIGNAL(clicked()), this, SLOT(slotAddItem())); connect(ui.remove, SIGNAL(clicked()), this, SLOT(slotRemoveItem())); connect(ui.increase, SIGNAL(clicked()), this, SLOT(slotIncreasePriority())); connect(ui.decrease, SIGNAL(clicked()), this, SLOT(slotDecreasePriority())); connect(parent, SIGNAL(rejected()), m_model, SLOT(load())); connect(parent, SIGNAL(applyClicked()), m_model, SLOT(save())); connect(parent, SIGNAL(okClicked()), m_model, SLOT(save())); connect(parent, SIGNAL(defaultClicked()), m_model, SLOT(resetDefaults())); slotUpdateButtons(); }
KIGPDialog::KIGPDialog(QWidget *parent, const QString& path ) : KPageDialog( parent) { setCaption(i18nc("@title:window", "Configure")); setButtons(Default|Ok|Cancel); setDefaultButton(Ok); setModal(true); showButtonSeparator(true); setFaceType(List); m_path = path; setCaption(i18nc("@title:window", "Create Image Gallery")); setButtonGuiItem( KDialog::Ok, KGuiItem(i18n("Create"),"imagegallery") ); m_config = new KConfig("kimgallerypluginrc", KConfig::NoGlobals); setupLookPage(path); setupDirectoryPage(path); setupThumbnailPage(path); connect(this,SIGNAL(defaultClicked()),this,SLOT(slotDefault())); }
SpotifySettingsDialog::SpotifySettingsDialog( QWidget *parent ) : KDialog( parent ) , m_settingsWidget(new Ui::SpotifySettingsWidget) { debug() << "Checking Spotify resolver: " << Collections::SpotifyCollection::resolverPath(); if( !QFile::exists( Collections::SpotifyCollection::resolverPath() ) ) { SpotifyDownloadDialog dialog; m_config.reset(); dialog.exec(); } setCaption( i18n( "Spotify configuration" ) ); setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Default ); enableButtonApply( false ); QWidget *w = new QWidget(this); m_settingsWidget->setupUi( w ); m_settingsWidget->messageWidget->hide(); setMainWidget( w ); connect( this, SIGNAL( okClicked() ), this, SLOT( slotTryLogin() ) ); connect( this, SIGNAL( cancelClicked() ), this, SLOT( slotCancel() ) ); connect( this, SIGNAL( applyClicked() ), this, SLOT( slotTryLogin() ) ); connect( this, SIGNAL( defaultClicked() ), this, SLOT( defaults() ) ); connect( m_settingsWidget->lineUsername, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotSettingsChanged() ) ); connect( m_settingsWidget->linePassword, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotSettingsChanged() ) ); connect( m_settingsWidget->checkHighQuality, SIGNAL( clicked() ), this, SLOT( slotSettingsChanged() ) ); connect( this, SIGNAL( changed( bool ) ), this, SLOT( enableButtonApply( bool ) ) ); // Load config from KConfig or KWallet load(); }
KSimPackageFileDialog::KSimPackageFileDialog(QWidget *parent, const char * name) : KDialogBase(KDialogBase::Plain, i18n("Package Files"), KDialogBase::Default | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name) { QWidget * wid = plainPage(); KSimPackageFileWidget * child = new KSimPackageFileWidget(wid, i18n("Package Files")); QBoxLayout * horLayout = new QHBoxLayout(wid); /* horLayout->setMargin(KDialog::marginHint()); horLayout->setSpacing(KDialog::spacingHint());*/ horLayout->addWidget(child); connect(this, SIGNAL(okClicked()), child, SLOT(slotAccept())); connect(this, SIGNAL(defaultClicked()), child, SLOT(slotDefault())); connect(this, SIGNAL(cancelClicked()), child, SLOT(slotCancel())); }
GameSetup::GameSetup(QWidget *parent) : ui(new Ui::GameSetup) { settings = new GameSettings(); setCaption(i18n("Setup GameOfLife")); setButtons(Ok|Cancel|Help|Default); setDefaultButton(Ok); setModal(true); showButtonSeparator(true); setButtonText(Help, i18n("A&bout")); QWidget *main = new QWidget(this); setMainWidget(main); ui->setupUi(main); ui->boxShapes->addItem("Rectangle"); ui->boxShapes->addItem("Rounded rectangle"); ui->boxShapes->addItem("Ellipse"); cell = QPixmap(71, 21); bkg = QPixmap(71, 21); connect(ui->sliderR, SIGNAL(valueChanged(int)), this, SLOT(onSliderRValueChanged(int))); connect(ui->sliderG, SIGNAL(valueChanged(int)), this, SLOT(onSliderGValueChanged(int))); connect(ui->sliderB, SIGNAL(valueChanged(int)), this, SLOT(onSliderValueChanged(int))); connect(ui->sliderR_2, SIGNAL(valueChanged(int)), this, SLOT(onSliderR_2ValueChanged(int))); connect(ui->sliderG_2, SIGNAL(valueChanged(int)), this, SLOT(onSliderG_2ValueChanged(int))); connect(ui->sliderB_2, SIGNAL(valueChanged(int)), this, SLOT(onSliderB_2ValueChanged(int))); connect(this, SIGNAL(okClicked()), SLOT(onOkClicked())); connect(this, SIGNAL(helpClicked()), SLOT(onHelpClicked())); connect(this, SIGNAL(defaultClicked()), SLOT(onDefaultClicked())); ShowSettings(); }
EqualizerPresetManager::EqualizerPresetManager( QWidget *parent ) : KDialog( parent ) { setCaption( i18n("Presets") ); setModal( true ); setButtons( Ok | Cancel | Default ); setDefaultButton( Ok ); showButtonSeparator( true ); QWidget *mainWidget = new QWidget( this ); setMainWidget( mainWidget ); QHBoxLayout *mainLayout = new QHBoxLayout( mainWidget, 0, spacingHint() ); m_presetsView = new K3ListView( mainWidget ); m_presetsView->setObjectName( "presetListView" ); m_presetsView->addColumn( i18n( "Presets" ) ); m_presetsView->setFullWidth( true ); connect(m_presetsView, SIGNAL( selectionChanged() ), SLOT( updateButtonState() )); connect(m_presetsView, SIGNAL( doubleClicked ( Q3ListViewItem*, const QPoint&, int ) ), SLOT( slotRename() )); mainLayout->addWidget( m_presetsView ); QVBoxLayout* buttonsLayout = new QVBoxLayout( mainLayout ); m_renameBtn = new QPushButton( i18n("&Rename"), mainWidget, "renameBtn" ); m_deleteBtn = new QPushButton( i18n("&Delete"), mainWidget, "deleteBtn" ); buttonsLayout->addWidget( m_renameBtn ); buttonsLayout->addWidget( m_deleteBtn ); connect(m_renameBtn, SIGNAL( clicked() ), SLOT( slotRename() )); connect(m_deleteBtn, SIGNAL( clicked() ), SLOT( slotDelete() )); connect(this, SIGNAL( defaultClicked() ), SLOT( slotDefault() )); QSpacerItem* spacer = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); buttonsLayout->addItem( spacer ); updateButtonState(); resize( QSize(300, 250).expandedTo(minimumSizeHint()) ); }
SettingsDlg::SettingsDlg( QWidget * parent, Settings::OptionState *state ) : KPageDialog( parent) { setCaption(i18n("Umbrello Setup") ); setButtons( Help | Default | Apply | Ok | Cancel ); setDefaultButton( Ok ); setModal( true ); showButtonSeparator( true ); setFaceType( KPageDialog::List ); m_bChangesApplied = false; m_pOptionState = state; setHelp( "umbrello/index.html", QString() ); setupGeneralPage(); setupFontPage(); setupUIPage(); setupClassPage(); setupCodeImportPage(); setupCodeGenPage(); setupCodeViewerPage(state->codeViewerState); setupAutoLayoutPage(); connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply())); connect(this,SIGNAL(defaultClicked()),this,SLOT(slotDefault())); }
PrefDialog::PrefDialog(QWidget *parent,int nbChannels) : QPageDialog(parent) { setButtons(Help | Default | Ok | Apply | Cancel); setDefaultButton(Ok); setFaceType(List); setWindowTitle(tr("Preferences")); setHelp("settings","klusters"); QWidget * w = new QWidget(this); prefGeneral = new PrefGeneral(w); QPageWidgetItem *item = new QPageWidgetItem(prefGeneral,tr("General")); item->setHeader(tr("Klusters General Configuration")); item->setIcon(QIcon(":/shared-icons/folder-open")); addPage(item); //adding page "Cluster view configuration" w = new QWidget(this); prefclusterView = new PrefClusterView(w); item = new QPageWidgetItem(prefclusterView,tr("Cluster view")); item->setHeader(tr("Cluster View configuration")); item->setIcon(QIcon(":/icons/clusterview")); addPage(item); //adding page "Waveform view configuration" w = new QWidget(this); prefWaveformView = new PrefWaveformView(w,nbChannels); item = new QPageWidgetItem(prefWaveformView,tr("Waveform view")); item->setHeader(tr("Waveform View configuration")); item->setIcon(QIcon(":/icons/waveformview")); addPage(item); // connect interactive widgets and selfmade signals to the enableApply slotDefault connect(prefGeneral->crashRecoveryCheckBox,SIGNAL(clicked()),this,SLOT(enableApply())); connect(prefGeneral->crashRecoveryComboBox,SIGNAL(activated(int)),this,SLOT(enableApply())); connect(prefGeneral->undoSpinBox,SIGNAL(valueChanged(int)),this,SLOT(enableApply())); connect(prefGeneral->backgroundColorButton,SIGNAL(colorChanged(QColor)),this,SLOT(enableApply())); connect(prefGeneral->reclusteringExecutableLineEdit,SIGNAL(textChanged(QString)),this,SLOT(enableApply())); //connect(prefGeneral,SIGNAL(reclusteringArgsUpdate()),this,SLOT(enableApply())); connect(prefGeneral->reclusteringArgsLineEdit,SIGNAL(textChanged(QString)),this,SLOT(enableApply())); connect(prefGeneral->useWhiteColorPrinting,SIGNAL(clicked()),this,SLOT(enableApply())); connect(prefclusterView->intervalSpinBox,SIGNAL(valueChanged(int)),this,SLOT(enableApply())); connect(prefWaveformView->gainSpinBox,SIGNAL(valueChanged(int)),this,SLOT(enableApply())); connect(prefWaveformView,SIGNAL(positionsChanged()),this,SLOT(enableApply())); connect(this, SIGNAL(applyClicked()), SLOT(slotApply())); connect(this, SIGNAL(defaultClicked()), SLOT(slotDefault())); connect(this,SIGNAL(helpClicked()),SLOT(slotHelp())); applyEnable = false; }
void SettingsController::showSettingsDialog() { if (KConfigDialog::showDialog("lokalize_settings")) return; KConfigDialog *dialog = new KConfigDialog(m_mainWindowPtr, "lokalize_settings", Settings::self()); dialog->setFaceType(KPageDialog::List); // Identity QWidget *w = new QWidget(dialog); Ui_prefs_identity ui_prefs_identity; ui_prefs_identity.setupUi(w); KConfigGroup grp = Settings::self()->config()->group("Identity"); ui_prefs_identity.DefaultLangCode->setModel(LanguageListModel::instance()->sortModel()); ui_prefs_identity.DefaultLangCode->setCurrentIndex(LanguageListModel::instance()->sortModelRowForLangCode( grp.readEntry("DefaultLangCode", QLocale::system().name()) )); connect(ui_prefs_identity.DefaultLangCode,SIGNAL(activated(int)),ui_prefs_identity.kcfg_DefaultLangCode,SLOT(setLangCode(int))); ui_prefs_identity.kcfg_DefaultLangCode->hide(); dialog->addPage(w, i18nc("@title:tab","Identity"), "preferences-desktop-user"); //Editor w = new QWidget(dialog); Ui_prefs_editor ui_prefs_editor; ui_prefs_editor.setupUi(w); dialog->addPage(w, i18nc("@title:tab","Editing"), "accessories-text-editor"); //Font w = new QWidget(dialog); Ui_prefs_appearance ui_prefs_appearance; ui_prefs_appearance.setupUi(w); dialog->addPage(w, i18nc("@title:tab","Appearance"), "preferences-desktop-font"); //TM w = new QWidget(dialog); Ui_prefs_tm ui_prefs_tm; ui_prefs_tm.setupUi(w); dialog->addPage(w, i18nc("@title:tab","Translation Memory"), "configure"); connect(dialog,SIGNAL(settingsChanged(QString)),this,SIGNAL(generalSettingsChanged())); //Spellcheck #if 0 w = new Sonnet::ConfigWidget(Settings::self()->config(),dialog); w->setParent(this); dialog->addPage(w, i18nc("@title:tab","Spellcheck"), "spellcheck_setting"); connect(dialog,SIGNAL(okClicked()),w,SLOT(save())); connect(dialog,SIGNAL(applyClicked()),w,SLOT(save())); connect(dialog,SIGNAL(defaultClicked()),w,SLOT(slotDefault())); #endif //connect(dialog,SIGNAL(settingsChanged(const QString&)),m_view, SLOT(settingsChanged())); dialog->show(); // dialog->addPage(new General(0, "General"), i18n("General") ); // dialog->addPage(new Appearance(0, "Style"), i18n("Appearance") ); // connect(dialog, SIGNAL(settingsChanged(const QString&)), mainWidget, SLOT(loadSettings())); // connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(loadSettings())); }
EditFilterDialog::EditFilterDialog( QWidget* parent, const QString &text ) : KDialog( parent ) , m_appended( false ) , m_filterText( text ) { setCaption( i18n( "Edit Filter" ) ); setModal( true ); setButtons( User1|User2|Default|Ok|Cancel ); setDefaultButton( Cancel ); showButtonSeparator( true ); m_ui.setupUi( mainWidget() ); // Redefine "Default" button KGuiItem defaultButton( i18n("&Append"), "list-add" ); setButtonWhatsThis( Default, i18n( "<qt><p>By clicking here you can add the defined condition. The \"OK\" button will " "close the dialog and apply the defined filter. With this button you can add more than " "one condition to create a more complex filtering condition.</p></qt>" ) ); setButtonToolTip( Default, i18n( "Add this filter condition to the list" ) ); setButtonGuiItem( Default, defaultButton ); // define "User1" button KGuiItem user1Button( i18n("&Clear"), "list-remove" ); setButtonWhatsThis( User1, i18n( "<p>By clicking here you will clear the filter. If you intend to " "undo the last appending just click on the \"Undo\" button.</p>" ) ); setButtonToolTip(User1, i18n( "Clear the filter" ) ); setButtonGuiItem( User1, user1Button ); // define "User2" button KGuiItem user2Button( i18nc("this \"undo\" will undo the last appended filter... be careful how you will translate it " "to avoid two buttons (\"Cancel\" and \"Undo\") with same label in the same dialog", "&Undo"), "edit-undo" ); setButtonWhatsThis( User2, i18n( "<p>Clicking here will remove the last appended filter. " "You cannot undo more than one action.</p>" ) ); setButtonToolTip( User2, i18n( "Remove last appended filter" ) ); setButtonGuiItem( User2, user2Button ); //setMainWidget( m_ui ); m_vector.push_back( "Simple Search" ); m_vector.push_back( "album" ); m_vector.push_back( "artist" ); m_vector.push_back( "composer" ); m_vector.push_back( "genre" ); m_vector.push_back( "title" ); m_vector.push_back( "track" ); m_vector.push_back( "year" ); // the "Simple Search" text is selected in the comboKeyword m_selectedIndex = 0; connect( m_ui.keywordCombo, SIGNAL( activated( int ) ), SLOT(selectedKeyword( int ) ) ); connect( m_ui.minimum1, SIGNAL( valueChanged( int ) ), SLOT(minSpinChanged( int ) ) ); connect( m_ui.maximum1, SIGNAL( valueChanged( int ) ), SLOT(maxSpinChanged( int ) ) ); // type text selected textWanted(); // check the "One Value Choosing" by default chooseOneValue(); connect( m_ui.conditionCombo, SIGNAL(activated( int ) ), SLOT(chooseCondition( int ) ) ); m_checkActions << m_ui.matchAll; m_checkActions << m_ui.matchAny; m_checkActions << m_ui.matchLiteral; m_checkActions << m_ui.matchNot; connect( m_ui.matchAll, SIGNAL( clicked() ), SLOT( slotCheckAll() ) ); connect( m_ui.matchAny, SIGNAL( clicked() ), SLOT( slotCheckAtLeastOne() ) ); connect( m_ui.matchLiteral, SIGNAL( clicked() ), SLOT( slotCheckExactly() ) ); connect( m_ui.matchNot, SIGNAL( clicked() ), SLOT( slotCheckExclude() ) ); // check "select all words" as default slotCheckAll(); m_ui.invertButton->setEnabled( false ); connect( m_ui.invertButton, SIGNAL( clicked() ), SLOT( assignPrefixNOT() ) ); // you need to append at least one filter condition to specify if do // an "AND" or an "OR" with the next condition if the filter is empty if( m_filterText.isEmpty() ) m_ui.groupBox_3->setEnabled( false ); connect( m_ui.andButton, SIGNAL(clicked()), SLOT(slotCheckAND()) ); connect( m_ui.orButton, SIGNAL(clicked()), SLOT(slotCheckOR()) ); // check "AND" condition as default slotCheckAND(); connect( this, SIGNAL(okClicked()), this, SLOT(slotOk() ) ); connect( this, SIGNAL( defaultClicked() ) , this, SLOT(slotDefault() ) ); connect( this, SIGNAL( user1Clicked() ), this, SLOT( slotUser1() ) ); connect( this, SIGNAL( user2Clicked() ), this, SLOT( slotUser2() ) ); Amarok::Collection *coll = CollectionManager::instance()->primaryCollection(); if( !coll ) return; QueryMaker *artist = coll->queryMaker()->setQueryType( QueryMaker::Artist ); QueryMaker *album = coll->queryMaker()->setQueryType( QueryMaker::Album ); QueryMaker *composer = coll->queryMaker()->setQueryType( QueryMaker::Composer ); QueryMaker *genre = coll->queryMaker()->setQueryType( QueryMaker::Genre ); QList<QueryMaker*> queries; queries << artist << album << composer << genre; //MetaQueryMaker will run multiple different queries just fine as long as we do not use it //to set the query type. Configuring the queries is ok though MetaQueryMaker *dataQueryMaker = new MetaQueryMaker( queries ); connect( dataQueryMaker, SIGNAL( newResultReady( QString, Meta::ArtistList ) ), SLOT( resultReady( QString, Meta::ArtistList ) ), Qt::QueuedConnection ); connect( dataQueryMaker, SIGNAL( newResultReady( QString, Meta::AlbumList ) ), SLOT( resultReady( QString, Meta::AlbumList ) ), Qt::QueuedConnection ); connect( dataQueryMaker, SIGNAL( newResultReady( QString, Meta::ComposerList ) ), SLOT( resultReady( QString, Meta::ComposerList ) ), Qt::QueuedConnection ); connect( dataQueryMaker, SIGNAL( newResultReady( QString, Meta::GenreList ) ), SLOT( resultReady( QString, Meta::GenreList ) ), Qt::QueuedConnection ); dataQueryMaker->run(); }
TModuleView::TModuleView( QWidget *parent, KCModule* module, const QString& icon_path, const QString& text, const QString& filename, bool needsRootPrivileges ) : QWidget( parent ), _proc(0L), _embedWidget(0L), _embedLayout(0L), _embedStack(0L) { contentView = new TMContent( this, module ); // Name of the desktop file _filename = filename.section('/',-1); parentInner = parent; QVBoxLayout *vbox = new QVBoxLayout( this, 3 ); QHBoxLayout *header = new QHBoxLayout( vbox, 5 ); QPixmap pix = DesktopIcon( icon_path, KIcon::SizeSmallMedium ); _icon = new QLabel( this ); _icon->setPixmap( pix ); _icon->setFixedSize( _icon->minimumSizeHint() ); _moduleName = new QLabel( this ); QString name = QString( "<b>" ) + text + QString( "</b>" ); _moduleName->setText( name ); header->addWidget( _icon ); header->addWidget( _moduleName ); _sep = new KSeparator( KSeparator::HLine, this ); // main content vbox->addWidget( contentView ); vbox->addWidget( _sep ); _back = new KPushButton( KGuiItem( i18n( "&Back" ), "back" ), this ); _back->setFixedSize( _back->sizeHint() ); _back->setDefault(true); _default = new KPushButton( KStdGuiItem::defaults(), this ); _default->setFixedSize( _default->sizeHint() ); _apply = new KPushButton( KStdGuiItem::apply(), this ); _apply->setFixedSize( _apply->sizeHint() ); _reset = new KPushButton( KGuiItem( i18n( "&Reset" ), "undo" ), this ); _reset->setFixedSize( _reset->sizeHint() ); _runAsRoot = new KPushButton( KGuiItem( i18n( "&Administrator Mode" ), "" ), this ); _runAsRoot->setFixedSize( _runAsRoot->sizeHint() ); if( !needsRootPrivileges or getuid() == 0) _runAsRoot->hide(); QHBoxLayout *buttons = new QHBoxLayout( vbox, 5); buttons->addWidget( _back, 0, AlignLeft ); buttons->addWidget( _default, 0, AlignLeft ); buttons->addWidget( _runAsRoot, 0, AlignLeft ); buttons->addStretch( 1 ); buttons->addWidget( _apply, 0, AlignRight ); buttons->addWidget( _reset, 0, AlignRight ); // set buttons visibility #if 0 int b = contentView->module()->buttons(); if ( !( b & KCModule::Default ) ) _default->hide(); if ( !( b & KCModule::Apply ) ) { _apply->hide(); _reset->hide(); } #endif connect( _back, SIGNAL( clicked() ), parent, SLOT( backToCategory() ) ); connect( _default, SIGNAL( clicked() ), SLOT( defaultClicked() ) ); connect( _apply, SIGNAL( clicked() ), SLOT( applyClicked() ) ); connect( _reset, SIGNAL( clicked() ), SLOT( resetClicked() ) ); connect( _runAsRoot, SIGNAL( clicked() ), SLOT( runAsRoot() ) ); connect( contentView->module(), SIGNAL( changed( bool ) ), SLOT( contentChanged( bool ) ) ); _apply->setEnabled( false ); _reset->setEnabled( false ); }