DmesgDialog::DmesgDialog(QWidget *parent) : KDialog(parent) { setButtons(KDialog::Close); setCaption(i18nc("@title:window", "dmesg")); dmesgProcess = new QProcess(this); dmesgProcess->setProcessChannelMode(QProcess::MergedChannels); connect(dmesgProcess, SIGNAL(readyRead()), this, SLOT(readyRead())); dmesgProcess->start(QLatin1String("dmesg"), QIODevice::ReadOnly); dmesgTextEdit = new QPlainTextEdit(this); dmesgTextEdit->setLineWrapMode(QPlainTextEdit::NoWrap); dmesgTextEdit->setReadOnly(true); setMainWidget(dmesgTextEdit); resize(100 * fontMetrics().averageCharWidth(), 28 * fontMetrics().height()); }
EquipmentWriter::EquipmentWriter() { QWidget *widget = new QWidget; ui.setupUi( widget ); ui.tabWidget->setCurrentIndex(0); setMainWidget( widget ); setCaption( i18n( "Define Equipment" ) ); setButtons( KDialog::Close ); ks = KStars::Instance(); nextScope = 0; nextEyepiece = 0; nextFilter = 0; nextLens = 0; loadEquipment(); newScope = true; newEyepiece = true; newLens = true; newFilter = true; #ifdef HAVE_INDI_H ui.driverComboBox->insertItems(1, DriverManager::Instance()->getDriversStringList()); #endif //make connections connect( this, SIGNAL( closeClicked() ), this, SLOT( slotClose() ) ); connect( ui.NewScope, SIGNAL( clicked() ), this, SLOT( slotNewScope() ) ); connect( ui.NewEyepiece, SIGNAL( clicked() ), this, SLOT( slotNewEyepiece() ) ); connect( ui.NewLens, SIGNAL( clicked() ), this, SLOT( slotNewLens() ) ); connect( ui.NewFilter, SIGNAL( clicked() ), this, SLOT( slotNewFilter() ) ); connect( ui.AddScope, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.AddEyepiece, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.AddLens, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.AddFilter, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.ScopeList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetScope(QString) ) ); connect( ui.EyepieceList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetEyepiece(QString) ) ); connect( ui.LensList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetLens(QString) ) ); connect( ui.FilterList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetFilter(QString) ) ); connect( ui.RemoveScope, SIGNAL( clicked() ), this, SLOT( slotRemoveScope() ) ); connect( ui.RemoveEyepiece, SIGNAL( clicked() ), this, SLOT( slotRemoveEyepiece() ) ); connect( ui.RemoveLens, SIGNAL( clicked() ), this, SLOT( slotRemoveLens() ) ); connect( ui.RemoveFilter, SIGNAL( clicked() ), this, SLOT( slotRemoveFilter() ) ); }
KU_PwDlg::KU_PwDlg( QWidget* parent ) : KDialog(parent) { setCaption(i18n("Enter Password")); setButtons(Ok | Cancel); setDefaultButton(Ok); QFrame *page = new QFrame( this ); setMainWidget( page ); QLabel* lb1 = new QLabel(page); lb1->setText(i18n("Password:"******"XXXXXXXXXXXX" ) ); lepw1->setMinimumSize(lepw1->sizeHint()); // clear text lepw1->clear(); lepw1->setFocus(); lepw1->setEchoMode(KLineEdit::Password); QLabel* lb2 = new QLabel(page); lb2->setText(i18n("Verify:")); lb2->setMinimumSize(lb2->sizeHint()); lb2->setAlignment(Qt::AlignRight|Qt::AlignVCenter); lepw2 = new KLineEdit(page); // ensure it fits at least 12 characters lepw2->setText( QLatin1String( "XXXXXXXXXXXX" ) ); lepw2->setMinimumSize(lepw2->sizeHint()); // clear text lepw2->clear(); lepw2->setEchoMode(KLineEdit::Password); QGridLayout *layout = new QGridLayout; layout->addWidget(lb1, 0, 0); layout->addWidget(lepw1, 0, 1); layout->addWidget(lb2, 1, 0); layout->addWidget(lepw2, 1, 1); page->setLayout(layout); }
KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringList& ) : KCModule( ResourcesFactory::instance(), parent, name ) { QVBoxLayout *layout = new QVBoxLayout( this ); mConfigPage = new KRES::ConfigPage( this ); layout->addWidget( mConfigPage ); connect( mConfigPage, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); setButtons( Help | Apply ); KAboutData *about = new KAboutData( I18N_NOOP( "kcmkresources" ), I18N_NOOP( "KDE Resources configuration module" ), 0, 0, KAboutData::License_GPL, I18N_NOOP( "(c) 2003 Tobias Koenig" ) ); about->addAuthor( "Tobias Koenig", 0, "*****@*****.**" ); setAboutData(about); }
KraftViewRO::KraftViewRO(QWidget *parent, const char *name) : KraftViewBase( parent ) { setObjectName( name ); setModal( false ); setCaption( i18n("Document" ) ); setButtons( Close ); m_type = ReadOnly; KVBox *w = new KVBox( parent ); mGlobalVBox = w; setMainWidget( w ); mGlobalVBox->setMargin( 3 ); mHtmlView = new HtmlView( mGlobalVBox ); mHtmlView->setStylesheetFile( "docoverview_ro.css" ); }
KOEventViewerDialog::KOEventViewerDialog( CalendarSupport::Calendar *calendar, QWidget *parent ) : KDialog( parent ) { setCaption( i18n( "Event Viewer" ) ); setButtons( Close | User1 | User2 ); setModal( false ); setButtonGuiItem( User1, KGuiItem( i18n( "Edit..." ), KIcon( "document-edit" ) ) ); setButtonGuiItem( User2, KGuiItem( i18n( "Show in Context" ) ) ); mEventViewer = new CalendarSupport::IncidenceViewer( calendar, this ); setMainWidget( mEventViewer ); resize( QSize( 500, 520 ).expandedTo( minimumSizeHint() ) ); connect( this, SIGNAL(finished()), this, SLOT(delayedDestruct()) ); connect( this, SIGNAL(user1Clicked()), this, SLOT(editIncidence()) ); connect( this, SIGNAL(user2Clicked()), this, SLOT(showIncidenceContext()) ); }
MainProjectDialog::MainProjectDialog(Project &p, QWidget *parent, const char */*name*/) : KoDialog( parent), project(p) { setWindowTitle( i18n("Project Settings") ); setButtons( Ok|Cancel ); setDefaultButton( Ok ); showButtonSeparator( true ); panel = new MainProjectPanel(project, this); setMainWidget(panel); enableButtonOk(false); resize( QSize(500, 410).expandedTo(minimumSizeHint())); connect(this, SIGNAL(okClicked()), SLOT(slotOk())); connect(panel, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOk(bool))); }
Setup::Setup(QWidget* const parent) : KPageDialog(parent), d(new Private()) { setCaption(i18n("Configure")); setButtons(Apply|Ok|Cancel); setDefaultButton(Ok); setModal(true); d->setupGeneral = new SetupGeneral(this); d->pageGeneral = addPage(d->setupGeneral, i18nc("General setup", "General")); connect(this, SIGNAL(applyClicked()), this, SLOT(slotApplyClicked())); connect(this, SIGNAL(okClicked()), this, SLOT(slotOkClicked())); }
/* * Constructs a fontProgressDialog which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ fontProgressDialog::fontProgressDialog(const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip, QWidget* parent, bool progressbar) : KDialog( parent), TextLabel2(0), TextLabel1(0), ProgressBar1(0), progress(0), process(0) { setCaption( i18n( "Font Generation Progress Dialog" ) ); setModal( true ); setButtons( Cancel ); setDefaultButton( Cancel ); setCursor(QCursor(Qt::WaitCursor)); setButtonGuiItem(Cancel, KGuiItem(i18n("Abort"), "process-stop", abortTip)); if (helpIndex.isEmpty() == false) { setHelp(helpIndex, "okular"); setHelpLinkText( i18n( "What is happening here?") ); enableLinkedHelp(true); } else enableLinkedHelp(false); KVBox* page = new KVBox( this ); setMainWidget( page ); TextLabel1 = new QLabel(label, page); TextLabel1->setAlignment(Qt::AlignCenter); TextLabel1->setWhatsThis( whatsThis ); TextLabel1->setToolTip( ttip ); if (progressbar) { ProgressBar1 = new QProgressBar( page ); ProgressBar1->setFormat(i18n("%v of %m")); ProgressBar1->setWhatsThis( whatsThis ); ProgressBar1->setToolTip( ttip ); } else ProgressBar1 = NULL; TextLabel2 = new QLabel("", page); TextLabel2->setAlignment(Qt::AlignCenter); TextLabel2->setWhatsThis( whatsThis ); TextLabel2->setToolTip( ttip ); qApp->connect(this, SIGNAL(finished()), this, SLOT(killProcess())); }
SelectOpDlg::SelectOpDlg(UMLView * parent, UMLClassifier * c) : KDialog( parent) { setCaption( i18n("Select Operation") ); setButtons( Ok | Cancel ); setDefaultButton( Yes ); setModal( true ); showButtonSeparator( true ); QFrame *frame = new QFrame( this ); setMainWidget( frame ); m_pView = parent; QVBoxLayout * topLayout = new QVBoxLayout(frame); m_pOpGB = new QGroupBox(i18n("Select Operation"), frame); topLayout->addWidget(m_pOpGB); QGridLayout * mainLayout = new QGridLayout(m_pOpGB); mainLayout->setSpacing(spacingHint()); mainLayout->setMargin(fontMetrics().height()); Dialog_Utils::makeLabeledEditField( m_pOpGB, mainLayout, 0, m_pSeqL, i18n("Sequence number:"), m_pSeqLE ); m_pOpRB = new QRadioButton(i18n("Class operation:"), m_pOpGB); connect(m_pOpRB, SIGNAL(clicked()), this, SLOT(slotSelectedOp())); mainLayout->addWidget(m_pOpRB, 1, 0); m_pOpCB = new KComboBox(m_pOpGB); m_pOpCB->setCompletionMode( KGlobalSettings::CompletionPopup ); m_pOpCB->setDuplicatesEnabled(false); // only allow one of each type in box mainLayout->addWidget(m_pOpCB, 1, 1); m_pCustomRB = new QRadioButton(i18n("Custom operation:"), m_pOpGB); connect(m_pCustomRB, SIGNAL(clicked()), this, SLOT(slotSelectedCustom())); mainLayout->addWidget(m_pCustomRB, 2, 0); m_pOpLE = new KLineEdit(m_pOpGB); mainLayout->addWidget(m_pOpLE, 2, 1); UMLOperationList list = c->getOpList(true); foreach (UMLOperation* obj, list ) { insertOperation( obj->toString(Uml::st_SigNoVis), list.count() ); }
RSDialog::RSDialog(QWidget* parent) : KDialog(parent) { setCaption(i18n("Risks/Security Phrases")); setButtons(Help | Close); createRPhrases(); createSPhrases(); ui.setupUi(mainWidget()); connect(ui.filterButton, SIGNAL(clicked()), this, SLOT(filter())); connect(this, SIGNAL(helpClicked()), this, SLOT(slotHelp())); filter(); }
PodcastSettingsDialog::PodcastSettingsDialog( Podcasts::SqlPodcastChannelPtr channel, QWidget* parent ) : KDialog( parent ) , m_ps( new Ui::PodcastSettingsBase() ) , m_channel( channel ) { QWidget* main = new QWidget( this ); m_ps->setupUi( main ); setMainWidget( main ); setCaption( i18nc("change options", "Configure %1", m_channel->title() ) ); setModal( true ); setButtons( Apply | Cancel | Ok ); setDefaultButton( Ok ); showButtonSeparator( true ); init(); }
ResumeDialog::ResumeDialog( QWidget *parent ) : KDialog( parent ) { m_modelAssigned = false; trNumber = 0; userId = 0; ui = new ResumeDialogUI( this ); setMainWidget( ui ); setCaption( i18n("Resume Sale") ); setButtons( KDialog::Ok|KDialog::Cancel ); enableButtonOk(false); connect(ui->tableWidget, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); connect( ui->editSearch, SIGNAL(returnPressed()), SLOT(filterClient()) ); setDefaultButton(KDialog::Ok); }
KSaneDeviceDialog::KSaneDeviceDialog(QWidget *parent) : KDialog(parent) { setButtons(KDialog::User1 | KDialog::Ok | KDialog::Cancel); setButtonText(User1, i18n("Reload devices list")); m_btnGroup = new QButtonGroup(this); m_btnBox = new QGroupBox; QVBoxLayout *layout = new QVBoxLayout; m_btnContainer = new QWidget; m_btnLayout = new QVBoxLayout(m_btnContainer); QScrollArea *area = new QScrollArea; m_btnBox->setLayout(layout); QLabel *explanation = new QLabel(i18n("<html>The SANE (Scanner Access Now Easy) system could not find any device.<br>" "Check that the scanner is plugged in and turned on<br>" "or check your systems scanner setup.<br>" "For details about SANE see the " "<a href='http://www.sane-project.org/'>SANE homepage</a>.</html>")); explanation->setOpenExternalLinks(true); int l,t,r,b; layout->getContentsMargins(&l, &t, &r, &b); explanation->setContentsMargins(l, t, r, b); layout->addWidget(explanation); m_btnBox->adjustSize(); // make sure to see the complete explanation text layout->addWidget(area); layout->setContentsMargins(0,0,0,0); area->setWidgetResizable(true); area->setFrameShape(QFrame::NoFrame); area->setWidget(m_btnContainer); setMainWidget(m_btnBox); setMinimumHeight(200); m_findDevThread = FindSaneDevicesThread::getInstance(); connect(m_findDevThread, SIGNAL(finished()), this, SLOT(updateDevicesList())); connect(this, SIGNAL(user1Clicked()), this, SLOT(reloadDevicesList())); reloadDevicesList(); }
/* * Constructs a SectionEditor as a child of 'parent'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ SectionEditor::SectionEditor(QWidget* parent) : KDialog(parent) { setButtons(Close); setCaption(i18n("Section Editor")); QWidget *widget = new QWidget(this); m_ui.setupUi(widget); m_btnAdd = new KPushButton(koIcon("list-add"), i18n("Add..."), this); m_ui.lGroupSectionsButtons->addWidget(m_btnAdd); m_btnEdit = new KPushButton(koIcon("document-edit"), i18n("Edit..."), this); m_ui.lGroupSectionsButtons->addWidget(m_btnEdit); m_btnRemove = new KPushButton(koIcon("list-remove"), i18n("Delete"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnRemove); m_btnMoveUp = new KPushButton(koIcon("arrow-up"), i18n("Move Up"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnMoveUp); m_btnMoveDown = new KPushButton(koIcon("arrow-down"), i18n("Move Down"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnMoveDown); m_ui.lGroupSectionsButtons->addStretch(); setMainWidget(widget); // signals and slots connections connect(m_ui.cbReportHeader, SIGNAL(toggled(bool)), this, SLOT(cbReportHeader_toggled(bool))); connect(m_ui.cbReportFooter, SIGNAL(toggled(bool)), this, SLOT(cbReportFooter_toggled(bool))); connect(m_ui.cbHeadFirst, SIGNAL(toggled(bool)), this, SLOT(cbHeadFirst_toggled(bool))); connect(m_ui.cbHeadLast, SIGNAL(toggled(bool)), this, SLOT(cbHeadLast_toggled(bool))); connect(m_ui.cbHeadEven, SIGNAL(toggled(bool)), this, SLOT(cbHeadEven_toggled(bool))); connect(m_ui.cbHeadOdd, SIGNAL(toggled(bool)), this, SLOT(cbHeadOdd_toggled(bool))); connect(m_ui.cbFootFirst, SIGNAL(toggled(bool)), this, SLOT(cbFootFirst_toggled(bool))); connect(m_ui.cbFootLast, SIGNAL(toggled(bool)), this, SLOT(cbFootLast_toggled(bool))); connect(m_ui.cbFootEven, SIGNAL(toggled(bool)), this, SLOT(cbFootEven_toggled(bool))); connect(m_ui.cbFootOdd, SIGNAL(toggled(bool)), this, SLOT(cbFootOdd_toggled(bool))); connect(m_ui.cbHeadAny, SIGNAL(toggled(bool)), this, SLOT(cbHeadAny_toggled(bool))); connect(m_ui.cbFootAny, SIGNAL(toggled(bool)), this, SLOT(cbFootAny_toggled(bool))); connect(m_ui.lbGroups, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateButtonsForItem(QListWidgetItem*))); connect(m_ui.lbGroups, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonsForRow(int))); connect(m_btnAdd, SIGNAL(clicked(bool)), this, SLOT(btnAdd_clicked())); connect(m_btnEdit, SIGNAL(clicked(bool)), this, SLOT(btnEdit_clicked())); connect(m_btnRemove, SIGNAL(clicked(bool)), this, SLOT(btnRemove_clicked())); connect(m_btnMoveUp, SIGNAL(clicked(bool)), this, SLOT(btnMoveUp_clicked())); connect(m_btnMoveDown, SIGNAL(clicked(bool)), this, SLOT(brnMoveDown_clicked())); }
LyricsDialog::LyricsDialog(const Song &s, QWidget *parent) : Dialog(parent) , prev(s) { QWidget *mw=new QWidget(this); QGridLayout *mainLayout=new QGridLayout(mw); QWidget *wid = new QWidget(mw); QFormLayout *layout = new QFormLayout(wid); int row=0; QLabel *lbl=new QLabel(i18n("If Cantata has failed to find lyrics, or has found the wrong ones, " "use this dialog to enter new search details. For example, the current " "song may actually be a cover-version - if so, then searching for " "lyrics by the original artist might help.\n\nIf this search does find " "new lyrics, these will still be associated with the original song title " "and artist as displayed in Cantata."), mw); lbl->setWordWrap(true); QLabel *icn=new QLabel(mw); icn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); int iconSize=48; icn->setMinimumSize(iconSize, iconSize); icn->setMaximumSize(iconSize, iconSize); icn->setPixmap(Icon("dialog-information").pixmap(iconSize, iconSize)); mainLayout->setMargin(0); layout->setMargin(0); mainLayout->addWidget(icn, 0, 0, 1, 1); mainLayout->addWidget(lbl, 0, 1, 1, 1); mainLayout->addItem(new QSpacerItem(8, 4, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0); mainLayout->addWidget(wid, 2, 0, 1, 2); titleEntry = new LineEdit(wid); artistEntry = new LineEdit(wid); layout->setWidget(row, QFormLayout::LabelRole, new QLabel(i18n("Title:"), wid)); layout->setWidget(row++, QFormLayout::FieldRole, titleEntry); layout->setWidget(row, QFormLayout::LabelRole, new QLabel(i18n("Artist:"), wid)); layout->setWidget(row++, QFormLayout::FieldRole, artistEntry); setCaption(i18n("Search For Lyrics")); setMainWidget(mw); setButtons(Ok|Cancel); enableButton(Ok, false); connect(titleEntry, SIGNAL(textChanged(const QString &)), SLOT(changed())); connect(artistEntry, SIGNAL(textChanged(const QString &)), SLOT(changed())); titleEntry->setFocus(); titleEntry->setText(s.title); artistEntry->setText(s.artist); }
void MainInfo::load(ICQUser *u) { if (u->Type == USER_TYPE_ICQ){ edtUin->setText(QString::number(u->Uin)); edtFirst->setReadOnly(bReadOnly); edtLast->setReadOnly(bReadOnly); edtNick->setReadOnly(bReadOnly); edtUin->show(); lblUin->show(); lineDiv->show(); } cmbEncoding->setCurrentItem(pClient->userEncoding(u->Uin)); edtFirst->setText(QString::fromLocal8Bit(u->FirstName.c_str())); edtLast->setText(QString::fromLocal8Bit(u->LastName.c_str())); edtNotes->setText(QString::fromLocal8Bit(u->Notes.c_str())); edtNick->setText(QString::fromLocal8Bit(u->Nick.c_str())); QStringList strDisplay; cmbDisplay->lineEdit()->setText(QString::fromLocal8Bit(u->Alias.c_str())); addString(strDisplay, QString::fromLocal8Bit(u->Nick.c_str())); addString(strDisplay, QString::fromLocal8Bit(u->FirstName.c_str()) + " " + QString::fromLocal8Bit(u->LastName.c_str())); addString(strDisplay, QString::fromLocal8Bit(u->LastName.c_str()) + " " + QString::fromLocal8Bit(u->FirstName.c_str())); addString(strDisplay, QString::fromLocal8Bit(u->FirstName.c_str())); addString(strDisplay, QString::fromLocal8Bit(u->LastName.c_str())); if (u->Type == USER_TYPE_EXT){ for (PhoneBook::iterator itPhone = u->Phones.begin(); itPhone != u->Phones.end(); ++itPhone){ PhoneInfo *info = static_cast<PhoneInfo*>(*itPhone); addString(strDisplay, QString::fromLocal8Bit(info->getNumber().c_str())); } for (EMailList::iterator itMail = u->EMails.begin(); itMail != u->EMails.end(); ++itMail){ EMailInfo *info = static_cast<EMailInfo*>(*itMail); addString(strDisplay, QString::fromLocal8Bit(info->Email.c_str())); } } cmbDisplay->clear(); cmbDisplay->insertStringList(strDisplay); CUser user(u); cmbDisplay->lineEdit()->setText(user.name()); mails = u->EMails; for (EMailList::iterator it = mails.begin(); it != mails.end(); it++){ EMailInfo *email = static_cast<EMailInfo*>(*it); lstEmail->insertItem(Pict("mail_generic"), QString::fromLocal8Bit(email->Email.c_str())); } reloadList(); setButtons(-1); }
GroupWisePrivacyDialog::GroupWisePrivacyDialog( GroupWiseAccount * account, QWidget *parent, const char * /*name*/ ) : KDialog( parent) , m_account( account ), m_dirty( false ), m_searchDlg(0) { setCaption(i18nc( "Account specific privacy settings", "Manage Privacy for %1", account->accountId() )); setButtons(KDialog::Ok|KDialog::Apply|KDialog::Cancel); setDefaultButton(Ok); setModal(false); QWidget * wid = new QWidget( this ); m_privacy.setupUi( wid ); setMainWidget( wid ); PrivacyManager * mgr = m_account->client()->privacyManager(); // populate the widget; // admin lock if ( mgr->isPrivacyLocked() ) { m_privacy.status->setText( i18n( "Privacy settings have been administratively locked" ) ); disableWidgets(); } populateWidgets(); m_privacy.allowList->setSelectionMode( Q3ListBox::Extended ); m_privacy.denyList->setSelectionMode( Q3ListBox::Extended ); connect( m_privacy.btnAllow, SIGNAL(clicked()), SLOT(slotAllowClicked()) ); connect( m_privacy.btnBlock, SIGNAL(clicked()), SLOT(slotBlockClicked()) ); connect( m_privacy.btnAdd, SIGNAL(clicked()), SLOT(slotAddClicked()) ); connect( m_privacy.btnRemove, SIGNAL(clicked()), SLOT(slotRemoveClicked()) ); connect( m_privacy.allowList, SIGNAL(selectionChanged()), SLOT(slotAllowListClicked()) ); connect( m_privacy.denyList, SIGNAL(selectionChanged()), SLOT(slotDenyListClicked()) ); connect( mgr, SIGNAL(privacyChanged(QString,bool)), SLOT(slotPrivacyChanged()) ); connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply())); m_privacy.btnAdd->setEnabled( true ); m_privacy.btnAllow->setEnabled( false ); m_privacy.btnBlock->setEnabled( false ); m_privacy.btnRemove->setEnabled( false ); /* showButtonOK( true ); showButtonApply( true ); showButtonCancel( true ); */ show(); }
KWCreateBookmarkDialog::KWCreateBookmarkDialog(const QStringList &nameList, const QString &suggestedName, QWidget *parent) : KoDialog(parent), m_nameList(nameList) { if (suggestedName.isEmpty() || m_nameList.contains(suggestedName)) { enableButtonOk(false); ui = new KWCreateBookmark(nameList, "", this); } else { ui = new KWCreateBookmark(nameList, suggestedName, this); } setMainWidget(ui); setCaption(i18n("Create New Bookmark")); setModal(true); setButtons(Ok | Cancel); setDefaultButton(Ok); showButtonSeparator(true); connect(ui, SIGNAL(bookmarkNameChanged(const QString &)), this, SLOT(nameChanged(const QString &))); }
ArchiveMailDialog::ArchiveMailDialog(QWidget *parent) :KDialog(parent) { setCaption( i18n( "Configure Archive Mail Agent" ) ); setWindowIcon( KIcon( "kmail" ) ); setButtons( Ok|Cancel ); setDefaultButton( Ok ); setModal( true ); QWidget *mainWidget = new QWidget( this ); QHBoxLayout *mainLayout = new QHBoxLayout( mainWidget ); mainLayout->setSpacing( KDialog::spacingHint() ); mainLayout->setMargin( KDialog::marginHint() ); mWidget = new ArchiveMailWidget(this); mainLayout->addWidget(mWidget); setMainWidget( mainWidget ); connect(this,SIGNAL(okClicked()),SLOT(slotSave())); readConfig(); }
DlgEngineEditing::DlgEngineEditing(QWidget *parent) : KDialog(parent) { QWidget *mainWidget = new QWidget(this); ui.setupUi(mainWidget); setMainWidget(mainWidget); setWindowTitle(i18n("Insert Engine")); setModal(true); setButtons(KDialog::Ok | KDialog::Cancel); showButtonSeparator(true); ui.engineNameLabel->setText(i18n("Engine name:")); ui.urlLabel->setText(i18n("URL:")); connect(ui.urlEdit,SIGNAL(textChanged(QString)), SLOT(slotChangeText())); connect(ui.engineNameEdit,SIGNAL(textChanged(QString)),SLOT(slotChangeText())); slotChangeText(); }
void PanelPreviewSound::update() { uint64 t = SoundMan.getChannelDurationPlayed(_sound); Common::UString played = formatTime(t); Common::UString total = formatTime(_duration); Common::UString percent = formatPercent(_duration, t); _textPosition->SetLabelMarkup(Common::UString::format("<tt>%s</tt>", played.c_str())); _textPercent->SetLabelMarkup(Common::UString::format("<tt>%s</tt>", percent.c_str())); _textDuration->SetLabelMarkup(Common::UString::format("<tt>%s</tt>", total.c_str())); _sliderPosition->SetValue(getSliderPos(_duration, t)); bool isPlaying = SoundMan.isPlaying(_sound); bool isPaused = SoundMan.isPaused(_sound); setButtons(!isPlaying || isPaused, isPlaying && !isPaused, isPlaying); }
KFontDialog::KFontDialog( QWidget *parent, const KFontChooser::DisplayFlags& flags, const QStringList &fontList, Qt::CheckState *sizeIsRelativeState ) : KDialog( parent ), d( new Private ) { setCaption( i18n("Select Font") ); setButtons( Ok | Cancel ); setDefaultButton(Ok); d->chooser = new KFontChooser( this, flags, fontList, 8, sizeIsRelativeState ); d->chooser->setObjectName( "fontChooser" ); connect( d->chooser , SIGNAL(fontSelected(QFont)) , this , SIGNAL(fontSelected(QFont)) ); setMainWidget( d->chooser ); }
KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const QString& title, QWidget* parent, long initConfigs, int chatMsgId, bool modal) : KPageDialog(parent), d( new KGameDialogPrivate ) { setCaption(title); setButtons(Ok|Default|Apply|Cancel); setDefaultButton(Ok); setFaceType(KPageDialog::Tabbed); setModal(modal); init(g, owner); if ((ConfigOptions)initConfigs!=NoConfig) { initDefaultDialog((ConfigOptions)initConfigs, chatMsgId); } connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(defaultClicked()),this,SLOT(slotDefault())); connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply())); }
ParagraphSettingsDialog::ParagraphSettingsDialog(TextTool *tool, QTextCursor *cursor, QWidget* parent) : KDialog(parent), m_tool(tool), m_cursor(cursor) { setCaption(i18n("Paragraph Format")); setModal(true); setButtons(Ok | Cancel | Apply); setDefaultButton(Ok); m_paragraphGeneral = new ParagraphGeneral; m_paragraphGeneral->hideStyleName(true); setMainWidget(m_paragraphGeneral); connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply())); connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); initTabs(); }
K3b::DeviceSelectionDialog::DeviceSelectionDialog( QWidget* parent, const QString& text ) : KDialog( parent ), d( new Private() ) { setCaption( i18n("Device Selection") ); setButtons( Ok|Cancel ); setDefaultButton( Ok ); QGridLayout* lay = new QGridLayout( mainWidget() ); QLabel* label = new QLabel( text.isEmpty() ? i18n("Please select a device:") : text, mainWidget() ); d->comboDevices = new K3b::DeviceComboBox( mainWidget() ); lay->addWidget( label, 0, 0 ); lay->addWidget( d->comboDevices, 1, 0 ); lay->setRowStretch( 2, 1 ); }
AdditionalInfoDialog::AdditionalInfoDialog(QWidget* parent, const QList<QByteArray>& visibleRoles) : KDialog(parent), m_visibleRoles(visibleRoles), m_listWidget(0) { setCaption(i18nc("@title:window", "Additional Information")); setButtons(Ok | Cancel); setDefaultButton(Ok); QWidget* mainWidget = new QWidget(this); mainWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); // Add header QLabel* header = new QLabel(mainWidget); header->setText(i18nc("@label", "Select which additional information should be shown:")); header->setWordWrap(true); // Add checkboxes bool nepomukRunning = false; bool indexingEnabled = false; #ifdef HAVE_NEPOMUK nepomukRunning = (Nepomuk::ResourceManager::instance()->initialized()); if (nepomukRunning) { KConfig config("nepomukserverrc"); indexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", false); } #endif m_listWidget = new QListWidget(mainWidget); m_listWidget->setSelectionMode(QAbstractItemView::NoSelection); const QList<KFileItemModel::RoleInfo> rolesInfo = KFileItemModel::rolesInformation(); foreach (const KFileItemModel::RoleInfo& info, rolesInfo) { QListWidgetItem* item = new QListWidgetItem(info.translation, m_listWidget); item->setCheckState(visibleRoles.contains(info.role) ? Qt::Checked : Qt::Unchecked); const bool enable = (!info.requiresNepomuk && !info.requiresIndexer) || (info.requiresNepomuk && nepomukRunning) || (info.requiresIndexer && indexingEnabled); if (!enable) { item->setFlags(item->flags() & ~Qt::ItemIsEnabled); } }
KoPAMasterPageDialog::KoPAMasterPageDialog(KoPADocument *document, KoPAMasterPage *activeMaster, QWidget *parent) : KDialog(parent), m_document(document) { QSize iconSize(128, 128); QWidget *mainWidget = new QWidget(this); QVBoxLayout *layout = new QVBoxLayout; if (m_document->pageType() == KoPageApp::Slide) { layout->addWidget(new QLabel(i18n("Select a master slide design:"), mainWidget)); setCaption(i18n("Master Slide")); } else { layout->addWidget(new QLabel(i18n("Select a master page design:"), mainWidget)); setCaption(i18n("Master Page")); } m_listView = new QListView; m_listView->setDragDropMode(QListView::NoDragDrop); m_listView->setIconSize(iconSize); m_listView->setViewMode(QListView::IconMode); m_listView->setFlow(QListView::LeftToRight); m_listView->setWrapping(true); m_listView->setResizeMode(QListView::Adjust); m_listView->setSelectionMode(QAbstractItemView::SingleSelection); m_listView->setMovement(QListView::Static); m_listView->setMinimumSize(320, 200); m_pageThumbnailModel = new KoPAPageThumbnailModel(m_document->pages(true), m_listView); m_pageThumbnailModel->setIconSize(iconSize); m_listView->setModel(m_pageThumbnailModel); layout->addWidget(m_listView); int row = m_document->pageIndex(activeMaster); QModelIndex index = m_pageThumbnailModel->index(row, 0); m_listView->setCurrentIndex(index); connect(m_listView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged())); mainWidget->setLayout(layout); setMainWidget(mainWidget); setModal(true); setButtons(Ok|Cancel); setDefaultButton(Ok); }
XXPortSelectDialog::XXPortSelectDialog( KAB::Core *core, bool sort, QWidget* parent ) : KDialog( parent ), mCore( core ), mUseSorting( sort ) { setCaption( i18n( "Choose Which Contacts to Export" ) ); setButtons( Help | Ok | Cancel ); setDefaultButton( Ok ); setModal( true ); showButtonSeparator( true ); initGUI(); connect( mFiltersCombo, SIGNAL( activated( int ) ), SLOT( filterChanged( int ) ) ); // setup filters mFilters = Filter::restore( KGlobal::config().data(), "Filter" ); Filter::List::ConstIterator filterIt; QStringList filters; for ( filterIt = mFilters.constBegin(); filterIt != mFilters.constEnd(); ++filterIt ) filters.append( (*filterIt).name() ); mFiltersCombo->addItems( filters ); mUseFilters->setEnabled( filters.count() > 0 ); // setup categories const QStringList categories = KABPrefs::instance()->customCategories(); mCategoriesView->setCategories( categories ); mUseCategories->setEnabled( categories.count() > 0 ); int count = mCore->selectedUIDs().count(); mUseSelection->setEnabled( count != 0 ); mUseSelection->setChecked( count > 0 ); mSortTypeCombo->addItem( i18nc( "@item:inlistbox Sort order", "Ascending" ) ); mSortTypeCombo->addItem( i18nc( "@item:inlistbox Sort order", "Descending" ) ); mFields = mCore->addressBook()->fields( KABC::Field::All ); KABC::Field::List::ConstIterator fieldIt; for ( fieldIt = mFields.constBegin(); fieldIt != mFields.constEnd(); ++fieldIt ) mFieldCombo->addItem( (*fieldIt)->label() ); connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp())); }
IRCWebcamDialog::IRCWebcamDialog( const QString &contactId, QWidget * parent ) : KDialog( parent ) { setCaption( i18n( "Webcam for %1", contactId ) ); setButtons( KDialog::Close ); setDefaultButton( KDialog::Close ); showButtonSeparator( true ); setAttribute( Qt::WA_DeleteOnClose ); setInitialSize( QSize(320,290) ); setEscapeButton( KDialog::Close ); // QObject::connect( this, SIGNAL(closeClicked()), this, SIGNAL(closingWebcamDialog()) ); QWidget *page = new QWidget(this); setMainWidget(page); QVBoxLayout *topLayout = new QVBoxLayout( page ); mImageContainer = new Kopete::WebcamWidget( page ); mImageContainer->setMinimumSize(320,240); mImageContainer->setText( i18n( "No webcam image received" ) ); mImageContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); topLayout->addWidget( mImageContainer ); show(); #ifndef VIDEOSUPPORT_DISABLED mVideoDevicePool = Kopete::AV::VideoDevicePool::self(); mVideoDevicePool->open(); mVideoDevicePool->setImageSize(320, 240); mVideoDevicePool->startCapturing(); if (EXIT_SUCCESS == mVideoDevicePool->getFrame()) { mVideoDevicePool->getImage(&mImage); mPixmap=QPixmap::fromImage(mImage); if (!mPixmap.isNull()) mImageContainer->updatePixmap(mPixmap); } connect(&qtimer, SIGNAL(timeout()), this, SLOT(slotUpdateImage()) ); qtimer.setSingleShot(false); qtimer.start(0); #endif }