From d39a72830c51f7244be7120777cf4fbc7095ae07 Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Fri, 25 Sep 2015 16:20:51 +0900 Subject: [PATCH] menu: modified shortcut info table on Detailed Info dialog Short-cut key information table has been separated into two parts. One is a Menu short-cut table, the other is HW key short-cut table. Change-Id: I8232cec0e77e6374dd43cc597ad4b5de3ed7a36a Signed-off-by: GiWoong Kim --- tizen/src/ui/menu/detailedinfodialog.cpp | 65 ++++++++++++++++-------- tizen/src/ui/menu/detailedinfodialog.h | 6 ++- 2 files changed, 48 insertions(+), 23 deletions(-) diff --git a/tizen/src/ui/menu/detailedinfodialog.cpp b/tizen/src/ui/menu/detailedinfodialog.cpp index 29a13fac18..b0f0504db6 100644 --- a/tizen/src/ui/menu/detailedinfodialog.cpp +++ b/tizen/src/ui/menu/detailedinfodialog.cpp @@ -66,14 +66,21 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) : /* tab */ tabWidget = new QTabWidget(this); + { + /* VM information table */ + vmInfoTable = createVmInfoTable(); + tabWidget->addTab(vmInfoTable, tr(DETAILED_INFO_VMTAB_TITLE)); - /* VM information table */ - vmInfoTable = createVmInfoTable(); - tabWidget->addTab(vmInfoTable, tr(DETAILED_INFO_VMTAB_TITLE)); + /* shortcut information table */ + QTabWidget *shortcutTab = new QTabWidget(tabWidget); - /* shortcut info table */ - shortcutInfoTable = createShortcutInfoTable(); - tabWidget->addTab(shortcutInfoTable, tr(DETAILED_INFO_SHORTCUTTAB_TITLE)); + menuShortcutTable = createShortcutInfoTable(); + shortcutTab->addTab(menuShortcutTable, "Menu"); + keyShortcutTable = createShortcutInfoTable(); + shortcutTab->addTab(keyShortcutTable, "HW Key"); + + tabWidget->addTab(shortcutTab, DETAILED_INFO_SHORTCUTTAB_TITLE); + } upsideLayout->addWidget(tabWidget); baseLayout->addLayout(upsideLayout); @@ -205,24 +212,40 @@ QTableWidget *DetailedInfoDialog::createShortcutInfoTable() void DetailedInfoDialog::updateShortcutTableItems() { - qDebug() << "clear" << shortcutInfoTable->rowCount() << "shortcut items"; - removeTableRows(shortcutInfoTable, 0, shortcutInfoTable->rowCount()); - /* insert menu shortcut info */ - insertMenuShortcutInfo(win->getUiInfo()->getMenuList()); + { + qDebug() << "clear" << + menuShortcutTable->rowCount() << "menu shortcut items"; + removeTableRows(menuShortcutTable, 0, menuShortcutTable->rowCount()); - // TODO: consider getHwKeyShortcutMap() - /* insert HW key shortcut info */ - insertHwKeyShortcutInfo(win->getUiInfo()->getMainForm()->getKeyList()); + insertMenuShortcutInfo(win->getUiInfo()->getMenuList()); - /* insert Controller's HW key shortcut info */ - ControllerForm *conForm = win->getUiInfo()->getConForm(); - if (conForm != NULL) { - insertHwKeyShortcutInfo(win->getUiInfo()->getConForm()->getKeyList(), - QString(" (controller)")); + menuShortcutTable->resizeColumnsToContents(); + qDebug() << menuShortcutTable->rowCount() << + "menu shortcut items have been inserted"; } - qDebug() << shortcutInfoTable->rowCount() << "shortcut items have been inserted"; + /* insert HW key shortcut info */ + { + qDebug() << "clear" << + keyShortcutTable->rowCount() << "key shortcut items"; + removeTableRows(keyShortcutTable, 0, keyShortcutTable->rowCount()); + + // TODO: consider getHwKeyShortcutMap() + insertHwKeyShortcutInfo( + win->getUiInfo()->getMainForm()->getKeyList()); + + ControllerForm *conForm = win->getUiInfo()->getConForm(); + if (conForm != NULL) { + insertHwKeyShortcutInfo( + win->getUiInfo()->getConForm()->getKeyList(), + QString(" (controller)")); + } + + keyShortcutTable->resizeColumnsToContents(); + qDebug() << keyShortcutTable->rowCount() << + "key shortcut items have been inserted"; + } } void DetailedInfoDialog::insertMenuShortcutInfo(QList &list) @@ -252,7 +275,7 @@ void DetailedInfoDialog::insertMenuShortcutInfo(QList &list) keySequence.replace("Ctrl", "Cmd"); #endif - insertTableRow(shortcutInfoTable, function, keySequence); + insertTableRow(menuShortcutTable, function, keySequence); } } } @@ -268,7 +291,7 @@ void DetailedInfoDialog::insertHwKeyShortcutInfo( hwKey = list.at(i); if (hwKey && hwKey->getKeySequence().isEmpty() == false && hwKey->getName().isEmpty() == false) { - insertTableRow(shortcutInfoTable, + insertTableRow(keyShortcutTable, hwKey->getName() + source, hwKey->getKeySequence().toString()); } } diff --git a/tizen/src/ui/menu/detailedinfodialog.h b/tizen/src/ui/menu/detailedinfodialog.h index e06dbf0e10..031609fa8c 100644 --- a/tizen/src/ui/menu/detailedinfodialog.h +++ b/tizen/src/ui/menu/detailedinfodialog.h @@ -65,7 +65,8 @@ private: void removeTableRows(QTableWidget *table, int startIndex, int lastIndex); void insertMenuShortcutInfo(QList &list); - void insertHwKeyShortcutInfo(QList &list, QString source = ""); + void insertHwKeyShortcutInfo( + QList &list, QString source = ""); MainWindow *win; QVBoxLayout *baseLayout; @@ -74,7 +75,8 @@ private: QTabWidget *tabWidget; QTableWidget *vmInfoTable; - QTableWidget *shortcutInfoTable; + QTableWidget *menuShortcutTable; + QTableWidget *keyShortcutTable; KeyboardShortcut *keyboardShortcut; }; -- 2.34.1