Changeset View
Changeset View
Standalone View
Standalone View
kcmodule/global/GeneralPage.cpp
Context not available. | |||||
24 | 24 | | |||
---|---|---|---|---|---|
25 | #include "actions/bundled/suspendsession.h" | 25 | #include "actions/bundled/suspendsession.h" | ||
26 | 26 | | |||
27 | #include "powerdevilpowermanagement.h" | ||||
28 | | ||||
27 | #include <Solid/Device> | 29 | #include <Solid/Device> | ||
28 | #include <Solid/DeviceInterface> | 30 | #include <Solid/DeviceInterface> | ||
29 | #include <Solid/Battery> | 31 | #include <Solid/Battery> | ||
30 | #include <Solid/PowerManagement> | | |||
31 | 32 | | |||
32 | #include <QtDBus/QDBusMessage> | 33 | #include <QtDBus/QDBusMessage> | ||
33 | #include <QtDBus/QDBusReply> | 34 | #include <QtDBus/QDBusReply> | ||
Context not available. | |||||
101 | } | 102 | } | ||
102 | } | 103 | } | ||
103 | 104 | | |||
104 | QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates(); | | |||
105 | | ||||
106 | BatteryCriticalCombo->addItem(QIcon::fromTheme("dialog-cancel"), i18n("Do nothing"), PowerDevil::BundledActions::SuspendSession::None); | 105 | BatteryCriticalCombo->addItem(QIcon::fromTheme("dialog-cancel"), i18n("Do nothing"), PowerDevil::BundledActions::SuspendSession::None); | ||
107 | if (methods.contains(Solid::PowerManagement::SuspendState)) { | 106 | if (PowerDevil::PowerManagement::instance()->canSuspend()) { | ||
108 | BatteryCriticalCombo->addItem(QIcon::fromTheme("system-suspend"), i18n("Suspend"), PowerDevil::BundledActions::SuspendSession::ToRamMode); | 107 | BatteryCriticalCombo->addItem(QIcon::fromTheme("system-suspend"), i18n("Suspend"), PowerDevil::BundledActions::SuspendSession::ToRamMode); | ||
109 | } | 108 | } | ||
110 | if (methods.contains(Solid::PowerManagement::HibernateState)) { | 109 | if (PowerDevil::PowerManagement::instance()->canHibernate()) { | ||
111 | BatteryCriticalCombo->addItem(QIcon::fromTheme("system-suspend-hibernate"), i18n("Hibernate"), PowerDevil::BundledActions::SuspendSession::ToDiskMode); | 110 | BatteryCriticalCombo->addItem(QIcon::fromTheme("system-suspend-hibernate"), i18n("Hibernate"), PowerDevil::BundledActions::SuspendSession::ToDiskMode); | ||
112 | } | 111 | } | ||
113 | BatteryCriticalCombo->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), PowerDevil::BundledActions::SuspendSession::ShutdownMode); | 112 | BatteryCriticalCombo->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), PowerDevil::BundledActions::SuspendSession::ShutdownMode); | ||
Context not available. |