From: sungmin ha Date: Fri, 17 Jul 2015 05:24:21 +0000 (+0900) Subject: shortcut: modified sorting for shortcutInfo tab X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~289^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb3ca2df97c1fb8a76efe10a8826167de089b776;p=sdk%2Femulator%2Fqemu.git shortcut: modified sorting for shortcutInfo tab added back and controller shortcuts Change-Id: I1acd732048d7244b9969bb1c88656fa24b68bf8a Signed-off-by: sungmin ha --- diff --git a/tizen/src/skin/client/skins/mobile-320x480-3btn/layout.xml b/tizen/src/skin/client/skins/mobile-320x480-3btn/layout.xml index f1908152e6..9a50f946ff 100644 --- a/tizen/src/skin/client/skins/mobile-320x480-3btn/layout.xml +++ b/tizen/src/skin/client/skins/mobile-320x480-3btn/layout.xml @@ -26,6 +26,7 @@ 158 Back + Esc @@ -72,6 +73,7 @@ 158 Back + Esc @@ -117,6 +119,7 @@ 158 Back + Esc @@ -162,6 +165,7 @@ 158 Back + Esc diff --git a/tizen/src/skin/client/skins/mobile-480x800-3btn/layout.xml b/tizen/src/skin/client/skins/mobile-480x800-3btn/layout.xml index 973ee93ad8..57fb37d2db 100644 --- a/tizen/src/skin/client/skins/mobile-480x800-3btn/layout.xml +++ b/tizen/src/skin/client/skins/mobile-480x800-3btn/layout.xml @@ -26,6 +26,7 @@ 158 Back + Esc @@ -72,6 +73,7 @@ 158 Back + Esc @@ -117,6 +119,7 @@ 158 Back + Esc @@ -162,6 +165,7 @@ 158 Back + Esc diff --git a/tizen/src/skin/client/skins/mobile-540x960-3btn/layout.xml b/tizen/src/skin/client/skins/mobile-540x960-3btn/layout.xml index 42ba76bd3a..7e06325f85 100644 --- a/tizen/src/skin/client/skins/mobile-540x960-3btn/layout.xml +++ b/tizen/src/skin/client/skins/mobile-540x960-3btn/layout.xml @@ -26,6 +26,7 @@ 158 Back + Esc @@ -72,6 +73,7 @@ 158 Back + Esc @@ -117,6 +119,7 @@ 158 Back + Esc @@ -162,6 +165,7 @@ 158 Back + Esc diff --git a/tizen/src/skin/client/skins/mobile-720x1280-3btn/layout.xml b/tizen/src/skin/client/skins/mobile-720x1280-3btn/layout.xml index b67df0aec6..d9b226ccab 100644 --- a/tizen/src/skin/client/skins/mobile-720x1280-3btn/layout.xml +++ b/tizen/src/skin/client/skins/mobile-720x1280-3btn/layout.xml @@ -26,6 +26,7 @@ 158 Back + Esc @@ -72,6 +73,7 @@ 158 Back + Esc @@ -117,6 +119,7 @@ 158 Back + Esc @@ -162,6 +165,7 @@ 158 Back + Esc diff --git a/tizen/src/skin/client/skins/mobile-general-3btn/controller/key-window/layout.xml b/tizen/src/skin/client/skins/mobile-general-3btn/controller/key-window/layout.xml index 91d067b5ea..603652f177 100644 --- a/tizen/src/skin/client/skins/mobile-general-3btn/controller/key-window/layout.xml +++ b/tizen/src/skin/client/skins/mobile-general-3btn/controller/key-window/layout.xml @@ -16,6 +16,7 @@ 158 Back + Esc diff --git a/tizen/src/skin/client/skins/mobile-general-3btn/layout.xml b/tizen/src/skin/client/skins/mobile-general-3btn/layout.xml index 40b940bba7..c5c079e9af 100644 --- a/tizen/src/skin/client/skins/mobile-general-3btn/layout.xml +++ b/tizen/src/skin/client/skins/mobile-general-3btn/layout.xml @@ -50,7 +50,9 @@ - + + Ctrl+F8 + Ctrl+F7 diff --git a/tizen/src/skin/client/skins/tv-1920x1080/layout.xml b/tizen/src/skin/client/skins/tv-1920x1080/layout.xml index 335b5eb6e8..d9278f412e 100644 --- a/tizen/src/skin/client/skins/tv-1920x1080/layout.xml +++ b/tizen/src/skin/client/skins/tv-1920x1080/layout.xml @@ -34,7 +34,9 @@ - + + Ctrl+F8 + Ctrl+F7 diff --git a/tizen/src/skin/client/skins/wearable-general-1btn/layout.xml b/tizen/src/skin/client/skins/wearable-general-1btn/layout.xml index cb25ba469d..06b2823396 100644 --- a/tizen/src/skin/client/skins/wearable-general-1btn/layout.xml +++ b/tizen/src/skin/client/skins/wearable-general-1btn/layout.xml @@ -40,7 +40,9 @@ - + + Ctrl+F8 + Ctrl+F7 diff --git a/tizen/src/ui/input/keyboardshortcut.cpp b/tizen/src/ui/input/keyboardshortcut.cpp index 8acd7027e8..e14d050cb0 100644 --- a/tizen/src/ui/input/keyboardshortcut.cpp +++ b/tizen/src/ui/input/keyboardshortcut.cpp @@ -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 KeyboardShortcut::getControllerShortcutList() return controllerShortcutList; } +QList KeyboardShortcut::getPopupMenuShortcutList() +{ + return popupMenuShortcutList; +} + +QList KeyboardShortcut::getHwKeyShortcutList() +{ + return hwKeyShortcutList; +} + QMap KeyboardShortcut::getPopupMenuShortcutMap() { return popupMenuShortcutMap; @@ -452,5 +475,9 @@ QMap KeyboardShortcut::getControllerShortcutMap() KeyboardShortcut::~KeyboardShortcut() { + removeHwKeyShortcut(); + removeControllerShortcut(); + removePopupMenuShortcut(); + qDebug("destroy keyboard shortcut"); } diff --git a/tizen/src/ui/input/keyboardshortcut.h b/tizen/src/ui/input/keyboardshortcut.h index f178d99f8e..c91d9c1aba 100644 --- a/tizen/src/ui/input/keyboardshortcut.h +++ b/tizen/src/ui/input/keyboardshortcut.h @@ -53,8 +53,11 @@ public: void setKeyboardShortcutContextMenu(MenuItem *item, QString property, QString keySequence); void removeControllerShortcut(); void removeHwKeyShortcut(); + void removePopupMenuShortcut(); QList getControllerShortcutList(); + QList getPopupMenuShortcutList(); + QList getHwKeyShortcutList(); QMap getPopupMenuShortcutMap(); QMap getHwKeyShortcutMap(); QMap getControllerShortcutMap(); @@ -83,6 +86,7 @@ private: MainWindow *parent; QList hwKeyList; QList controllerKeyList; + QList popupMenuShortcutList; QList controllerShortcutList; QList hwKeyShortcutList; QMap popupMenuShortcutMap; diff --git a/tizen/src/ui/menu/detailedinfodialog.cpp b/tizen/src/ui/menu/detailedinfodialog.cpp index a33eed80ee..8c0a535a42 100644 --- a/tizen/src/ui/menu/detailedinfodialog.cpp +++ b/tizen/src/ui/menu/detailedinfodialog.cpp @@ -184,19 +184,26 @@ void DetailedInfoDialog::slotSetMaximumSize(int tab) table->horizontalHeader()->setStretchLastSection(true); } -void DetailedInfoDialog::setShortcutInfoTable(QMap map) +void DetailedInfoDialog::setShortcutInfoTable(QMap map, QList list) { int row = shortcutInfoTable->rowCount(); QMap::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); diff --git a/tizen/src/ui/menu/detailedinfodialog.h b/tizen/src/ui/menu/detailedinfodialog.h index 023cd499ca..3a549554d2 100644 --- a/tizen/src/ui/menu/detailedinfodialog.h +++ b/tizen/src/ui/menu/detailedinfodialog.h @@ -54,7 +54,7 @@ public: ~DetailedInfoDialog(); QTableWidget *getShortcutInfoTable(); - void setShortcutInfoTable(QMap map); + void setShortcutInfoTable(QMap map, QList list); void setDataTable(QTableWidget* table, QString key, QString value, int index); void removeDataTable(QTableWidget* table, int startIndex, int lastIndex);