[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/kdm/kfrontend
From: Oswald Buddenhagen <ossi () kde ! org>
Date: 2005-02-20 13:34:08
Message-ID: 20050220133408.EC4651BABE () office ! kde ! org
[Download RAW message or body]
CVS commit by ossi:
add some accels
M +22 -9 kgdialog.cpp 1.25
M +2 -2 kgdialog.h 1.11
--- kdebase/kdm/kfrontend/kgdialog.cpp #1.24:1.25
@@ -59,9 +59,12 @@ KGDialog::completeMenu()
if (_isLocal) {
dpyMenu = new QPopupMenu( this );
- inserten( i18n("Sw&itch User"), ALT+Key_I, dpyMenu );
+ int id = inserten( i18n("Sw&itch User"), ALT+Key_I, dpyMenu );
connect( dpyMenu, SIGNAL(activated( int )),
SLOT(slotDisplaySelected( int )) );
connect( dpyMenu, SIGNAL(aboutToShow()),
SLOT(slotPopulateDisplays()) );
+ QAccel *accel = new QAccel( this );
+ accel->insertItem( ALT+CTRL+Key_Insert, id );
+ connect( accel, SIGNAL(activated( int )), SLOT(slotActivateMenu( int )) );
}
#endif
@@ -82,8 +85,14 @@ KGDialog::completeMenu()
if (_allowShutdown != SHUT_NONE) {
- inserten( i18n("&Shutdown..."), ALT+Key_S, SLOT(slotShutdown()) );
+ inserten( i18n("&Shutdown..."), ALT+Key_S, SLOT(slotShutdown( int )) );
QAccel *accel = new QAccel( this );
accel->insertItem( ALT+CTRL+Key_Delete );
- connect( accel, SIGNAL(activated( int )), SLOT(slotShutdown()) );
+ connect( accel, SIGNAL(activated( int )), SLOT(slotShutdown( int )) );
+ accel = new QAccel( this );
+ accel->insertItem( SHIFT+ALT+CTRL+Key_PageUp, SHUT_REBOOT );
+ connect( accel, SIGNAL(activated( int )), SLOT(slotShutdown( int )) );
+ accel = new QAccel( this );
+ accel->insertItem( SHIFT+ALT+CTRL+Key_PageDown, SHUT_HALT );
+ connect( accel, SIGNAL(activated( int )), SLOT(slotShutdown( int )) );
}
}
@@ -109,5 +118,5 @@ KGDialog::inserten( const QString& txt,
}
-void
+int
KGDialog::inserten( const QString& txt, int accel, QPopupMenu *cmnu )
{
@@ -117,4 +126,5 @@ KGDialog::inserten( const QString& txt,
optMenu->connectItem( id, this, SLOT(slotActivateMenu( int )) );
optMenu->setItemParameter( id, id );
+ return id;
}
@@ -177,12 +187,15 @@ KGDialog::slotConsole()
void
-KGDialog::slotShutdown()
+KGDialog::slotShutdown( int id )
{
if (verify)
verify->suspend();
+ if (id < 0) {
if (_scheduledSd == SHUT_ALWAYS)
KDMShutdown::scheduleShutdown( this );
else
KDMSlimShutdown( this ).exec();
+ } else
+ KDMSlimShutdown::externShutdown( id, 0, -1 );
if (verify)
verify->resume();
--- kdebase/kdm/kfrontend/kgdialog.h #1.10:1.11
@@ -54,5 +54,5 @@ class KGDialog : public FDialog {
void slotReallySwitch();
void slotConsole();
- void slotShutdown();
+ void slotShutdown( int id );
protected:
@@ -63,5 +63,5 @@ class KGDialog : public FDialog {
#endif
void inserten( const QString& txt, int accel, const char *member );
- void inserten( const QString& txt, int accel, QPopupMenu *cmnu );
+ int inserten( const QString& txt, int accel, QPopupMenu *cmnu );
bool needSep;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic