summaryrefslogtreecommitdiffstats
path: root/kcontrol/kicker/menutab_impl.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-03 20:49:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-03 20:49:48 +0000
commitfd7a608ffe99df747f0496300276b95f766c18b9 (patch)
treec54dfe97fb682af9705d2cb09c424c60db861228 /kcontrol/kicker/menutab_impl.cpp
parent27856879bf962f178d88e79144e37a47e731b122 (diff)
downloadtdebase-fd7a608ffe99df747f0496300276b95f766c18b9.tar.gz
tdebase-fd7a608ffe99df747f0496300276b95f766c18b9.zip
* Added Kickoff menu
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1171422 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/kicker/menutab_impl.cpp')
-rw-r--r--kcontrol/kicker/menutab_impl.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/kcontrol/kicker/menutab_impl.cpp b/kcontrol/kicker/menutab_impl.cpp
index 1d1053af8..b85db9fc7 100644
--- a/kcontrol/kicker/menutab_impl.cpp
+++ b/kcontrol/kicker/menutab_impl.cpp
@@ -16,12 +16,16 @@
*/
#include <tqcheckbox.h>
+#include <tqgroupbox.h>
#include <tqdir.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqpushbutton.h>
#include <tqradiobutton.h>
+#include <tqcombobox.h>
+#include <tqbuttongroup.h>
+#include <dcopref.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kdesktopfile.h>
@@ -148,12 +152,47 @@ void MenuTab::load( bool useDefaults )
}
}
+ c->setGroup("General");
+ m_comboMenuStyle->setCurrentItem( c->readBoolEntry("LegacyKMenu", true) ? 1 : 0 );
+ m_openOnHover->setChecked( c->readBoolEntry("OpenOnHover", true) );
+ menuStyleChanged();
+
+ connect(m_comboMenuStyle, TQT_SIGNAL(activated(int)), TQT_SIGNAL(changed()));
+ connect(m_comboMenuStyle, TQT_SIGNAL(activated(int)), TQT_SLOT(menuStyleChanged()));
+ connect(m_openOnHover, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()));
+
m_showFrequent->setChecked(true);
if ( useDefaults )
emit changed();
}
+void MenuTab::menuStyleChanged()
+{
+ if (m_comboMenuStyle->currentItem()==1) {
+ m_openOnHover->setEnabled(false);
+ m_subMenus->setEnabled(true);
+ kcfg_UseSidePixmap->setEnabled(true);
+ kcfg_MenuEntryFormat->setEnabled(true);
+ kcfg_RecentVsOften->setEnabled(true);
+ m_showFrequent->setEnabled(true);
+ kcfg_UseSearchBar->setEnabled(true);
+ kcfg_MaxEntries2->setEnabled(true);
+ maxrecentdocs->setEnabled(true);
+ }
+ else {
+ m_openOnHover->setEnabled(true);
+ m_subMenus->setEnabled(false);
+ kcfg_UseSidePixmap->setEnabled(false);
+ kcfg_MenuEntryFormat->setEnabled(false);
+ kcfg_RecentVsOften->setEnabled(false);
+ m_showFrequent->setEnabled(false);
+ kcfg_UseSearchBar->setEnabled(false);
+ kcfg_MaxEntries2->setEnabled(false);
+ maxrecentdocs->setEnabled(false);
+ }
+}
+
void MenuTab::save()
{
KSharedConfig::Ptr c = KSharedConfig::openConfig(KickerConfig::the()->configName());
@@ -179,9 +218,18 @@ void MenuTab::save()
}
}
c->writeEntry("Extensions", ext);
+ c->setGroup("General");
+ bool kmenusetting = m_comboMenuStyle->currentItem()==1;
+ bool oldkmenusetting = c->readBoolEntry("LegacyKMenu", true);
+
+ c->writeEntry("LegacyKMenu", kmenusetting);
+ c->writeEntry("OpenOnHover", m_openOnHover->isChecked());
c->sync();
+ if (kmenusetting != oldkmenusetting)
+ DCOPRef ("kicker", "default").call("restart()");
+
// Save KMenu settings
c->setGroup("KMenu");
c->writeEntry("CustomIcon", m_kmenu_icon);
@@ -195,7 +243,7 @@ void MenuTab::save()
config->sync();
if (m_kmenu_button_changed == true) {
- system("dcop kicker kicker restart &");
+ DCOPRef ("kicker", "default").call("restart()");
}
}