menu: modify some variable names for Always on Top
authorGiWoong Kim <giwoong.kim@samsung.com>
Fri, 11 Dec 2015 04:58:20 +0000 (13:58 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Fri, 11 Dec 2015 08:03:10 +0000 (17:03 +0900)
Change-Id: I9d57e4de836273ac735117895dff41a6ed28ef47
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/ui/mainwindow.cpp
tizen/src/ui/mainwindow.h
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/menu/contextmenu.h

index 56b11de4e73839808b8d103618bb68793140b9e9..aa2120eb0bca010b1d32aaf2835f369081fd7b5f 100644 (file)
@@ -5,11 +5,10 @@
  *
  * Contact:
  * Jihye Won <jihye.won1@samsung.com>
- * Hyunjin Lee <hyunjin816.lee@samsung.com>
  * SungMin Ha <sungmin82.ha@samsung.com>
  * GiWoong Kim <giwoong.kim@samsung.com>
  * SeokYeon Hwang <syeon.hwang@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
  * Stanislav Vorobiov
  *
  * This program is free software; you can redistribute it and/or
@@ -324,7 +323,7 @@ void MainWindow::openController(int index, int dockPos)
     display->update();
 
 #ifdef CONFIG_LINUX
-    popupMenu->slotTopMost(getUiState()->isOnTop());
+    popupMenu->slotOnTop(getUiState()->isOnTop());
 #endif
 }
 
@@ -518,7 +517,7 @@ void MainWindow::processCaptured(bool captured, void *pixels,
 
 void MainWindow::setTopMost(bool on)
 {
-    popupMenu->slotTopMost(on);
+    popupMenu->slotOnTop(on);
 }
 
 KeyboardShortcut *MainWindow::getKeyboardShortcut()
index b23522fc3895001a57d9527353d203e84fff60ac..24a15a879abc5c6ef42282ab2cafd2d3424570fd 100644 (file)
@@ -5,11 +5,10 @@
  *
  * Contact:
  * Jihye Won <jihye.won1@samsung.com>
- * Hyunjin Lee <hyunjin816.lee@samsung.com>
  * SungMin Ha <sungmin82.ha@samsung.com>
  * GiWoong Kim <giwoong.kim@samsung.com>
  * SeokYeon Hwang <syeon.hwang@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
  * Stanislav Vorobiov
  *
  * This program is free software; you can redistribute it and/or
index da0eb4040598a3d324f12ed347986472318dca9d..307b600bf77a5b21e5fb38faeec5c7848d3c3808 100644 (file)
@@ -6,7 +6,8 @@
  * Contact:
  * SungMin Ha <sungmin82.ha@samsung.com>
  * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -62,7 +63,7 @@ ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent)
     this->controllerMenu = NULL;
 
     this->actionDetailedInfo = NULL;
-    this->actionTopMost = NULL;
+    this->actionOnTop = NULL;
     this->actionShell = NULL;
     this->actionControlPanel = NULL;
     this->actionScreenShot = NULL;
@@ -91,6 +92,10 @@ ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent)
     installEventFilter(this);
 }
 
+QAction *ContextMenu::getOnTopAction() {
+    return actionOnTop;
+}
+
 void ContextMenu::createItems(QMenu *menu, QList<MenuItem *> &list)
 {
     MenuItem *item = NULL;
@@ -215,22 +220,22 @@ void ContextMenu::createOnTopItem(QMenu *menu, MenuItem *item)
     }
 
     QString menuName = item->getName();
-    actionTopMost = menu->addAction(
+    actionOnTop = menu->addAction(
         menuName.isEmpty() ? MENU_ONTOP_ITEM_TEXT : menuName);
 #ifdef CONFIG_DARWIN
-    actionTopMost->setIcon(QIcon(QPixmap(":/icons/alwaysontop.png")));
+    actionOnTop->setIcon(QIcon(QPixmap(":/icons/alwaysontop.png")));
 #endif
-    actionTopMost->setCheckable(true);
-    connect(actionTopMost, SIGNAL(triggered(bool)), this, SLOT(slotTopMost(bool)));
+    actionOnTop->setCheckable(true);
+    connect(actionOnTop, SIGNAL(triggered(bool)), this, SLOT(slotOnTop(bool)));
 
     /* shortcut */
     if (item->getShortcuts().isEmpty() == false) {
         QShortcut *shortcut = new QShortcut(
             item->getShortcuts().begin().value(), parent);
-        attachShortcut(actionTopMost, shortcut, SLOT(slotTopMostShortcut()));
+        attachShortcut(actionOnTop, shortcut, SLOT(slotOnTopShortcut()));
     }
 
-    item->setAction(actionTopMost);
+    item->setAction(actionOnTop);
 }
 
 void ContextMenu::createMoveItem(QMenu *menu, MenuItem *item)
@@ -658,11 +663,11 @@ void ContextMenu::slotDetailedInfo()
     infoDialog->show();
 
 #ifdef CONFIG_LINUX
-    slotTopMost(parent->getUiState()->isOnTop());
+    slotOnTop(parent->getUiState()->isOnTop());
 #endif
 }
 
-void ContextMenu::slotTopMost(bool on)
+void ContextMenu::slotOnTop(bool on)
 {
     qDebug("stays on top: %s", on? "on" : "off");
 
@@ -683,16 +688,18 @@ void ContextMenu::slotTopMost(bool on)
 
     UiUtil::setTopMost(parent, on);
 
-    actionTopMost->setChecked(on);
+    if (actionOnTop != NULL) {
+        actionOnTop->setChecked(on);
+    }
     parent->getUiState()->setOnTop(on);
 }
 
-void ContextMenu::slotTopMostShortcut()
+void ContextMenu::slotOnTopShortcut()
 {
     /* toggle */
-    slotTopMost(!actionTopMost->isChecked());
+    slotOnTop(!actionOnTop->isChecked());
 
-    qDebug() << "shortcut:" << actionTopMost->text() << actionTopMost->isChecked();
+    qDebug() << "shortcut:" << actionOnTop->text() << actionOnTop->isChecked();
 }
 
 void ContextMenu::slotMove()
@@ -1009,7 +1016,7 @@ void ContextMenu::slotShowScreenshot(const QPixmap &screenshot)
     screenshotDialog->show();
 
 #ifdef CONFIG_LINUX
-    slotTopMost(parent->getUiState()->isOnTop());
+    slotOnTop(parent->getUiState()->isOnTop());
 #endif
 }
 
@@ -1035,7 +1042,7 @@ void ContextMenu::slotAbout()
     aboutDialog->show();
 
 #ifdef CONFIG_LINUX
-    slotTopMost(parent->getUiState()->isOnTop());
+    slotOnTop(parent->getUiState()->isOnTop());
 #endif
 }
 
@@ -1115,7 +1122,7 @@ QMessageBox *ContextMenu::showMsgBox(
     msgBox->show(); /* non-blocking */
 
 #ifdef CONFIG_LINUX
-    slotTopMost(parent->getUiState()->isOnTop());
+    slotOnTop(parent->getUiState()->isOnTop());
 #endif
 
     return msgBox;
index 942a077b6760184a82196b2fda0ce6811ed24773..3c2181eda7f882c6b2937d148b84ea639caa2ada 100644 (file)
@@ -6,7 +6,8 @@
  * Contact:
  * SungMin Ha <sungmin82.ha@samsung.com>
  * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -59,23 +60,20 @@ public:
     explicit ContextMenu(QWidget *parent = 0);
     ~ContextMenu();
 
+    QAction *getOnTopAction();
+
     QSignalMapper *getSwitchMapper();
     QSignalMapper *getScaleMapper();
     QSignalMapper *getControllerMapper();
 
-    QActionGroup *switchGroup;
-    QActionGroup *scaleGroup;
-    QActionGroup *keyboardGroup;
-    QActionGroup *controllerGroup;
-
     ScreenShotDialog *screenshotDialog;
 
 public slots:
     void slotAmbiguousShortcut();
 
     void slotDetailedInfo();
-    void slotTopMost(bool on);
-    void slotTopMostShortcut();
+    void slotOnTop(bool on);
+    void slotOnTopShortcut();
     void slotMove();
     void slotSwitch(int index);
     void slotSwitchShortcutPrev();
@@ -144,8 +142,13 @@ private:
     QMenu *scaleMenu;
     QMenu *controllerMenu;
 
+    QActionGroup *switchGroup;
+    QActionGroup *scaleGroup;
+    QActionGroup *keyboardGroup;
+    QActionGroup *controllerGroup;
+
     QAction *actionDetailedInfo;
-    QAction *actionTopMost;
+    QAction *actionOnTop;
     QAction *actionMove;
     QAction *actionShell;
     QAction *actionControlPanel;