rpms/kdebase-workspace/F-9 kdebase-workspace-4.0.4-kickoff-suspend.patch, NONE, 1.1 kdebase-workspace.spec, 1.83, 1.84
Than Ngo (than)
fedora-extras-commits at redhat.com
Sat May 24 20:43:17 UTC 2008
- Previous message (by thread): rpms/eiciel/devel fedora_sys_usergroups.patch, NONE, 1.1 .cvsignore, 1.5, 1.6 eiciel.spec, 1.7, 1.8 sources, 1.5, 1.6
- Next message (by thread): rpms/kdebase/F-9 kdebase-4.0.4-konqueror-updatehistoryentry.patch, NONE, 1.1 kdebase.spec, 1.321, 1.322
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: than
Update of /cvs/extras/rpms/kdebase-workspace/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9708
Modified Files:
kdebase-workspace.spec
Added Files:
kdebase-workspace-4.0.4-kickoff-suspend.patch
Log Message:
suspend in kickoff
kdebase-workspace-4.0.4-kickoff-suspend.patch:
--- NEW FILE kdebase-workspace-4.0.4-kickoff-suspend.patch ---
diff -up kdebase-workspace-4.0.4/plasma/applets/kickoff/CMakeLists.txt.orig kdebase-workspace-4.0.4/plasma/applets/kickoff/CMakeLists.txt
--- kdebase-workspace-4.0.4/plasma/applets/kickoff/CMakeLists.txt.orig 2008-03-27 21:34:51.000000000 +0100
+++ kdebase-workspace-4.0.4/plasma/applets/kickoff/CMakeLists.txt 2008-05-24 21:38:18.000000000 +0200
@@ -55,13 +55,13 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
# Kickoff Plasma Applet
set ( Applet_SRCS ${Kickoff_SRCS} applet/applet.cpp )
kde4_add_plugin(plasma_applet_launcher ${Applet_SRCS})
-target_link_libraries(plasma_applet_launcher plasma ${Kickoff_LIBS})
+target_link_libraries(plasma_applet_launcher plasma solidcontrol ${Kickoff_LIBS})
install(TARGETS plasma_applet_launcher DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES applet/plasma-applet-launcher.desktop DESTINATION ${SERVICES_INSTALL_DIR})
# Simple KMenu Plasma Applet
set ( SimpleApplet_SRCS ${Kickoff_SRCS} simpleapplet/menuview.cpp simpleapplet/simpleapplet.cpp )
kde4_add_plugin(plasma_applet_simplelauncher ${SimpleApplet_SRCS})
-target_link_libraries(plasma_applet_simplelauncher plasma ${Kickoff_LIBS})
+target_link_libraries(plasma_applet_simplelauncher plasma solidcontrol ${Kickoff_LIBS})
install(TARGETS plasma_applet_simplelauncher DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES simpleapplet/plasma-applet-simplelauncher.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff -up kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.cpp.orig kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.cpp
--- kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.cpp.orig 2008-03-27 21:34:51.000000000 +0100
+++ kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.cpp 2008-05-24 21:38:18.000000000 +0200
@@ -29,6 +29,8 @@
#include <KService>
#include <KToolInvocation>
#include <solid/powermanagement.h>
+#include <solid/control/powermanager.h>
+#include <kjob.h>
// KDE Base
#include <kworkspace/kworkspace.h>
@@ -83,6 +85,18 @@ bool LeaveItemHandler::openUrl(const QUr
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer::singleShot(0, this, SLOT(logout()));
return true;
+ } else if (m_logoutAction == "standby") {
+ // decouple dbus call, otherwise we'll run into a dead-lock
+ QTimer::singleShot(0, this, SLOT(standby()));
+ return true;
+ } else if (m_logoutAction == "suspendram") {
+ // decouple dbus call, otherwise we'll run into a dead-lock
+ QTimer::singleShot(0, this, SLOT(suspendRAM()));
+ return true;
+ } else if (m_logoutAction == "suspenddisk") {
+ // decouple dbus call, otherwise we'll run into a dead-lock
+ QTimer::singleShot(0, this, SLOT(suspendDisk()));
+ return true;
}
return false;
@@ -128,3 +142,27 @@ void LeaveItemHandler::switchUser()
krunner.switchUser();
}
}
+
+void LeaveItemHandler::standby()
+{
+ Solid::Control::PowerManager::SuspendMethod spdMethod = Solid::Control::PowerManager::Standby;
+ KJob *job = Solid::Control::PowerManager::suspend( spdMethod );
+ if (job != 0)
+ job->start();
+}
+
+void LeaveItemHandler::suspendRAM()
+{
+ Solid::Control::PowerManager::SuspendMethod spdMethod = Solid::Control::PowerManager::ToRam;
+ KJob *job = Solid::Control::PowerManager::suspend( spdMethod );
+ if (job != 0)
+ job->start();
+}
+
+void LeaveItemHandler::suspendDisk()
+{
+ Solid::Control::PowerManager::SuspendMethod spdMethod = Solid::Control::PowerManager::ToDisk;
+ KJob *job = Solid::Control::PowerManager::suspend( spdMethod );
+ if (job != 0)
+ job->start();
+}
diff -up kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.h.orig kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.h
--- kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.h.orig 2008-03-27 21:34:51.000000000 +0100
+++ kdebase-workspace-4.0.4/plasma/applets/kickoff/core/itemhandlers.h 2008-05-24 21:40:54.000000000 +0200
@@ -42,6 +42,9 @@ private Q_SLOTS:
void logout();
void lock();
void switchUser();
+ void standby();
+ void suspendRAM();
+ void suspendDisk();
private:
QString m_logoutAction;
diff -up kdebase-workspace-4.0.4/plasma/applets/kickoff/core/leavemodel.cpp.orig kdebase-workspace-4.0.4/plasma/applets/kickoff/core/leavemodel.cpp
--- kdebase-workspace-4.0.4/plasma/applets/kickoff/core/leavemodel.cpp.orig 2008-03-27 21:34:51.000000000 +0100
+++ kdebase-workspace-4.0.4/plasma/applets/kickoff/core/leavemodel.cpp 2008-05-24 21:39:19.000000000 +0200
@@ -27,6 +27,7 @@
#include <KLocalizedString>
#include <KIcon>
#include <solid/powermanagement.h>
+#include <solid/control/powermanager.h>
// Local
#include "core/models.h"
@@ -77,6 +78,21 @@ QStandardItem* LeaveModel::createStandar
item->setIcon(KIcon("system-restart"));
item->setData(i18n("Restart the computer"),Kickoff::SubTitleRole);
}
+ else if (basename == "standby") {
+ item->setText(i18n("Standby"));
+ item->setIcon(KIcon("system-suspend"));
+ item->setData(i18n("Pause without logging out"),Kickoff::SubTitleRole);
+ }
+ else if (basename == "suspenddisk") {
+ item->setText(i18n("Suspend to Disk"));
+ item->setIcon(KIcon("system-suspend-hibernate"));
+ item->setData(i18n("Pause without logging out"),Kickoff::SubTitleRole);
+ }
+ else if (basename == "suspendram") {
+ item->setText(i18n("Suspend to RAM"));
+ item->setIcon(KIcon("system-suspend-hibernate"));
+ item->setData(i18n("Pause without logging out"),Kickoff::SubTitleRole);
+ }
else {
item->setText(basename);
item->setData(url,Kickoff::SubTitleRole);
@@ -122,6 +138,22 @@ LeaveModel::LeaveModel(QObject *parent)
systemOptions->appendRow(hibernateOption);
}
+ Solid::Control::PowerManager::SuspendMethods spdMethods = Solid::Control::PowerManager::supportedSuspendMethods();
+ if( spdMethods & Solid::Control::PowerManager::Standby ) {
+ QStandardItem *standbyOption = createStandardItem("leave:/standby");
+ systemOptions->appendRow(standbyOption);
+ }
+
+ if( spdMethods & Solid::Control::PowerManager::ToRam ) {
+ QStandardItem *suspendramOption = createStandardItem("leave:/suspendram");
+ systemOptions->appendRow(suspendramOption);
+ }
+
+ if( spdMethods & Solid::Control::PowerManager::ToDisk ) {
+ QStandardItem *suspenddiskOption = createStandardItem("leave:/suspenddisk");
+ systemOptions->appendRow(suspenddiskOption);
+ }
+
// Shutdown
QStandardItem *shutDownOption = createStandardItem("leave:/shutdown");
systemOptions->appendRow(shutDownOption);
Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/extras/rpms/kdebase-workspace/F-9/kdebase-workspace.spec,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- kdebase-workspace.spec 24 May 2008 18:58:14 -0000 1.83
+++ kdebase-workspace.spec 24 May 2008 20:42:35 -0000 1.84
@@ -57,6 +57,8 @@
# #444141: Initial wallpaper chooser has "EOS" preselected but wallpaper is "Fedora Waves"
#Â http://websvn.kde.org/?view=rev&revision=801651
Patch203: kdebase-workspace-4.0.3-plasma-default-wallpaper-config.patch
+# suspend in kickoff
+Patch204: kdebase-workspace-4.0.4-kickoff-suspend.patch
# upgrade path for former kde-redhat'ers
Obsoletes: kdebase-kdm < 6:%{version}-%{release}
@@ -176,6 +178,7 @@
%patch201 -p1 -b .kde#158301
%patch202 -p1 -b .rh#443610
%patch203 -p0 -b .plasma-default-wallpaper-config
+%patch204 -p1 -b .kickoff-suspend
%build
@@ -300,6 +303,7 @@
%changelog
* Sat May 24 2008 Than Ngo <than at redhat.com> - 4.0.4-6
- fix kdm session commands
+- suspend in kickoff
* Wed May 21 2008 Than Ngo <than at redhat.com> 4.0.4-5
- fix #447030, hyperlinks do not open correctly in firefox
- Previous message (by thread): rpms/eiciel/devel fedora_sys_usergroups.patch, NONE, 1.1 .cvsignore, 1.5, 1.6 eiciel.spec, 1.7, 1.8 sources, 1.5, 1.6
- Next message (by thread): rpms/kdebase/F-9 kdebase-4.0.4-konqueror-updatehistoryentry.patch, NONE, 1.1 kdebase.spec, 1.321, 1.322
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list