Changeset View
Changeset View
Standalone View
Standalone View
daemon/actions/bundled/suspendsessionconfig.cpp
Context not available. | |||||
20 | 20 | | |||
---|---|---|---|---|---|
21 | #include "suspendsessionconfig.h" | 21 | #include "suspendsessionconfig.h" | ||
22 | 22 | | |||
23 | #include "powerdevilpowermanagement.h" | ||||
24 | | ||||
23 | #include <QHBoxLayout> | 25 | #include <QHBoxLayout> | ||
24 | #include <QSpinBox> | 26 | #include <QSpinBox> | ||
25 | 27 | | |||
26 | #include <Solid/PowerManagement> | | |||
27 | | ||||
28 | #include <KComboBox> | 28 | #include <KComboBox> | ||
29 | #include <KLocalizedString> | 29 | #include <KLocalizedString> | ||
30 | #include <KPluginFactory> | 30 | #include <KPluginFactory> | ||
Context not available. | |||||
78 | m_idleTime->setValue(0); | 78 | m_idleTime->setValue(0); | ||
79 | m_idleTime->setSuffix(i18n(" min")); | 79 | m_idleTime->setSuffix(i18n(" min")); | ||
80 | 80 | | |||
81 | QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates(); | 81 | if (PowerManagement::instance()->canSuspend()) { | ||
82 | | ||||
83 | if (methods.contains(Solid::PowerManagement::SuspendState)) { | | |||
84 | m_comboBox->addItem(QIcon::fromTheme("system-suspend"), i18n("Suspend"), (uint)SuspendSession::ToRamMode); | 82 | m_comboBox->addItem(QIcon::fromTheme("system-suspend"), i18n("Suspend"), (uint)SuspendSession::ToRamMode); | ||
85 | } | 83 | } | ||
86 | if (methods.contains(Solid::PowerManagement::HibernateState)) { | 84 | if (PowerManagement::instance()->canHibernate()) { | ||
87 | m_comboBox->addItem(QIcon::fromTheme("system-suspend-hibernate"), i18n("Hibernate"), (uint)SuspendSession::ToDiskMode); | 85 | m_comboBox->addItem(QIcon::fromTheme("system-suspend-hibernate"), i18n("Hibernate"), (uint)SuspendSession::ToDiskMode); | ||
88 | } | 86 | } | ||
89 | if (methods.contains(Solid::PowerManagement::HybridSuspendState)) { | 87 | if (PowerManagement::instance()->canHybridSuspend()) { | ||
90 | m_comboBox->addItem(QIcon::fromTheme("system-suspend-hybrid"), i18n("Hybrid suspend"), (uint)SuspendSession::SuspendHybridMode); | 88 | m_comboBox->addItem(QIcon::fromTheme("system-suspend-hybrid"), i18n("Hybrid suspend"), (uint)SuspendSession::SuspendHybridMode); | ||
91 | } | 89 | } | ||
92 | m_comboBox->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), (uint)SuspendSession::ShutdownMode); | 90 | m_comboBox->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), (uint)SuspendSession::ShutdownMode); | ||
Context not available. |