コード例 #1
0
ConfigureOptionsDialog::ConfigureOptionsDialog(QWidget* parent, const OperationStack& ostack, const QString& name) :
	KConfigDialog(parent, name, Config::self()),
	m_GeneralPageWidget(new GeneralPageWidget(this)),
	m_FileSystemColorsPageWidget(new FileSystemColorsPageWidget(this)),
	m_AdvancedPageWidget(new AdvancedPageWidget(this)),
	m_OperationStack(ostack)
{
	setFaceType(List);

	KPageWidgetItem* item = NULL;

	item = addPage(&generalPageWidget(), i18nc("@title:tab general application settings", "General"), QString(), i18n("General Settings"));
	item->setIcon(KIconLoader().loadIcon(QLatin1String("partitionmanager"), KIconLoader::Desktop));

	connect(&generalPageWidget().comboDefaultFileSystem(), SIGNAL(activated(int)), SLOT(onComboDefaultFileSystemActivated(int)));
	connect(generalPageWidget().radioButton, &QRadioButton::toggled, this, &ConfigureOptionsDialog::onShredSourceActivated);

	item = addPage(&fileSystemColorsPageWidget(), i18nc("@title:tab", "File System Colors"), QString(), i18n("File System Color Settings"));
	item->setIcon(KIconLoader().loadIcon(QLatin1String("format-fill-color"), KIconLoader::Desktop));

	if (QCoreApplication::arguments().contains(QLatin1String("--advconfig")))
	{
		item = addPage(&advancedPageWidget(), i18nc("@title:tab advanced application settings", "Advanced"), QString(), i18n("Advanced Settings"));
		item->setIcon(KIconLoader().loadIcon(QLatin1String("configure"), KIconLoader::Desktop));

		connect(&advancedPageWidget().comboBackend(), SIGNAL(activated(int)), SLOT(onComboBackendActivated(int)));
	}
コード例 #2
0
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()));
}
コード例 #3
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();
}
コード例 #4
0
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()));
}
コード例 #5
0
/**
 * 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]);
}
コード例 #6
0
ファイル: assocpropdlg.cpp プロジェクト: Elv13/Umbrello-ng
// 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();
}
コード例 #7
0
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();
}
コード例 #8
0
ファイル: KoDocumentInfoDlg.cpp プロジェクト: HOST-Oman/krita
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();
}
コード例 #9
0
ConfigDialog::ConfigDialog(QWidget* parent)
: KConfigDialog(parent, "Settings", GwenviewConfig::self())
, d(new ConfigDialogPrivate)
{
    setFaceType(KPageDialog::List);
    setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Default);
    showButtonSeparator(true);

    QWidget* widget;
    KPageWidgetItem* pageItem;

    // General
    widget = setupPage(d->mGeneralConfigPage);
    pageItem = addPage(widget, i18n("General"));
    pageItem->setIcon(KIcon("gwenview"));
    connect(d->mGeneralConfigPage.kcfg_ViewBackgroundValue, SIGNAL(valueChanged(int)), SLOT(updateViewBackgroundFrame()));

    // Image View
    widget = setupPage(d->mImageViewConfigPage);

    d->mAlphaBackgroundModeGroup = new InvisibleButtonGroup(widget);
    d->mAlphaBackgroundModeGroup->setObjectName(QLatin1String("kcfg_AlphaBackgroundMode"));
    d->mAlphaBackgroundModeGroup->addButton(d->mImageViewConfigPage.checkBoardRadioButton, int(RasterImageView::AlphaBackgroundCheckBoard));
    d->mAlphaBackgroundModeGroup->addButton(d->mImageViewConfigPage.solidColorRadioButton, int(RasterImageView::AlphaBackgroundSolid));

    d->mWheelBehaviorGroup = new InvisibleButtonGroup(widget);
    d->mWheelBehaviorGroup->setObjectName(QLatin1String("kcfg_MouseWheelBehavior"));
    d->mWheelBehaviorGroup->addButton(d->mImageViewConfigPage.mouseWheelScrollRadioButton, int(MouseWheelBehavior::Scroll));
    d->mWheelBehaviorGroup->addButton(d->mImageViewConfigPage.mouseWheelBrowseRadioButton, int(MouseWheelBehavior::Browse));

    d->mAnimationMethodGroup = new InvisibleButtonGroup(widget);
    d->mAnimationMethodGroup->setObjectName(QLatin1String("kcfg_AnimationMethod"));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.glAnimationRadioButton, int(DocumentView::GLAnimation));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.softwareAnimationRadioButton, int(DocumentView::SoftwareAnimation));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.noAnimationRadioButton, int(DocumentView::NoAnimation));

    d->mThumbnailBarOrientationGroup = new InvisibleButtonGroup(widget);
    d->mThumbnailBarOrientationGroup->setObjectName(QLatin1String("kcfg_ThumbnailBarOrientation"));
    d->mThumbnailBarOrientationGroup->addButton(d->mImageViewConfigPage.horizontalRadioButton, int(Qt::Horizontal));
    d->mThumbnailBarOrientationGroup->addButton(d->mImageViewConfigPage.verticalRadioButton, int(Qt::Vertical));

    pageItem = addPage(widget, i18n("Image View"));
    pageItem->setIcon(KIcon("view-preview"));

    // Advanced
    widget = setupPage(d->mAdvancedConfigPage);
    pageItem = addPage(widget, i18n("Advanced"));
    pageItem->setIcon(KIcon("preferences-other"));
    d->mAdvancedConfigPage.cacheHelpLabel->setFont(KGlobalSettings::smallestReadableFont());

    updateViewBackgroundFrame();
}
コード例 #10
0
ファイル: settingsdialog.cpp プロジェクト: Fxrh/rekonq
Private::Private(SettingsDialog *parent)
{
    KPageWidgetItem *pageItem;

    // -- 1
    generalWidg = new GeneralWidget(parent);
    generalWidg->layout()->setMargin(0);
    pageItem = parent->addPage(generalWidg, i18n("General"));
    pageItem->setIcon(KIcon("rekonq"));

    // -- 2
    tabsWidg = new TabsWidget(parent);
    tabsWidg->layout()->setMargin(0);
    pageItem = parent->addPage(tabsWidg, i18n("Tabs"));
    pageItem->setIcon(KIcon("tab-duplicate"));

    // -- 3
    appearanceWidg = new AppearanceWidget(parent);
    appearanceWidg->layout()->setMargin(0);
    pageItem = parent->addPage(appearanceWidg, i18n("Appearance"));
    pageItem->setIcon(KIcon("preferences-desktop-font"));

    // -- 4
    webkitWidg = new WebKitWidget(parent);
    webkitWidg->layout()->setMargin(0);
    pageItem = parent->addPage(webkitWidg, i18n("WebKit"));
    QString webkitIconPath = KStandardDirs::locate("appdata", "pics/webkit-icon.png");
    KIcon webkitIcon = KIcon(QIcon(webkitIconPath));
    pageItem->setIcon(webkitIcon);

    // -- 5
    networkWidg = new NetworkWidget(parent);
    networkWidg->layout()->setMargin(0);
    pageItem = parent->addPage(networkWidg , i18n("Network"));
    pageItem->setIcon(KIcon("preferences-system-network"));

    // -- 6
    adBlockWidg = new AdBlockWidget(parent);
    adBlockWidg->layout()->setMargin(0);
    pageItem = parent->addPage(adBlockWidg , i18n("Ad Block"));
    pageItem->setIcon(KIcon("preferences-web-browser-adblock"));

    // -- 7
    shortcutsEditor = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(), parent);
    pageItem = parent->addPage(shortcutsEditor , i18n("Shortcuts"));
    pageItem->setIcon(KIcon("configure-shortcuts"));

    // -- 8
    KCModuleInfo ebrowsingInfo("ebrowsing.desktop");
    ebrowsingModule = new KCModuleProxy(ebrowsingInfo, parent);
    pageItem = parent->addPage(ebrowsingModule, i18n(ebrowsingInfo.moduleName().toUtf8()));
    pageItem->setIcon(KIcon(ebrowsingInfo.icon()));

    // WARNING 
    // remember wheh changing here that the smallest netbooks
    // have a 1024x576 resolution. So DON'T bother that limits!!
    parent->setMinimumSize(700, 525);
}
コード例 #11
0
	KPageWidgetItem* Config::addConfigFolder(const QString &section, const QString &icon)
	{
		KPageWidgetItem *toReturn = addPage(new QWidget(this), section);
		toReturn->setIcon(QIcon::fromTheme(icon));

		return toReturn;
	}
コード例 #12
0
//-----------------------------------------------------------------------------
HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
    : KPageDialog(parent), _rank(rank), _tab(0)
{
//     kDebug(11001) << ": HighscoresDialog";

    setWindowTitle( i18n("Highscores") );
// TODO    setButtons( Close|User1|User2 );
// TODO    setDefaultButton( Close );
    if ( internal->nbGameTypes()>1 )
        setFaceType( KPageDialog::Tree );
    else
        setFaceType( KPageDialog::Plain );
// TODO    setButtonGuiItem( User1, KGuiItem(i18n("Configure..."), QLatin1String( "configure" )) );
// TODO    setButtonGuiItem( User2, KGuiItem(i18n("Export...")) );
    connect( this, SIGNAL(user1Clicked()), SLOT(slotUser1()) );
    connect( this, SIGNAL(user2Clicked()), SLOT(slotUser2()) );

    for (uint i=0; i<internal->nbGameTypes(); i++) {
        QString title = internal->manager.gameTypeLabel(i, Manager::I18N);
        QString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
        HighscoresWidget *hsw = new HighscoresWidget(0);
        KPageWidgetItem *pageItem = new KPageWidgetItem( hsw, title);
        pageItem->setIcon( KIcon( BarIcon(icon, KIconLoader::SizeLarge) ) );
        addPage( pageItem );
        _pages.append(pageItem);
        connect(hsw, SIGNAL(tabChanged(int)), SLOT(tabChanged(int)));
    }

    connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)),
            SLOT(highscorePageChanged(KPageWidgetItem*,KPageWidgetItem*)));
    setCurrentPage(_pages[internal->gameType()]);
}
コード例 #13
0
void ConquirereSettingsDialog::setupPages()
{
    setFaceType( List );
    setWindowTitle(i18n("Preferences"));
    setButtons(Reset | Ok | Apply | Cancel);
    setDefaultButton(Ok);
    enableButtonApply(false);
    setModal(true);
    showButtonSeparator(true);

    m_appearanceSettings = new AppearanceSettings();
    connect(this, SIGNAL(applyClicked()), m_appearanceSettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_appearanceSettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_appearanceSettings, SLOT(applySettings()));
    connect(m_appearanceSettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *asitem = addPage( m_appearanceSettings, i18n( "Appearance" ) );
    asitem->setIcon( KIcon( "view-choose" ) );

    m_librarySettings = new LibrarySettings();
    connect(this, SIGNAL(applyClicked()), m_librarySettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_librarySettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_librarySettings, SLOT(applySettings()));
    connect(m_librarySettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *libsitem = addPage( m_librarySettings, i18n( "Library" ) );
    libsitem->setIcon( KIcon( "folder-database" ) );

    m_exportSettings = new ExportSettings();
    connect(this, SIGNAL(applyClicked()), m_exportSettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_exportSettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_exportSettings, SLOT(applySettings()));
    connect(m_exportSettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *esitem = addPage( m_exportSettings, i18n( "Export" ) );
    esitem->setIcon( KIcon( "document-export" ) );

    m_systemSyncSettings = new SystemSyncSettings();
    connect(this, SIGNAL(applyClicked()), m_systemSyncSettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_systemSyncSettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_systemSyncSettings, SLOT(applySettings()));
    connect(m_systemSyncSettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *sssitem = addPage( m_systemSyncSettings, i18n( "Synchronize" ) );
    sssitem->setIcon( KIcon( "view-refresh" ) );

}
コード例 #14
0
ファイル: inlinewidgetview.cpp プロジェクト: KDE/simon
/**
 * \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);
}
コード例 #15
0
ファイル: konfigurator.cpp プロジェクト: KDE/krusader
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()));
}
コード例 #16
0
void KasPrefsDialog::addIndicatorsPage()
{
   KVBox *indicatorsPage = new KVBox( this );

   KPageWidgetItem *item = addPage( indicatorsPage, i18n("Indicators") );
   item->setIcon( Icon( "bell" ) );

   (void) new QWidget( indicatorsPage, "spacer" );
   (void) new QWidget( indicatorsPage, "spacer" );
}
コード例 #17
0
ファイル: kpagewidgettest.cpp プロジェクト: vasi/kdelibs
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++;
}
コード例 #18
0
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"));
		}
	}
}
コード例 #19
0
ファイル: kpagewidgettest.cpp プロジェクト: vasi/kdelibs
void KPageWidgetTest::insertPage()
{
  static int counter = 0;

  KPageWidgetItem *item = mWidget->currentPage();
  if ( !item )
    return;

  const QString title = QString( "before folder %1" ).arg( QString::number( counter ) );
  item = mWidget->insertPage( item, new QLabel( title ) , title );
  item->setIcon( KIcon( "folder" ) );

  counter++;
}
コード例 #20
0
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()));
}
コード例 #21
0
ファイル: pref_preferences.cpp プロジェクト: Axure/tagua
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();
}
コード例 #22
0
ファイル: kateglobal.cpp プロジェクト: hlamer/kate
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;
}
コード例 #23
0
void KasPrefsDialog::addThumbsPage()
{
   KVBox *thumbsPage = new KVBox( this );

   KPageWidgetItem *item = addPage( thumbsPage, i18n("Thumbnails") );
   item->setIcon( Icon( "icons" ) );

   thumbsCheck = new QCheckBox( i18n("Enable thu&mbnails"), thumbsPage );
   thumbsCheck->setWhatsThis(
		    i18n( "Enables the display of a thumbnailed image of the window when "
			  "you move your mouse pointer over an item. The thumbnails are "
			  "approximate, and may not reflect the current window contents.\n\n"
			  "Using this option on a slow machine may cause performance problems." ) );
   thumbsCheck->setChecked( kasbar->thumbnailsEnabled() );
   connect( thumbsCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setThumbnailsEnabled(bool) ) );

   embedThumbsCheck = new QCheckBox( i18n("&Embed thumbnails"), thumbsPage );
   embedThumbsCheck->setChecked( kasbar->embedThumbnails() );
   connect( embedThumbsCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setEmbedThumbnails(bool) ) );

   KHBox *thumbSizeBox = new KHBox( thumbsPage );
   thumbSizeBox->setWhatsThis(
		    i18n( "Controls the size of the window thumbnails. Using large sizes may "
			  "cause performance problems." ) );
   QLabel *thumbSizeLabel = new QLabel( i18n("Thumbnail &size: "), thumbSizeBox );
   int percent = (int) (kasbar->thumbnailSize() * 100.0);
   thumbSizeSlider = new QSlider( 0, 100, 1, percent, Qt::Horizontal, thumbSizeBox );
   connect( thumbSizeSlider, SIGNAL( valueChanged( int ) ),
	    kasbar, SLOT( setThumbnailSize( int ) ) );
   thumbSizeLabel->setBuddy( thumbSizeSlider );

   KHBox *thumbUpdateBox = new KHBox( thumbsPage );
   thumbUpdateBox->setSpacing( spacingHint() );
   thumbUpdateBox->setWhatsThis(
		    i18n( "Controls the frequency with which the thumbnail of the active window "
			  "is updated. If the value is 0 then no updates will be performed.\n\n"
			  "Using small values may cause performance problems on slow machines." ) );
   QLabel *thumbUpdateLabel = new QLabel( i18n("&Update thumbnail every: "), thumbUpdateBox );
   thumbUpdateSpin = new QSpinBox( 0, 1000, 1, thumbUpdateBox );
   thumbUpdateSpin->setValue( kasbar->thumbnailUpdateDelay() );
   connect( thumbUpdateSpin, SIGNAL( valueChanged( int ) ),
   	    kasbar, SLOT( setThumbnailUpdateDelay( int ) ) );
   (void) new QLabel( i18n("seconds"), thumbUpdateBox );
   thumbUpdateLabel->setBuddy( thumbUpdateSpin );

   (void) new QWidget( thumbsPage, "spacer" );
   (void) new QWidget( thumbsPage, "spacer" );
   (void) new QWidget( thumbsPage, "spacer" );
}
コード例 #24
0
ファイル: assocpropdlg.cpp プロジェクト: Elv13/Umbrello-ng
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"));
}
コード例 #25
0
//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;
}
コード例 #26
0
	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;
	}
コード例 #27
0
void KasPrefsDialog::addAdvancedPage()
{
   KVBox *advancedPage = new KVBox( this );

   KPageWidgetItem *item = addPage( advancedPage, i18n("Advanced") );
   item->setIcon( Icon( "misc" ) );

   // Startup notifier
   notifierCheck = new QCheckBox( i18n("Enable &startup notifier"), advancedPage );
   notifierCheck->setWhatsThis(
		    i18n( "Enables the display of tasks that are starting but have not yet "
			  "created a window." ) );
   notifierCheck->setChecked( kasbar->notifierEnabled() );
   connect( notifierCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setNotifierEnabled(bool) ) );

   // Status advanced
   modifiedCheck = new QCheckBox( i18n("Enable &modified indicator"), advancedPage );
   modifiedCheck->setWhatsThis(
		    i18n( "Enables the display of a floppy disk state icon for windows containing "
			  "a modified document." ) );
   modifiedCheck->setChecked( kasbar->showModified() );
   connect( modifiedCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setShowModified(bool) ) );

   progressCheck = new QCheckBox( i18n("Enable &progress indicator"), advancedPage );
   progressCheck->setWhatsThis(
		    i18n( "Enables the display of a progress bar in the label of windows show "
			  "are progress indicators." ) );
   progressCheck->setChecked( kasbar->showProgress() );
   connect( progressCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setShowProgress(bool) ) );

   attentionCheck = new QCheckBox( i18n("Enable &attention indicator"), advancedPage );
   attentionCheck->setWhatsThis(
		    i18n( "Enables the display of an icon that indicates a window that needs attention." ) );
   attentionCheck->setChecked( kasbar->showAttention() );
   connect( attentionCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setShowAttention(bool) ) );

   inactiveFramesCheck = new QCheckBox( i18n("Enable frames for inactive items"), advancedPage );
   inactiveFramesCheck->setWhatsThis(
		    i18n( "Enables frames around inactive items, if you want the bar to disappear into " \
			  "the background you should probably uncheck this option." ) );
   inactiveFramesCheck->setChecked( kasbar->paintInactiveFrames() );
   connect( inactiveFramesCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setPaintInactiveFrames(bool) ) );

   (void) new QWidget( advancedPage, "spacer" );
   (void) new QWidget( advancedPage, "spacer" );
}
コード例 #28
0
ファイル: manageactionsdialog.cpp プロジェクト: KDE/simon
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"));
}
コード例 #29
0
void KasPrefsDialog::addBehavePage()
{
   KVBox *behavePage = new KVBox( this );

   KPageWidgetItem *item = addPage( behavePage, i18n("Behavior") );
   item->setIcon( Icon( "window_list" ) );

   groupWindowsCheck = new QCheckBox( i18n("&Group windows"), behavePage );
   groupWindowsCheck->setWhatsThis(
		    i18n( "Enables the grouping together of related windows." ) );
   groupWindowsCheck->setChecked( kasbar->groupWindows() );
   connect( groupWindowsCheck, SIGNAL( toggled(bool) ),
	    kasbar, SLOT( setGroupWindows(bool) ) );

   showAllWindowsCheck = new QCheckBox( i18n("Show all &windows"), behavePage );
   showAllWindowsCheck->setWhatsThis(
		    i18n( "Enables the display of all windows, not just those on the current desktop." ) );
   showAllWindowsCheck->setChecked( kasbar->showAllWindows() );
   connect( showAllWindowsCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setShowAllWindows(bool) ) );

   groupInactiveCheck = new QCheckBox( i18n("&Group windows on inactive desktops"), behavePage );
   groupInactiveCheck->setWhatsThis(
		    i18n( "Enables the grouping together of windows that are not on the current desktop." ) );
   groupInactiveCheck->setChecked( kasbar->groupInactiveDesktops() );
   connect( groupInactiveCheck, SIGNAL( toggled(bool) ),
	    kasbar, SLOT( setGroupInactiveDesktops(bool) ) );

   onlyShowMinimizedCheck = new QCheckBox( i18n("Only show &minimized windows"), behavePage );
   onlyShowMinimizedCheck->setWhatsThis(
		    i18n( "When this option is checked only minimized windows are shown in the bar. " \
			  "This gives Kasbar similar behavior to the icon handling in older environments " \
			  "like CDE or OpenLook." ) );
   onlyShowMinimizedCheck->setChecked( kasbar->onlyShowMinimized() );
   connect( onlyShowMinimizedCheck, SIGNAL( toggled(bool) ), kasbar, SLOT( setOnlyShowMinimized(bool) ) );

   (void) new QWidget( behavePage, "spacer" );
   (void) new QWidget( behavePage, "spacer" );
}
コード例 #30
0
ファイル: ManagerSettingsDialog.cpp プロジェクト: KDE/muon
ManagerSettingsDialog::ManagerSettingsDialog(QWidget* parent, QApt::Config *aptConfig) :
    KPageDialog(parent),
    m_aptConfig(aptConfig)

{
    const QSize minSize = minimumSize();
    setMinimumSize(QSize(512, minSize.height()));

    setFaceType(List);
    setWindowTitle(i18nc("@title:window", "Muon Preferences"));
    setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
    button(QDialogButtonBox::Apply)->setEnabled(false);

    // General settings
    GeneralSettingsPage *generalPage = new GeneralSettingsPage(this, m_aptConfig);
    KPageWidgetItem *generalSettingsFrame = addPage(generalPage,
                                            i18nc("@title:group Title of the general group", "General"));
    generalSettingsFrame->setIcon(QIcon::fromTheme("system-run"));
    connect(generalPage, SIGNAL(changed()), this, SLOT(changed()));
    connect(generalPage, SIGNAL(authChanged()), this, SLOT(authChanged()));

    m_pages.insert(generalPage);
}