Permalink
Browse files

implemented #267 Add logout/lock screen actions to razor runner

  • Loading branch information...
1 parent 3e38d75 commit c1cca1a92c8cfd9bb1ef82cf364009b64daa5e8d @pvanek pvanek committed Apr 6, 2012
Showing with 35 additions and 0 deletions.
  1. +14 −0 razorqt-runner/dialog.cpp
  2. +5 −0 razorqt-runner/dialog.h
  3. +16 −0 razorqt-runner/dialog.ui
View
@@ -7,6 +7,7 @@
* Copyright: 2010-2011 Razor team
* Authors:
* Alexander Sokoloff <sokoloff.a@gmail.com>
+ * Petr Vanek <petr@scribus.info>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
@@ -34,6 +35,8 @@
#include <razorqt/razorsettings.h>
#include <qtxdg/xdgicon.h>
#include <razorqxt/qxtglobalshortcut.h>
+#include <razorqt/powermanager.h>
+#include <razorqt/screensaver.h>
#include <QtCore/QDebug>
@@ -44,6 +47,7 @@
#include <QtGui/QAction>
#include <QtGui/QMessageBox>
#include <QtGui/QApplication>
+#include <QtGui/QMenu>
#include <QScrollBar>
// I hate a X11 heading files. As a result we have such nightmare.
@@ -93,7 +97,17 @@ Dialog::Dialog(QWidget *parent) :
connect(a, SIGNAL(triggered()), mCommandItemModel, SLOT(clearHistory()));
addAction(a);
+ mPowerManager = new PowerManager(this);
+ addActions(mPowerManager->availableActions());
+ mScreenSaver = new ScreenSaver(this);
+ addActions(mScreenSaver->availableActions());
+
setContextMenuPolicy(Qt::ActionsContextMenu);
+
+ QMenu *menu = new QMenu(this);
+ menu->addActions(actions());
+ ui->actionButton->setMenu(menu);
+ ui->actionButton->setIcon(XdgIcon::fromTheme("configure"));
// End of popup menu ........................
applySettings();
View
@@ -38,6 +38,9 @@ class RazorSettings;
class QxtGlobalShortcut;
class CommandListView;
class CommandItemModel;
+class PowerManager;
+class ScreenSaver;
+
class Dialog : public QDialog
{
@@ -63,6 +66,8 @@ class Dialog : public QDialog
CommandItemModel *mCommandItemModel;
bool mShowOnTop;
int mMonitor;
+ PowerManager *mPowerManager;
+ ScreenSaver *mScreenSaver;
void realign();
//! \brief handle various additional behaviours (math only for now)
View
@@ -92,6 +92,22 @@
</widget>
</item>
<item>
+ <widget class="QToolButton" name="actionButton">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="popupMode">
+ <enum>QToolButton::InstantPopup</enum>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::NoArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="HorizSizeGrip" name="rightSizer" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">

0 comments on commit c1cca1a

Please sign in to comment.