shortcut: modified sorting for shortcutInfo tab
authorsungmin ha <sungmin82.ha@samsung.com>
Fri, 17 Jul 2015 05:24:21 +0000 (14:24 +0900)
committerSangho Park <sangho.p@samsung.com>
Mon, 20 Jul 2015 00:16:43 +0000 (09:16 +0900)
added back and controller shortcuts

Change-Id: I1acd732048d7244b9969bb1c88656fa24b68bf8a
Signed-off-by: sungmin ha <sungmin82.ha@samsung.com>
12 files changed:
tizen/src/skin/client/skins/mobile-320x480-3btn/layout.xml
tizen/src/skin/client/skins/mobile-480x800-3btn/layout.xml
tizen/src/skin/client/skins/mobile-540x960-3btn/layout.xml
tizen/src/skin/client/skins/mobile-720x1280-3btn/layout.xml
tizen/src/skin/client/skins/mobile-general-3btn/controller/key-window/layout.xml
tizen/src/skin/client/skins/mobile-general-3btn/layout.xml
tizen/src/skin/client/skins/tv-1920x1080/layout.xml
tizen/src/skin/client/skins/wearable-general-1btn/layout.xml
tizen/src/ui/input/keyboardshortcut.cpp
tizen/src/ui/input/keyboardshortcut.h
tizen/src/ui/menu/detailedinfodialog.cpp
tizen/src/ui/menu/detailedinfodialog.h

index f1908152e6325230ee3b609be86b535bb11ffdf3..9a50f946ff209799798c178b3f04ee180f262331 100644 (file)
@@ -26,6 +26,7 @@
                     <region left="247" top="552" width="54" height="54"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="362" top="487" width="15" height="70"/>
@@ -72,6 +73,7 @@
                     <region left="552" top="79" width="54" height="54"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="486" top="3" width="70" height="15"/>
                     <region left="78" top="14" width="54" height="54"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="3" top="64" width="15" height="70"/>
                     <region left="14" top="248" width="54" height="54"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="64" top="362" width="70" height="15"/>
index 973ee93ad803a6feeba72d5c44ea1d62e98995b1..57fb37d2db0bcd5ae003e2a540cc74ad250493e2 100644 (file)
@@ -26,6 +26,7 @@
                     <region left="355" top="882" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="536" top="814" width="20" height="74"/>
@@ -72,6 +73,7 @@
                     <region left="882" top="122" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="813" top="0" width="74" height="20"/>
                     <region left="121" top="9" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="0" top="79" width="20" height="74"/>
                     <region left="9" top="355" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="78" top="534" width="74" height="20"/>
index 42ba76bd3a1fd33d19b8aac3431fe0398525cdaa..7e06325f85b4b909a641c07ffc9948a8a301c610 100644 (file)
@@ -26,6 +26,7 @@
                     <region left="406" top="1044" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="595" top="974" width="20" height="74"/>
@@ -72,6 +73,7 @@
                     <region left="1044" top="134" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="973" top="0" width="74" height="20"/>
                     <region left="132" top="9" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="0" top="79" width="20" height="74"/>
                     <region left="9" top="408" width="74" height="74"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="79" top="595" width="74" height="20"/>
index b67df0aec6ec017504b42463410c02c1a0a51a63..d9b226ccabe46d163a91c3fea553ab911161f9ef 100644 (file)
@@ -26,6 +26,7 @@
                     <region left="565" top="1396" width="84" height="84"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="836" top="1304" width="24" height="96"/>
@@ -72,6 +73,7 @@
                     <region left="1395" top="205" width="84" height="84"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="1303" top="0" width="96" height="24"/>
                     <region left="205" top="25" width="84" height="84"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="0" top="105" width="24" height="96"/>
                     <region left="23" top="565" width="84" height="84"/>
                     <keycode>158</keycode>
                     <tooltip>Back</tooltip>
+                    <shortcut>Esc</shortcut>
                 </key>
                 <key name="Power">
                     <region left="104" top="836" width="96" height="24"/>
index 91d067b5ea4dadc4b2908214223dfe7314544e78..603652f177b3a136efbb8fcc59758d5370a53d8b 100644 (file)
@@ -16,6 +16,7 @@
             <key name="Back">
                 <keycode>158</keycode>
                 <tooltip>Back</tooltip>
+                <shortcut>Esc</shortcut>
             </key>
 
             <key name="Power">
index 40b940bba75908aac9665a2d4f9db7f7fdbf1bbf..c5c079e9af17007b8fc7af6ec4f828b1a0f0aa5d 100644 (file)
@@ -50,7 +50,9 @@
         <separator/>
         <advancedItem>
             <menuList>
-                <controllerItem/>
+                <controllerItem name="Controller">
+                    <shortcut>Ctrl+F8</shortcut>
+                </controllerItem>
                 <screenShotItem name="Screen Shot">
                     <shortcut>Ctrl+F7</shortcut>
                 </screenShotItem>
index 335b5eb6e818b1cbbb1079dacaf05cdef38b2792..d9278f412e851cd3c5fd3b4b79b753961924d20c 100644 (file)
@@ -34,7 +34,9 @@
         <separator/>
         <advancedItem>
             <menuList>
-                <controllerItem/>
+                <controllerItem name="Controller">
+                    <shortcut>Ctrl+F8</shortcut>
+                </controllerItem>
                 <screenShotItem name="Screen Shot">
                     <shortcut>Ctrl+F7</shortcut>
                 </screenShotItem>
index cb25ba469dc97e267f9c28182b7e5102da4122b9..06b2823396d24fb530431014ab0e9944fd1ba836 100644 (file)
@@ -40,7 +40,9 @@
         <separator/>
         <advancedItem>
             <menuList>
-                <controllerItem/>
+                <controllerItem name="Controller">
+                    <shortcut>Ctrl+F8</shortcut>
+                </controllerItem>
                 <screenShotItem name="Screen Shot">
                     <shortcut>Ctrl+F7</shortcut>
                 </screenShotItem>
index 8acd7027e86cbb3cc8d0bcaf14cdf99dd6d10e49..e14d050cb07473db31fb496c361e289a259e89fe 100644 (file)
@@ -61,6 +61,18 @@ void KeyboardShortcut::removeHwKeyShortcut()
     qDebug() << "Removed hwKey shortcuts";
 }
 
+void KeyboardShortcut::removePopupMenuShortcut()
+{
+    for (int index = 0; index < popupMenuShortcutList.count(); index++) {
+        delete popupMenuShortcutList.at(index);
+    }
+
+    popupMenuShortcutList.clear();
+    popupMenuShortcutMap.clear();
+
+    qDebug() << "Removed popupMenu shortcuts";
+}
+
 void KeyboardShortcut::registShortcutKey(QShortcut *shortcut, QString item)
 {
     QSignalMapper *mapper = new QSignalMapper(this);
@@ -209,6 +221,7 @@ void KeyboardShortcut::setKeyboardShortcutContextMenu(MenuItem *item, QString pr
         itemName.append(" " + property);
     }
 
+    popupMenuShortcutList.append(shortcut);
     popupMenuShortcutMap.insert(itemName, keySequence);
 }
 
@@ -435,6 +448,16 @@ QList<QShortcut *> KeyboardShortcut::getControllerShortcutList()
     return controllerShortcutList;
 }
 
+QList<QShortcut *> KeyboardShortcut::getPopupMenuShortcutList()
+{
+    return popupMenuShortcutList;
+}
+
+QList<QShortcut *> KeyboardShortcut::getHwKeyShortcutList()
+{
+    return hwKeyShortcutList;
+}
+
 QMap<QString, QString> KeyboardShortcut::getPopupMenuShortcutMap()
 {
     return popupMenuShortcutMap;
@@ -452,5 +475,9 @@ QMap<QString, QString> KeyboardShortcut::getControllerShortcutMap()
 
 KeyboardShortcut::~KeyboardShortcut()
 {
+    removeHwKeyShortcut();
+    removeControllerShortcut();
+    removePopupMenuShortcut();
+
     qDebug("destroy keyboard shortcut");
 }
index f178d99f8e92ceb99c1308a898a898311ed1082c..c91d9c1abac9b2764412a45ac00b9bf200659c92 100644 (file)
@@ -53,8 +53,11 @@ public:
     void setKeyboardShortcutContextMenu(MenuItem *item, QString property, QString keySequence);
     void removeControllerShortcut();
     void removeHwKeyShortcut();
+    void removePopupMenuShortcut();
 
     QList<QShortcut *> getControllerShortcutList();
+    QList<QShortcut *> getPopupMenuShortcutList();
+    QList<QShortcut *> getHwKeyShortcutList();
     QMap<QString, QString> getPopupMenuShortcutMap();
     QMap<QString, QString> getHwKeyShortcutMap();
     QMap<QString, QString> getControllerShortcutMap();
@@ -83,6 +86,7 @@ private:
     MainWindow *parent;
     QList<HardwareKey *> hwKeyList;
     QList<HardwareKey *> controllerKeyList;
+    QList<QShortcut *> popupMenuShortcutList;
     QList<QShortcut *> controllerShortcutList;
     QList<QShortcut *> hwKeyShortcutList;
     QMap<QString, QString> popupMenuShortcutMap;
index a33eed80eef963623de56c8c6799a8ff2a4a2447..8c0a535a426b67ade65f4931203edae137adf855 100644 (file)
@@ -184,19 +184,26 @@ void DetailedInfoDialog::slotSetMaximumSize(int tab)
     table->horizontalHeader()->setStretchLastSection(true);
 }
 
-void DetailedInfoDialog::setShortcutInfoTable(QMap<QString, QString> map)
+void DetailedInfoDialog::setShortcutInfoTable(QMap<QString, QString> map, QList<QShortcut *> list)
 {
     int row = shortcutInfoTable->rowCount();
     QMap<QString, QString>::const_iterator mapIter = map.constBegin();
-    while (mapIter != map.constEnd()) {
+
+    for (int index = 0; index < list.count(); index++) {
+        while (mapIter != map.constEnd()) {
+            if (mapIter.value() == list.at(index)->key().toString()) {
 #ifdef CONFIG_DARWIN
-        QString value = mapIter.value();
-        value.replace("Ctrl", "Cmd");
-        setDataTable(shortcutInfoTable, mapIter.key(), value, row++);
+                QString value = mapIter.value();
+                value.replace("Ctrl", "Cmd");
+                setDataTable(shortcutInfoTable, mapIter.key(), value, row++);
 #else
-        setDataTable(shortcutInfoTable, mapIter.key(), mapIter.value(), row++);
+                setDataTable(shortcutInfoTable, mapIter.key(), mapIter.value(), row++);
 #endif
-        ++mapIter;
+                break;
+            }
+            ++mapIter;
+        }
+        mapIter = map.constBegin();
     }
 }
 
@@ -291,9 +298,12 @@ void DetailedInfoDialog::showEvent(QShowEvent *event)
 
     /* insert shortcut info */
     removeDataTable(shortcutInfoTable, 0, shortcutInfoTable->rowCount());
-    setShortcutInfoTable(keyboardShortcut->getPopupMenuShortcutMap());
-    setShortcutInfoTable(keyboardShortcut->getHwKeyShortcutMap());
-    setShortcutInfoTable(keyboardShortcut->getControllerShortcutMap());
+    setShortcutInfoTable(keyboardShortcut->getPopupMenuShortcutMap(),
+                         keyboardShortcut->getPopupMenuShortcutList());
+    setShortcutInfoTable(keyboardShortcut->getHwKeyShortcutMap(),
+                         keyboardShortcut->getHwKeyShortcutList());
+    setShortcutInfoTable(keyboardShortcut->getControllerShortcutMap(),
+                         keyboardShortcut->getControllerShortcutList());
 
     vmInfoTable->horizontalHeader()->setStretchLastSection(true);
     shortcutInfoTable->horizontalHeader()->setStretchLastSection(true);
index 023cd499cadc6b0e9a7cfaf373908e4ac579a839..3a549554d246e0ec07c319f759be2896f64eeabc 100644 (file)
@@ -54,7 +54,7 @@ public:
     ~DetailedInfoDialog();
 
     QTableWidget *getShortcutInfoTable();
-    void setShortcutInfoTable(QMap<QString, QString> map);
+    void setShortcutInfoTable(QMap<QString, QString> map, QList<QShortcut *> list);
     void setDataTable(QTableWidget* table, QString key, QString value, int index);
     void removeDataTable(QTableWidget* table, int startIndex, int lastIndex);