From 10e41144596fc9ced40fc349d9ecd099b1c2ea19 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 11 Dec 2009 20:21:27 +0000 Subject: Initial import of Trinity 3.5.11 to kdebase Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes Will need to check for commit warnings and repair as encountered Also needs full compile test git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/kicker/main.cpp | 12 + kcontrol/kicker/main.h | 1 + kcontrol/kicker/menutab.ui | 588 +++++++++++++++++++++++++++------------ kcontrol/kicker/menutab_impl.cpp | 62 +++++ kcontrol/kicker/menutab_impl.h | 4 + 5 files changed, 487 insertions(+), 180 deletions(-) (limited to 'kcontrol/kicker') diff --git a/kcontrol/kicker/main.cpp b/kcontrol/kicker/main.cpp index 4ef0f842f..021cfbdd9 100644 --- a/kcontrol/kicker/main.cpp +++ b/kcontrol/kicker/main.cpp @@ -132,6 +132,18 @@ void KickerConfig::init() configFileWatch->startScan(); } +void KickerConfig::restartKicker() +{ + // Tell kicker to restart + if (!kapp->dcopClient()->isAttached()) + { + kapp->dcopClient()->attach(); + } + QCString appname; + appname = "kicker"; + kapp->dcopClient()->send(appname, appname, "restart", ""); +} + void KickerConfig::notifyKicker() { kdDebug() << "KickerConfig::notifyKicker()" << endl; diff --git a/kcontrol/kicker/main.h b/kcontrol/kicker/main.h index cb585b077..1797f7637 100644 --- a/kcontrol/kicker/main.h +++ b/kcontrol/kicker/main.h @@ -43,6 +43,7 @@ public: QString configName(); void notifyKicker(); + void restartKicker(); QString quickHelp() const; KAboutData *aboutData(); diff --git a/kcontrol/kicker/menutab.ui b/kcontrol/kicker/menutab.ui index 8d49a7965..e64285767 100644 --- a/kcontrol/kicker/menutab.ui +++ b/kcontrol/kicker/menutab.ui @@ -143,6 +143,155 @@ + + + kcfg_ShowKMenuText + + + Display text in K Menu button + + + true + + + <qt>When this option is selected the text below will be shown in the K Menu button. + + + + + unnamed + + + 0 + + + + kcfg_KMenuText + + + 35 + + + + + TextLabel1_3_3_2 + + + + 4 + 1 + 0 + 0 + + + + Custom K Menu button icon: + + + + + btnCustomKMenuIcon + + + + 0 + 0 + 0 + 0 + + + + + 26 + 26 + + + + + 26 + 26 + + + + false + + + + + + + + TextLabel1_3_3_2 + + + + 4 + 1 + 0 + 0 + + + + Text: + + + + + TextLabel1_3_3_2 + + + + 4 + 1 + 0 + 0 + + + + Font: + + + + + kcfg_ButtonFont + + + + + spacer6 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + spacer8 + + + Vertical + + + MinimumExpanding + + + + 20 + 0 + + + + m_editKMenuButton @@ -194,187 +343,266 @@ - - - m_browserGroup - - - QuickBrowser Menus - - - - unnamed - - - - Layout3 - - - - unnamed - - - - m_maxQuickBrowserItemsLabel - - - Ma&ximum number of entries: - - - kcfg_MaxEntries2 - - - When browsing directories that contain a lot of files, the QuickBrowser can sometimes hide your whole desktop. Here you can limit the number of entries shown at a time in the QuickBrowser. This is particularly useful for low screen resolutions. - - - - - kcfg_MaxEntries2 - - - 30 - - - 10 - - - 100 - - - When browsing directories that contain a lot of files, the QuickBrowser can sometimes hide your whole desktop. Here you can limit the number of entries shown at a time in the QuickBrowser. This is particularly useful for low screen resolutions. - - - - - - - kcfg_ShowHiddenFiles - - - Show hidden fi&les - - - true - - - If this option is enabled, hidden files (i.e. files beginning with a dot) will be shown in the QuickBrowser menus. - - - - - Spacer7 - - - Horizontal - - - Expanding - - - - 20 - 0 - - - - - - - - m_pRecentOrderGroup - - - QuickStart Menu Items - - - - unnamed + + + unnamed + + + 0 - - - Layout4 - - - - unnamed - - - - TextLabel2 - - - Maxim&um number of entries: - - - kcfg_NumVisibleEntries - - - This option allows you to define the maximum number of applications that should be displayed in the QuickStart menu area. - - - - - kcfg_NumVisibleEntries - - - 5 - - - 0 - - - 20 - - - This option allows you to define how many applications should be displayed at most in the QuickStart menu area. - - - - - - - kcfg_RecentVsOften - - - Show the &applications most recently used - - - true - - - When this option is selected the QuickStart menu area will be filled with the applications you have used most recently. - - - - - m_showFrequent - - - Show the applications most fre&quently used - - - When this option is selected the QuickStart menu area will be filled with the applications you use most frequently. - - - - - Spacer8 - - - Horizontal - - - Expanding - - - - 20 - 0 - - - - - + + + m_browserGroup + + + QuickBrowser Menus + + + + unnamed + + + + Layout3 + + + + unnamed + + + + m_maxQuickBrowserItemsLabel + + + Ma&ximum number of entries: + + + kcfg_MaxEntries2 + + + When browsing directories that contain a lot of files, the QuickBrowser can sometimes hide your whole desktop. Here you can limit the number of entries shown at a time in the QuickBrowser. This is particularly useful for low screen resolutions. + + + + + kcfg_MaxEntries2 + + + 30 + + + 10 + + + 100 + + + When browsing directories that contain a lot of files, the QuickBrowser can sometimes hide your whole desktop. Here you can limit the number of entries shown at a time in the QuickBrowser. This is particularly useful for low screen resolutions. + + + + + + + kcfg_ShowHiddenFiles + + + Show hidden fi&les + + + true + + + If this option is enabled, hidden files (i.e. files beginning with a dot) will be shown in the QuickBrowser menus. + + + + + Spacer7 + + + Horizontal + + + Expanding + + + + 20 + 0 + + + + + + + + m_recentGroup + + + Recent Documents Menu + + + + unnamed + + + + Layout3 + + + + unnamed + + + + m_maxRecentDocumentsItemsLabel + + + Ma&ximum number of entries: + + + kcfg_MaxEntries2 + + + This sets the maximum number of recently accessed documents stored for fast retrieval. + + + + + maxrecentdocs + + + 10 + + + 10 + + + 100 + + + This sets the maximum number of recently accessed documents stored for fast retrieval. + + + + + + + Spacer7 + + + Horizontal + + + Expanding + + + + 20 + 0 + + + + + + + + m_pRecentOrderGroup + + + QuickStart Menu Items + + + + unnamed + + + + Layout4 + + + + unnamed + + + + TextLabel2 + + + Maxim&um number of entries: + + + kcfg_NumVisibleEntries + + + This option allows you to define the maximum number of applications that should be displayed in the QuickStart menu area. + + + + + kcfg_NumVisibleEntries + + + 5 + + + 0 + + + 20 + + + This option allows you to define how many applications should be displayed at most in the QuickStart menu area. + + + + + + + kcfg_RecentVsOften + + + Show the &applications most recently used + + + true + + + When this option is selected the QuickStart menu area will be filled with the applications you have used most recently. + + + + + m_showFrequent + + + Show the applications most fre&quently used + + + When this option is selected the QuickStart menu area will be filled with the applications you use most frequently. + + + + + Spacer8 + + + Horizontal + + + Expanding + + + + 20 + 0 + + + + + + diff --git a/kcontrol/kicker/menutab_impl.cpp b/kcontrol/kicker/menutab_impl.cpp index 55cabaa88..935f04684 100644 --- a/kcontrol/kicker/menutab_impl.cpp +++ b/kcontrol/kicker/menutab_impl.cpp @@ -32,8 +32,13 @@ #include #include +#include +#include + #include "main.h" +#include "kickerSettings.h" + #include "menutab_impl.h" #include "menutab_impl.moc" @@ -66,6 +71,25 @@ MenuTab::MenuTab( QWidget *parent, const char* name ) { // connections connect(m_editKMenuButton, SIGNAL(clicked()), SLOT(launchMenuEditor())); + connect(btnCustomKMenuIcon, SIGNAL(clicked()), SLOT(launchIconEditor())); + connect(kcfg_KMenuText, SIGNAL(textChanged(QString)), SLOT(kmenuChanged())); + connect(kcfg_ShowKMenuText, SIGNAL(toggled(bool)), SLOT(kmenuChanged())); + //connect(kcfg_ButtonFont, SIGNAL(fontSelected(const QFont &)), SLOT(kmenuChanged())); + connect(maxrecentdocs, SIGNAL(valueChanged(int)), this, SLOT(changed())); + + KIconLoader * ldr = KGlobal::iconLoader(); + QPixmap kmenu_icon; + m_kmenu_icon = KickerSettings::customKMenuIcon(); + if (m_kmenu_icon.isNull() == true) { + m_kmenu_icon = QString("kmenu"); + } + kmenu_icon = ldr->loadIcon(m_kmenu_icon, KIcon::Small, KIcon::SizeSmall); + btnCustomKMenuIcon->setPixmap(kmenu_icon); + + KConfig *config; + config = new KConfig(QString::fromLatin1("kdeglobals"), false, false); + config->setGroup(QString::fromLatin1("RecentDocuments")); + maxrecentdocs->setValue(config->readNumEntry(QString::fromLatin1("MaxEntries"), 10)); m_browserGroupLayout->setColStretch( 1, 1 ); m_pRecentOrderGroupLayout->setColStretch( 1, 1 ); @@ -156,6 +180,22 @@ void MenuTab::save() c->writeEntry("Extensions", ext); c->sync(); + + // Save KMenu settings + c->setGroup("KMenu"); + c->writeEntry("CustomIcon", m_kmenu_icon); + c->sync(); + + // Save recent documents + KConfig *config; + config = new KConfig(QString::fromLatin1("kdeglobals"), false, false); + config->setGroup(QString::fromLatin1("RecentDocuments")); + config->writeEntry("MaxEntries", maxrecentdocs->value()); + config->sync(); + + if (m_kmenu_button_changed == true) { + system("dcop kicker kicker restart &"); + } } void MenuTab::defaults() @@ -179,3 +219,25 @@ void MenuTab::launchMenuEditor() i18n("Application Missing")); } } + +void MenuTab::launchIconEditor() +{ + KIconDialog dlg(this); + QString newIcon = dlg.selectIcon(KIcon::Small, KIcon::Application); + if (newIcon.isEmpty()) + return; + + m_kmenu_icon = newIcon; + KIconLoader * ldr = KGlobal::iconLoader(); + QPixmap kmenu_icon; + kmenu_icon = ldr->loadIcon(m_kmenu_icon, KIcon::Small, KIcon::SizeSmall); + btnCustomKMenuIcon->setPixmap(kmenu_icon); + m_kmenu_button_changed = true; + + emit changed(); +} + +void MenuTab::kmenuChanged() +{ + m_kmenu_button_changed = true; +} diff --git a/kcontrol/kicker/menutab_impl.h b/kcontrol/kicker/menutab_impl.h index 20ed393e1..71c669048 100644 --- a/kcontrol/kicker/menutab_impl.h +++ b/kcontrol/kicker/menutab_impl.h @@ -62,10 +62,14 @@ signals: public slots: void launchMenuEditor(); + void launchIconEditor(); + void kmenuChanged(); protected: kSubMenuItem *m_bookmarkMenu; kSubMenuItem *m_quickBrowserMenu; + QString m_kmenu_icon; + bool m_kmenu_button_changed; }; #endif -- cgit v1.2.1