[tdebase/ksmserver] added UPower support

pull/2/head
Serghei Amelian 12 years ago
parent 39c1afd3f8
commit b5236f1d75

@ -77,6 +77,7 @@ option( WITH_XINERAMA "Enable xinerama extension support" ${WITH_ALL_OPTIONS} )
option( WITH_ARTS "Enable aRts support" ${WITH_ALL_OPTIONS} ) option( WITH_ARTS "Enable aRts support" ${WITH_ALL_OPTIONS} )
option( WITH_I8K "Enable Dell laptop support (ksysguard)" ${WITH_ALL_OPTIONS} ) option( WITH_I8K "Enable Dell laptop support (ksysguard)" ${WITH_ALL_OPTIONS} )
option( WITH_HAL "Enable HAL support" ${WITH_ALL_OPTIONS} ) option( WITH_HAL "Enable HAL support" ${WITH_ALL_OPTIONS} )
option( WITH_UPOWER "Enable UPOWER support" ${WITH_ALL_OPTIONS} )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )

@ -1,6 +1,6 @@
################################################# #################################################
# #
# (C) 2010-2011 Serghei Amelian # (C) 2010-2012 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com # serghei (DOT) amelian (AT) gmail.com
# #
# Improvements and feedback are welcome # Improvements and feedback are welcome
@ -215,7 +215,7 @@ find_package( TQt )
find_package( TDE ) find_package( TDE )
# dbus-tqt need Qt flags
# dbus (tdm, ksmserver) # dbus (tdm, ksmserver)
if( BUILD_TDM OR BUILD_KSMSERVER ) if( BUILD_TDM OR BUILD_KSMSERVER )
@ -224,19 +224,33 @@ if( BUILD_TDM OR BUILD_KSMSERVER )
tde_message_fatal( "dbus-1 is required, but was not found on your system" ) tde_message_fatal( "dbus-1 is required, but was not found on your system" )
endif( ) endif( )
# check for dbus-tqt endif( )
pkg_check_modules( DBUS_TQT REQUIRED dbus-tqt )
tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
set( CMAKE_REQUIRED_INCLUDES ${DBUS_TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS} ${QT_INCLUDE_DIRS}) # tqt-dbus (tdm, ksmserver)
set( CMAKE_REQUIRED_LIBRARIES ${DBUS_TQT_LDFLAGS} ${TQT_LDFLAGS} ${QT_LDFLAGS} ) if( BUILD_TDM OR BUILD_KSMSERVER )
check_cxx_source_compiles("
#include <tqt.h> if( BUILD_KSMSERVER AND WITH_UPOWER )
#include <dbus/connection.h> pkg_check_modules( DBUS_1_TQT dbus-1-tqt )
int main(int, char**) { return 0; } " if( NOT DBUS_1_TQT_FOUND )
HAVE_DBUS_QT3_07 ) tde_message_fatal( "dbus-tqt-1 is required, but was not found on your system" )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) endif( )
if( NOT HAVE_DBUS_QT3_07 ) else( )
tde_message_fatal( "dbus-tqt is required, but was not found on your system" ) # check for dbus-tqt
# dbus-tqt need Qt flags
pkg_check_modules( DBUS_TQT REQUIRED dbus-tqt )
tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
set( CMAKE_REQUIRED_INCLUDES ${DBUS_TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS} ${QT_INCLUDE_DIRS})
set( CMAKE_REQUIRED_LIBRARIES ${DBUS_TQT_LDFLAGS} ${TQT_LDFLAGS} ${QT_LDFLAGS} )
check_cxx_source_compiles("
#include <tqt.h>
#include <dbus/connection.h>
int main(int, char**) { return 0; } "
HAVE_DBUS_QT3_07 )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
if( NOT HAVE_DBUS_QT3_07 )
tde_message_fatal( "dbus-tqt is required, but was not found on your system" )
endif( )
endif( ) endif( )
endif( ) endif( )

@ -13,18 +13,24 @@ if( NOT DBUS_SYSTEM_BUS )
set( DBUS_SYSTEM_BUS "unix:path=/var/run/dbus/system_bus_socket" CACHE INTERNAL "" FORCE ) set( DBUS_SYSTEM_BUS "unix:path=/var/run/dbus/system_bus_socket" CACHE INTERNAL "" FORCE )
endif() endif()
if( WITH_UPOWER )
add_definitions( -DWITH_UPOWER )
endif( )
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/tdmlib ${CMAKE_SOURCE_DIR}/tdmlib
${TDE_INCLUDE_DIR} ${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS}
${DBUS_1_TQT_INCLUDE_DIRS}
${DBUS_TQT_INCLUDE_DIRS} ${DBUS_TQT_INCLUDE_DIRS}
${HAL_INCLUDE_DIRS} ${HAL_INCLUDE_DIRS}
) )
link_directories( link_directories(
${TQT_LIBRARY_DIRS} ${TQT_LIBRARY_DIRS}
${DBUS_1_TQT_LIBRARY_DIRS}
${DBUS_TQT_LIBRARY_DIRS} ${DBUS_TQT_LIBRARY_DIRS}
) )
@ -43,5 +49,5 @@ tde_add_tdeinit_executable( ksmserver AUTOMOC
main.cpp server.cpp shutdowndlg.cpp startupdlg.cpp main.cpp server.cpp shutdowndlg.cpp startupdlg.cpp
legacy.cpp startup.cpp shutdown.cpp client.cpp legacy.cpp startup.cpp shutdown.cpp client.cpp
KSMServerInterface.skel server.skel timed.ui KSMServerInterface.skel server.skel timed.ui
LINK dmctl-static tdeui-shared krsync-shared ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES} LINK dmctl-static tdeui-shared krsync-shared ${HAL_LIBRARIES} ${DBUS_1_TQT_LIBRARIES} ${DBUS_TQT_LIBRARIES}
) )

@ -1,11 +1,20 @@
/***************************************************************** /*****************************************************************
ksmserver - the KDE session management server ksmserver - the KDE session management server
Copyright (C) 2012 Serghei Amelian <serghei.amelian@gmail.com>
Copyright (C) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net> Copyright (C) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org> Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
******************************************************************/ ******************************************************************/
#include "shutdowndlg.h" #include "shutdowndlg.h"
#ifdef WITH_UPOWER
#include <tqdbusdata.h>
#include <tqdbusmessage.h>
#include <tqdbusproxy.h>
#include <tqdbusvariant.h>
#endif
#include <tqapplication.h> #include <tqapplication.h>
#include <tqlayout.h> #include <tqlayout.h>
#include <tqgroupbox.h> #include <tqgroupbox.h>
@ -76,42 +85,42 @@ KSMShutdownFeedback::KSMShutdownFeedback()
m_greyImageCreated( FALSE ) m_greyImageCreated( FALSE )
{ {
if (kapp->isX11CompositionAvailable()) { if (kapp->isX11CompositionAvailable()) {
m_grayImage = TQImage( TQApplication::desktop()->width(), TQApplication::desktop()->height(), 32 ); m_grayImage = TQImage( TQApplication::desktop()->width(), TQApplication::desktop()->height(), 32 );
m_grayImage = m_grayImage.convertDepth(32); m_grayImage = m_grayImage.convertDepth(32);
m_grayImage.setAlphaBuffer(false); m_grayImage.setAlphaBuffer(false);
m_grayImage.fill(0); // Set the alpha buffer to 0 (fully transparent) m_grayImage.fill(0); // Set the alpha buffer to 0 (fully transparent)
m_grayImage.setAlphaBuffer(true); m_grayImage.setAlphaBuffer(true);
} }
else { else {
// The hacks below aren't needed any more because Qt3 supports true transparency for the fading logout screen when composition is available // The hacks below aren't needed any more because Qt3 supports true transparency for the fading logout screen when composition is available
DCOPRef("kicker", "KMenu").call("hideMenu"); // Make sure the K Menu is completely removed from the screen before taking a snapshot... DCOPRef("kicker", "KMenu").call("hideMenu"); // Make sure the K Menu is completely removed from the screen before taking a snapshot...
m_grayImage = TQPixmap(TQPixmap::grabWindow(qt_xrootwin(), 0, 0, TQApplication::desktop()->width(), TQApplication::desktop()->height())).convertToImage(); m_grayImage = TQPixmap(TQPixmap::grabWindow(qt_xrootwin(), 0, 0, TQApplication::desktop()->width(), TQApplication::desktop()->height())).convertToImage();
} }
m_unfadedImage = m_grayImage; m_unfadedImage = m_grayImage;
resize(0, 0); resize(0, 0);
setShown(true); setShown(true);
TQTimer::singleShot( 500, this, TQT_SLOT( slotPaintEffect() ) ); TQTimer::singleShot( 500, this, TQT_SLOT( slotPaintEffect() ) );
} }
// called after stopping shutdown-feedback -> smooth fade-back to color-mode // called after stopping shutdown-feedback -> smooth fade-back to color-mode
void KSMShutdownFeedback::fadeBack( void ) void KSMShutdownFeedback::fadeBack( void )
{ {
m_fadeTime.restart(); m_fadeTime.restart();
m_fadeBackwards = TRUE; m_fadeBackwards = TRUE;
// its possible that we have to fade back, before all is completely gray, so we cannot start // its possible that we have to fade back, before all is completely gray, so we cannot start
// with completely gray when fading back... // with completely gray when fading back...
m_compensation = 1.0f - m_grayOpacity; m_compensation = 1.0f - m_grayOpacity;
// wait until we're completely back in color-mode... // wait until we're completely back in color-mode...
while ( m_grayOpacity > 0.0f ) while ( m_grayOpacity > 0.0f )
slotPaintEffect(); slotPaintEffect();
} }
void KSMShutdownFeedback::slotPaintEffect() void KSMShutdownFeedback::slotPaintEffect()
{ {
// determine which fade to use // determine which fade to use
if (KConfigGroup(KGlobal::config(), "Logout").readBoolEntry("doFancyLogout", true)) if (KConfigGroup(KGlobal::config(), "Logout").readBoolEntry("doFancyLogout", true))
{ {
float doFancyLogoutAdditionalDarkness = (float)KConfigGroup(KGlobal::config(), "Logout").readDoubleNumEntry("doFancyLogoutAdditionalDarkness", 0.6); float doFancyLogoutAdditionalDarkness = (float)KConfigGroup(KGlobal::config(), "Logout").readDoubleNumEntry("doFancyLogoutAdditionalDarkness", 0.6);
@ -132,10 +141,10 @@ void KSMShutdownFeedback::slotPaintEffect()
m_root.resize( width(), height() ); m_root.resize( width(), height() );
TQImage blendedImage = m_grayImage; TQImage blendedImage = m_grayImage;
TQPainter p; TQPainter p;
p.begin( &m_root ); p.begin( &m_root );
blendedImage.setAlphaBuffer(false); blendedImage.setAlphaBuffer(false);
p.drawImage( 0, 0, blendedImage ); p.drawImage( 0, 0, blendedImage );
p.end(); p.end();
setBackgroundPixmap( m_root ); setBackgroundPixmap( m_root );
setGeometry( TQApplication::desktop()->geometry() ); setGeometry( TQApplication::desktop()->geometry() );
@ -362,11 +371,11 @@ void KSMShutdownFeedback::slotPaintEffect()
TQTimer::singleShot( 5, this, TQT_SLOT( slotPaintEffect() ) ); TQTimer::singleShot( 5, this, TQT_SLOT( slotPaintEffect() ) );
} }
} }
// standard logout fade // standard logout fade
else else
{ {
if (kapp->isX11CompositionAvailable()) { if (kapp->isX11CompositionAvailable()) {
// We can do this in a different (simpler) manner because we have compositing support! // We can do this in a different (simpler) manner because we have compositing support!
// The end effect will be very similar to the old style logout // The end effect will be very similar to the old style logout
float doFancyLogoutFadeTime = 1000; float doFancyLogoutFadeTime = 1000;
@ -479,35 +488,35 @@ void KSMShutdownFeedback::slotPaintEffect()
} }
TQTimer::singleShot( 1, this, TQT_SLOT( slotPaintEffect() ) ); TQTimer::singleShot( 1, this, TQT_SLOT( slotPaintEffect() ) );
} }
else { else {
if ( m_currentY >= height() ) { if ( m_currentY >= height() ) {
if ( backgroundMode() == TQWidget::NoBackground ) { if ( backgroundMode() == TQWidget::NoBackground ) {
setBackgroundMode( TQWidget::NoBackground ); setBackgroundMode( TQWidget::NoBackground );
setBackgroundPixmap( m_root ); setBackgroundPixmap( m_root );
} }
return; return;
} }
if ( m_currentY == 0 ) { if ( m_currentY == 0 ) {
KPixmap pixmap; KPixmap pixmap;
pixmap = TQPixmap(TQPixmap::grabWindow( qt_xrootwin(), 0, 0, width(), height() )); pixmap = TQPixmap(TQPixmap::grabWindow( qt_xrootwin(), 0, 0, width(), height() ));
bitBlt( this, 0, 0, &pixmap ); bitBlt( this, 0, 0, &pixmap );
bitBlt( &m_root, 0, 0, &pixmap ); bitBlt( &m_root, 0, 0, &pixmap );
} }
KPixmap pixmap; KPixmap pixmap;
pixmap = TQPixmap(TQPixmap::grabWindow( qt_xrootwin(), 0, m_currentY, width(), 10 )); pixmap = TQPixmap(TQPixmap::grabWindow( qt_xrootwin(), 0, m_currentY, width(), 10 ));
TQImage image = pixmap.convertToImage(); TQImage image = pixmap.convertToImage();
KImageEffect::blend( Qt::black, image, 0.4 ); KImageEffect::blend( Qt::black, image, 0.4 );
KImageEffect::toGray( image, true ); KImageEffect::toGray( image, true );
pixmap.convertFromImage( image ); pixmap.convertFromImage( image );
bitBlt( this, 0, m_currentY, &pixmap ); bitBlt( this, 0, m_currentY, &pixmap );
bitBlt( &m_root, 0, m_currentY, &pixmap ); bitBlt( &m_root, 0, m_currentY, &pixmap );
m_currentY += 10; m_currentY += 10;
TQTimer::singleShot( 1, this, TQT_SLOT( slotPaintEffect() ) ); TQTimer::singleShot( 1, this, TQT_SLOT( slotPaintEffect() ) );
} }
} }
} }
@ -639,24 +648,24 @@ void KSMShutdownIPFeedback::slotPaintEffect()
////// //////
KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
bool maysd, KApplication::ShutdownType sdtype ) bool maysd, KApplication::ShutdownType sdtype )
: TQDialog( parent, 0, TRUE, (WFlags)WType_Popup ), targets(0) : TQDialog( parent, 0, TRUE, (WFlags)WType_Popup ), targets(0)
// this is a WType_Popup on purpose. Do not change that! Not // this is a WType_Popup on purpose. Do not change that! Not
// having a popup here has severe side effects. // having a popup here has severe side effects.
{ {
TQVBoxLayout* vbox = new TQVBoxLayout( this ); TQVBoxLayout* vbox = new TQVBoxLayout( this );
TQFrame* frame = new TQFrame( this ); TQFrame* frame = new TQFrame( this );
frame->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised ); frame->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised );
frame->setLineWidth( style().pixelMetric( TQStyle::PM_DefaultFrameWidth, frame ) ); frame->setLineWidth( style().pixelMetric( TQStyle::PM_DefaultFrameWidth, frame ) );
// we need to set the minimum size for the logout box, since it // we need to set the minimum size for the logout box, since it
// gets too small if there isn't all options available // gets too small if there isn't all options available
frame->setMinimumWidth(400); frame->setMinimumWidth(400);
vbox->addWidget( frame ); vbox->addWidget( frame );
vbox = new TQVBoxLayout( frame, 2 * KDialog::marginHint(), vbox = new TQVBoxLayout( frame, 2 * KDialog::marginHint(),
2 * KDialog::spacingHint() ); 2 * KDialog::spacingHint() );
// default factor // default factor
bool doUbuntuLogout = KConfigGroup(KGlobal::config(), "Logout").readBoolEntry("doUbuntuLogout", false); bool doUbuntuLogout = KConfigGroup(KGlobal::config(), "Logout").readBoolEntry("doUbuntuLogout", false);
@ -721,16 +730,17 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
buttonlay->addStretch( 1 ); buttonlay->addStretch( 1 );
// End session // End session
KPushButton* btnLogout = new KPushButton( KGuiItem( i18n("&End Current Session"), "undo"), frame ); KPushButton* btnLogout = new KPushButton( KGuiItem( i18n("&End Current Session"), "undo"), frame );
TQToolTip::add( btnLogout, i18n( "<qt><h3>End Current Session</h3><p>Log out of the current session to login with a different user</p></qt>" ) ); TQToolTip::add( btnLogout, i18n( "<qt><h3>End Current Session</h3><p>Log out of the current session to login with a different user</p></qt>" ) );
btnFont = btnLogout->font(); btnFont = btnLogout->font();
buttonlay->addWidget( btnLogout ); buttonlay->addWidget( btnLogout );
connect(btnLogout, TQT_SIGNAL(clicked()), TQT_SLOT(slotLogout())); connect(btnLogout, TQT_SIGNAL(clicked()), TQT_SLOT(slotLogout()));
} }
#ifndef WITH_UPOWER
#ifdef COMPILE_HALBACKEND #ifdef COMPILE_HALBACKEND
m_halCtx = NULL; m_halCtx = NULL;
#endif #endif
#endif // WITH_UPOWER
if (maysd) { if (maysd) {
@ -744,6 +754,25 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
bool canSuspend = false; bool canSuspend = false;
bool canHibernate = false; bool canHibernate = false;
#ifdef WITH_UPOWER
m_dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus);
TQT_DBusProxy upowerProperties("org.freedesktop.UPower", "/org/freedesktop/UPower", "org.freedesktop.DBus.Properties", m_dbusConn);
// can suspend?
TQValueList<TQT_DBusData> params;
params << TQT_DBusData::fromString(upowerProperties.interface()) << TQT_DBusData::fromString("CanSuspend");
TQT_DBusMessage reply = upowerProperties.sendWithReply("Get", params);
if(reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1)
canSuspend = reply[0].toVariant().value.toBool();
// can hibernate?
params.clear();
params << TQT_DBusData::fromString(upowerProperties.interface()) << TQT_DBusData::fromString("CanHibernate");
reply = upowerProperties.sendWithReply("Get", params);
if(reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1)
canHibernate = reply[0].toVariant().value.toBool();
#else
#ifdef COMPILE_HALBACKEND #ifdef COMPILE_HALBACKEND
// Query HAL for suspend/resume support // Query HAL for suspend/resume support
m_halCtx = libhal_ctx_new(); m_halCtx = libhal_ctx_new();
@ -800,6 +829,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
} }
} }
#endif #endif
#endif // WITH_UPOWER
if(doUbuntuLogout) { if(doUbuntuLogout) {
@ -809,7 +839,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
FlatButton* btnSuspend = new FlatButton( frame ); FlatButton* btnSuspend = new FlatButton( frame );
btnSuspend->setTextLabel( i18n("&Suspend"), false ); btnSuspend->setTextLabel( i18n("&Suspend"), false );
btnSuspend->setPixmap( DesktopIcon( "suspend") ); btnSuspend->setPixmap( DesktopIcon( "suspend") );
int i = btnSuspend->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1 int i = btnSuspend->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnSuspend->setAccel( "ALT+" + btnSuspend->textLabel().lower()[i+1] ) ; btnSuspend->setAccel( "ALT+" + btnSuspend->textLabel().lower()[i+1] ) ;
hbuttonbox->addWidget ( btnSuspend); hbuttonbox->addWidget ( btnSuspend);
connect(btnSuspend, TQT_SIGNAL(clicked()), TQT_SLOT(slotSuspend())); connect(btnSuspend, TQT_SIGNAL(clicked()), TQT_SLOT(slotSuspend()));
@ -819,7 +849,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
{ {
// Hibernate // Hibernate
FlatButton* btnHibernate = new FlatButton( frame ); FlatButton* btnHibernate = new FlatButton( frame );
btnHibernate->setTextLabel( i18n("&Hibernate"), false ); btnHibernate->setTextLabel( i18n("&Hibernate"), false );
btnHibernate->setPixmap( DesktopIcon( "hibernate") ); btnHibernate->setPixmap( DesktopIcon( "hibernate") );
int i = btnHibernate->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1 int i = btnHibernate->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnHibernate->setAccel( "ALT+" + btnHibernate->textLabel().lower()[i+1] ) ; btnHibernate->setAccel( "ALT+" + btnHibernate->textLabel().lower()[i+1] ) ;
@ -838,7 +868,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
FlatButton* btnReboot = new FlatButton( frame ); FlatButton* btnReboot = new FlatButton( frame );
btnReboot->setTextLabel( i18n("&Restart"), false ); btnReboot->setTextLabel( i18n("&Restart"), false );
btnReboot->setPixmap( DesktopIcon( "reload") ); btnReboot->setPixmap( DesktopIcon( "reload") );
int i = btnReboot->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1 int i = btnReboot->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnReboot->setAccel( "ALT+" + btnReboot->textLabel().lower()[i+1] ) ; btnReboot->setAccel( "ALT+" + btnReboot->textLabel().lower()[i+1] ) ;
hbuttonbox2->addWidget ( btnReboot); hbuttonbox2->addWidget ( btnReboot);
connect(btnReboot, TQT_SIGNAL(clicked()), TQT_SLOT(slotReboot())); connect(btnReboot, TQT_SIGNAL(clicked()), TQT_SLOT(slotReboot()));
@ -894,16 +924,16 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
{ {
// Shutdown // Shutdown
KPushButton* btnHalt = new KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit"), frame ); KPushButton* btnHalt = new KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit"), frame );
TQToolTip::add( btnHalt, i18n( "<qt><h3>Turn Off Computer</h3><p>Log out of the current session and turn off the computer</p></qt>" ) ); TQToolTip::add( btnHalt, i18n( "<qt><h3>Turn Off Computer</h3><p>Log out of the current session and turn off the computer</p></qt>" ) );
btnHalt->setFont( btnFont ); btnHalt->setFont( btnFont );
buttonlay->addWidget( btnHalt ); buttonlay->addWidget( btnHalt );
connect(btnHalt, TQT_SIGNAL(clicked()), TQT_SLOT(slotHalt())); connect(btnHalt, TQT_SIGNAL(clicked()), TQT_SLOT(slotHalt()));
if ( sdtype == KApplication::ShutdownTypeHalt || getenv("TDM_AUTOLOGIN") ) if ( sdtype == KApplication::ShutdownTypeHalt || getenv("TDM_AUTOLOGIN") )
btnHalt->setFocus(); btnHalt->setFocus();
// Reboot // Reboot
KSMDelayedPushButton* btnReboot = new KSMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload"), frame ); KSMDelayedPushButton* btnReboot = new KSMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload"), frame );
TQToolTip::add( btnReboot, i18n( "<qt><h3>Restart Computer</h3><p>Log out of the current session and restart the computer</p><p>Hold the mouse button or the space bar for a short while to get a list of options what to boot</p></qt>" ) ); TQToolTip::add( btnReboot, i18n( "<qt><h3>Restart Computer</h3><p>Log out of the current session and restart the computer</p><p>Hold the mouse button or the space bar for a short while to get a list of options what to boot</p></qt>" ) );
btnReboot->setFont( btnFont ); btnReboot->setFont( btnFont );
buttonlay->addWidget( btnReboot ); buttonlay->addWidget( btnReboot );
@ -999,130 +1029,164 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
KSMShutdownDlg::~KSMShutdownDlg() KSMShutdownDlg::~KSMShutdownDlg()
{ {
#ifdef COMPILE_HALBACKEND #ifdef COMPILE_HALBACKEND
if (m_halCtx) if (m_halCtx)
{ {
DBusError error; DBusError error;
dbus_error_init(&error); dbus_error_init(&error);
libhal_ctx_shutdown(m_halCtx, &error); libhal_ctx_shutdown(m_halCtx, &error);
libhal_ctx_free(m_halCtx); libhal_ctx_free(m_halCtx);
} }
#endif #endif
} }
void KSMShutdownDlg::slotLogout() void KSMShutdownDlg::slotLogout()
{ {
m_shutdownType = KApplication::ShutdownTypeNone; m_shutdownType = KApplication::ShutdownTypeNone;
accept(); accept();
} }
void KSMShutdownDlg::slotReboot() void KSMShutdownDlg::slotReboot()
{ {
// no boot option selected -> current // no boot option selected -> current
m_bootOption = TQString::null; m_bootOption = TQString::null;
m_shutdownType = KApplication::ShutdownTypeReboot; m_shutdownType = KApplication::ShutdownTypeReboot;
accept(); accept();
} }
void KSMShutdownDlg::slotReboot(int opt) void KSMShutdownDlg::slotReboot(int opt)
{ {
if (int(rebootOptions.size()) > opt) if (int(rebootOptions.size()) > opt)
m_bootOption = rebootOptions[opt]; m_bootOption = rebootOptions[opt];
m_shutdownType = KApplication::ShutdownTypeReboot; m_shutdownType = KApplication::ShutdownTypeReboot;
accept(); accept();
} }
void KSMShutdownDlg::slotHalt() void KSMShutdownDlg::slotHalt()
{ {
m_bootOption = TQString::null; m_bootOption = TQString::null;
m_shutdownType = KApplication::ShutdownTypeHalt; m_shutdownType = KApplication::ShutdownTypeHalt;
accept(); accept();
} }
void KSMShutdownDlg::slotSuspend() void KSMShutdownDlg::slotSuspend()
{ {
#ifdef WITH_UPOWER
if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock");
}
if( m_dbusConn.isConnected() ) {
TQT_DBusMessage msg = TQT_DBusMessage::methodCall(
"org.freedesktop.UPower",
"/org/freedesktop/UPower",
"org.freedesktop.UPower",
"Suspend");
m_dbusConn.sendWithReply(msg);
}
reject(); // continue on resume
#else
#ifdef COMPILE_HALBACKEND #ifdef COMPILE_HALBACKEND
if (m_lockOnResume) { if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock"); DCOPRef("kdesktop", "KScreensaverIface").send("lock");
} }
if (m_dbusConn) if (m_dbusConn)
{ {
DBusMessage *msg = dbus_message_new_method_call( DBusMessage *msg = dbus_message_new_method_call(
"org.freedesktop.Hal", "org.freedesktop.Hal",
"/org/freedesktop/Hal/devices/computer", "/org/freedesktop/Hal/devices/computer",
"org.freedesktop.Hal.Device.SystemPowerManagement", "org.freedesktop.Hal.Device.SystemPowerManagement",
"Suspend"); "Suspend");
int wakeup=0; int wakeup=0;
dbus_message_append_args(msg, DBUS_TYPE_INT32, &wakeup, DBUS_TYPE_INVALID); dbus_message_append_args(msg, DBUS_TYPE_INT32, &wakeup, DBUS_TYPE_INVALID);
dbus_connection_send(m_dbusConn, msg, NULL); dbus_connection_send(m_dbusConn, msg, NULL);
dbus_message_unref(msg); dbus_message_unref(msg);
} }
reject(); // continue on resume reject(); // continue on resume
#endif #endif
#endif // WITH_UPOWER
} }
void KSMShutdownDlg::slotHibernate() void KSMShutdownDlg::slotHibernate()
{ {
#ifdef WITH_UPOWER
if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock");
}
if( m_dbusConn.isConnected() ) {
TQT_DBusMessage msg = TQT_DBusMessage::methodCall(
"org.freedesktop.UPower",
"/org/freedesktop/UPower",
"org.freedesktop.UPower",
"Hibernate");
m_dbusConn.sendWithReply(msg);
}
reject(); // continue on resume
#else
#ifdef COMPILE_HALBACKEND #ifdef COMPILE_HALBACKEND
if (m_lockOnResume) { if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock"); DCOPRef("kdesktop", "KScreensaverIface").send("lock");
} }
if (m_dbusConn) if (m_dbusConn)
{ {
DBusMessage *msg = dbus_message_new_method_call( DBusMessage *msg = dbus_message_new_method_call(
"org.freedesktop.Hal", "org.freedesktop.Hal",
"/org/freedesktop/Hal/devices/computer", "/org/freedesktop/Hal/devices/computer",
"org.freedesktop.Hal.Device.SystemPowerManagement", "org.freedesktop.Hal.Device.SystemPowerManagement",
"Hibernate"); "Hibernate");
dbus_connection_send(m_dbusConn, msg, NULL); dbus_connection_send(m_dbusConn, msg, NULL);
dbus_message_unref(msg); dbus_message_unref(msg);
} }
reject(); // continue on resume reject(); // continue on resume
#endif #endif
#endif // WITH_UPOWER
} }
bool KSMShutdownDlg::confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, TQString& bootOption ) bool KSMShutdownDlg::confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, TQString& bootOption )
{ {
kapp->enableStyles(); kapp->enableStyles();
KSMShutdownDlg* l = new KSMShutdownDlg( 0, KSMShutdownDlg* l = new KSMShutdownDlg( 0,
//KSMShutdownFeedback::self(), //KSMShutdownFeedback::self(),
maysd, sdtype ); maysd, sdtype );
// Show dialog (will save the background in showEvent) // Show dialog (will save the background in showEvent)
TQSize sh = l->sizeHint(); TQSize sh = l->sizeHint();
TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos()); TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos());
l->move(rect.x() + (rect.width() - sh.width())/2, l->move(rect.x() + (rect.width() - sh.width())/2,
rect.y() + (rect.height() - sh.height())/2); rect.y() + (rect.height() - sh.height())/2);
bool result = l->exec(); bool result = l->exec();
sdtype = l->m_shutdownType; sdtype = l->m_shutdownType;
bootOption = l->m_bootOption; bootOption = l->m_bootOption;
delete l; delete l;
kapp->disableStyles(); kapp->disableStyles();
return result; return result;
} }
TQWidget* KSMShutdownIPDlg::showShutdownIP() TQWidget* KSMShutdownIPDlg::showShutdownIP()
{ {
kapp->enableStyles(); kapp->enableStyles();
KSMShutdownIPDlg* l = new KSMShutdownIPDlg( 0 ); KSMShutdownIPDlg* l = new KSMShutdownIPDlg( 0 );
kapp->disableStyles(); kapp->disableStyles();
return l; return l;
} }
KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent) KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent)
@ -1140,8 +1204,8 @@ KSMShutdownIPDlg::~KSMShutdownIPDlg()
} }
KSMDelayedPushButton::KSMDelayedPushButton( const KGuiItem &item, KSMDelayedPushButton::KSMDelayedPushButton( const KGuiItem &item,
TQWidget *parent, TQWidget *parent,
const char *name) const char *name)
: KPushButton( item, parent, name), pop(0), popt(0) : KPushButton( item, parent, name), pop(0), popt(0)
{ {
connect(this, TQT_SIGNAL(pressed()), TQT_SLOT(slotPressed())); connect(this, TQT_SIGNAL(pressed()), TQT_SLOT(slotPressed()));
@ -1159,7 +1223,7 @@ void KSMDelayedPushButton::setPopup(TQPopupMenu *p)
void KSMDelayedPushButton::slotPressed() void KSMDelayedPushButton::slotPressed()
{ {
if (pop) if (pop)
popt->start(TQApplication::startDragTime()); popt->start(TQApplication::startDragTime());
} }
void KSMDelayedPushButton::slotReleased() void KSMDelayedPushButton::slotReleased()
@ -1178,74 +1242,74 @@ void KSMDelayedPushButton::slotTimeout()
} }
KSMDelayedMessageBox::KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay ) KSMDelayedMessageBox::KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay )
: TimedLogoutDlg( 0, 0, true, (WFlags)WType_Popup ), m_remaining(confirmDelay) : TimedLogoutDlg( 0, 0, true, (WFlags)WType_Popup ), m_remaining(confirmDelay)
{ {
if ( sdtype == KApplication::ShutdownTypeHalt ) if ( sdtype == KApplication::ShutdownTypeHalt )
{ {
m_title->setText( i18n( "Would you like to turn off your computer?" ) ); m_title->setText( i18n( "Would you like to turn off your computer?" ) );
m_template = i18n( "This computer will turn off automatically\n" m_template = i18n( "This computer will turn off automatically\n"
"after %1 seconds." ); "after %1 seconds." );
m_logo->setPixmap( BarIcon( "exit", 48 ) ); m_logo->setPixmap( BarIcon( "exit", 48 ) );
} else if ( sdtype == KApplication::ShutdownTypeReboot ) } else if ( sdtype == KApplication::ShutdownTypeReboot )
{ {
if (bootOption.isEmpty()) if (bootOption.isEmpty())
m_title->setText( i18n( "Would you like to reboot your computer?" ) ); m_title->setText( i18n( "Would you like to reboot your computer?" ) );
else else
m_title->setText( i18n( "Would you like to reboot to \"%1\"?" ).arg(bootOption) ); m_title->setText( i18n( "Would you like to reboot to \"%1\"?" ).arg(bootOption) );
m_template = i18n( "This computer will reboot automatically\n" m_template = i18n( "This computer will reboot automatically\n"
"after %1 seconds." ); "after %1 seconds." );
m_logo->setPixmap( BarIcon( "reload", 48 ) ); m_logo->setPixmap( BarIcon( "reload", 48 ) );
} else { } else {
m_title->setText( i18n( "Would you like to end your current session?" ) ); m_title->setText( i18n( "Would you like to end your current session?" ) );
m_template = i18n( "This session will end\n" m_template = i18n( "This session will end\n"
"after %1 seconds automatically." ); "after %1 seconds automatically." );
m_logo->setPixmap( BarIcon( "previous", 48 ) ); m_logo->setPixmap( BarIcon( "previous", 48 ) );
} }
updateText(); updateText();
adjustSize(); adjustSize();
if ( double( height() ) / width() < 0.25 ) if ( double( height() ) / width() < 0.25 )
{ {
setFixedHeight( tqRound( width() * 0.3 ) ); setFixedHeight( tqRound( width() * 0.3 ) );
adjustSize(); adjustSize();
} }
TQTimer *timer = new TQTimer( this ); TQTimer *timer = new TQTimer( this );
timer->start( 1000 ); timer->start( 1000 );
connect( timer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateText() ) ); connect( timer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateText() ) );
KDialog::centerOnScreen(this); KDialog::centerOnScreen(this);
} }
void KSMDelayedMessageBox::updateText() void KSMDelayedMessageBox::updateText()
{ {
m_remaining--; m_remaining--;
if ( m_remaining == 0 ) if ( m_remaining == 0 )
{ {
accept(); accept();
return; return;
} }
m_text->setText( m_template.arg( m_remaining ) ); m_text->setText( m_template.arg( m_remaining ) );
} }
bool KSMDelayedMessageBox::showTicker( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay ) bool KSMDelayedMessageBox::showTicker( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay )
{ {
kapp->enableStyles(); kapp->enableStyles();
KSMDelayedMessageBox msg( sdtype, bootOption, confirmDelay ); KSMDelayedMessageBox msg( sdtype, bootOption, confirmDelay );
TQSize sh = msg.sizeHint(); TQSize sh = msg.sizeHint();
TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos()); TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos());
msg.move(rect.x() + (rect.width() - sh.width())/2, msg.move(rect.x() + (rect.width() - sh.width())/2,
rect.y() + (rect.height() - sh.height())/2); rect.y() + (rect.height() - sh.height())/2);
bool result = msg.exec(); bool result = msg.exec();
kapp->disableStyles(); kapp->disableStyles();
return result; return result;
} }
KSMPushButton::KSMPushButton( const KGuiItem &item, KSMPushButton::KSMPushButton( const KGuiItem &item,
TQWidget *parent, TQWidget *parent,
const char *name) const char *name)
: KPushButton( item, parent, name), : KPushButton( item, parent, name),
m_pressed(false) m_pressed(false)
{ {
setDefault( false ); setDefault( false );
setAutoDefault ( false ); setAutoDefault ( false );
@ -1256,19 +1320,19 @@ void KSMPushButton::keyPressEvent( TQKeyEvent* e )
{ {
switch ( e->key() ) switch ( e->key() )
{ {
case Key_Enter: case Key_Enter:
case Key_Return: case Key_Return:
case Key_Space: case Key_Space:
m_pressed = TRUE; m_pressed = TRUE;
setDown(true); setDown(true);
emit pressed(); emit pressed();
break; break;
case Key_Escape: case Key_Escape:
e->ignore(); e->ignore();
break; break;
default: default:
e->ignore(); e->ignore();
} }
TQPushButton::keyPressEvent(e); TQPushButton::keyPressEvent(e);
} }
@ -1303,7 +1367,7 @@ void KSMPushButton::keyReleaseEvent( TQKeyEvent* e )
FlatButton::FlatButton( TQWidget *parent, const char *name ) FlatButton::FlatButton( TQWidget *parent, const char *name )
: TQToolButton( parent, name/*, TQt::WNoAutoErase*/ ), : TQToolButton( parent, name/*, TQt::WNoAutoErase*/ ),
m_pressed(false) m_pressed(false)
{ {
init(); init();
} }

@ -1,6 +1,7 @@
/***************************************************************** /*****************************************************************
ksmserver - the KDE session management server ksmserver - the KDE session management server
Copyright (C) 2012 Serghei Amelian <serghei.amelian@gmail.com>
Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org> Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
******************************************************************/ ******************************************************************/
@ -32,129 +33,138 @@ class KAction;
#include <config.h> #include <config.h>
#ifndef NO_QT3_DBUS_SUPPORT #ifdef WITH_UPOWER
/* We acknowledge the the dbus API is unstable */ #include <tqdbusconnection.h>
#define DBUS_API_SUBJECT_TO_CHANGE #else
#include <dbus/connection.h> #warning test
#endif // NO_QT3_DBUS_SUPPORT #ifndef NO_QT3_DBUS_SUPPORT
/* We acknowledge the the dbus API is unstable */
#ifdef COMPILE_HALBACKEND #define DBUS_API_SUBJECT_TO_CHANGE
#include <hal/libhal.h> #include <dbus/connection.h>
#endif #endif // NO_QT3_DBUS_SUPPORT
#ifdef COMPILE_HALBACKEND
#include <hal/libhal.h>
#endif
#endif // WITH_UPOWER
// The (singleton) widget that makes/fades the desktop gray. // The (singleton) widget that makes/fades the desktop gray.
class KSMShutdownFeedback : public TQWidget class KSMShutdownFeedback : public TQWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
static void start() { s_pSelf = new KSMShutdownFeedback(); } static void start() { s_pSelf = new KSMShutdownFeedback(); }
static void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; } static void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; }
static KSMShutdownFeedback * self() { return s_pSelf; } static KSMShutdownFeedback * self() { return s_pSelf; }
protected: protected:
~KSMShutdownFeedback() {} ~KSMShutdownFeedback() {}
private slots: private slots:
void slotPaintEffect(); void slotPaintEffect();
private: private:
static KSMShutdownFeedback * s_pSelf; static KSMShutdownFeedback * s_pSelf;
KSMShutdownFeedback(); KSMShutdownFeedback();
int m_currentY; int m_currentY;
TQPixmap m_root; TQPixmap m_root;
void fadeBack( void ); void fadeBack( void );
float m_grayOpacity; float m_grayOpacity;
float m_compensation; float m_compensation;
bool m_fadeBackwards; bool m_fadeBackwards;
bool m_readDelayComplete; bool m_readDelayComplete;
TQImage m_unfadedImage; TQImage m_unfadedImage;
TQImage m_grayImage; TQImage m_grayImage;
TQTime m_fadeTime; TQTime m_fadeTime;
int m_rowsDone; int m_rowsDone;
KPixmapIO m_pmio; KPixmapIO m_pmio;
bool m_greyImageCreated; bool m_greyImageCreated;
}; };
// The (singleton) widget that shows either pretty pictures or a black screen during logout // The (singleton) widget that shows either pretty pictures or a black screen during logout
class KSMShutdownIPFeedback : public TQWidget class KSMShutdownIPFeedback : public TQWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
static void start() { s_pSelf = new KSMShutdownIPFeedback(); } static void start() { s_pSelf = new KSMShutdownIPFeedback(); }
static void showit() { if ( s_pSelf != 0L ) s_pSelf->showNow(); } static void showit() { if ( s_pSelf != 0L ) s_pSelf->showNow(); }
static void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; } static void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; }
static KSMShutdownIPFeedback * self() { return s_pSelf; } static KSMShutdownIPFeedback * self() { return s_pSelf; }
static bool ispainted() { if ( s_pSelf != 0L ) return s_pSelf->m_isPainted; else return false; } static bool ispainted() { if ( s_pSelf != 0L ) return s_pSelf->m_isPainted; else return false; }
protected: protected:
~KSMShutdownIPFeedback(); ~KSMShutdownIPFeedback();
public slots: public slots:
void slotPaintEffect(); void slotPaintEffect();
void slotSetBackgroundPixmap(const TQPixmap &); void slotSetBackgroundPixmap(const TQPixmap &);
private: private:
static KSMShutdownIPFeedback * s_pSelf; static KSMShutdownIPFeedback * s_pSelf;
KSMShutdownIPFeedback(); KSMShutdownIPFeedback();
int m_currentY; int m_currentY;
TQPixmap m_root; TQPixmap m_root;
void fadeBack( void ); void fadeBack( void );
void showNow( void ); void showNow( void );
int m_timeout; int m_timeout;
bool m_isPainted; bool m_isPainted;
KRootPixmap* m_sharedRootPixmap; KRootPixmap* m_sharedRootPixmap;
TQPixmap m_rootPixmap; TQPixmap m_rootPixmap;
int mPixmapTimeout; int mPixmapTimeout;
}; };
// The confirmation dialog // The confirmation dialog
class KSMShutdownDlg : public TQDialog class KSMShutdownDlg : public TQDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
static bool confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, TQString& bopt ); static bool confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, TQString& bopt );
public slots: public slots:
void slotLogout(); void slotLogout();
void slotHalt(); void slotHalt();
void slotReboot(); void slotReboot();
void slotReboot(int); void slotReboot(int);
void slotSuspend(); void slotSuspend();
void slotHibernate(); void slotHibernate();
protected: protected:
~KSMShutdownDlg(); ~KSMShutdownDlg();
private: private:
KSMShutdownDlg( TQWidget* parent, bool maysd, KApplication::ShutdownType sdtype ); KSMShutdownDlg( TQWidget* parent, bool maysd, KApplication::ShutdownType sdtype );
KApplication::ShutdownType m_shutdownType; KApplication::ShutdownType m_shutdownType;
TQString m_bootOption; TQString m_bootOption;
TQPopupMenu *targets; TQPopupMenu *targets;
TQStringList rebootOptions; TQStringList rebootOptions;
#ifdef WITH_UPOWER
TQT_DBusConnection m_dbusConn;
#else
#ifdef COMPILE_HALBACKEND #ifdef COMPILE_HALBACKEND
LibHalContext* m_halCtx; LibHalContext* m_halCtx;
DBusConnection *m_dbusConn; DBusConnection *m_dbusConn;
#endif #endif
bool m_lockOnResume; #endif // WITH_UPOWER
bool m_lockOnResume;
}; };
// The shutdown-in-progress dialog // The shutdown-in-progress dialog
class KSMShutdownIPDlg : public KSMModalDialog class KSMShutdownIPDlg : public KSMModalDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
static TQWidget* showShutdownIP(); static TQWidget* showShutdownIP();
protected: protected:
~KSMShutdownIPDlg(); ~KSMShutdownIPDlg();
private: private:
KSMShutdownIPDlg( TQWidget* parent ); KSMShutdownIPDlg( TQWidget* parent );
}; };
class KSMDelayedPushButton : public KPushButton class KSMDelayedPushButton : public KPushButton
@ -227,18 +237,18 @@ class TQLabel;
class KSMDelayedMessageBox : public TimedLogoutDlg class KSMDelayedMessageBox : public TimedLogoutDlg
{ {
Q_OBJECT Q_OBJECT
public: public:
KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay ); KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay );
static bool showTicker( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay ); static bool showTicker( KApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay );
protected slots: protected slots:
void updateText(); void updateText();
private: private:
TQString m_template; TQString m_template;
int m_remaining; int m_remaining;
}; };
#endif #endif

@ -30,31 +30,20 @@ class KAction;
#include <kapplication.h> #include <kapplication.h>
#include <kpixmapio.h> #include <kpixmapio.h>
#include <config.h>
#ifndef NO_QT3_DBUS_SUPPORT
/* We acknowledge the the dbus API is unstable */
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/connection.h>
#endif // NO_QT3_DBUS_SUPPORT
#ifdef COMPILE_HALBACKEND
#include <hal/libhal.h>
#endif
// The startup-in-progress dialog // The startup-in-progress dialog
class KSMStartupIPDlg : public KSMModalDialog class KSMStartupIPDlg : public KSMModalDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
static TQWidget* showStartupIP(); static TQWidget* showStartupIP();
protected: protected:
~KSMStartupIPDlg(); ~KSMStartupIPDlg();
private: private:
KSMStartupIPDlg( TQWidget* parent ); KSMStartupIPDlg( TQWidget* parent );
}; };
#endif #endif

Loading…
Cancel
Save