diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
commit | 10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch) | |
tree | 88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kcontrol/kicker/menutab_impl.cpp | |
parent | 4aed2c8219774f5d797760606b8489a92ddc5163 (diff) | |
download | tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip |
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
Diffstat (limited to 'kcontrol/kicker/menutab_impl.cpp')
-rw-r--r-- | kcontrol/kicker/menutab_impl.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
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 <knuminput.h> #include <kstandarddirs.h> +#include <kicondialog.h> +#include <kiconloader.h> + #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; +} |