<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<key name="Back">
<keycode>158</keycode>
<tooltip>Back</tooltip>
+ <shortcut>Esc</shortcut>
</key>
<key name="Power">
<separator/>
<advancedItem>
<menuList>
- <controllerItem/>
+ <controllerItem name="Controller">
+ <shortcut>Ctrl+F8</shortcut>
+ </controllerItem>
<screenShotItem name="Screen Shot">
<shortcut>Ctrl+F7</shortcut>
</screenShotItem>
<separator/>
<advancedItem>
<menuList>
- <controllerItem/>
+ <controllerItem name="Controller">
+ <shortcut>Ctrl+F8</shortcut>
+ </controllerItem>
<screenShotItem name="Screen Shot">
<shortcut>Ctrl+F7</shortcut>
</screenShotItem>
<separator/>
<advancedItem>
<menuList>
- <controllerItem/>
+ <controllerItem name="Controller">
+ <shortcut>Ctrl+F8</shortcut>
+ </controllerItem>
<screenShotItem name="Screen Shot">
<shortcut>Ctrl+F7</shortcut>
</screenShotItem>
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);
itemName.append(" " + property);
}
+ popupMenuShortcutList.append(shortcut);
popupMenuShortcutMap.insert(itemName, keySequence);
}
return controllerShortcutList;
}
+QList<QShortcut *> KeyboardShortcut::getPopupMenuShortcutList()
+{
+ return popupMenuShortcutList;
+}
+
+QList<QShortcut *> KeyboardShortcut::getHwKeyShortcutList()
+{
+ return hwKeyShortcutList;
+}
+
QMap<QString, QString> KeyboardShortcut::getPopupMenuShortcutMap()
{
return popupMenuShortcutMap;
KeyboardShortcut::~KeyboardShortcut()
{
+ removeHwKeyShortcut();
+ removeControllerShortcut();
+ removePopupMenuShortcut();
+
qDebug("destroy keyboard shortcut");
}
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();
MainWindow *parent;
QList<HardwareKey *> hwKeyList;
QList<HardwareKey *> controllerKeyList;
+ QList<QShortcut *> popupMenuShortcutList;
QList<QShortcut *> controllerShortcutList;
QList<QShortcut *> hwKeyShortcutList;
QMap<QString, QString> popupMenuShortcutMap;
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();
}
}
/* 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);
~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);