ToolBoxWidget::ToolBoxWidget(QWidget *parent) : QDockWidget(parent), ui(new Ui::ToolBoxWidget) { ui->setupUi(this); emptyPage = new QWidget; //index 0 this-ui->stackedWidget->addWidget(emptyPage); createBlockW = new CreateBlockWidget; //index 1 this->ui->stackedWidget->addWidget(createBlockW); moveVerticesW = new MoveVerticesWidget; //index 2 this->ui->stackedWidget->addWidget(moveVerticesW); setBCsW = new SetBCsWidget; //index 3 this->ui->stackedWidget->addWidget(setBCsW); edgePropsW = new EdgePropsWidget; //index 4 this->ui->stackedWidget->addWidget(edgePropsW); this->ui->stackedWidget->setCurrentIndex(1); connect(createBlockW,SIGNAL(cancel()),this,SLOT(slotCancel())); connect(setBCsW,SIGNAL(done()),this,SLOT(slotCancel())); connect(moveVerticesW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString))); connect(moveVerticesW,SIGNAL(moveDone()),this,SLOT(slotCancel())); connect(createBlockW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString))); connect(setBCsW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString))); connect(edgePropsW,SIGNAL(cancel()),this,SLOT(slotCancel())); connect(edgePropsW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString))); }
void KTimerDialog::slotInternalTimeout() { emit timerTimeout(); switch(buttonOnTimeout) { case Help: slotHelp(); break; case Default: slotDefault(); break; case Ok: slotOk(); break; case Apply: applyPressed(); break; case Try: slotTry(); break; case Cancel: slotCancel(); break; case Close: slotClose(); break; /*case User1: slotUser1(); break; case User2: slotUser2(); break;*/ case User3: slotUser3(); break; case No: slotNo(); break; case Yes: slotCancel(); break; case Details: slotDetails(); break; case Filler: case Stretch: kdDebug() << "Cannot execute button code " << buttonOnTimeout << endl; break; } }
K3b::DataMultisessionImportDialog::DataMultisessionImportDialog( QWidget* parent ) : QDialog( parent), d( new Private() ) { setModal(true); setWindowTitle(i18n("Session Import")); QVBoxLayout* layout = new QVBoxLayout( this ); QLabel* label = new QLabel( i18n( "Please select a session to import." ), this ); d->sessionView = new QTreeWidget( this ); d->sessionView->setHeaderHidden( true ); d->sessionView->setItemsExpandable( false ); d->sessionView->setRootIsDecorated( false ); QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this ); d->okButton = buttonBox->button( QDialogButtonBox::Ok ); connect( buttonBox, SIGNAL(accepted()), SLOT(accept()) ); connect( buttonBox, SIGNAL(rejected()), SLOT(reject()) ); layout->addWidget( label ); layout->addWidget( d->sessionView ); layout->addWidget( buttonBox ); connect( k3bappcore->mediaCache(), SIGNAL(mediumChanged(K3b::Device::Device*)), this, SLOT(updateMedia()) ); connect( d->sessionView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(slotSelectionChanged()) ); connect( d->sessionView, SIGNAL(itemActivated(QTreeWidgetItem*,int)), SIGNAL(okClicked()) ); connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel())); }
KrCalcSpaceDialog::KrCalcSpaceDialog(QWidget *parent, KrPanel * panel, const QStringList & items, bool autoclose) : QDialog(parent), m_autoClose(autoclose), m_canceled(false), m_timerCounter(0), m_items(items), m_view(panel->view) { setWindowTitle(i18n("Calculate Occupied Space")); setWindowModality(Qt::WindowModal); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); m_thread = new CalcThread(panel->virtualPath(), items); m_pollTimer = new QTimer(this); m_label = new QLabel("", this); mainLayout->addWidget(m_label); showResult(); // fill m_label with something useful mainLayout->addStretch(10); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); mainLayout->addWidget(buttonBox); okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); // the dialog: The Ok button is hidden until it is needed okButton->setVisible(false); cancelButton = buttonBox->button(QDialogButtonBox::Cancel); connect(buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), SLOT(slotCancel())); }
PanoPreviewPage::PanoPreviewPage(PanoManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "<b>Preview and Post-Processing</b>")), d(new Private(mngr)) { d->dlg = dlg; DVBox* const vbox = new DVBox(this); d->title = new QLabel(vbox); d->title->setOpenExternalLinks(true); d->title->setWordWrap(true); d->previewWidget = new DPreviewManager(vbox); d->previewWidget->setButtonText(i18nc("@action:button", "Details...")); d->postProcessing = new DHistoryView(vbox); d->progressBar = new DProgressWdg(vbox); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-hugin.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); connect(d->progressBar, SIGNAL(signalProgressCanceled()), this, SLOT(slotCancel())); }
walletconfiginput::walletconfiginput( QWidget * parent, std::function< void( const QString&,const QString&,const QString& ) > p, std::function< void() > q ) : QDialog( parent ),m_ui( new Ui::walletconfiginput ),m_add( std::move( p ) ),m_cancel( std::move( q ) ) { m_ui->setupUi( this ) ; this->setFixedSize( this->size() ) ; if( parent ){ this->setFont( parent->font() ) ; } m_ui->lineEditVolumeID->setEnabled( true ) ; m_ui->lineEditKey->setEchoMode( QLineEdit::Password ) ; m_ui->lineEditRepeatKey->setEchoMode( QLineEdit::Password ) ; connect( m_ui->pushButtonAdd,SIGNAL( clicked() ),this,SLOT( pbAdd() ) ) ; connect( m_ui->pushButtonCancel,SIGNAL( clicked() ),this,SLOT( slotCancel() ) ) ; connect( m_ui->pushButtonImageFile,SIGNAL( clicked() ),this,SLOT( pbImageFilePath() ) ) ; connect( m_ui->pushButtonVolume,SIGNAL( clicked() ),this,SLOT( pbVolumePath() ) ) ; m_ui->pushButtonImageFile->setIcon( QIcon( ":/file.png" ) ) ; m_ui->pushButtonVolume->setIcon( QIcon( ":/partition.png" ) ) ; this->installEventFilter( this ) ; this->show() ; }
AddCatDialog::AddCatDialog( KStars *_ks ) : KDialog( ( QWidget* )_ks ), ks( _ks ) { QDir::setCurrent( QDir::homePath() ); acd = new AddCatDialogUI(this); setMainWidget(acd); setCaption( i18n( "Import Catalog" ) ); setButtons( KDialog::Help|KDialog::Ok|KDialog::Cancel ); connect( acd->DataURL->lineEdit(), SIGNAL( lostFocus() ), this, SLOT( slotShowDataFile() ) ); connect( acd->DataURL, SIGNAL( urlSelected( const KUrl & ) ), this, SLOT( slotShowDataFile() ) ); connect( acd->PreviewButton, SIGNAL( clicked() ), this, SLOT( slotPreviewCatalog() ) ); connect( this, SIGNAL( okClicked() ), this, SLOT( slotCreateCatalog() ) ); // connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel())); connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp())); acd->FieldList->addItem( i18n( "ID Number" ) ); acd->FieldList->addItem( i18n( "Right Ascension" ) ); acd->FieldList->addItem( i18n( "Declination" ) ); acd->FieldList->addItem( i18n( "Object Type" ) ); acd->FieldPool->addItem( i18n( "Common Name" ) ); acd->FieldPool->addItem( i18n( "Magnitude" ) ); acd->FieldPool->addItem( i18n( "Flux" ) ); acd->FieldPool->addItem( i18n( "Major Axis" ) ); acd->FieldPool->addItem( i18n( "Minor Axis" ) ); acd->FieldPool->addItem( i18n( "Position Angle" ) ); acd->FieldPool->addItem( i18n( "Ignore" ) ); }
void Dialog::setProgressDialogVisible(bool b) { if (!b) { d->deleteProgressDialog(true); } else if(d->progressDialogTimeout >= 0) { if (d->progressDialog) { return; } d->progressDialog = new KProgressDialog(this, i18nc("@title:window", "Check Spelling"), i18nc("progress label", "Spell checking in progress...")); d->progressDialog->setModal(true); d->progressDialog->setAutoClose(false); d->progressDialog->setAutoReset(false); // create an 'indefinite' progress box as we currently cannot get progress feedback from // the speller d->progressDialog->progressBar()->reset(); d->progressDialog->progressBar()->setRange(0, 0); d->progressDialog->progressBar()->setValue(0); connect(d->progressDialog, SIGNAL(cancelClicked()), this, SLOT(slotCancel())); d->progressDialog->setMinimumDuration(d->progressDialogTimeout); } }
KDialogBase::KDialogBase( const QString & /*caption*/, int /*buttonMask*/, ButtonCode /*defaultButton*/, ButtonCode /*escapeButton*/, QWidget *parent, const char *name, bool modal, bool /*separator*/, const QString &user1, const QString &user2, const QString &/*user3*/ ) // third button left out because // it is only used by KCookieWin, which activates the cookie-detail button, which // is too large for small displays, anyway : QDialog( parent, name, modal ) { m_mainLayout = new QVBoxLayout( this ); m_buttonLayout = new QHBoxLayout( m_mainLayout ); m_okButton = new QPushButton( user1.isEmpty() ? i18n( "Yes" ) : user1 , this ); m_cancelButton = new QPushButton( user2.isEmpty() ? i18n( "No" ) : user2, this ); m_buttonLayout->addStretch(); m_buttonLayout->addWidget( m_okButton ); m_buttonLayout->addWidget( m_cancelButton ); m_buttonLayout->addStretch(); connect( m_okButton, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); connect( m_cancelButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); m_mainWidget = 0; }
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 CameraController::slotUploadFailed(const QString& folder, const QString& file, const QString& src) { Q_UNUSED(folder); Q_UNUSED(src); sendLogMsg(i18n("Failed to upload <filename>%1</filename>", file), DHistoryView::ErrorEntry); if (!d->canceled) { if (queueIsEmpty()) { KMessageBox::error(d->parent, i18n("Failed to upload file <filename>%1</filename>.", file)); } else { const QString msg = i18n("Failed to upload file <filename>%1</filename>. Do you want to continue?", file); int result = KMessageBox::warningContinueCancel(d->parent, msg); if (result != KMessageBox::Continue) { slotCancel(); } } } }
MaintenanceTool::MaintenanceTool(const QString& id, ProgressItem* const parent) : ProgressItem(parent, id, QString(), QString(), true, true), d(new Private) { connect(this, SIGNAL(progressItemCanceled(QString)), this, SLOT(slotCancel())); }
void ExportSymlinks::execute() { // test the destination directory if (m_destinationDir->isEmpty()) { tracer->error(__func__, "The specified 'destinationDir' is null or empty!"); return; } QDir dir(*m_destinationDir); if (!dir.exists()) { tracer->error(__func__, "The specified 'destinationDir' does not exist or is not a directory!"); return; } // test the files to export if (!m_sourceFiles || m_sourceFiles->isEmpty()) { tracer->info(__func__, "No files to export!"); return; } // setup progress dialog m_progressDialog = new KProgressDialog(m_parent, "exportSymlinksProgressDialog", i18n("Exporting symbolic links"), i18n("Initializing export..."), true); m_progressDialog->progressBar()->setTotalSteps(m_sourceFiles->count()); m_progressDialog->setAllowCancel(true); connect(m_progressDialog, SIGNAL(cancelClicked()), this, SLOT(slotCancel())); m_progressDialog->show(); // do the job doExport(); }
CloseMessageBox::CloseMessageBox(const QString& Caption, const QString& Text, QWidget *parent, const char *name) : QDialog(parent, name) // must not be "WDestructiveClose" !!!!! { setCaption(Caption); all = new Q3VBoxLayout(this); all->setSpacing(5); QLabel *l = new QLabel(Text, this); l->setAlignment(Qt::AlignVCenter|Qt::AlignHCenter); l->setMargin(5); all->addWidget(l); Q3HBox *Butts = new Q3HBox(this); // Butts->setSpacing(5); all->addWidget(Butts); QPushButton *Save = new QPushButton(tr("Save"), Butts); connect(Save, SIGNAL(clicked()), SLOT(slotSave())); QPushButton *SaveAll = new QPushButton(tr("Save all"), Butts); connect(SaveAll, SIGNAL(clicked()), SLOT(slotSaveAll())); QPushButton *Discard = new QPushButton(tr("Discard"), Butts); connect(Discard, SIGNAL(clicked()), SLOT(slotDiscard())); QPushButton *DiscardAll = new QPushButton(tr("Discard all"), Butts); connect(DiscardAll, SIGNAL(clicked()), SLOT(slotDiscardAll())); QPushButton *Cancel = new QPushButton(tr("Cancel"), Butts); connect(Cancel, SIGNAL(clicked()), SLOT(slotCancel())); }
void EditorTool::setToolSettings(EditorToolSettings* const settings) { d->settings = settings; d->settings->setToolIcon(toolIcon()); d->settings->setToolName(toolName()); connect(d->settings, SIGNAL(signalOkClicked()), this, SLOT(slotOk())); connect(d->settings, SIGNAL(signalCancelClicked()), this, SLOT(slotCancel())); connect(d->settings, SIGNAL(signalDefaultClicked()), this, SLOT(slotResetSettings())); connect(d->settings, SIGNAL(signalSaveAsClicked()), this, SLOT(slotSaveAsSettings())); connect(d->settings, SIGNAL(signalLoadClicked()), this, SLOT(slotLoadSettings())); connect(d->settings, SIGNAL(signalTryClicked()), this, SLOT(slotPreview())); connect(d->settings, SIGNAL(signalChannelChanged()), this, SLOT(slotChannelChanged())); connect(d->settings, SIGNAL(signalScaleChanged()), this, SLOT(slotScaleChanged())); // Will be unblocked in slotInit() // This will prevent signals emit during tool init. d->settings->blockSignals(true); }
void DlgPreferences::addPageWidget(DlgPreferencePage* pWidget) { connect(this, SIGNAL(showDlg()), pWidget, SLOT(slotShow())); connect(this, SIGNAL(closeDlg()), pWidget, SLOT(slotHide())); connect(this, SIGNAL(showDlg()), pWidget, SLOT(slotUpdate())); connect(this, SIGNAL(applyPreferences()), pWidget, SLOT(slotApply())); connect(this, SIGNAL(cancelPreferences()), pWidget, SLOT(slotCancel())); connect(this, SIGNAL(resetToDefaults()), pWidget, SLOT(slotResetToDefaults())); QScrollArea* sa = new QScrollArea(pagesWidget); sa->setWidgetResizable(true); sa->setWidget(pWidget); pagesWidget->addWidget(sa); int iframe = 2 * sa->frameWidth(); m_pageSizeHint = m_pageSizeHint.expandedTo( pWidget->sizeHint()+QSize(iframe, iframe)); }
ValidatorsDialog::ValidatorsDialog(QWidget *parent ) : KPageDialog( parent) { setButtons(Ok|Cancel); setDefaultButton(Ok); setModal(false); showButtonSeparator(true); setCaption(i18nc("@title:window", "Configure Validator Plugin")); setMinimumWidth(400); #ifdef HAVE_TIDY QWidget* internalConfiguration = new QWidget(); m_internalUi.setupUi(internalConfiguration); internalConfiguration->layout()->setMargin(0); KPageWidgetItem *internalConfigurationItem = addPage(internalConfiguration, i18n("Internal Validation")); internalConfigurationItem->setIcon(KIcon("validators")); #endif QWidget* remoteConfiguration = new QWidget(); m_remoteUi.setupUi(remoteConfiguration); remoteConfiguration->layout()->setMargin(0); KPageWidgetItem *remoteConfigurationItem = addPage(remoteConfiguration, i18n("Remote Validation")); remoteConfigurationItem->setIcon(KIcon("validators")); connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel())); load(); }
int qtbook_cd::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotGo(); break; case 1: slotPrint(); break; case 2: slotQuery(); break; case 3: slotReset(); break; case 4: slotCancel(); break; case 5: slotShowUsers(); break; case 6: slotSaveTracks(); break; case 7: slotDeleteTrack(); break; case 8: slotInsertTrack(); break; case 9: slotSelectImage(); break; case 10: slotComputeRuntime(); break; case 11: slotCloseTracksBrowser(); break; case 12: slotPopulateCopiesEditor(); break; case 13: slotPopulateTracksBrowser(); break; default: ; } _id -= 14; } return _id; }
LibraryScannerDlg::LibraryScannerDlg(QWidget * parent, Qt::WindowFlags f) : QWidget(parent, f), m_bCancelled(false) { setWindowIcon(QIcon(":/images/ic_mixxx_window.png")); QVBoxLayout* pLayout = new QVBoxLayout(this); setWindowTitle(tr("Library Scanner")); QLabel* pLabel = new QLabel(tr("It's taking Mixxx a minute to scan your music library, please wait..."),this); pLayout->addWidget(pLabel); QPushButton* pCancel = new QPushButton(tr("Cancel"), this); connect(pCancel, SIGNAL(clicked()), this, SLOT(slotCancel())); pLayout->addWidget(pCancel); QLabel* pCurrent = new QLabel(this); pCurrent->setMaximumWidth(600); pCurrent->setWordWrap(true); connect(this, SIGNAL(progress(QString)), pCurrent, SLOT(setText(QString))); pLayout->addWidget(pCurrent); setLayout(pLayout); m_timer.start(); }
void ConfigDialogImpl::displayDialog() { ui = new Configdialog(0L, "configure", true); connect(ui->buttonCancel, SIGNAL(clicked()), SLOT(slotCancel())); connect(ui->buttonOk, SIGNAL(clicked()), SLOT(slotOk())); setConfig(); ui->show(); }
void netKey::setSSID(QString SSID){ //Set the label to show the SSID labelssid->setText(SSID); //Also set the slot/signal connections here (for now) connect( pushApply,SIGNAL( clicked() ),this,SLOT( slotApply() ) ); connect( pushCancel,SIGNAL( clicked() ),this,SLOT( slotCancel() ) ); connect( checkShowKey, SIGNAL( clicked() ),this,SLOT( slotShowKey() ) ); slotShowKey(); }
KLProjectConfigWidget::KLProjectConfigWidget(KLProject* project, QWidget *parent, const char *name) :QDialog(parent, name), m_validator(QRegExp("0x[0-9a-fA-F]{1,4}"), this, "reValidator"), ui(new Ui_KLProjectConfigWidgetBase) { ui->setupUi(this); m_project = project; m_projectManagerInConfigWidget = new KLProjectManagerWidget( project, ui->tab_common, "managerInConfig" ); m_projectManagerInConfigWidget->setConfigButtonVisible( false ); ui->layProjectManager->addWidget( m_projectManagerInConfigWidget ); ui->cbCPU->clear(); // Add all the CPUs: ui->cbCPU->insertStringList( project->cpus() ); // Update the project files list: project->update(); // Add linker flags columns ui->lvLinkerFlags->addColumn(i18n("Purpose")); ui->lvLinkerFlags->addColumn(i18n("Flags")); // Fill the linker flags list: m_possibleLinkerFlags["-Wl,-lm"] = i18n("Link with math library"); m_possibleLinkerFlags["-Wl,-lprintf"] = i18n("Link with printf library"); m_possibleLinkerFlags["-Wl,-lprintf_min"] = i18n("Link with printf_min library"); m_possibleLinkerFlags["-Wl,-u,vfprintf -Wl,-lprintf_flt"] = i18n("Link with floating point printf library"); QStringList keys = m_possibleLinkerFlags.keys(); keys.sort(); for ( QStringList::iterator it = keys.begin(); it != keys.end(); ++it ) { Q3CheckListItem* cur = new Q3CheckListItem( ui->lvLinkerFlags, m_possibleLinkerFlags[*it], Q3CheckListItem::CheckBox ); cur->setText( 1, *it ); m_linkerFlagsCBs.append( cur ); } updateGUIFromSettings(); updateCPUInfo( ui->cbCPU->currentText() ); connect(ui->cbCPU,SIGNAL(currentIndexChanged(QString)),this,SLOT(slotCPUChanged(QString))); connect(ui->pbOK,SIGNAL(clicked()),this,SLOT(slotOK())); connect(ui->pbCancel,SIGNAL(clicked()),this,SLOT(slotCancel())); connect(ui->pbSetDefault,SIGNAL(clicked()),this,SLOT(slotSetDefault())); //Setup spinboxes with hex-in and output ui->kisbStartOfText->setValidator(&m_validator); ui->kisbStartOfText->setBase(16); ui->kisbStartOfData->setValidator(&m_validator); ui->kisbStartOfData->setBase(16); ui->kisbStartOfBSS->setValidator(&m_validator); ui->kisbStartOfBSS->setBase(16); ui->kisbStartOfHeap->setValidator(&m_validator); ui->kisbStartOfHeap->setBase(16); ui->kisbEndOfHeap->setValidator(&m_validator); ui->kisbEndOfHeap->setBase(16); }
/* * Constructs a AddDirectoryServiceDialogImpl which is a child of 'parent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ AddDirectoryServiceDialogImpl::AddDirectoryServiceDialogImpl( QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl ) : QDialog(parent, fl), AddDirectoryServiceDialog() { setObjectName( name ); setModal( modal ); setupUi(this); portED->setValidator( new QIntValidator( 0, 65535, portED ) ); connect(PushButton3, SIGNAL(clicked()), SLOT(slotAccept())); connect(PushButton4, SIGNAL(clicked()), SLOT(slotCancel())); }
void AdvancedRenameProcessDialog::slotRenameImages() { if (d->newNameList.isEmpty()) { slotCancel(); return; } processOne(); }
LightDialog::LightDialog(PinEditDoc * doc, QWidget * parent, const char * name, Qt::WFlags f) : QDialog(parent, name, f) { assert(doc != NULL); p_Doc = doc; p_Behavior = NULL; QLabel * labelR = new QLabel("r", this); QLabel * labelG = new QLabel("g", this); QLabel * labelB = new QLabel("b", this); QLabel * labelX = new QLabel("x", this); QLabel * labelY = new QLabel("y", this); QLabel * labelZ = new QLabel("z", this); p_EditR = new QLineEdit(this); p_EditG = new QLineEdit(this); p_EditB = new QLineEdit(this); p_EditX = new QLineEdit(this); p_EditY = new QLineEdit(this); p_EditZ = new QLineEdit(this); p_BoxBlink = new QCheckBox("blink", this); p_SpinDelay = new QSpinBox(10, 100, 10, this); QPushButton * donebutton = new QPushButton("ok", this); connect(donebutton, SIGNAL(clicked()), this, SLOT(slotDone())); QPushButton * removebutton = new QPushButton("remove light", this); connect(removebutton, SIGNAL(clicked()), this, SLOT(slotRemove())); QPushButton * cancelbutton = new QPushButton("cancel", this); connect(cancelbutton, SIGNAL(clicked()), this, SLOT(slotCancel())); // the layout of the objects Q3BoxLayout * vlayout = new Q3VBoxLayout(this); Q3BoxLayout * hlayout1 = new Q3HBoxLayout(vlayout); hlayout1->addWidget(labelR); hlayout1->addWidget(p_EditR); hlayout1->addWidget(labelG); hlayout1->addWidget(p_EditG); hlayout1->addWidget(labelB); hlayout1->addWidget(p_EditB); Q3BoxLayout * hlayout2 = new Q3HBoxLayout(vlayout); hlayout2->addWidget(labelX); hlayout2->addWidget(p_EditX); hlayout2->addWidget(labelY); hlayout2->addWidget(p_EditY); hlayout2->addWidget(labelZ); hlayout2->addWidget(p_EditZ); Q3BoxLayout * hlayout3 = new Q3HBoxLayout(vlayout); hlayout3->addWidget(p_BoxBlink); hlayout3->addWidget(p_SpinDelay); Q3BoxLayout * hlayout4 = new Q3HBoxLayout(vlayout); hlayout4->addWidget(donebutton); hlayout4->addWidget(removebutton); hlayout4->addWidget(cancelbutton); EM_CERR("lightdialog::lightdialog"); }
void UimPrefDialog::createMainWidgets() { QVBoxLayout *mainVLayout = new QVBoxLayout( this ); mainVLayout->setMargin( 6 ); QSplitter *mainSplitter = new QSplitter( this ); /* ListView */ m_groupListView = new QTreeWidget( mainSplitter ); m_groupListView->setRootIsDecorated( false ); m_groupListView->setHeaderLabel( _("Group") ); m_groupListView->setSelectionMode( QAbstractItemView::SingleSelection ); connect( m_groupListView, SIGNAL(itemSelectionChanged()), this, SLOT(slotItemSelectionChanged()) ); /* Contents Frame */ m_rightSideWidget = new QScrollArea( mainSplitter ); m_rightSideWidget->setWidgetResizable( true ); m_groupWidgetStack = new QStackedWidget; /* Buttons */ QWidget *buttonHWidget = new QWidget( this ); buttonHWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed); QHBoxLayout *buttonHLayout = new QHBoxLayout( buttonHWidget ); buttonHLayout->setMargin( 6 ); buttonHLayout->setSpacing( 6 ); QPushButton *defaultButton = new QPushButton( _("Defaults"), buttonHWidget ); connect( defaultButton, SIGNAL(clicked()), this, SLOT(slotSetDefault()) ); QPushButton *okButton = new QPushButton( _("OK"), buttonHWidget ); connect( okButton, SIGNAL(clicked()), this, SLOT(slotOK()) ); m_applyButton = new QPushButton( _("Apply"), buttonHWidget ); m_applyButton->setEnabled( false ); connect( m_applyButton, SIGNAL(clicked()), this, SLOT(slotApply()) ); QPushButton *cancelButton = new QPushButton( _("Cancel"), buttonHWidget ); connect( cancelButton, SIGNAL(clicked()), this, SLOT(slotCancel()) ); buttonHLayout->addWidget( defaultButton ); buttonHLayout->addStretch(); buttonHLayout->addWidget( okButton ); buttonHLayout->addWidget( m_applyButton ); buttonHLayout->addWidget( cancelButton ); QFrame *separator = new QFrame( this ); separator->setFrameShape( QFrame::HLine ); separator->setFrameShadow( QFrame::Sunken ); mainVLayout->setMargin( 0 ); mainVLayout->addWidget( mainSplitter ); mainVLayout->addWidget( separator ); mainVLayout->addWidget( buttonHWidget ); mainSplitter->setStretchFactor( 1, 1 ); }
KReferDialog::KReferDialog( KPhoneView * phv,int kcwn,QString uPrefix,QWidget *parent, const char *name ) : QDialog( parent, name, true ) { phoneView=phv; kcwNumber= kcwn; userPrefix=uPrefix; phoneBook = 0; QVBox *vbox = new QVBox( this ); vbox->setMargin( 3 ); vbox->setSpacing( 3 ); QVBoxLayout *vboxl = new QVBoxLayout( this, 5 ); vboxl->addWidget( vbox ); (void) new QLabel( tr("Refer-to URI:"), vbox ); touri = new QLineEdit( vbox ); touri->setMinimumWidth( fontMetrics().maxWidth() * 20 ); QHBoxLayout *buttonBox; buttonBox = new QHBoxLayout( vboxl, 6 ); loadUri = new QPushButton( "", this ); QIconSet icon; icon.setPixmap(SHARE_DIR "/icons/phonebook.png", QIconSet::Automatic ); loadUri->setIconSet( icon ); loadUri->setFixedWidth( loadUri->fontMetrics().maxWidth() * 2 ); buttonBox->addWidget( loadUri ); helpPushButton = new QPushButton( this, tr("help button") ); helpPushButton->setText( tr("&help...") ); helpPushButton->setEnabled( FALSE ); buttonBox->addWidget( helpPushButton ); QSpacerItem *spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); buttonBox->addItem( spacer ); okPushButton = new QPushButton( this, tr("ok button") ); okPushButton->setText( "OK" ); okPushButton->setDefault( TRUE ); buttonBox->addWidget( okPushButton ); cancelPushButton = new QPushButton( this,tr( "cancel button") ); cancelPushButton->setText( tr("Cancel") ); cancelPushButton->setAccel( Key_Escape ); buttonBox->addWidget( cancelPushButton ); connect( loadUri, SIGNAL( clicked() ), this, SLOT( getUri() ) ); connect( okPushButton, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); connect( cancelPushButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); }
IconSizeDialog::IconSizeDialog(const QString &caption, const QString &message, const QString &icon, int iconSize, QWidget *parent) : QDialog(parent) { // QDialog options setWindowTitle(caption); QWidget *mainWidget = new QWidget(this); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); mainLayout->addWidget(mainWidget); setModal(true); QWidget *page = new QWidget(this); QVBoxLayout *topLayout = new QVBoxLayout(page); QLabel *label = new QLabel(message, page); topLayout->addWidget(label); QListWidget *iconView = new UndraggableKIconView(page); m_size16 = new QListWidgetItem(DesktopIcon(icon, 16), i18n("16 by 16 pixels"), iconView); m_size22 = new QListWidgetItem(DesktopIcon(icon, 22), i18n("22 by 22 pixels"), iconView); m_size32 = new QListWidgetItem(DesktopIcon(icon, 32), i18n("32 by 32 pixels"), iconView); m_size48 = new QListWidgetItem(DesktopIcon(icon, 48), i18n("48 by 48 pixels"), iconView); m_size64 = new QListWidgetItem(DesktopIcon(icon, 64), i18n("64 by 64 pixels"), iconView); m_size128 = new QListWidgetItem(DesktopIcon(icon, 128), i18n("128 by 128 pixels"), iconView); iconView->setIconSize(QSize(128, 128)); iconView->setMinimumSize(QSize(128*6 + (6 + 2) * iconView->spacing() + 20, m_size128->sizeHint().height() + 2 * iconView->spacing() + 20)); topLayout->addWidget(iconView); switch (iconSize) { case 16: m_size16->setSelected(true); m_iconSize = 16; break; case 22: m_size22->setSelected(true); m_iconSize = 22; break; default: case 32: m_size32->setSelected(true); m_iconSize = 32; break; case 48: m_size48->setSelected(true); m_iconSize = 48; break; case 64: m_size64->setSelected(true); m_iconSize = 64; break; case 128: m_size128->setSelected(true); m_iconSize = 128; break; } connect(iconView, SIGNAL(executed(QListWidgetItem*)), this, SLOT(choose(QListWidgetItem*))); connect(iconView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(choose(QListWidgetItem*))); connect(iconView, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); mainLayout->addWidget(page); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this); okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); mainLayout->addWidget(buttonBox); connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), SLOT(slotCancel())); }
void wifiscanssid::init(QString device) { DeviceName = device; pushSelect->setEnabled(FALSE); QTimer::singleShot(500, this, SLOT(slotRescan())); connect( pushRescan, SIGNAL( clicked() ), this, SLOT(slotRescan()) ); connect( pushSelect, SIGNAL( clicked() ), this, SLOT(slotConnect()) ); connect( pushCancel, SIGNAL( clicked() ), this, SLOT(slotCancel()) ); }
DialogRenamePlaylist::DialogRenamePlaylist(QTabWidget *tw, int index, QWidget *parent) : QDialog(parent),indexTab(index), tabWidget(tw), ui(new Ui::DialogRenamePlaylist) { ui->setupUi(this); name = ""; cancelflag = false; ui->lineEdit->setText(QDateTime::currentDateTime().toString("d-MM-yy h-mm-s")); setWindowTitle(tr("Имя плэлиста")); connect(ui->pushButtonRename, SIGNAL(clicked()), SLOT(slotRename())); connect(ui->pushButtonCancel, SIGNAL(clicked()), SLOT(slotCancel())); }