[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/powerdevil
From: Dario Freddi <drf54321 () gmail ! com>
Date: 2009-01-19 19:30:11
Message-ID: 1232393411.190162.30236.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 913724 by dafre:
* Adding an option to turn off screen upon lid closing and button press
* Improved notifications, using Actions instead of clicks
M +34 -17 daemon/PowerDevilDaemon.cpp
M +2 -1 daemon/PowerDevilDaemon.h
M +4 -0 kcmodule/EditPage.cpp
M +2 -1 kcmodule/EditPage.h
M +2 -1 powerdevil.notifyrc
--- trunk/KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.cpp \
#913723:913724 @@ -537,8 +537,7 @@
case Shutdown:
if (PowerDevilSettings::waitBeforeSuspending()) {
emitWarningNotification("criticalbattery", i18n("Your \
battery has reached "
- "critical level, the PC will be \
halted in %1 seconds. "
- "Click here to block the \
process.", + "critical level, the PC \
will be halted in %1 seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(shutdown()));
} else {
@@ -549,7 +548,7 @@
if (PowerDevilSettings::waitBeforeSuspending()) {
emitWarningNotification("criticalbattery", i18n("Your \
battery has reached "
"critical level, the PC will be \
suspended to disk in "
- "%1 seconds. Click here to block \
the process.", + "%1 seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(suspendToDisk()));
} else {
@@ -560,7 +559,7 @@
if (PowerDevilSettings::waitBeforeSuspending()) {
emitWarningNotification("criticalbattery", i18n("Your \
battery has reached "
"critical level, the PC will be \
suspended to RAM in "
- "%1 seconds. Click here to block \
the process", + "%1 seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(suspendToRam()));
} else {
@@ -570,8 +569,7 @@
case Standby:
if (PowerDevilSettings::waitBeforeSuspending()) {
emitWarningNotification("criticalbattery", i18n("Your \
battery has reached "
- "critical level, the PC is going \
Standby in %1 seconds. "
- "Click here to block the \
process.", + "critical level, the PC \
is going Standby in %1 seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(standby()));
} else {
@@ -619,6 +617,9 @@
case Lock:
lockScreen();
break;
+ case TurnOffScreen:
+ turnOffScreen();
+ break;
default:
break;
}
@@ -643,6 +644,9 @@
case ShutdownDialog:
shutdownDialog();
break;
+ case TurnOffScreen:
+ turnOffScreen();
+ break;
default:
break;
}
@@ -667,6 +671,9 @@
case ShutdownDialog:
shutdownDialog();
break;
+ case TurnOffScreen:
+ turnOffScreen();
+ break;
default:
break;
}
@@ -692,8 +699,7 @@
}
if (PowerDevilSettings::waitBeforeSuspending()) {
- emitNotification("doingjob", i18n("The computer will be halted in \
%1 seconds. Click "
- "here to block the process.",
+ emitNotification("doingjob", i18n("The computer will be halted in \
%1 seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(shutdown()));
} else {
@@ -709,7 +715,7 @@
if (PowerDevilSettings::waitBeforeSuspending()) {
emitNotification("doingjob", i18n("The computer will be suspended \
to disk in %1 "
- "seconds. Click here to block \
the process.", + "seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(suspendToDisk()));
} else {
@@ -725,7 +731,7 @@
if (PowerDevilSettings::waitBeforeSuspending()) {
emitNotification("doingjob", i18n("The computer will be suspended \
to RAM in %1 "
- "seconds. Click here to block \
the process.", + "seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(suspendToRam()));
} else {
@@ -741,7 +747,7 @@
if (PowerDevilSettings::waitBeforeSuspending()) {
emitNotification("doingjob", i18n("The computer will be put into \
standby in %1 "
- "seconds. Click here to block \
the process.", + "seconds.",
\
PowerDevilSettings::waitBeforeSuspendingTime()), SLOT(standby()));
} else {
@@ -933,6 +939,10 @@
POLLER_CALL(d->pollLoader->poller(), catchIdleEvent());
lockScreen();
break;
+ case TurnOffScreen:
+ POLLER_CALL(d->pollLoader->poller(), catchIdleEvent());
+ turnOffScreen();
+ break;
default:
break;
}
@@ -1017,12 +1027,13 @@
} else {
d->notification = KNotification::event(evid, message, \
KIcon(iconname).pixmap(20, 20),
0, \
KNotification::Persistent, d->applicationData); + \
d->notification->setActions(QStringList() << i18nc("Interrupts the \
suspension/shutdown process", "Abort Action"));
connect(d->notificationTimer, SIGNAL(timeout()), slot);
connect(d->notificationTimer, SIGNAL(timeout()), \
SLOT(cleanUpTimer()));
- d->lockHandler->connect(d->notification, SIGNAL(closed()), \
d->lockHandler, SLOT(releaseNotificationLock()));
- connect(d->notification, SIGNAL(closed()), SLOT(cleanUpTimer()));
+ d->lockHandler->connect(d->notification, SIGNAL(activated(unsigned \
int)), d->lockHandler, SLOT(releaseNotificationLock())); + \
connect(d->notification, SIGNAL(activated(unsigned int)), \
SLOT(cleanUpTimer()));
d->notificationTimer->start(PowerDevilSettings::waitBeforeSuspendingTime() \
* 1000); }
@@ -1044,12 +1055,13 @@
} else {
d->notification = KNotification::event(evid, message, \
KIcon(iconname).pixmap(20, 20),
0, \
KNotification::Persistent, d->applicationData); + \
d->notification->setActions(QStringList() << i18nc("Interrupts the \
suspension/shutdown process", "Abort Action"));
connect(d->notificationTimer, SIGNAL(timeout()), slot);
connect(d->notificationTimer, SIGNAL(timeout()), \
SLOT(cleanUpTimer()));
- d->lockHandler->connect(d->notification, SIGNAL(closed()), \
d->lockHandler, SLOT(releaseNotificationLock()));
- connect(d->notification, SIGNAL(closed()), SLOT(cleanUpTimer()));
+ d->lockHandler->connect(d->notification, SIGNAL(activated(unsigned \
int)), d->lockHandler, SLOT(releaseNotificationLock())); + \
connect(d->notification, SIGNAL(activated(unsigned int)), \
SLOT(cleanUpTimer()));
d->notificationTimer->start(PowerDevilSettings::waitBeforeSuspendingTime() \
* 1000); }
@@ -1071,12 +1083,13 @@
} else {
d->notification = KNotification::event(evid, message, \
KIcon(iconname).pixmap(20, 20),
0, \
KNotification::Persistent, d->applicationData); + \
d->notification->setActions(QStringList() << i18nc("Interrupts the \
suspension/shutdown process", "Abort Action"));
connect(d->notificationTimer, SIGNAL(timeout()), slot);
connect(d->notificationTimer, SIGNAL(timeout()), \
SLOT(cleanUpTimer()));
- d->lockHandler->connect(d->notification, SIGNAL(closed()), \
d->lockHandler, SLOT(releaseNotificationLock()));
- connect(d->notification, SIGNAL(closed()), SLOT(cleanUpTimer()));
+ d->lockHandler->connect(d->notification, SIGNAL(activated(unsigned \
int)), d->lockHandler, SLOT(releaseNotificationLock())); + \
connect(d->notification, SIGNAL(activated(unsigned int)), \
SLOT(cleanUpTimer()));
d->notificationTimer->start(PowerDevilSettings::waitBeforeSuspendingTime() \
* 1000); }
@@ -1308,6 +1321,10 @@
void PowerDevilDaemon::turnOffScreen()
{
+ if (PowerDevilSettings::configLockScreen()) {
+ lockScreen();
+ }
+
#ifdef HAVE_DPMS
CARD16 dummy;
--- trunk/KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.h \
#913723:913724 @@ -150,7 +150,8 @@
S2Disk = 4,
Shutdown = 8,
Lock = 16,
- ShutdownDialog = 32
+ ShutdownDialog = 32,
+ TurnOffScreen = 64
};
enum IdleStatus {
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/EditPage.cpp \
#913723:913724 @@ -100,16 +100,20 @@
idleCombo->addItem(KIcon("dialog-cancel"), i18n("Do nothing"), (int) \
None);
idleCombo->addItem(KIcon("system-shutdown"), i18n("Shutdown"), (int) \
Shutdown);
idleCombo->addItem(KIcon("system-lock-screen"), i18n("Lock Screen"), \
(int) Lock); + idleCombo->addItem(KIcon("preferences-desktop-screensaver"), \
i18n("Turn Off Screen"), (int) TurnOffScreen);
laptopClosedCombo->addItem(KIcon("dialog-cancel"), i18n("Do nothing"), \
(int) None);
laptopClosedCombo->addItem(KIcon("system-shutdown"), i18n("Shutdown"), \
(int) Shutdown);
laptopClosedCombo->addItem(KIcon("system-lock-screen"), i18n("Lock \
Screen"), (int) Lock); + \
laptopClosedCombo->addItem(KIcon("preferences-desktop-screensaver"), \
i18n("Turn Off Screen"), (int) TurnOffScreen);
sleepButtonCombo->addItem(KIcon("dialog-cancel"), i18n("Do nothing"), \
(int) None);
sleepButtonCombo->addItem(KIcon("system-shutdown"), i18n("Shutdown"), \
(int) Shutdown);
sleepButtonCombo->addItem(KIcon("system-lock-screen"), i18n("Lock \
Screen"), (int) Lock); + \
sleepButtonCombo->addItem(KIcon("preferences-desktop-screensaver"), \
i18n("Turn Off Screen"), (int) TurnOffScreen);
sleepButtonCombo->addItem(KIcon("system-log-out"), i18n("Prompt Log \
out dialog"), (int) ShutdownDialog);
powerButtonCombo->addItem(KIcon("dialog-cancel"), i18n("Do nothing"), \
(int) None);
powerButtonCombo->addItem(KIcon("system-shutdown"), i18n("Shutdown"), \
(int) Shutdown);
powerButtonCombo->addItem(KIcon("system-lock-screen"), i18n("Lock \
Screen"), (int) Lock); + \
powerButtonCombo->addItem(KIcon("preferences-desktop-screensaver"), \
i18n("Turn Off Screen"), (int) TurnOffScreen);
powerButtonCombo->addItem(KIcon("system-log-out"), i18n("Prompt Log \
out dialog"), (int) ShutdownDialog);
Solid::Control::PowerManager::SuspendMethods methods = \
Solid::Control::PowerManager::supportedSuspendMethods();
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/EditPage.h \
#913723:913724 @@ -72,7 +72,8 @@
S2Disk = 4,
Shutdown = 8,
Lock = 16,
- ShutdownDialog = 32
+ ShutdownDialog = 32,
+ TurnOffScreen = 64
};
KSharedConfig::Ptr m_profilesConfig;
--- trunk/KDE/kdebase/workspace/powerdevil/powerdevil.notifyrc \
#913723:913724 @@ -1151,7 +1151,8 @@
Comment[zh_TW]=此通知在暫停的工作將要結束時會顯示,並且開始倒數計時。建議您保持此選 \
開啟。 Contexts=stdnot
Sound=KDE-Sys-App-Negative.ogg
-Action=Sound|Popup
+Action=Sound|Popup|Taskbar
+Persistant=true
[Event/powerdevilerror]
Name=Internal PowerDevil Error
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic