|
Lines 52-58
Link Here
|
| 52 |
#include <kdebug.h> |
52 |
#include <kdebug.h> |
| 53 |
#include <tdeglobal.h> |
53 |
#include <tdeglobal.h> |
| 54 |
#include <tdeglobalsettings.h> |
54 |
#include <tdeglobalsettings.h> |
|
|
55 |
#ifdef __TDE_HAVE_TDEHWLIB |
| 55 |
#include <tdehardwaredevices.h> |
56 |
#include <tdehardwaredevices.h> |
|
|
57 |
#endif |
| 56 |
#include <kiconloader.h> |
58 |
#include <kiconloader.h> |
| 57 |
#include <klineedit.h> |
59 |
#include <klineedit.h> |
| 58 |
#include <tdelocale.h> |
60 |
#include <tdelocale.h> |
|
Lines 1359-1368
void KMenu::insertStaticExitItems()
Link Here
|
| 1359 |
} |
1361 |
} |
| 1360 |
|
1362 |
|
| 1361 |
bool maysd = false; |
1363 |
bool maysd = false; |
| 1362 |
#ifdef COMPILE_HALBACKEND |
1364 |
#if defined(COMPILE_HALBACKEND) |
| 1363 |
if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown()) |
1365 |
if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown()) |
| 1364 |
maysd = true; |
1366 |
maysd = true; |
| 1365 |
#else |
1367 |
#elif defined(__TDE_HAVE_TDEHWLIB) |
| 1366 |
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); |
1368 |
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); |
| 1367 |
if( rootDevice ) { |
1369 |
if( rootDevice ) { |
| 1368 |
maysd = rootDevice->canPowerOff(); |
1370 |
maysd = rootDevice->canPowerOff(); |
|
Lines 3792-3798
void KMenu::insertSuspendOption( int &nId, int &index )
Link Here
|
| 3792 |
bool suspend_freeze = false; |
3794 |
bool suspend_freeze = false; |
| 3793 |
bool standby = false; |
3795 |
bool standby = false; |
| 3794 |
bool suspend_disk = false; |
3796 |
bool suspend_disk = false; |
| 3795 |
#ifdef COMPILE_HALBACKEND |
3797 |
#if defined(COMPILE_HALBACKEND) |
| 3796 |
suspend_ram = libhal_device_get_property_bool(m_halCtx, |
3798 |
suspend_ram = libhal_device_get_property_bool(m_halCtx, |
| 3797 |
"/org/freedesktop/Hal/devices/computer", |
3799 |
"/org/freedesktop/Hal/devices/computer", |
| 3798 |
"power_management.can_suspend", |
3800 |
"power_management.can_suspend", |
|
Lines 3807-3813
void KMenu::insertSuspendOption( int &nId, int &index )
Link Here
|
| 3807 |
"/org/freedesktop/Hal/devices/computer", |
3809 |
"/org/freedesktop/Hal/devices/computer", |
| 3808 |
"power_management.can_hibernate", |
3810 |
"power_management.can_hibernate", |
| 3809 |
NULL); |
3811 |
NULL); |
| 3810 |
#else // COMPILE_HALBACKEND |
3812 |
#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND |
| 3811 |
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); |
3813 |
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); |
| 3812 |
if (rootDevice) { |
3814 |
if (rootDevice) { |
| 3813 |
suspend_ram = rootDevice->canSuspend(); |
3815 |
suspend_ram = rootDevice->canSuspend(); |
|
Lines 3868-3874
void KMenu::slotSuspend(int id)
Link Here
|
| 3868 |
DCOPRef("kdesktop", "KScreensaverIface").call("lock()"); |
3870 |
DCOPRef("kdesktop", "KScreensaverIface").call("lock()"); |
| 3869 |
} |
3871 |
} |
| 3870 |
|
3872 |
|
| 3871 |
#ifdef COMPILE_HALBACKEND |
3873 |
#if defined(COMPILE_HALBACKEND) |
| 3872 |
DBusMessage* msg = NULL; |
3874 |
DBusMessage* msg = NULL; |
| 3873 |
|
3875 |
|
| 3874 |
if (m_dbusConn) { |
3876 |
if (m_dbusConn) { |
|
Lines 3901-3907
void KMenu::slotSuspend(int id)
Link Here
|
| 3901 |
} |
3903 |
} |
| 3902 |
dbus_message_unref(msg); |
3904 |
dbus_message_unref(msg); |
| 3903 |
} |
3905 |
} |
| 3904 |
#else // COMPILE_HALBACKEND |
3906 |
#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND |
| 3905 |
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); |
3907 |
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); |
| 3906 |
if (rootDevice) { |
3908 |
if (rootDevice) { |
| 3907 |
if (id == 1) { |
3909 |
if (id == 1) { |
|
Lines 3916-3925
void KMenu::slotSuspend(int id)
Link Here
|
| 3916 |
return; |
3918 |
return; |
| 3917 |
} |
3919 |
} |
| 3918 |
} |
3920 |
} |
|
|
3921 |
#else |
| 3922 |
error = false; |
| 3919 |
#endif |
3923 |
#endif |
| 3920 |
if (error) |
3924 |
if (error) { |
| 3921 |
KMessageBox::error(this, i18n("Suspend failed")); |
3925 |
KMessageBox::error(this, i18n("Suspend failed")); |
| 3922 |
|
3926 |
} |
| 3923 |
} |
3927 |
} |
| 3924 |
|
3928 |
|
| 3925 |
void KMenu::runUserCommand() |
3929 |
void KMenu::runUserCommand() |