diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-20 20:42:38 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-20 20:42:38 +0000 |
commit | cc19575364b9e988c3b2742aa42b1017b179b919 (patch) | |
tree | 1cd4b26a2b2e9c670301fae1e6f2337f5c90753b /kcontrol/randr/krandrtray.cpp | |
parent | 4a0149e6c1b7fd08667ae65da9213ea758a452db (diff) | |
download | tdebase-cc19575364b9e988c3b2742aa42b1017b179b919.tar.gz tdebase-cc19575364b9e988c3b2742aa42b1017b179b919.zip |
RandrTray fixes; other minor compilation fixes
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1152359 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/randr/krandrtray.cpp')
-rw-r--r-- | kcontrol/randr/krandrtray.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/kcontrol/randr/krandrtray.cpp b/kcontrol/randr/krandrtray.cpp index 8b230ba74..bee4a5e10 100644 --- a/kcontrol/randr/krandrtray.cpp +++ b/kcontrol/randr/krandrtray.cpp @@ -53,7 +53,7 @@ KRandRSystemTray::KRandRSystemTray(QWidget* parent, const char *name) { setPixmap(KSystemTray::loadSizedIcon("randr", width())); setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - connect(this, SIGNAL(quitSelected()), kapp, SLOT(quit())); + connect(this, SIGNAL(quitSelected()), this, SLOT(_quit())); QToolTip::add(this, i18n("Screen resize & rotate")); my_parent = parent; @@ -88,6 +88,23 @@ KRandRSystemTray::KRandRSystemTray(QWidget* parent, const char *name) } } +/*! + * \b SLOT which called if krandrtray is exited by the user. In this case the user + * is asked through a yes/no box if "KRandRTray should start automatically on log in" and the + * result is written to the KDE configfile. + */ +void KRandRSystemTray::_quit (){ + r_config = new KSimpleConfig("krandrtrayrc"); + + QString tmp1 = i18n ("Start KRandRTray automatically when you log in?"); + int tmp2 = KMessageBox::questionYesNo ( 0, tmp1, i18n("Question"), i18n("Start Automatically"), i18n("Do Not Start")); + r_config->setGroup("General"); + r_config->writeEntry ("Autostart", tmp2 == KMessageBox::Yes); + r_config->sync (); + + exit(0); +} + void KRandRSystemTray::resizeEvent ( QResizeEvent * ) { // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes |