From kde-commits Sun Feb 28 20:40:05 2010 From: Oswald Buddenhagen Date: Sun, 28 Feb 2010 20:40:05 +0000 To: kde-commits Subject: KDE/kdebase/workspace/kdm Message-Id: <1267389605.227985.32118.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126739021713698 SVN commit 1097271 by ossi: always show confirmation dialog before switching to console mode the dialog also contains instructions on getting back to text mode. BUG: 223576 M +0 -1 TODO M +0 -2 backend/dm.c M +21 -5 kfrontend/kdmshutdown.cpp M +10 -12 kfrontend/kgdialog.cpp --- trunk/KDE/kdebase/workspace/kdm/TODO #1097270:1097271 @@ -11,7 +11,6 @@ - do something about GreetString, i18n & theming. need some magic for the default. -- message after switching to text mode - report critical startup errors to the console - set LANGUAGE in the backend for i18n-capable PAM libs --- trunk/KDE/kdebase/workspace/kdm/backend/dm.c #1097270:1097271 @@ -546,8 +546,6 @@ if ((vt = TTYtoVT( *consoleTTYs ))) activateVT( vt ); #endif - - /* XXX output something useful here */ } #ifdef HAVE_VTS --- trunk/KDE/kdebase/workspace/kdm/kfrontend/kdmshutdown.cpp #1097270:1097271 @@ -582,6 +582,11 @@ doShutdown( type, os ); } +#define SHUT_CONSOLE_HELP I18N_NOOP( \ + "
Switching to console mode will terminate all local X servers and" \ + " leave you with console logins only. Graphical mode is automatically" \ + " resumed 10 seconds after the last console session ends or after" \ + " 40 seconds if no-one logs in in the first place.
") KDMConfShutdown::KDMConfShutdown( int _uid, const QList &sessions, int type, const QString &os, QWidget *_parent ) @@ -591,9 +596,13 @@ if (type == SHUT_CONSOLE) willShut = false; #endif - box->addWidget( new QLabel( QString( "
" - "%1%2" - "
" ) + QLabel *lbl = new QLabel( QString( "
" + "%1%2" + "
" +#ifdef HAVE_VTS + "%3" +#endif + "
" ) .arg( (type == SHUT_HALT) ? i18n("Turn Off Computer") : #ifdef HAVE_VTS @@ -603,8 +612,15 @@ i18n("Restart Computer") ) .arg( !os.isEmpty() ? i18n("
(Next boot: %1)", os ) : - QString() ), - this ) ); + QString() ) +#ifdef HAVE_VTS + .arg( (type == SHUT_CONSOLE) ? + i18n(SHUT_CONSOLE_HELP) : + QString() ) +#endif + ); + lbl->setWordWrap( true ); + box->addWidget( lbl ); if (!sessions.isEmpty()) { if (willShut && _scheduledSd != SHUT_NEVER) --- trunk/KDE/kdebase/workspace/kdm/kfrontend/kgdialog.cpp #1097270:1097271 @@ -167,21 +167,19 @@ void KGDialog::slotConsole() { + QList sess; #ifdef HAVE_VTS - QList sess = fetchSessions( 0 ); - if (!sess.isEmpty()) { - if (verify) - verify->suspend(); - int ret = KDMConfShutdown( -1, sess, SHUT_CONSOLE, 0 ).exec(); - if (verify) - verify->resume(); - if (!ret) - return; - } -#else + sess = fetchSessions( 0 ); +#endif if (verify) + verify->suspend(); + int ret = KDMConfShutdown( -1, sess, SHUT_CONSOLE, 0 ).exec(); + if (verify) + verify->resume(); + if (!ret) + return; + if (verify) verify->abort(); -#endif gSet( 1 ); gSendInt( G_Console ); gSet( 0 );