#include <QLightDM/User>
#include <QLightDM/Language>
#include <QLightDM/UsersModel>
+#include <QLightDM/System>
#include <QtCore/QDebug>
#include <QtGui/QListWidgetItem>
ui->setupUi(this);
ui->feedbackLabel->setText(QString());
- ui->hostnameLabel->setText(m_greeter->hostname());
+ ui->hostnameLabel->setText(QLightDM::hostname());
QLightDM::UsersModel *usersModel = new QLightDM::UsersModel(this);
ui->userListView->setModel(usersModel);
#include <QLightDM/Greeter>
#include <QLightDM/SessionsModel>
+#include <QLightDM/Power>
#include <QMenu>
#include <QAction>
QAction *shutDownAction = new QAction(QIcon::fromTheme("system-shutdown"), "Shutdown", this);
connect(shutDownAction, SIGNAL(triggered()), m_greeter, SLOT(shutdown()));
- shutDownAction->setEnabled(m_greeter->canShutdown());
+ shutDownAction->setEnabled(QLightDM::canShutdown());
powerMenu->addAction(shutDownAction);
QAction *restartAction = new QAction(QIcon::fromTheme("system-reboot"), "Restart", this);
connect(restartAction, SIGNAL(triggered()), m_greeter, SLOT(restart()));
- restartAction->setEnabled(m_greeter->canRestart());
+ restartAction->setEnabled(QLightDM::canRestart());
powerMenu->addAction(restartAction);
QAction* suspendAction = new QAction(QIcon::fromTheme("system-suspend"), "Suspend", this);
connect(suspendAction, SIGNAL(triggered()), m_greeter, SLOT(suspend()));
- suspendAction->setEnabled(m_greeter->canSuspend());
+ suspendAction->setEnabled(QLightDM::canSuspend());
powerMenu->addAction(suspendAction);
QAction* hibernateAction = new QAction(QIcon::fromTheme("system-suspend-hibernate"), "Hibernate", this);
connect(hibernateAction, SIGNAL(triggered()), m_greeter, SLOT(hibernate()));
- hibernateAction->setEnabled(m_greeter->canHibernate());
+ hibernateAction->setEnabled(QLightDM::canHibernate());
powerMenu->addAction(hibernateAction);
ui->powerOptionsButton->setMenu(powerMenu);
return consoleKitInterface != NULL;
}
-bool canSuspend()
+bool QLightDM::canSuspend()
{
if (!setupPowerManagementInterface())
return false;
return false;
}
-void suspend()
+void QLightDM::suspend()
{
if (setupPowerManagementInterface())
powerManagementInterface->call("Suspend");
}
-bool canHibernate()
+bool QLightDM::canHibernate()
{
if (!setupPowerManagementInterface())
return false;
return false;
}
-void hibernate()
+void QLightDM::hibernate()
{
if (setupConsoleKitInterface())
powerManagementInterface->call("Hibernate");
}
-bool canShutdown()
+bool QLightDM::canShutdown()
{
if (!setupConsoleKitInterface())
return false;
return false;
}
-void shutdown()
+void QLightDM::shutdown()
{
if (setupConsoleKitInterface())
consoleKitInterface->call("stop");
}
-bool canRestart()
+bool QLightDM::canRestart()
{
if (!setupConsoleKitInterface())
return false;
return false;
}
-void restart()
+void QLightDM::restart()
{
if (setupConsoleKitInterface())
consoleKitInterface->call("Restart");