summaryrefslogtreecommitdiffstats
path: root/ksmserver
diff options
context:
space:
mode:
Diffstat (limited to 'ksmserver')
-rw-r--r--ksmserver/CMakeLists.txt5
-rw-r--r--ksmserver/Makefile.am6
-rw-r--r--ksmserver/global.h4
-rw-r--r--ksmserver/legacy.cpp2
-rw-r--r--ksmserver/server.cpp24
-rw-r--r--ksmserver/server.h6
-rw-r--r--ksmserver/shutdown.cpp16
-rw-r--r--ksmserver/shutdowndlg.cpp224
-rw-r--r--ksmserver/shutdowndlg.h30
-rw-r--r--ksmserver/startup.cpp8
-rw-r--r--ksmserver/startupdlg.h2
11 files changed, 93 insertions, 234 deletions
diff --git a/ksmserver/CMakeLists.txt b/ksmserver/CMakeLists.txt
index 8578b01c1..aa6681f28 100644
--- a/ksmserver/CMakeLists.txt
+++ b/ksmserver/CMakeLists.txt
@@ -25,13 +25,10 @@ include_directories(
${CMAKE_SOURCE_DIR}/tdmlib
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
- ${DBUS_TQT_INCLUDE_DIRS}
- ${HAL_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
- ${DBUS_TQT_LIBRARY_DIRS}
)
@@ -50,5 +47,5 @@ tde_add_tdeinit_executable( ksmserver AUTOMOC
main.cpp server.cpp shutdowndlg.cpp startupdlg.cpp
legacy.cpp startup.cpp shutdown.cpp client.cpp
KSMServerInterface.skel server.skel timed.ui
- LINK dmctl-static tdeui-shared tdersync-shared ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES}
+ LINK dmctl-static tdeui-shared tdersync-shared ${TDEHW_LIBRARIES}
)
diff --git a/ksmserver/Makefile.am b/ksmserver/Makefile.am
index 8f1a236e4..2c2fa237d 100644
--- a/ksmserver/Makefile.am
+++ b/ksmserver/Makefile.am
@@ -17,7 +17,7 @@
SUBDIRS = .
-INCLUDES= -I$(top_srcdir)/tdmlib $(all_includes) $(HAL_INCS) $(DBUS_INCS)
+INCLUDES= -I$(top_srcdir)/tdmlib $(all_includes)
bin_PROGRAMS =
lib_LTLIBRARIES =
@@ -31,7 +31,7 @@ ksmserver_la_SOURCES = main.cpp server.cpp shutdowndlg.cpp \
KSMServerInterface.skel server.skel timed.ui
ksmserver_la_LDFLAGS = $(all_libraries) -avoid-version -module
-ksmserver_la_LIBADD = ../tdmlib/libdmctl.la $(LIB_TDEUI) $(HAL_LIBS) $(DBUS_LIBS)
+ksmserver_la_LIBADD = ../tdmlib/libdmctl.la $(LIB_TDEUI)
picsdir = $(kde_datadir)/ksmserver/pics
pics_DATA = shutdownkonq.png
@@ -44,7 +44,7 @@ updatedir = $(kde_datadir)/tdeconf_update
EXTRA_PROGRAMS = testsh
testsh_SOURCES = test.cpp timed.ui
testsh_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor
-testsh_LDADD = $(LIB_TDEUI) shutdowndlg.lo ../tdmlib/libdmctl.la $(HAL_LIBS) $(DBUS_LIBS)
+testsh_LDADD = $(LIB_TDEUI) shutdowndlg.lo ../tdmlib/libdmctl.la
messages:
$(XGETTEXT) *.cpp -o $(podir)/ksmserver.pot
diff --git a/ksmserver/global.h b/ksmserver/global.h
index b76a8b363..326587ac6 100644
--- a/ksmserver/global.h
+++ b/ksmserver/global.h
@@ -10,8 +10,4 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
#define KSMVendorString "KDE"
#define KSMReleaseString "1.0"
-#ifdef USE_QT4
-#define NO_QT3_DBUS_SUPPORT
-#endif
-
#endif
diff --git a/ksmserver/legacy.cpp b/ksmserver/legacy.cpp
index 80f4e0984..1fbba6c3b 100644
--- a/ksmserver/legacy.cpp
+++ b/ksmserver/legacy.cpp
@@ -151,7 +151,7 @@ void KSMServer::performLegacySessionSave()
ev.xclient.message_type = wm_protocols;
ev.xclient.format = 32;
ev.xclient.data.l[0] = wm_save_yourself;
- ev.xclient.data.l[1] = GET_QT_X_TIME();
+ ev.xclient.data.l[1] = get_tqt_x_time();
XSelectInput(newdisplay, w, PropertyChangeMask|StructureNotifyMask);
XSendEvent(newdisplay, w, False, 0, &ev);
}
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index 505865c54..be5ed0bcc 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -599,13 +599,13 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag
clientInteracting = 0;
xonCommand = config->readEntry( "xonCommand", "xon" );
-#ifdef __TDE_HAVE_TDEHWLIB
+#ifdef WITH_TDEHWLIB
hwDevices = TDEGlobal::hardwareDevices();
#endif
- connect( &knotifyTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( knotifyTimeout()));
- connect( &startupSuspendTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( startupSuspendTimeout()));
- connect( &pendingShutdown, TQT_SIGNAL( timeout()), TQT_SLOT( pendingShutdownTimeout()));
+ connect( &knotifyTimeoutTimer, TQ_SIGNAL( timeout()), TQ_SLOT( knotifyTimeout()));
+ connect( &startupSuspendTimeoutTimer, TQ_SIGNAL( timeout()), TQ_SLOT( startupSuspendTimeout()));
+ connect( &pendingShutdown, TQ_SIGNAL( timeout()), TQ_SLOT( pendingShutdownTimeout()));
only_local = _only_local;
#ifdef HAVE__ICETRANSNOLISTEN
@@ -676,7 +676,7 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag
for ( int i = 0; i < numTransports; i++) {
con = new KSMListener( listenObjs[i] );
listener.append( con );
- connect( con, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( newConnection(int) ) );
+ connect( con, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( newConnection(int) ) );
}
signal(SIGHUP, sighandler);
@@ -684,11 +684,11 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag
signal(SIGINT, sighandler);
signal(SIGPIPE, SIG_IGN);
- connect( &notificationTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( notificationTimeout() ) );
- connect( &protectionTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( protectionTimerTick() ) );
- connect( &restoreTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( tryRestoreNext() ) );
- connect( &shutdownTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( timeoutQuit() ) );
- connect( kapp, TQT_SIGNAL( shutDown() ), this, TQT_SLOT( cleanUp() ) );
+ connect( &notificationTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( notificationTimeout() ) );
+ connect( &protectionTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( protectionTimerTick() ) );
+ connect( &restoreTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( tryRestoreNext() ) );
+ connect( &shutdownTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( timeoutQuit() ) );
+ connect( kapp, TQ_SIGNAL( shutDown() ), this, TQ_SLOT( cleanUp() ) );
}
KSMServer::~KSMServer()
@@ -723,7 +723,7 @@ void KSMServer::cleanUp()
DM().shutdown( shutdownType, shutdownMode, bootOption );
}
else {
-#ifdef __TDE_HAVE_TDEHWLIB
+#ifdef WITH_TDEHWLIB
TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice();
if (rootDevice) {
if (shutdownType == TDEApplication::ShutdownTypeHalt) {
@@ -742,7 +742,7 @@ void KSMServer::cleanUp()
void* KSMServer::watchConnection( IceConn iceConn )
{
KSMConnection* conn = new KSMConnection( iceConn );
- connect( conn, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( processData(int) ) );
+ connect( conn, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( processData(int) ) );
return (void*) conn;
}
diff --git a/ksmserver/server.h b/ksmserver/server.h
index 7273f057e..fdf08cded 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -21,7 +21,7 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
#include <tqtimer.h>
#include <dcopobject.h>
-#ifdef __TDE_HAVE_TDEHWLIB
+#ifdef WITH_TDEHWLIB
#include <tdehardwaredevices.h>
#endif
@@ -49,7 +49,7 @@ typedef TQMap<WId,SMData> WindowMap;
class KSMServer : public TQObject, public KSMServerInterface
{
-Q_OBJECT
+TQ_OBJECT
K_DCOP
k_dcop:
void notifySlot(TQString,TQString,TQString,TQString,TQString,int,int,int,int);
@@ -253,7 +253,7 @@ private:
WindowMap legacyWindows;
-#ifdef __TDE_HAVE_TDEHWLIB
+#ifdef WITH_TDEHWLIB
TDEHardwareDevices* hwDevices;
#endif
int initialClientCount;
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 8b14ceaf1..f62894d72 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -152,7 +152,7 @@ bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd, bool &mayrb,
mayrb = true;
}
else {
-#ifdef __TDE_HAVE_TDEHWLIB
+#ifdef WITH_TDEHWLIB
TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice();
if (rootDevice) {
if (rootDevice->canPowerOff()) {
@@ -241,7 +241,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
// If this is not done the desktop of the locked session will be shown after suspend/hibernate until the lock fully engages!
kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "lock()", TQCString(""), replyType, replyData);
}
-#ifdef __TDE_HAVE_TDEHWLIB
+#ifdef WITH_TDEHWLIB
TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice();
if (rootDevice) {
switch (selection) {
@@ -272,8 +272,8 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
if (showLogoutStatusDlg) {
shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP();
if (shutdownNotifierIPDlg) {
- connect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown()));
- connect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself()));
+ connect(shutdownNotifierIPDlg, TQ_SIGNAL(abortLogoutClicked()), this, TQ_SLOT(cancelShutdown()));
+ connect(shutdownNotifierIPDlg, TQ_SIGNAL(skipNotificationClicked()), this, TQ_SLOT(forceSkipSaveYourself()));
static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Notifying applications of logout request..."));
notificationTimer.start( KSMSERVER_NOTIFICATION_MANUAL_OPTIONS_TIMEOUT, true );
}
@@ -289,7 +289,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
// Set the real desktop background to black so that exit looks
// clean regardless of what was on "our" desktop.
if (!showLogoutStatusDlg) {
- TQT_TQWIDGET(kapp->desktop())->setBackgroundColor( Qt::black );
+ kapp->desktop()->setBackgroundColor( TQt::black );
}
state = Shutdown;
wmPhase1WaitingCount = 0;
@@ -764,8 +764,8 @@ void KSMServer::completeShutdownOrCheckpoint()
if (!shutdownNotifierIPDlg) {
shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP();
if (shutdownNotifierIPDlg) {
- connect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown()));
- connect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself()));
+ connect(shutdownNotifierIPDlg, TQ_SIGNAL(abortLogoutClicked()), this, TQ_SLOT(cancelShutdown()));
+ connect(shutdownNotifierIPDlg, TQ_SIGNAL(skipNotificationClicked()), this, TQ_SLOT(forceSkipSaveYourself()));
}
}
while (!KSMShutdownIPFeedback::ispainted()) {
@@ -963,7 +963,7 @@ void KSMServer::killWM()
}
if( iswm ) {
completeKillingWM();
- TQTimer::singleShot( 5000, this, TQT_SLOT( timeoutWMQuit() ) );
+ TQTimer::singleShot( 5000, this, TQ_SLOT( timeoutWMQuit() ) );
}
else {
killingCompleted();
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index dc1d4dfcb..64bf4a407 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -6,6 +6,10 @@ Copyright (C) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
******************************************************************/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "shutdowndlg.h"
#include <tqapplication.h>
@@ -33,7 +37,7 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
#include <tdelocale.h>
#include <tdeconfig.h>
#include <tdeapplication.h>
-#ifdef __TDE_HAVE_TDEHWLIB
+#ifdef WITH_TDEHWLIB
#include <tdehardwaredevices.h>
#endif
#include <kdebug.h>
@@ -101,7 +105,7 @@ KSMShutdownFeedback::KSMShutdownFeedback()
m_unfadedImage = m_grayImage;
resize(0, 0);
setShown(true);
- TQTimer::singleShot( 500, this, TQT_SLOT( slotPaintEffect() ) );
+ TQTimer::singleShot( 500, this, TQ_SLOT( slotPaintEffect() ) );
}
// called after stopping shutdown-feedback -> smooth fade-back to color-mode
@@ -239,7 +243,7 @@ void KSMShutdownFeedback::slotPaintEffect()
bitBlt( this, 0, start_y1, &img );
}
- TQTimer::singleShot( 5, this, TQT_SLOT( slotPaintEffect() ) );
+ TQTimer::singleShot( 5, this, TQ_SLOT( slotPaintEffect() ) );
}
else {
// if slotPaintEffect() is called first time, we have to initialize the gray image
@@ -366,7 +370,7 @@ void KSMShutdownFeedback::slotPaintEffect()
bitBlt( this, 0, start_y1, &img );
}
- TQTimer::singleShot( 5, this, TQT_SLOT( slotPaintEffect() ) );
+ TQTimer::singleShot( 5, this, TQ_SLOT( slotPaintEffect() ) );
}
}
else {
@@ -482,7 +486,7 @@ void KSMShutdownFeedback::slotPaintEffect()
bitBlt( this, 0, start_y1, &img );
}
- TQTimer::singleShot( 1, this, TQT_SLOT( slotPaintEffect() ) );
+ TQTimer::singleShot( 1, this, TQ_SLOT( slotPaintEffect() ) );
}
else {
if ( m_currentY >= height() ) {
@@ -507,13 +511,13 @@ void KSMShutdownFeedback::slotPaintEffect()
KPixmap pixmap;
pixmap = TQPixmap(TQPixmap::grabWindow( tqt_xrootwin(), 0, m_currentY, width(), 10 ));
TQImage image = pixmap.convertToImage();
- KImageEffect::blend( Qt::black, image, 0.4 );
+ KImageEffect::blend( TQt::black, image, 0.4 );
KImageEffect::toGray( image, true );
pixmap.convertFromImage( image );
bitBlt( this, 0, m_currentY, &pixmap );
bitBlt( &m_root, 0, m_currentY, &pixmap );
m_currentY += 10;
- TQTimer::singleShot( 1, this, TQT_SLOT( slotPaintEffect() ) );
+ TQTimer::singleShot( 1, this, TQ_SLOT( slotPaintEffect() ) );
}
}
}
@@ -525,7 +529,7 @@ void KSMShutdownFeedback::slotPaintEffect()
KSMShutdownIPFeedback * KSMShutdownIPFeedback::s_pSelf = 0L;
KSMShutdownIPFeedback::KSMShutdownIPFeedback()
-: TQWidget( 0L, "systemmodaldialogclass", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop ), m_timeout(0), m_isPainted(false), m_paintedFromSharedRootPixmap(false), m_sharedRootPixmap(NULL), mPixmapTimeout(0)
+: TQWidget( 0L, "systemmodaldialogclass", TQt::WStyle_Customize | TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop ), m_timeout(0), m_isPainted(false), m_paintedFromSharedRootPixmap(false), m_sharedRootPixmap(NULL), mPixmapTimeout(0)
{
setShown(false);
@@ -535,7 +539,7 @@ KSMShutdownIPFeedback::KSMShutdownIPFeedback()
m_sharedRootPixmap = new KRootPixmap(this);
m_sharedRootPixmap->setCustomPainting(true);
- connect(m_sharedRootPixmap, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQT_SLOT(slotSetBackgroundPixmap(const TQPixmap &)));
+ connect(m_sharedRootPixmap, TQ_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQ_SLOT(slotSetBackgroundPixmap(const TQPixmap &)));
if (TQPaintDevice::x11AppDepth() == 32) {
// The shared pixmap is 24 bits, but we are 32 bits
@@ -567,13 +571,13 @@ void KSMShutdownIPFeedback::showNow()
if (!m_isPainted) {
setGeometry( TQApplication::desktop()->geometry() );
- TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) );
+ TQTimer::singleShot( 0, this, TQ_SLOT(slotPaintEffect()) );
}
}
void KSMShutdownIPFeedback::enableExports()
{
-#ifdef Q_WS_X11
+#ifdef TQ_WS_X11
kdDebug(270) << k_lineinfo << "activating background exports.\n";
DCOPClient *client = kapp->dcopClient();
if (!client->isAttached()) {
@@ -628,7 +632,7 @@ void KSMShutdownIPFeedback::slotPaintEffect()
m_sharedRootPixmap->start();
}
- TQTimer::singleShot( 100, this, SLOT(slotPaintEffect()) );
+ TQTimer::singleShot( 100, this, TQ_SLOT(slotPaintEffect()) );
mPixmapTimeout++;
return;
}
@@ -643,13 +647,13 @@ void KSMShutdownIPFeedback::slotPaintEffect()
}
if ((pm.isNull()) || (pm.width() != kapp->desktop()->width()) || (pm.height() != kapp->desktop()->height())) {
if (mPixmapTimeout < 10) {
- TQTimer::singleShot( 100, this, SLOT(slotPaintEffect()) );
+ TQTimer::singleShot( 100, this, TQ_SLOT(slotPaintEffect()) );
mPixmapTimeout++;
return;
}
else {
pm = TQPixmap(kapp->desktop()->width(), kapp->desktop()->height());
- pm.fill(Qt::black);
+ pm.fill(TQt::black);
m_paintedFromSharedRootPixmap = false;
}
}
@@ -753,7 +757,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
{
// first line of buttons
hbuttonbox = new TQHBoxLayout( hbox, factor * KDialog::spacingHint() );
- hbuttonbox->setAlignment( Qt::AlignHCenter );
+ hbuttonbox->setAlignment( TQt::AlignHCenter );
// End session
FlatButton* btnLogout = new FlatButton( frame );
btnLogout->setTextLabel( TQString("&") + i18n("Log out"), false );
@@ -762,7 +766,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
int i = btnLogout->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnLogout->setAccel( "ALT+" + btnLogout->textLabel().lower()[i+1] ) ;
hbuttonbox->addWidget ( btnLogout );
- connect(btnLogout, TQT_SIGNAL(clicked()), TQT_SLOT(slotLogout()));
+ connect(btnLogout, TQ_SIGNAL(clicked()), TQ_SLOT(slotLogout()));
}
else
{
@@ -772,7 +776,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
hbox->addWidget( lfrm, AlignCenter );
buttonlay = new TQVBoxLayout( hbox, factor * KDialog::spacingHint() );
- buttonlay->setAlignment( Qt::AlignHCenter );
+ buttonlay->setAlignment( TQt::AlignHCenter );
TQLabel* icon = new TQLabel( lfrm );
if (TDEConfigGroup(TDEGlobal::config(), "Logout").readBoolEntry("doNotUseKonqyPicture", false)) {
@@ -790,13 +794,9 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
TQToolTip::add( btnLogout, i18n( "<qt><p>Log out of the current session to login as a different user.</p></qt>" ) );
btnFont = btnLogout->font();
buttonlay->addWidget( btnLogout );
- connect(btnLogout, TQT_SIGNAL(clicked()), TQT_SLOT(slotLogout()));
+ connect(btnLogout, TQ_SIGNAL(clicked()), TQ_SLOT(slotLogout()));
}
-#ifdef COMPILE_HALBACKEND
- m_halCtx = NULL;
-#endif
-
if ((maysd) || (mayrb)) {
// respect lock on resume & disable suspend/hibernate settings
@@ -811,70 +811,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
bool canHibernate = false;
bool canHybridSuspend = false;
-#if defined(COMPILE_HALBACKEND)
- // Query HAL for suspend/resume support
- m_halCtx = libhal_ctx_new();
-
- DBusError error;
- dbus_error_init(&error);
- m_dbusConn = dbus_connection_open_private(DBUS_SYSTEM_BUS, &error);
- if (!m_dbusConn)
- {
- dbus_error_free(&error);
- libhal_ctx_free(m_halCtx);
- m_halCtx = NULL;
- }
- else
- {
- dbus_bus_register(m_dbusConn, &error);
- if (dbus_error_is_set(&error))
- {
- dbus_error_free(&error);
- libhal_ctx_free(m_halCtx);
- m_dbusConn = NULL;
- m_halCtx = NULL;
- }
- else
- {
- libhal_ctx_set_dbus_connection(m_halCtx, m_dbusConn);
- if (!libhal_ctx_init(m_halCtx, &error))
- {
- if (dbus_error_is_set(&error))
- dbus_error_free(&error);
- libhal_ctx_free(m_halCtx);
- m_dbusConn = NULL;
- m_halCtx = NULL;
- }
- }
- }
-
- if (m_halCtx)
- {
- if (libhal_device_get_property_bool(m_halCtx,
- "/org/freedesktop/Hal/devices/computer",
- "power_management.can_suspend",
- NULL))
- {
- canSuspend = true;
- }
-
- if (libhal_device_get_property_bool(m_halCtx,
- "/org/freedesktop/Hal/devices/computer",
- "power_management.can_hibernate",
- NULL))
- {
- canHibernate = true;
- }
-
- if (libhal_device_get_property_bool(m_halCtx,
- "/org/freedesktop/Hal/devices/computer",
- "power_management.can_suspend_hybrid",
- NULL))
- {
- canHybridSuspend = true;
- }
- }
-#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND
+#if defined(WITH_TDEHWLIB)
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice();
if (rootDevice) {
canFreeze = rootDevice->canFreeze();
@@ -888,7 +825,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
canHibernate = false;
canHybridSuspend = false;
}
-#endif // COMPILE_HALBACKEND
+#endif
if(doUbuntuLogout) {
// Ubuntu style logout window
@@ -904,7 +841,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
int i = btnFreeze->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnFreeze->setAccel( "ALT+" + btnFreeze->textLabel().lower()[i+1] ) ;
hbuttonbox->addWidget ( btnFreeze );
- connect(btnFreeze, TQT_SIGNAL(clicked()), TQT_SLOT(slotFreeze()));
+ connect(btnFreeze, TQ_SIGNAL(clicked()), TQ_SLOT(slotFreeze()));
}
if (canSuspend && !disableSuspend)
@@ -920,7 +857,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
int i = btnSuspend->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnSuspend->setAccel( "ALT+" + btnSuspend->textLabel().lower()[i+1] ) ;
hbuttonbox->addWidget ( btnSuspend );
- connect(btnSuspend, TQT_SIGNAL(clicked()), TQT_SLOT(slotSuspend()));
+ connect(btnSuspend, TQ_SIGNAL(clicked()), TQ_SLOT(slotSuspend()));
}
if (canHibernate && !disableHibernate)
@@ -935,7 +872,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
int i = btnHibernate->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnHibernate->setAccel( "ALT+" + btnHibernate->textLabel().lower()[i+1] ) ;
hbuttonbox->addWidget ( btnHibernate );
- connect(btnHibernate, TQT_SIGNAL(clicked()), TQT_SLOT(slotHibernate()));
+ connect(btnHibernate, TQ_SIGNAL(clicked()), TQ_SLOT(slotHibernate()));
}
if (canHybridSuspend && !disableSuspend && !disableHibernate)
@@ -953,7 +890,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
int i = btnHybridSuspend->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnHybridSuspend->setAccel( "ALT+" + btnHybridSuspend->textLabel().lower()[i+1] ) ;
hbuttonbox->addWidget ( btnHybridSuspend );
- connect(btnHybridSuspend, TQT_SIGNAL(clicked()), TQT_SLOT(slotHybridSuspend()));
+ connect(btnHybridSuspend, TQ_SIGNAL(clicked()), TQ_SLOT(slotHybridSuspend()));
}
// Separator (within buttonlay)
@@ -961,7 +898,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
// bottom buttons
TQHBoxLayout* hbuttonbox2 = new TQHBoxLayout( vbox, factor * KDialog::spacingHint() );
- hbuttonbox2->setAlignment( Qt::AlignHCenter );
+ hbuttonbox2->setAlignment( TQt::AlignHCenter );
if (mayrb) {
// Reboot
@@ -972,7 +909,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
int i = btnReboot->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnReboot->setAccel( "ALT+" + btnReboot->textLabel().lower()[i+1] ) ;
hbuttonbox2->addWidget ( btnReboot);
- connect(btnReboot, TQT_SIGNAL(clicked()), TQT_SLOT(slotReboot()));
+ connect(btnReboot, TQ_SIGNAL(clicked()), TQ_SLOT(slotReboot()));
if ( sdtype == TDEApplication::ShutdownTypeReboot ) {
btnReboot->setFocus();
}
@@ -999,7 +936,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
}
btnReboot->setPopup(targets);
- connect( targets, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReboot(int)) );
+ connect( targets, TQ_SIGNAL(activated(int)), TQ_SLOT(slotReboot(int)) );
}
// BAD KARMA .. this code is copied line by line from standard konqy dialog [EOF]
}
@@ -1013,7 +950,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
int i = btnHalt->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1
btnHalt->setAccel( "ALT+" + btnHalt->textLabel().lower()[i+1] ) ;
hbuttonbox2->addWidget ( btnHalt );
- connect(btnHalt, TQT_SIGNAL(clicked()), TQT_SLOT(slotHalt()));
+ connect(btnHalt, TQ_SIGNAL(clicked()), TQ_SLOT(slotHalt()));
if ( sdtype == TDEApplication::ShutdownTypeHalt ) {
btnHalt->setFocus();
}
@@ -1021,12 +958,12 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
// cancel buttonbox
TQHBoxLayout* hbuttonbox3 = new TQHBoxLayout( vbox, factor * KDialog::spacingHint() );
- hbuttonbox3->setAlignment( Qt::AlignRight );
+ hbuttonbox3->setAlignment( TQt::AlignRight );
// Back to Desktop
KSMPushButton* btnBack = new KSMPushButton( KStdGuiItem::cancel(), frame );
hbuttonbox3->addWidget( btnBack );
- connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
+ connect(btnBack, TQ_SIGNAL(clicked()), TQ_SLOT(reject()));
}
else
@@ -1038,7 +975,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
TQToolTip::add( btnHalt, i18n( "<qt><p>Log out of the current session and turn off the computer.</p></qt>" ) );
btnHalt->setFont( btnFont );
buttonlay->addWidget( btnHalt );
- connect(btnHalt, TQT_SIGNAL(clicked()), TQT_SLOT(slotHalt()));
+ connect(btnHalt, TQ_SIGNAL(clicked()), TQ_SLOT(slotHalt()));
if ( sdtype == TDEApplication::ShutdownTypeHalt || getenv("TDM_AUTOLOGIN") ) {
btnHalt->setFocus();
}
@@ -1051,7 +988,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
btnReboot->setFont( btnFont );
buttonlay->addWidget( btnReboot );
- connect(btnReboot, TQT_SIGNAL(clicked()), TQT_SLOT(slotReboot()));
+ connect(btnReboot, TQ_SIGNAL(clicked()), TQ_SLOT(slotReboot()));
if ( sdtype == TDEApplication::ShutdownTypeReboot ) {
btnReboot->setFocus();
}
@@ -1077,7 +1014,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
}
btnReboot->setPopup(targets);
- connect( targets, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReboot(int)) );
+ connect( targets, TQ_SIGNAL(activated(int)), TQ_SLOT(slotReboot(int)) );
}
}
@@ -1089,7 +1026,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
" almost instantly.</p><p>This correspond to ACPI S0 mode.</p></qt>"));
btnFreeze->setFont( btnFont );
buttonlay->addWidget( btnFreeze );
- connect(btnFreeze, TQT_SIGNAL(clicked()), TQT_SLOT(slotFreeze()));
+ connect(btnFreeze, TQ_SIGNAL(clicked()), TQ_SLOT(slotFreeze()));
}
if (canSuspend && !disableSuspend)
@@ -1101,7 +1038,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
"<p>Also known as Suspend-to-RAM mode.</p></qt>"));
btnSuspend->setFont( btnFont );
buttonlay->addWidget( btnSuspend );
- connect(btnSuspend, TQT_SIGNAL(clicked()), TQT_SLOT(slotSuspend()));
+ connect(btnSuspend, TQ_SIGNAL(clicked()), TQ_SLOT(slotSuspend()));
}
if (canHibernate && !disableHibernate)
@@ -1112,7 +1049,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
" considerable time is required to reactivate the system again.</p><p>This correspond to ACPI S4 mode.</p><p>Also known as Suspend-to-Disk mode.</p></qt>"));
btnHibernate->setFont( btnFont );
buttonlay->addWidget( btnHibernate );
- connect(btnHibernate, TQT_SIGNAL(clicked()), TQT_SLOT(slotHibernate()));
+ connect(btnHibernate, TQ_SIGNAL(clicked()), TQ_SLOT(slotHibernate()));
}
if (canHybridSuspend && !disableSuspend && !disableHibernate)
@@ -1126,7 +1063,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
"<p>Also known as Suspend-to-RAM + Suspend-to-Disk mode.</p></qt>"));
btnHybridSuspend->setFont( btnFont );
buttonlay->addWidget( btnHybridSuspend );
- connect(btnHybridSuspend, TQT_SIGNAL(clicked()), TQT_SLOT(slotHybridSuspend()));
+ connect(btnHybridSuspend, TQ_SIGNAL(clicked()), TQ_SLOT(slotHybridSuspend()));
}
buttonlay->addStretch( 1 );
@@ -1137,7 +1074,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
// Back to Desktop
KPushButton* btnBack = new KPushButton( KStdGuiItem::cancel(), frame );
buttonlay->addWidget( btnBack );
- connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
+ connect(btnBack, TQ_SIGNAL(clicked()), TQ_SLOT(reject()));
}
}
else {
@@ -1146,13 +1083,13 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
{
// cancel buttonbox
TQHBoxLayout* hbuttonbox3 = new TQHBoxLayout( vbox, factor * KDialog::spacingHint() );
- hbuttonbox3->setAlignment( Qt::AlignRight );
+ hbuttonbox3->setAlignment( TQt::AlignRight );
// Back to Desktop
KSMPushButton* btnBack = new KSMPushButton( KStdGuiItem::cancel(), frame );
hbuttonbox3->addWidget( btnBack );
- connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
+ connect(btnBack, TQ_SIGNAL(clicked()), TQ_SLOT(reject()));
}
else
{
@@ -1163,7 +1100,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
KPushButton* btnBack = new KPushButton( KStdGuiItem::cancel(), frame );
buttonlay->addWidget( btnBack );
- connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
+ connect(btnBack, TQ_SIGNAL(clicked()), TQ_SLOT(reject()));
}
}
}
@@ -1171,15 +1108,6 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
KSMShutdownDlg::~KSMShutdownDlg()
{
-#ifdef COMPILE_HALBACKEND
- if (m_halCtx)
- {
- DBusError error;
- dbus_error_init(&error);
- libhal_ctx_shutdown(m_halCtx, &error);
- libhal_ctx_free(m_halCtx);
- }
-#endif
}
@@ -1216,46 +1144,13 @@ void KSMShutdownDlg::slotHalt()
void KSMShutdownDlg::slotSuspend()
{
-#ifndef COMPILE_HALBACKEND
*m_selection = SuspendType::Suspend;
-#else
- if (m_dbusConn)
- {
- DBusMessage *msg = dbus_message_new_method_call(
- "org.freedesktop.Hal",
- "/org/freedesktop/Hal/devices/computer",
- "org.freedesktop.Hal.Device.SystemPowerManagement",
- "Suspend");
-
- int wakeup=0;
- dbus_message_append_args(msg, DBUS_TYPE_INT32, &wakeup, DBUS_TYPE_INVALID);
-
- dbus_connection_send(m_dbusConn, msg, NULL);
-
- dbus_message_unref(msg);
- }
-#endif
reject(); // continue on resume
}
void KSMShutdownDlg::slotHibernate()
{
-#ifndef COMPILE_HALBACKEND
*m_selection = SuspendType::Hibernate;
-#else
- if (m_dbusConn)
- {
- DBusMessage *msg = dbus_message_new_method_call(
- "org.freedesktop.Hal",
- "/org/freedesktop/Hal/devices/computer",
- "org.freedesktop.Hal.Device.SystemPowerManagement",
- "Hibernate");
-
- dbus_connection_send(m_dbusConn, msg, NULL);
-
- dbus_message_unref(msg);
- }
-#endif
reject(); // continue on resume
}
@@ -1267,22 +1162,7 @@ void KSMShutdownDlg::slotFreeze()
void KSMShutdownDlg::slotHybridSuspend()
{
-#ifndef COMPILE_HALBACKEND
*m_selection = SuspendType::HybridSuspend;
-#else
- if (m_dbusConn)
- {
- DBusMessage *msg = dbus_message_new_method_call(
- "org.freedesktop.Hal",
- "/org/freedesktop/Hal/devices/computer",
- "org.freedesktop.Hal.Device.SystemPowerManagement",
- "SuspendHybrid");
-
- dbus_connection_send(m_dbusConn, msg, NULL);
-
- dbus_message_unref(msg);
- }
-#endif
reject(); // continue on resume
}
@@ -1366,8 +1246,8 @@ KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent)
setNotificationActionButtonsSkipText(i18n("Skip Notification"));
m_button2->setText(i18n("Abort Logout"));
- connect(m_button1, SIGNAL(clicked()), this, SIGNAL(skipNotificationClicked()));
- connect(m_button2, SIGNAL(clicked()), this, SIGNAL(abortLogoutClicked()));
+ connect(m_button1, TQ_SIGNAL(clicked()), this, TQ_SIGNAL(skipNotificationClicked()));
+ connect(m_button2, TQ_SIGNAL(clicked()), this, TQ_SIGNAL(abortLogoutClicked()));
show();
setActiveWindow();
@@ -1384,10 +1264,10 @@ KSMDelayedPushButton::KSMDelayedPushButton( const KGuiItem &item,
const char *name)
: KPushButton( item, parent, name), pop(0), popt(0)
{
- connect(this, TQT_SIGNAL(pressed()), TQT_SLOT(slotPressed()));
- connect(this, TQT_SIGNAL(released()), TQT_SLOT(slotReleased()));
+ connect(this, TQ_SIGNAL(pressed()), TQ_SLOT(slotPressed()));
+ connect(this, TQ_SIGNAL(released()), TQ_SLOT(slotReleased()));
popt = new TQTimer(this);
- connect(popt, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()));
+ connect(popt, TQ_SIGNAL(timeout()), TQ_SLOT(slotTimeout()));
}
void KSMDelayedPushButton::setPopup(TQPopupMenu *p)
@@ -1449,7 +1329,7 @@ KSMDelayedMessageBox::KSMDelayedMessageBox( TDEApplication::ShutdownType sdtype,
}
TQTimer *timer = new TQTimer( this );
timer->start( 1000 );
- connect( timer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateText() ) );
+ connect( timer, TQ_SIGNAL( timeout() ), TQ_SLOT( updateText() ) );
KDialog::centerOnScreen(this);
}
@@ -1556,7 +1436,7 @@ void FlatButton::init()
setUsesBigPixmap(true);
setAutoRaise(true);
setTextPosition( TQToolButton::Under );
- setFocusPolicy(TQ_StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
}
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index 25ee60f77..7539fd75b 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -34,16 +34,6 @@ class TDEAction;
#include <config.h>
-#ifdef COMPILE_HALBACKEND
- #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
-
- #include <hal/libhal.h>
-#endif // COMPILE_HALBACKEND
-
namespace SuspendType {
enum SuspendType {
NotSpecified = 0,
@@ -58,7 +48,7 @@ enum SuspendType {
// The (singleton) widget that makes/fades the desktop gray.
class KSMShutdownFeedback : public TQWidget
{
- Q_OBJECT
+ TQ_OBJECT
public:
static void start() { s_pSelf = new KSMShutdownFeedback(); }
@@ -92,7 +82,7 @@ private:
// The (singleton) widget that shows either pretty pictures or a black screen during logout
class KSMShutdownIPFeedback : public TQWidget
{
- Q_OBJECT
+ TQ_OBJECT
public:
static void start() { s_pSelf = new KSMShutdownIPFeedback(); }
@@ -135,7 +125,7 @@ private:
// The confirmation dialog
class KSMShutdownDlg : public TQDialog
{
- Q_OBJECT
+ TQ_OBJECT
public:
static bool confirmShutdown( bool maysd, bool mayrb, TDEApplication::ShutdownType& sdtype, TQString& bopt, int* selection=0 );
@@ -159,10 +149,6 @@ private:
TQString m_bootOption;
TQPopupMenu *targets;
TQStringList rebootOptions;
-#ifdef COMPILE_HALBACKEND
- LibHalContext* m_halCtx;
- DBusConnection *m_dbusConn;
-#endif
bool m_lockOnResume;
int* m_selection;
};
@@ -170,7 +156,7 @@ private:
// The shutdown-in-progress dialog
class KSMShutdownIPDlg : public KSMModalDialog
{
- Q_OBJECT
+ TQ_OBJECT
public:
static TQWidget* showShutdownIP();
@@ -196,7 +182,7 @@ private:
class KSMDelayedPushButton : public KPushButton
{
- Q_OBJECT
+ TQ_OBJECT
public:
@@ -215,7 +201,7 @@ private:
class KSMPushButton : public KPushButton
{
- Q_OBJECT
+ TQ_OBJECT
public:
@@ -235,7 +221,7 @@ private:
class FlatButton : public TQToolButton
{
- Q_OBJECT
+ TQ_OBJECT
public:
@@ -264,7 +250,7 @@ class TQLabel;
class KSMDelayedMessageBox : public TimedLogoutDlg
{
- Q_OBJECT
+ TQ_OBJECT
public:
KSMDelayedMessageBox( TDEApplication::ShutdownType sdtype, const TQString &bootOption, int confirmDelay );
diff --git a/ksmserver/startup.cpp b/ksmserver/startup.cpp
index fb9e696ec..f3b0012ab 100644
--- a/ksmserver/startup.cpp
+++ b/ksmserver/startup.cpp
@@ -145,7 +145,7 @@ void KSMServer::restoreSession( TQString sessionName )
if ((showFancyLogin) && (!startupNotifierIPDlg)) {
startupNotifierIPDlg = KSMStartupIPDlg::showStartupIP();
}
- TQTimer::singleShot( 4000, this, TQT_SLOT( autoStart0() ) );
+ TQTimer::singleShot( 4000, this, TQ_SLOT( autoStart0() ) );
} else {
if ((showFancyLogin) && (!startupNotifierIPDlg)) {
startupNotifierIPDlg = KSMStartupIPDlg::showStartupIP();
@@ -192,7 +192,7 @@ void KSMServer::startDefaultSession()
if ((showFancyLogin) && (!startupNotifierIPDlg)) {
startupNotifierIPDlg = KSMStartupIPDlg::showStartupIP();
}
- TQTimer::singleShot( 4000, this, TQT_SLOT( autoStart0() ) );
+ TQTimer::singleShot( 4000, this, TQ_SLOT( autoStart0() ) );
}
@@ -226,7 +226,7 @@ void KSMServer::autoStart0Done()
connectDCOPSignal( "kcminit", "kcminit", "phase1Done()",
"kcmPhase1Done()", true);
state = KcmInitPhase1;
- TQTimer::singleShot( 10000, this, TQT_SLOT( kcmPhase1Timeout())); // protection
+ TQTimer::singleShot( 10000, this, TQ_SLOT( kcmPhase1Timeout())); // protection
DCOPRef( "kcminit", "kcminit" ).send( "runPhase1" );
}
@@ -333,7 +333,7 @@ void KSMServer::autoStart2()
DCOPRef( "kdesktop", "KDesktopIface" ).send( "runAutoStart" );
connectDCOPSignal( "kcminit", "kcminit", "phase2Done()",
"kcmPhase2Done()", true);
- TQTimer::singleShot( 10000, this, TQT_SLOT( kcmPhase2Timeout())); // protection
+ TQTimer::singleShot( 10000, this, TQ_SLOT( kcmPhase2Timeout())); // protection
DCOPRef( "kcminit", "kcminit" ).send( "runPhase2" );
if( !defaultSession())
restoreLegacySession( TDEGlobal::config());
diff --git a/ksmserver/startupdlg.h b/ksmserver/startupdlg.h
index a18a121d6..bc9327a09 100644
--- a/ksmserver/startupdlg.h
+++ b/ksmserver/startupdlg.h
@@ -34,7 +34,7 @@ class TDEAction;
// The startup-in-progress dialog
class KSMStartupIPDlg : public KSMModalDialog
{
- Q_OBJECT
+ TQ_OBJECT
public:
static TQWidget* showStartupIP();