From b971f9aae70373db39fb62a75c82f25e9252f6b3 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 12 Sep 2011 20:26:03 +0000 Subject: Use new modal system nofitication dialog in kdebase smserver Add fancy startup dialog to match the fancy shutdown dialog This is only used if the themed splash screen is turned off git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253056 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksmserver/startup.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'ksmserver/startup.cpp') diff --git a/ksmserver/startup.cpp b/ksmserver/startup.cpp index 2778b9dd9..4527aadaf 100644 --- a/ksmserver/startup.cpp +++ b/ksmserver/startup.cpp @@ -81,15 +81,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "server.h" #include "global.h" +#include "startupdlg.h" #include "client.h" #include +// shall we show a nice fancy login screen? +bool showFancyLogin = FALSE; +bool trinity_startup_main_sequence_done = FALSE; + /*! Restores the previous session. Ensures the window manager is running (if specified). */ void KSMServer::restoreSession( TQString sessionName ) { + showFancyLogin = KConfigGroup(KGlobal::config(), "Login").readBoolEntry("showFancyLogin", true); + KConfig ksplashcfg( "ksplashrc", true ); + ksplashcfg.setGroup( "KSplash" ); + if ( ksplashcfg.readEntry( "Theme", "Default" ) != TQString("None") ) + showFancyLogin = false; + if( state != Idle ) return; state = LaunchingWM; @@ -131,8 +142,14 @@ void KSMServer::restoreSession( TQString sessionName ) // visually more appealing startup. for (uint i = 0; i < wmCommands.count(); i++) startApplication( wmCommands[i] ); + if ((showFancyLogin) && (!startupNotifierIPDlg)) { + startupNotifierIPDlg = KSMStartupIPDlg::showStartupIP(); + } TQTimer::singleShot( 4000, this, TQT_SLOT( autoStart0() ) ); } else { + if ((showFancyLogin) && (!startupNotifierIPDlg)) { + startupNotifierIPDlg = KSMStartupIPDlg::showStartupIP(); + } autoStart0(); } } @@ -144,6 +161,12 @@ void KSMServer::restoreSession( TQString sessionName ) */ void KSMServer::startDefaultSession() { + showFancyLogin = KConfigGroup(KGlobal::config(), "Login").readBoolEntry("showFancyLogin", true); + KConfig ksplashcfg( "ksplashrc", true ); + ksplashcfg.setGroup( "KSplash" ); + if ( ksplashcfg.readEntry( "Theme", "Default" ) != TQString("None") ) + showFancyLogin = false; + if( state != Idle ) return; @@ -158,6 +181,9 @@ void KSMServer::startDefaultSession() connectDCOPSignal( launcher, launcher, "autoStart2Done()", "autoStart2Done()", true); startApplication( wm ); + if ((showFancyLogin) && (!startupNotifierIPDlg)) { + startupNotifierIPDlg = KSMStartupIPDlg::showStartupIP(); + } TQTimer::singleShot( 4000, this, TQT_SLOT( autoStart0() ) ); } @@ -348,6 +374,13 @@ void KSMServer::finishStartup() state = Idle; + // [FIXME] When this fires applications are still being loaded, especially the task tray apps + // See if there is a way to detect when all session managed applications have been fully started and wait to fire this until that point! + if (startupNotifierIPDlg) { + static_cast(startupNotifierIPDlg)->closeSMDialog(); + startupNotifierIPDlg=0; + } + setupXIOErrorHandler(); // From now on handle X errors as normal shutdown. } @@ -417,6 +450,12 @@ void KSMServer::publishProgress( int progress, bool max ) void KSMServer::upAndRunning( const TQString& msg ) { + if (startupNotifierIPDlg) { + static_cast(startupNotifierIPDlg)->setStartupPhase(msg); + if (msg == TQString("session ready")) { + trinity_startup_main_sequence_done = TRUE; + } + } DCOPRef( "ksplash" ).send( "upAndRunning", msg ); XEvent e; e.xclient.type = ClientMessage; -- cgit v1.2.3