//---- ResourceAppointmentsSettingsDialog::ResourceAppointmentsSettingsDialog( ViewBase *view, ResourceAppointmentsItemModel *model, QWidget *parent ) : KPageDialog( parent ), m_view( view ) { ResourceAppointmentsDisplayOptionsPanel *panel = new ResourceAppointmentsDisplayOptionsPanel( model ); KPageWidgetItem *page = addPage( panel, i18n( "General" ) ); page->setHeader( i18n( "Resource Assignments View Settings" ) ); QTabWidget *tab = new QTabWidget(); QWidget *w = ViewBase::createPageLayoutWidget( view ); tab->addTab( w, w->windowTitle() ); m_pagelayout = w->findChild<KoPageLayoutWidget*>(); Q_ASSERT( m_pagelayout ); m_headerfooter = ViewBase::createHeaderFooterWidget( view ); m_headerfooter->setOptions( view->printingOptions() ); tab->addTab( m_headerfooter, m_headerfooter->windowTitle() ); page = addPage( tab, i18n( "Printing" ) ); page->setHeader( i18n( "Printing Options" ) ); connect( this, SIGNAL(accepted()), this, SLOT(slotOk())); connect( this, SIGNAL(accepted()), panel, SLOT(slotOk())); //TODO: there was no default button configured, should there? // connect( button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), panel, SLOT(setDefault())); }
// void AssocPropDlg::setupPages (UMLObject * c) void AssocPropDlg::setupPages (AssociationWidget *assocWidget) { UMLDoc* umlDoc = UMLApp::app()->document(); // general page QFrame *page = new QFrame(); KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18nc("general settings", "General")); pageItem->setHeader( i18n("General Settings") ); pageItem->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_General) ); addPage( pageItem ); QHBoxLayout *genLayout = new QHBoxLayout(page); page->setMinimumSize(310, 330); m_pGenPage = new AssocGenPage (umlDoc, page, assocWidget); genLayout->addWidget(m_pGenPage); // role page QFrame *newPage = new QFrame(); pageItem = new KPageWidgetItem( newPage, i18n("Roles")); pageItem->setHeader( i18n("Role Settings")); pageItem->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_Roles) ); addPage( pageItem ); QHBoxLayout * roleLayout = new QHBoxLayout(newPage); // newPage->setMinimumSize(310, 330); m_pRolePage = new AssocRolePage(umlDoc, newPage, assocWidget); roleLayout->addWidget(m_pRolePage); setupFontPage(); }
/** * Class constructor. * @param nPage The initial page to show * @param pParent The parent widget * @param szName The widget's name */ PreferencesDlg::PreferencesDlg(uint nPage, QWidget* pParent, const char* szName) : KPageDialog(pParent), m_lDlgPageItems(QList<KPageWidgetItem*>()) { KVBox* pFrame; KPageWidgetItem *item; // Setup KPageDialog sub-widget setFaceType(KPageDialog::List); setCaption(i18n("Preferences")); setButtons(KDialog::Default | KDialog::Ok | KDialog::Apply | KDialog::Cancel); setDefaultButton(KDialog::Ok); setObjectName(szName); QDialog::setModal(false); // Create and add the "Frontend" page pFrame = new KVBox(); item = addPage(pFrame, i18n("Programs")); item->setHeader(i18n("Paths to back-end programmes")); item->setIcon(KIcon("preferences-desktop-default-applications", KIconLoader::global())); m_lDlgPageItems << item; m_pPrefFrontend = new PrefFrontend(pFrame); // Create and add the "Colours" page pFrame = new KVBox(); item = addPage(pFrame, i18n("Colours")); item->setHeader(i18n("Window colours")); item->setIcon(KIcon("preferences-desktop-color", KIconLoader::global())); m_lDlgPageItems << item; m_pPrefColor = new PrefColor(pFrame); // Create and add the "Fonts" page pFrame = new KVBox(); item = addPage(pFrame, i18n("Fonts")); item->setHeader(i18n("Window fonts")); item->setIcon(KIcon("preferences-desktop-font", KIconLoader::global())); m_lDlgPageItems << item; m_pPrefFont = new PrefFont(pFrame); // Create and add the "Options" page pFrame = new KVBox(); item = addPage(pFrame, i18n("Options")); item->setHeader(i18n("Misc. Options")); item->setIcon(KIcon("configure", KIconLoader::global())); m_lDlgPageItems << item; m_pPrefOpt = new PrefOpt(pFrame); // Make sure the "Apply" button is initially disabled enableButtonApply(false); // Enable the "Apply" button when a parameter changes its value connect(m_pPrefFrontend, SIGNAL(modified()), this, SLOT(slotModified())); connect(m_pPrefColor, SIGNAL(modified()), this, SLOT(slotModified())); connect(m_pPrefFont, SIGNAL(modified()), this, SLOT(slotModified())); connect(m_pPrefOpt, SIGNAL(modified()), this, SLOT(slotModified())); // Show the ( new ) current page setCurrentPage(m_lDlgPageItems[nPage]); }
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())); }
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(); }
KoPAConfigureDialog::KoPAConfigureDialog(KoPAView* parent) : KPageDialog(parent) { setFaceType(List); setWindowTitle(i18n("Configure")); setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults); button(QDialogButtonBox::Ok)->setDefault(true); m_miscPage = new KoConfigMiscPage( parent->koDocument(), parent->kopaCanvas()->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(accepted()), this, SLOT(slotApply()) ); connect( button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), this, SLOT(slotDefault())); connect( button(QDialogButtonBox::Apply), SIGNAL(clicked(bool)), this, SLOT(slotApply()) ); connect(this, SIGNAL(changed()), parent, SLOT(slotUpdateAuthorProfileActions())); }
KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo) : KPageDialog(parent) , d(new KoDocumentInfoDlgPrivate) { d->info = docInfo; setWindowTitle(i18n("Document Information")); // setInitialSize(QSize(500, 500)); setFaceType(KPageDialog::List); setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); button(QDialogButtonBox::Ok)->setDefault(true); d->aboutUi = new Ui::KoDocumentInfoAboutWidget(); QWidget *infodlg = new QWidget(); d->aboutUi->setupUi(infodlg); d->aboutUi->cbLanguage->addItems(KoGlobal::listOfLanguages()); d->aboutUi->cbLanguage->setCurrentIndex(-1); KPageWidgetItem *page = new KPageWidgetItem(infodlg, i18n("General")); page->setHeader(i18n("General")); // Ugly hack, the mimetype should be a parameter, instead KoDocumentBase* doc = dynamic_cast< KoDocumentBase* >(d->info->parent()); if (doc) { QMimeDatabase db; QMimeType mime = db.mimeTypeForName(doc->mimeType()); if (mime.isValid()) { page->setIcon(KisIconUtils::loadIcon(mime.iconName())); } } else { // hide all entries not used in pages for KoDocumentInfoPropsPage d->aboutUi->filePathInfoLabel->setVisible(false); d->aboutUi->filePathLabel->setVisible(false); d->aboutUi->filePathSeparatorLine->setVisible(false); d->aboutUi->lblTypeDesc->setVisible(false); d->aboutUi->lblType->setVisible(false); } addPage(page); d->pages.append(page); initAboutTab(); d->authorUi = new Ui::KoDocumentInfoAuthorWidget(); QWidget *authordlg = new QWidget(); d->authorUi->setupUi(authordlg); page = new KPageWidgetItem(authordlg, i18n("Author")); page->setHeader(i18n("Last saved by")); page->setIcon(koIcon("user-identity")); addPage(page); d->pages.append(page); initAuthorTab(); }
AccountseditorConfigDialog::AccountseditorConfigDialog( ViewBase *view, AccountTreeView *treeview, QWidget *p) : KPageDialog(p), m_view( view ), m_treeview( treeview ) { setCaption( i18n("Settings") ); setButtons( Ok|Cancel ); setDefaultButton( Ok ); showButtonSeparator( true ); QTabWidget *tab = new QTabWidget(); QWidget *w = ViewBase::createPageLayoutWidget( view ); tab->addTab( w, w->windowTitle() ); m_pagelayout = w->findChild<KoPageLayoutWidget*>(); Q_ASSERT( m_pagelayout ); m_headerfooter = ViewBase::createHeaderFooterWidget( view ); m_headerfooter->setOptions( view->printingOptions() ); tab->addTab( m_headerfooter, m_headerfooter->windowTitle() ); KPageWidgetItem *page = addPage( tab, i18n( "Printing" ) ); page->setHeader( i18n( "Printing Options" ) ); connect( this, SIGNAL(okClicked()), this, SLOT(slotOk())); }
/** * \brief Registers the given InlineWidget as a new page and displays it * \author Peter Grasch * @param page the page to register */ void InlineWidgetView::registerPage(InlineWidget *page) { Q_ASSERT(page); KPageWidgetItem *item = addPage(page, page->getTitle()); item->setIcon(page->getIcon()); item->setHeader(page->getDesc()); emit registeredPage(page); }
void Konfigurator::newPage(KonfiguratorPage *page, const QString &name, const QString &desc, const QIcon &icon) { KPageWidgetItem *item = new KPageWidgetItem(page, name); item->setIcon(icon); item->setHeader(desc); addPage(item); kgPages.append(item); connect(page, SIGNAL(sigChanged()), this, SLOT(slotApplyEnable())); }
void KPageWidgetTest::addPage() { static int counter = 0; const QString title = QString( "dynamic folder %1" ).arg( QString::number( counter ) ); KPageWidgetItem *item = mWidget->addPage( new QPushButton( title ) , title ); item->setIcon( KIcon( "folder" ) ); item->setHeader( QString( "Header Test No. %1" ).arg( QString::number( counter ) ) ); item->setCheckable( true ); counter++; }
ConfigDialog::ConfigDialog(QWidget *parent, const QString &name, KCoreConfigSkeleton *config) : KConfigDialog(parent, name, config), hasWidgetChanged(false) { KPageWidgetItem *item; // General page item = addPage(new GeneralConfigWidget(NULL), i18nc("@title General settings", "General")); item->setHeader(i18n("General Settings")); item->setIcon(QIcon::fromTheme("preferences-other")); // Error Check page item = addPage(new ErrorsConfigWidget(NULL), i18nc("@title Error Check Settings", "Error Check")); item->setHeader(i18n("Error Check Settings")); item->setIcon(QIcon::fromTheme("games-endturn")); // Spelling page sonnetConfigWidget = new Sonnet::ConfigWidget(NULL); connect(sonnetConfigWidget, SIGNAL(configChanged()), this, SLOT(widgetChanged())); item = addPage(sonnetConfigWidget, i18nc("@title Spelling Settings", "Spelling")); item->setHeader(i18n("Spelling Settings")); item->setIcon(QIcon::fromTheme("tools-check-spelling")); // VideoPlayer page item = addPage(new PlayerConfigWidget(NULL), i18nc("@title VideoPlayer Settings", "VideoPlayer")); item->setHeader(i18n("VideoPlayer Settings")); item->setIcon(QIcon::fromTheme("mediaplayer-logo")); // Backend pages QStringList backendNames(VideoPlayer::instance()->backendNames()); for(QStringList::ConstIterator it = backendNames.begin(); it != backendNames.end(); it++) { QWidget *configWidget = VideoPlayer::instance()->backend(*it)->newConfigWidget(0); if(configWidget) { item = addPage(configWidget, *it); item->setHeader(i18nc("@title VideoPlayer backend settings", "%1 Backend Settings", *it)); item->setIcon(QIcon::fromTheme((*it).toLower() + "-logo")); } } }
Preferences::Preferences(const QString& currentVariant, QWidget *parent) : QDialog(parent) { setupUi(this); setWindowIcon(KIcon("tagua")); connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply())); pagePref->hide(); PrefBase *b; KPageWidgetItem *i; b = new PrefWrapper<PrefBoard>(currentVariant, this); connect(this, SIGNAL(applied()), b, SLOT(apply())); i = pagePref->addPage(b, "Board"); i->setHeader("Board preferences:"); i->setIcon(KIcon("games-config-board")); b = new PrefWrapper<PrefMoveList>(currentVariant, this); connect(this, SIGNAL(applied()), b, SLOT(apply())); i = pagePref->addPage(b, "Move list"); i->setHeader("Move list preferences:"); i->setIcon(KIcon("view-list-tree")); b = new PrefWrapper<PrefTheme>(currentVariant, this); connect(this, SIGNAL(applied()), b, SLOT(apply())); i = pagePref->addPage(b, "Theme"); i->setHeader("Pieces & squares theme:"); i->setIcon(KIcon("games-config-theme")); pagePref->show(); b = new PrefWrapper<PrefEngines>(currentVariant, this); connect(this, SIGNAL(applied()), b, SLOT(apply())); i = pagePref->addPage(b, "Engines"); i->setHeader("Engines:"); i->setIcon(KIcon("help-hint")); pagePref->show(); }
YahooUserInfoDialog::YahooUserInfoDialog( YahooContact *c, QWidget * parent ) : KPageDialog( parent ), m_contact(c) { setFaceType( KPageDialog::List ); setCaption( i18n( "Yahoo User Information" ) ); setButtons( KDialog::User2 | KDialog::User1 | KDialog::Cancel ); setDefaultButton( KDialog::Cancel ); setButtonGuiItem( KDialog::User1, KGuiItem( i18n("Save and Close") ) ); setButtonGuiItem( KDialog::User2, KGuiItem( i18n("Merge with existing entry") ) ); showButton( KDialog::User2, false ); kDebug(14180) << "Creating new yahoo user info widget"; QWidget *genInfo = new QWidget(this); m_genInfoWidget = new Ui::YahooGeneralInfoWidget; m_genInfoWidget->setupUi( genInfo ); KPageWidgetItem *genInfoItem = addPage( genInfo, i18n("General Info") ); genInfoItem->setHeader( i18n( "General Yahoo Information" ) ); genInfoItem->setIcon( KIcon("user-identity") ); QWidget *workInfo = new QWidget(this); m_workInfoWidget = new Ui::YahooWorkInfoWidget; m_workInfoWidget->setupUi( workInfo ); KPageWidgetItem *workInfoItem = addPage( workInfo, i18n("Work Info") ); workInfoItem->setHeader( i18n( "Work Information" ) ); workInfoItem->setIcon( KIcon("mail-attachment") ); QWidget *otherInfo = new QWidget(this); m_otherInfoWidget = new Ui::YahooOtherInfoWidget; m_otherInfoWidget->setupUi( otherInfo ); KPageWidgetItem *otherInfoItem = addPage( otherInfo, i18n("Other Info") ); otherInfoItem->setHeader( i18n( "Other Yahoo Information" ) ); otherInfoItem->setIcon( KIcon("document-properties") ); QObject::connect(this, SIGNAL(user1Clicked()), this, SLOT(slotSaveAndCloseClicked())); QObject::connect(this, SIGNAL(user2Clicked()), this, SLOT(slotUser2())); }
void KateGlobal::configDialog(QWidget *parent) { QPointer<KPageDialog> kd = new KPageDialog(parent); kd->setCaption( i18n("Configure") ); kd->setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Help ); kd->setFaceType( KPageDialog::List ); kd->setHelp( QString(), KGlobal::mainComponent().componentName() ); QList<KTextEditor::ConfigPage*> editorPages; for (int i = 0; i < configPages (); ++i) { const QString name = configPageName (i); QFrame *page = new QFrame(); KPageWidgetItem *item = kd->addPage( page, name ); item->setHeader( configPageFullName (i) ); item->setIcon( configPageIcon(i) ); QVBoxLayout *topLayout = new QVBoxLayout( page ); topLayout->setMargin( 0 ); KTextEditor::ConfigPage *cp = configPage(i, page); connect(kd, SIGNAL(applyClicked ( )), cp, SLOT(apply())); topLayout->addWidget( cp); editorPages.append (cp); } if (kd->exec() && kd) { KateGlobalConfig::global()->configStart (); KateDocumentConfig::global()->configStart (); KateViewConfig::global()->configStart (); KateRendererConfig::global()->configStart (); for (int i=0; i < editorPages.count(); ++i) { editorPages.at(i)->apply(); } KateGlobalConfig::global()->configEnd (); KateDocumentConfig::global()->configEnd (); KateViewConfig::global()->configEnd (); KateRendererConfig::global()->configEnd (); } delete kd; }
KPageWidgetItem* Config::addConfigPage(KPageWidgetItem* parent, QWidget *page, const QString &itemName, const QIcon& icon, const QString &header) { KILE_DEBUG_MAIN << "slot: add config page item=" << itemName; // add page KPageWidgetItem *pageWidgetItem = addSubPage(parent, page, itemName); pageWidgetItem->setIcon(icon); pageWidgetItem->setHeader(header); // add to the dialog manager m_manager->addWidget(page); return pageWidgetItem; }
void AssocPropDlg::setupFontPage() { if ( !m_pAssoc) { return; } KVBox *page = new KVBox(); KPageWidgetItem* pageItem = new KPageWidgetItem( page, i18n("Font")); pageItem->setHeader( i18n("Font Settings")); pageItem->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_Font) ); addPage( pageItem ); m_pChooser = new KFontChooser( (QWidget*)page, false, QStringList(), false); m_pChooser->setFont( m_pAssoc->getFont()); m_pChooser->setSampleText(i18n("Association font")); }
//shared by FormDialog and FormAssistant static KPageWidgetItem* formAddPage(KPageDialog* dialog, const QString& name, const QString& header, const QString& iconname) { QWidget* widget = new QWidget( dialog->mainWidget() ); QVBoxLayout* boxlayout = new QVBoxLayout(widget); boxlayout->setSpacing(0); boxlayout->setMargin(0); widget->setLayout(boxlayout); KPageWidgetItem* item = dialog->addPage(widget, name); item->setHeader(header.isNull() ? name : header); if( ! iconname.isEmpty() ) item->setIcon( KIcon(iconname) ); //d->items.insert(name, item); return item; }
ManageActionsDialog::ManageActionsDialog(QWidget* parent) : KDialog(parent), pageWidget(new KPageWidget(this)), manageActionsAutorunWidget(new ManageActionsAutorunWidget(this)), listConfiguration(new ListConfiguration(this)) { setCaption( i18n("Manage Actions") ); setMainWidget( pageWidget ); QWidget *baseWidget = new QWidget( this ); ui.setupUi(baseWidget); KPageWidgetItem *generalItem = pageWidget->addPage(baseWidget, i18nc("General settings page", "General")); generalItem->setIcon(KIcon("fork")); generalItem->setHeader(""); ui.pbApplyForAll->setIcon(KIcon("arrow-down-double")); ui.pbAdd->setIcon(KIcon("list-add")); ui.pbRemove->setIcon(KIcon("list-remove")); ui.pbUp->setIcon(KIcon("go-up")); ui.pbDown->setIcon(KIcon("go-down")); connect(ui.pbAdd, SIGNAL(clicked()), this, SLOT(add())); connect(ui.pbRemove, SIGNAL(clicked()), this, SLOT(remove())); connect(ui.pbUp, SIGNAL(clicked()), this, SLOT(moveUp())); connect(ui.pbDown, SIGNAL(clicked()), this, SLOT(moveDown())); connect(ui.leTrigger, SIGNAL(textChanged(QString)), this, SLOT(applyTrigger(QString))); connect(ui.pbApplyForAll, SIGNAL(clicked()), this, SLOT(applyTriggerToAll())); ui.lvPlugins->setIconSize(QSize(24,24)); ui.lvPlugins->setSpacing(2); setButtons(KDialog::Ok); connect(ui.lvPlugins, SIGNAL(clicked(QModelIndex)), this, SLOT(currentSelectionChanged())); ui.twActionConfig->addTab(listConfiguration, i18n("Lists")); ui.twActionConfig->addTab(manageActionsAutorunWidget, i18n("Autorun")); }
FormProgressDialog::FormProgressDialog(const QString& caption, const QString& labelText) : KPageDialog(), d(new Private) { d->gotCanceled = false; d->time.start(); setCaption(caption); KDialog::setButtons(KDialog::Ok|KDialog::Cancel); setFaceType(KPageDialog::Plain); enableButton(KDialog::Ok, false); //setWindowModality(Qt::WindowModal); setModal(false); //true); setMinimumWidth(540); setMinimumHeight(400); QWidget* widget = new QWidget( mainWidget() ); KPageWidgetItem* item = KPageDialog::addPage(widget, QString()); item->setHeader(labelText); //item->setIcon( KIcon(iconname) ); widget = item->widget(); QVBoxLayout* layout = new QVBoxLayout(widget); layout->setMargin(0); widget->setLayout(layout); d->browser = new QTextBrowser(this); d->browser->setHtml(labelText); layout->addWidget(d->browser); d->bar = new QProgressBar(this); //d->bar->setFormat("%v"); d->bar->setVisible(false); layout->addWidget(d->bar); setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding) ); show(); qApp->processEvents(); }
void KIGPDialog::setupLookPage(const QString& path) { QFrame *page = new QFrame(); KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("Look") ); pageItem->setHeader(i18n("Page Look")); pageItem->setIcon(KIcon(BarIcon("fill-color", KIconLoader::SizeMedium )) ); addPage(pageItem); KConfigGroup look = m_config->group("Look"); QVBoxLayout *vlay = new QVBoxLayout( page ); vlay->setMargin( 0 ); QLabel *label; label = new QLabel( i18n("&Page title:"), page); vlay->addWidget(label); m_title = new QLineEdit(i18n("Image Gallery for %1", path), page); vlay->addWidget( m_title ); label->setBuddy(m_title); m_imagesPerRow = new KIntNumInput(look.readEntry("ImagesPerRow", 4), page); m_imagesPerRow->setRange( 1, 8, 1 ); m_imagesPerRow->setSliderEnabled( true ); m_imagesPerRow->setLabel( i18n("I&mages per row:") ); vlay->addWidget( m_imagesPerRow ); QGridLayout *grid = new QGridLayout(); grid->setMargin( 2 ); grid->setSpacing( 2 ); vlay->addLayout( grid ); m_imageName = new QCheckBox( i18n("Show image file &name"), page); m_imageName->setChecked( look.readEntry("ImageName", true) ); grid->addWidget( m_imageName, 0, 0 ); m_imageSize = new QCheckBox( i18n("Show image file &size"), page); m_imageSize->setChecked( look.readEntry("ImageSize", false) ); grid->addWidget( m_imageSize, 0, 1 ); m_imageProperty = new QCheckBox( i18n("Show image &dimensions"), page); m_imageProperty->setChecked( look.readEntry("ImageProperty", false) ); grid->addWidget( m_imageProperty, 1, 0 ); QHBoxLayout *hlay11 = new QHBoxLayout( ); vlay->addLayout( hlay11 ); m_fontName = new QComboBox( page ); QStringList standardFonts; KFontChooser::getFontList(standardFonts, 0); m_fontName->addItems( standardFonts ); m_fontName->setItemText( m_fontName->currentIndex(), look.readEntry("FontName", KGlobalSettings::generalFont().family() ) ); label = new QLabel( i18n("Fon&t name:"), page ); label->setBuddy( m_fontName ); hlay11->addWidget( label ); hlay11->addStretch( 1 ); hlay11->addWidget( m_fontName ); QHBoxLayout *hlay12 = new QHBoxLayout( ); vlay->addLayout( hlay12 ); m_fontSize = new QSpinBox( page ); m_fontSize->setMinimum(6); m_fontSize->setMaximum(15); m_fontSize->setSingleStep(1); m_fontSize->setValue( look.readEntry("FontSize", 14) ); label = new QLabel( i18n("Font si&ze:"), page ); label->setBuddy( m_fontSize ); hlay12->addWidget( label ); hlay12->addStretch( 1 ); hlay12->addWidget( m_fontSize ); QHBoxLayout *hlay1 = new QHBoxLayout(); vlay->addLayout( hlay1 ); m_foregroundColor = new KColorButton(page); m_foregroundColor->setColor( QColor( look.readEntry("ForegroundColor", "#d0ffd0") ) ); label = new QLabel( i18n("&Foreground color:"), page); label->setBuddy( m_foregroundColor ); hlay1->addWidget( label ); hlay1->addStretch( 1 ); hlay1->addWidget(m_foregroundColor); QHBoxLayout *hlay2 = new QHBoxLayout(); vlay->addLayout( hlay2 ); m_backgroundColor = new KColorButton(page); m_backgroundColor->setColor( QColor(look.readEntry("BackgroundColor", "#333333") ) ); label = new QLabel( i18n("&Background color:"), page); hlay2->addWidget( label ); label->setBuddy( m_backgroundColor ); hlay2->addStretch( 1 ); hlay2->addWidget(m_backgroundColor); vlay->addStretch(1); }
void KIGPDialog::setupThumbnailPage(const QString& path) { Q_UNUSED (path); QFrame *page = new QFrame(); KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("Thumbnails") ); pageItem->setHeader(i18n("Thumbnails")); pageItem->setIcon(KIcon(BarIcon("view-preview", KIconLoader::SizeMedium )) ); addPage(pageItem); KConfigGroup group = m_config->group("Thumbnails"); QLabel *label; QVBoxLayout *vlay = new QVBoxLayout( page ); vlay->setMargin( 0 ); QHBoxLayout *hlay3 = new QHBoxLayout(); vlay->addLayout( hlay3 ); m_imageFormat = new QComboBox(page); QStringList lstImgageFormat; lstImgageFormat<<"JPEG"<<"PNG"; m_imageFormat->addItems(lstImgageFormat); m_imageFormat->setItemText( m_imageFormat->currentIndex(), group.readEntry("ImageFormat", "JPEG") ); label = new QLabel( i18n("Image format f&or the thumbnails:"), page); hlay3->addWidget( label ); label->setBuddy( m_imageFormat ); hlay3->addStretch( 1 ); hlay3->addWidget(m_imageFormat); m_thumbnailSize = new KIntNumInput(group.readEntry("ThumbnailSize", 140), page); m_thumbnailSize->setRange(10, 1000, 1 ); m_thumbnailSize->setLabel( i18n("Thumbnail size:") ); m_thumbnailSize->setSliderEnabled(true); vlay->addWidget( m_thumbnailSize ); QGridLayout *grid = new QGridLayout(); grid->setMargin( 2 ); grid->setSpacing( 2 ); vlay->addLayout( grid ); QHBoxLayout *hlay4 = new QHBoxLayout(); vlay->addLayout( hlay4 ); const bool colorDepthSet = group.readEntry("ColorDepthSet", false); m_colorDepthSet = new QCheckBox(i18n("&Set different color depth:"), page); m_colorDepthSet->setChecked(colorDepthSet); hlay4->addWidget( m_colorDepthSet ); m_colorDepth = new QComboBox(page); QStringList lst; lst<<"1"<<"8"<<"16"<<"32"; m_colorDepth->addItems( lst ); m_colorDepth->setItemText(m_colorDepth->currentIndex(), group.readEntry("ColorDepth", "8")); m_colorDepth->setEnabled(colorDepthSet); hlay4->addWidget( m_colorDepth ); connect(m_colorDepthSet, SIGNAL( toggled(bool) ), m_colorDepth, SLOT( setEnabled(bool) ) ); vlay->addStretch(1); }
void KIGPDialog::setupDirectoryPage(const QString& path) { QFrame *page = new QFrame(); KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("Folders") ); pageItem->setHeader(i18n("Folders")); pageItem->setIcon(KIcon(BarIcon("folder", KIconLoader::SizeMedium )) ); addPage(pageItem); KConfigGroup group = m_config->group("Directory"); QVBoxLayout *dvlay = new QVBoxLayout( page ); dvlay->setMargin( 0 ); QLabel *label; label = new QLabel(i18n("&Save to HTML file:"), page); dvlay->addWidget( label ); QString whatsThis; whatsThis = i18n("<p>The name of the HTML file this gallery will be saved to.</p>"); label->setWhatsThis( whatsThis ); m_imageNameReq = new KUrlRequester(QString(path + "images.html"), page); label->setBuddy( m_imageNameReq ); dvlay->addWidget(m_imageNameReq); connect( m_imageNameReq, SIGNAL(textChanged(const QString&)), this, SLOT(imageUrlChanged(const QString&)) ); m_imageNameReq->setWhatsThis( whatsThis ); const bool recurseSubDir = group.readEntry("RecurseSubDirectories", false); m_recurseSubDir = new QCheckBox(i18n("&Recurse subfolders"), page); m_recurseSubDir->setChecked( recurseSubDir ); whatsThis = i18n("<p>Whether subfolders should be included for the " "image gallery creation or not.</p>"); m_recurseSubDir->setWhatsThis( whatsThis ); const int recursionLevel = group.readEntry("RecursionLevel", 0); m_recursionLevel = new KIntNumInput( recursionLevel, page ); m_recursionLevel->setRange( 0, 99, 1); m_recursionLevel->setSliderEnabled(true); m_recursionLevel->setLabel( i18n("Rec&ursion depth:") ); if ( recursionLevel == 0 ) m_recursionLevel->setSpecialValueText( i18n("Endless")); m_recursionLevel->setEnabled(recurseSubDir); whatsThis = i18n("<p>You can limit the number of folders the " "image gallery creator will traverse to by setting an " "upper bound for the recursion depth.</p>"); m_recursionLevel->setWhatsThis( whatsThis ); connect(m_recurseSubDir, SIGNAL( toggled(bool) ), m_recursionLevel, SLOT( setEnabled(bool) ) ); dvlay->addWidget(m_recurseSubDir); dvlay->addWidget(m_recursionLevel); m_copyOriginalFiles = new QCheckBox(i18n("Copy or&iginal files"), page); m_copyOriginalFiles->setChecked(group.readEntry("CopyOriginalFiles", false) ); dvlay->addWidget(m_copyOriginalFiles); whatsThis = i18n("<p>This makes a copy of all images and the gallery will refer " "to these copies instead of the original images.</p>"); m_copyOriginalFiles->setWhatsThis( whatsThis ); const bool useCommentFile = group.readEntry("UseCommentFile", false); m_useCommentFile = new QCheckBox(i18n("Use &comment file"), page); m_useCommentFile->setChecked(useCommentFile); dvlay->addWidget(m_useCommentFile); whatsThis = i18n("<p>If you enable this option you can specify " "a comment file which will be used for generating " "subtitles for the images.</p>" "<p>For details about the file format please see " "the \"What's This?\" help below.</p>"); m_useCommentFile->setWhatsThis( whatsThis ); label = new QLabel(i18n("Comments &file:"), page); label->setEnabled( useCommentFile ); dvlay->addWidget( label ); whatsThis = i18n("<p>You can specify the name of the comment file here. " "The comment file contains the subtitles for the images. " "The format of this file is:</p>" "<p>FILENAME1:" "<br />Description" "<br />" "<br />FILENAME2:" "<br />Description" "<br />" "<br />and so on</p>"); label->setWhatsThis( whatsThis ); m_commentFileReq = new KUrlRequester(QString(path + "comments"), page); m_commentFileReq->setEnabled(useCommentFile); label->setBuddy( m_commentFileReq ); dvlay->addWidget(m_commentFileReq); m_commentFileReq->setWhatsThis( whatsThis ); connect(m_useCommentFile, SIGNAL(toggled(bool)), label, SLOT(setEnabled(bool))); connect(m_useCommentFile, SIGNAL(toggled(bool)), m_commentFileReq, SLOT(setEnabled(bool))); dvlay->addStretch(1); }
ConfigureDialog::ConfigureDialog(const QString &destName, bool isClass, QWidget *parent) : KPageDialog(parent) { setFaceType(List); setModal(false); setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Apply); setWindowTitle(destName); setWindowIcon(QIcon::fromTheme("configure")); enableButtonApply(false); // Needed so we have our dialog size saved setAttribute(Qt::WA_DeleteOnClose); QStringList attr; KPageWidgetItem *page; modifyPrinter = new ModifyPrinter(destName, isClass, this); PrinterBehavior *printerBehavior = new PrinterBehavior(destName, isClass, this); attr << modifyPrinter->neededValues(); attr << printerBehavior->neededValues(); attr << KCUPS_PRINTER_TYPE; // needed to know if it's a remote printer attr << KCUPS_PRINTER_MAKE_AND_MODEL; KCupsPrinter printer; QPointer<KCupsRequest> request = new KCupsRequest; request->getPrinterAttributes(destName, isClass, attr); request->waitTillFinished(); if (!request) { return; } if (!request->hasError() && !request->printers().isEmpty()){ printer = request->printers().first(); } // qCDebug(PM_CONFIGURE_PRINTER) << "VALUES" << printer.a rgument(); // qCDebug(PM_CONFIGURE_PRINTER) << "marker" << values["marker-levels"].value<QList<int> >(); request->deleteLater(); // qCDebug(PM_CONFIGURE_PRINTER) << values; if (printer.type() & CUPS_PRINTER_LOCAL) { qCDebug(PM_CONFIGURE_PRINTER) << "CUPS_PRINTER_LOCAL"; } isClass = printer.isClass(); bool isRemote = false; if (printer.type() & CUPS_PRINTER_REMOTE) { qCDebug(PM_CONFIGURE_PRINTER) << "CUPS_PRINTER_REMOTE"; isRemote = true; } if (printer.type() & CUPS_PRINTER_BW) { qCDebug(PM_CONFIGURE_PRINTER) << "CUPS_PRINTER_BW"; } if (printer.type() & CUPS_PRINTER_COLOR) { qCDebug(PM_CONFIGURE_PRINTER) << "CUPS_PRINTER_COLOR"; } if (printer.type() & CUPS_PRINTER_MFP) { qCDebug(PM_CONFIGURE_PRINTER) << "CUPS_PRINTER_MFP"; } modifyPrinter->setRemote(isRemote); modifyPrinter->setValues(printer); page = new KPageWidgetItem(modifyPrinter, i18n("Modify Printer")); page->setHeader(i18n("Configure")); page->setIcon(QIcon::fromTheme("dialog-information")); // CONNECT this signal ONLY to the first Page connect(modifyPrinter, SIGNAL(changed(bool)), this, SLOT(enableButtonApply(bool))); addPage(page); if (!isClass) { // At least on localhost:631 modify printer does not show printer options // for classes printerOptions = new PrinterOptions(destName, isClass, isRemote, this); page = new KPageWidgetItem(printerOptions, i18n("Printer Options")); page->setHeader(i18n("Set the Default Printer Options")); page->setIcon(QIcon::fromTheme("view-pim-tasks")); addPage(page); connect(modifyPrinter, SIGNAL(ppdChanged()), this, SLOT(ppdChanged())); modifyPrinter->setCurrentMake(printerOptions->currentMake()); modifyPrinter->setCurrentMakeAndModel(printerOptions->currentMakeAndModel()); } printerBehavior->setRemote(isRemote); printerBehavior->setValues(printer); page = new KPageWidgetItem(printerBehavior, i18n("Banners, Policies and Allowed Users")); page->setHeader(i18n("Banners, Policies and Allowed Users")); page->setIcon(QIcon::fromTheme("feed-subscribe")); addPage(page); // connect this after ALL pages were added, otherwise the slot will be called connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)), SLOT(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*))); KConfigGroup group(KSharedConfig::openConfig("print-manager"), "ConfigureDialog"); KWindowConfig::restoreWindowSize(windowHandle(), group); connect(buttonBox(), SIGNAL(clicked(QAbstractButton*)), this, SLOT(slotButtonClicked(QAbstractButton*))); }
KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo, KoDocumentRdf* docRdf) : KPageDialog(parent) , d(new KoDocumentInfoDlgPrivate) { d->m_info = docInfo; d->m_rdf = docRdf; setCaption(i18n("Document Information")); setInitialSize(QSize(500, 500)); setFaceType(KPageDialog::List); setButtons(KDialog::Ok | KDialog::Cancel); setDefaultButton(KDialog::Ok); d->m_aboutUi = new Ui::KoDocumentInfoAboutWidget(); QWidget *infodlg = new QWidget(); d->m_aboutUi->setupUi(infodlg); if (!KoEncryptionChecker::isEncryptionSupported()) { d->m_aboutUi->lblEncryptedDesc->setVisible(false); d->m_aboutUi->lblEncrypted->setVisible(false); d->m_aboutUi->pbEncrypt->setVisible(false); d->m_aboutUi->lblEncryptedPic->setVisible(false); } KPageWidgetItem *page = new KPageWidgetItem(infodlg, i18n("General")); page->setHeader(i18n("General")); // Ugly hack, the mimetype should be a parameter, instead KoDocument* doc = dynamic_cast< KoDocument* >(d->m_info->parent()); if (doc) { KMimeType::Ptr mime = KMimeType::mimeType(doc->mimeType()); if (! mime) mime = KMimeType::defaultMimeTypePtr(); page->setIcon(KIcon(KIconLoader::global()->loadMimeTypeIcon(mime->iconName(), KIconLoader::Desktop, 48))); } addPage(page); d->m_pages.append(page); initAboutTab(); d->m_authorUi = new Ui::KoDocumentInfoAuthorWidget(); QWidget *authordlg = new QWidget(); d->m_authorUi->setupUi(authordlg); page = new KPageWidgetItem(authordlg, i18n("Author")); page->setHeader(i18n("Author")); page->setIcon(KIcon("user-identity")); addPage(page); d->m_pages.append(page); initAuthorTab(); // Saving encryption implies saving the document, this is done after closing the dialog connect(this, SIGNAL(hidden()), this, SLOT(slotSaveEncryption())); if (d->m_rdf) { d->m_rdfEditWidget = 0; #ifdef SHOULD_BUILD_RDF d->m_rdfEditWidget = new KoDocumentRdfEditWidget(this, d->m_rdf); page = new KPageWidgetItem(d->m_rdfEditWidget->widget(), i18n("Rdf")); page->setHeader(i18n("Rdf")); page->setIcon(KIcon("text-rdf")); addPage(page); d->m_pages.append(page); #endif } }