I have made the following changes intended for :
  CE:UX:MTF / meegotouch-systemui

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/5851

Thank You,
Marko Saukko

[This message was auto-generated]

---

Request # 5851:

Messages from BOSS:

State: review at 2012-08-16T16:41:47 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: Project:MTF:UX / meegotouch-systemui -> CE:UX:MTF / 
meegotouch-systemui
  
changes files:
--------------
--- meegotouch-systemui.changes
+++ meegotouch-systemui.changes
@@ -0,0 +1,4 @@
+* Wed Aug 15 2012 Simonas Leleiva <[email protected]> - 1.3.2-1
+- Added poweroff dialog (button&query) to the status menu,
+  Fixes NEMO#74: Add poweroff dialog to systemui
+  

new:
----
  Add-shutdown-dialog-to-status-indicator-menu.patch

spec files:
-----------
--- meegotouch-systemui.spec
+++ meegotouch-systemui.spec
@@ -34,6 +34,7 @@
 Patch12:     NEMO_11_remove_profile_from_statusmenu.patch
 Patch13:     NEMO_12_fix_statusmenu_top.patch
 Patch14:     meegotouch-systemui-1.2.20-1-add-missing-libs-for-linking.patch
+Patch15:     Add-shutdown-dialog-to-status-indicator-menu.patch
 Requires:   contextkit-meego-cellular
 Requires:   contextkit-meego-internet
 BuildRequires:  pkgconfig(libpulse)
@@ -162,6 +163,9 @@
 %patch13 -p1
 # meegotouch-systemui-1.2.20-1-add-missing-libs-for-linking.patch
 %patch14 -p1
+# Add-shutdown-dialog-to-status-indicator-menu.patch
+%patch15 -p1
+
 # >> setup
 # << setup
 

other changes:
--------------

++++++ Add-shutdown-dialog-to-status-indicator-menu.patch (new)
--- Add-shutdown-dialog-to-status-indicator-menu.patch
+++ Add-shutdown-dialog-to-status-indicator-menu.patch
@@ -0,0 +1,204 @@
+diff --git a/src/systemui/statusindicatormenu/statusindicatormenu.cpp 
b/src/systemui/statusindicatormenu/statusindicatormenu.cpp
+index 962dc8b..2f40ab4 100644
+--- a/src/systemui/statusindicatormenu/statusindicatormenu.cpp
++++ b/src/systemui/statusindicatormenu/statusindicatormenu.cpp
+@@ -17,6 +17,7 @@
+ **
+ ****************************************************************************/
+ #include <MApplicationIfProxy>
++#include <MMessageBox>
+ #include "statusindicatormenu.h"
+ #include "statusindicatormenudropdownview.h"
+ 
+@@ -25,6 +26,9 @@ const QString 
StatusIndicatorMenu::CONTROL_PANEL_SERVICE_NAME = "com.nokia.DuiCo
+ StatusIndicatorMenu::StatusIndicatorMenu(QGraphicsItem *parent) :
+     MApplicationMenu()
+ {
++#ifdef HAVE_QMSYSTEM
++    m_State = NULL;
++#endif
+     Q_UNUSED(parent);
+ }
+ 
+@@ -51,6 +55,23 @@ void StatusIndicatorMenu::launchControlPanelAndHide()
+     hideStatusIndicatorMenu();
+ }
+ 
++void StatusIndicatorMenu::launchPowerOffDialog()
++{
++    // % "Are you sure you want to power off the device?"
++    MMessageBox box(qtTrId("qtn_stat_menu_poweroff_query"), M::YesButton | 
M::NoButton);
++    int result = box.exec();
++    if (result == QMessageBox::Yes) {
++#ifdef HAVE_QMSYSTEM
++        if (m_State == NULL) {
++            m_State = new MeeGo::QmSystemState(this);
++        }
++        m_State->set(MeeGo::QmSystemState::ShuttingDown);
++#else
++        start("halt -p");
++#endif
++    }
++}
++
+ void StatusIndicatorMenu::showStatusIndicatorMenu()
+ {
+     emit showRequested();
+diff --git a/src/systemui/statusindicatormenu/statusindicatormenu.h 
b/src/systemui/statusindicatormenu/statusindicatormenu.h
+index dcaf719..dbac9ae 100644
+--- a/src/systemui/statusindicatormenu/statusindicatormenu.h
++++ b/src/systemui/statusindicatormenu/statusindicatormenu.h
+@@ -23,6 +23,10 @@
+ #include <MApplicationMenu>
+ #include "mstatusindicatormenuextensioninterface.h"
+ 
++#ifdef HAVE_QMSYSTEM
++#include <qmsystemstate.h>
++#endif
++
+ class StatusIndicatorMenuWindow;
+ 
+ /*!
+@@ -73,11 +77,22 @@ private slots:
+      */
+     void launchControlPanelAndHide();
+ 
++    /*!
++     * \brief Slot for getting information about poweroff button clicks
++     */
++    void launchPowerOffDialog();
++
++
+ private: // methods
+ 
+     //! The name of the control panel service
+     const static QString CONTROL_PANEL_SERVICE_NAME;
+ 
++#ifdef HAVE_QMSYSTEM
++    //! System state
++    MeeGo::QmSystemState *m_State;
++#endif
++
+ #ifdef UNIT_TEST
+     friend class Ut_StatusIndicatorMenu;
+ #endif
+diff --git 
a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp 
b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp
+index 3567b28..29ace31 100644
+--- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp
++++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp
+@@ -131,13 +131,22 @@ QGraphicsWidget* 
StatusIndicatorMenuDropDownView::createTopRow()
+     settingsButton->setIconID("icon-m-status-menu-settings");
+     connect(settingsButton, SIGNAL(clicked()), controller, 
SLOT(launchControlPanelAndHide()));
+ 
+-    // Put the extension area and the settings button to a horizontal layout
++    // Create a button for triggering the powerOff dialog
++    //% "Power off"
++    MButton *powerOffButton = new MButton(qtTrId("qtn_stat_menu_poweroff"));
++    powerOffButton->setObjectName("StatusIndicatorMenuTopRowExtensionButton");
++    powerOffButton->setViewType(MButton::iconType);
++    powerOffButton->setIconID("icon-m-status-menu-poweroff");
++    connect(powerOffButton, SIGNAL(clicked()), controller, 
SLOT(launchPowerOffDialog()));
++
++    // Put the extension area and the buttons to a horizontal layout
+     QGraphicsLinearLayout *topRowLayout = new 
QGraphicsLinearLayout(Qt::Horizontal);
+     topRowLayout->setContentsMargins(0, 0, 0, 0);
+     topRowLayout->setSpacing(0);
+     topRowLayout->addStretch();
+     topRowLayout->addItem(settingsPluginsExtensionArea);
+     topRowLayout->addItem(settingsButton);
++    topRowLayout->addItem(powerOffButton);
+     topRowLayout->addStretch();
+ 
+     // Create a container widget for extension area and settings button layout
+diff --git a/src/systemui/systemui.conf b/src/systemui/systemui.conf
+index 5b5b61d..ba9c919 100644
+--- a/src/systemui/systemui.conf
++++ b/src/systemui/systemui.conf
+@@ -10,6 +10,9 @@
+     <allow send_destination="com.nokia.mce"
+            send_interface="com.nokia.mce.request"
+            send_member="tklock_callback" />
++    <allow send_destination="com.nokia.dsme"
++           send_interface="com.nokia.dsme.request"
++           send_member="req_shutdown" />
+   </policy>
+ 
+ </busconfig>
+diff --git a/tests/stubs/statusindicatormenu_stub.h 
b/tests/stubs/statusindicatormenu_stub.h
+index 2984fc4..d18b42e 100644
+--- a/tests/stubs/statusindicatormenu_stub.h
++++ b/tests/stubs/statusindicatormenu_stub.h
+@@ -15,6 +15,7 @@ class StatusIndicatorMenuStub : public StubBase {
+   virtual void hideStatusIndicatorMenu();
+   virtual void setStatusIndicatorMenuInterface(MApplicationExtensionInterface 
*extension);
+   virtual void launchControlPanelAndHide();
++  virtual void launchPowerOffDialog();
+ };
+ 
+ // 2. IMPLEMENT STUB
+@@ -44,6 +45,10 @@ void StatusIndicatorMenuStub::launchControlPanelAndHide() {
+   stubMethodEntered("launchControlPanelAndHide");
+ }
+ 
++void StatusIndicatorMenuStub::launchPowerOffDialog() {
++  stubMethodEntered("launchPowerOffDialog");
++}
++
+ 
+ // 3. CREATE A STUB INSTANCE
+ StatusIndicatorMenuStub gDefaultStatusIndicatorMenuStub;
+@@ -76,4 +81,8 @@ void StatusIndicatorMenu::launchControlPanelAndHide() {
+   gStatusIndicatorMenuStub->launchControlPanelAndHide();
+ }
+ 
++void StatusIndicatorMenu::launchPowerOffDialog() {
++  gStatusIndicatorMenuStub->launchPowerOffDialog();
++}
++
+ #endif
+diff --git a/tests/ut_statusindicatormenu/ut_statusindicatormenu.cpp 
b/tests/ut_statusindicatormenu/ut_statusindicatormenu.cpp
+index b8983be..bd0cfda 100644
+--- a/tests/ut_statusindicatormenu/ut_statusindicatormenu.cpp
++++ b/tests/ut_statusindicatormenu/ut_statusindicatormenu.cpp
+@@ -70,6 +70,7 @@ void Ut_StatusIndicatorMenu::init()
+ {
+     statusIndicatorMenu = new StatusIndicatorMenu();
+     connect(this, SIGNAL(settingsButtonClicked()), statusIndicatorMenu, 
SLOT(launchControlPanelAndHide()));
++    connect(this, SIGNAL(powerOffButtonClicked()), statusIndicatorMenu, 
SLOT(launchPowerOffDialog()));
+     connect(this, 
SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), 
statusIndicatorMenu, 
SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*)));
+ }
+ 
+@@ -98,6 +99,13 @@ void Ut_StatusIndicatorMenu::testSettingsButtonClicked()
+     QVERIFY(mApplicationIfProxyLaunchCalled);
+ }
+ 
++void Ut_StatusIndicatorMenu::testPowerOffButtonClicked()
++{
++    emit powerOffButtonClicked();
++
++    QVERIFY(mApplicationIfProxyLaunchCalled);
++}
++
+ void Ut_StatusIndicatorMenu::testExtensionInstantiated()
+ {
+     TestStatusIndicatorMenuExtensionInterface extension;
+diff --git a/tests/ut_statusindicatormenu/ut_statusindicatormenu.h 
b/tests/ut_statusindicatormenu/ut_statusindicatormenu.h
+index 0778986..361caee 100644
+--- a/tests/ut_statusindicatormenu/ut_statusindicatormenu.h
++++ b/tests/ut_statusindicatormenu/ut_statusindicatormenu.h
+@@ -31,6 +31,7 @@ class Ut_StatusIndicatorMenu : public QObject
+ 
+ signals:
+     void settingsButtonClicked();
++    void powerOffButtonClicked();
+     void extensionInstantiated(MApplicationExtensionInterface*);
+ 
+ private:
+@@ -49,6 +50,7 @@ private slots:
+ 
+     // Test cases
(5 more lines skipped)

++++++ meegotouch-systemui.yaml
--- meegotouch-systemui.yaml
+++ meegotouch-systemui.yaml
@@ -27,6 +27,7 @@
     - NEMO_11_remove_profile_from_statusmenu.patch
     - NEMO_12_fix_statusmenu_top.patch
     - meegotouch-systemui-1.2.20-1-add-missing-libs-for-linking.patch
+    - Add-shutdown-dialog-to-status-indicator-menu.patch
 Description: |
     This package contains the system UI daemon.
 PkgBR:



Reply via email to