menu: detailed info dialog source code refactoring
authorGiWoong Kim <giwoong.kim@samsung.com>
Thu, 13 Aug 2015 08:39:11 +0000 (17:39 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 17 Aug 2015 07:42:23 +0000 (16:42 +0900)
remove a manual resizing
modified some variable and function names
declare new functions for widgets
and set fixed size for About dialog

Change-Id: Ifef06bae4d17e35eede846c74f2ba4eb6f6760fa
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/ui/menu/aboutdialog.cpp
tizen/src/ui/menu/detailedinfodialog.cpp
tizen/src/ui/menu/detailedinfodialog.h

index c6d4127a4094b6a650be1d6aa1080e8df75395d8..88a8dd090d3256bf9c81864c90b592e865478514 100644 (file)
@@ -32,7 +32,7 @@
 #include "build_info.h"
 
 AboutDialog::AboutDialog(QWidget *parent) :
-    QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint)
+    QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint)
 {
     setWindowTitle(ABOUT_TITLE);
 
@@ -120,6 +120,8 @@ void AboutDialog::showEvent(QShowEvent *event)
 {
     Q_UNUSED(event)
 
+    setFixedSize(size());
+
     QWidget *win = parentWidget();
     move(win->geometry().center().x() - (geometry().size().width() / 2),
         win->geometry().center().y() - (geometry().size().height() / 2));
index 455d22a972d001afecc15432883b6a3227e623e0..bf3266f25c68a20af801166e1b63af69c7038126 100644 (file)
@@ -38,170 +38,164 @@ int get_display_pixel_density(void);
 extern int _qemu_argc;
 extern char **_qemu_argv;
 
+#define TABLE_BORDER_SIZE 2
+#define TAB_BORDER_SIZE 4
+#define DIALOG_HORIZ_SPACE 20
+#define DIALOG_VERTIC_SPACE 60
+#define DIALOG_MIN_WIDTH 200
+#define DIALOG_MIN_HEIGHT 200
+#define DIALOG_DEF_WIDTH 320
+#define DIALOG_DEF_HEIGHT 480
+
 DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
-    QDialog(parent, Qt::Tool | Qt::WindowTitleHint |
-                    Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint)
+    QDialog(parent)
 {
-    QStringList imagePathList = getImagePathList();
-    MainWindow *win = ((MainWindow *)parent);
+    win = ((MainWindow *)parent);
     keyboardShortcut = win->getKeyboardShortcut();
 
     setWindowTitle(DETAILED_INFO_TITLE);
+    setMinimumWidth(DIALOG_MIN_WIDTH);
+    setMinimumHeight(DIALOG_MIN_HEIGHT);
 
     baseLayout = new QVBoxLayout(this);
     baseLayout->setMargin(10);
     baseLayout->setSpacing(10);
 
     /* upside */
-    upsideLayout = new QHBoxLayout(this);
+    upsideLayout = new QHBoxLayout();
     upsideLayout->setMargin(0);
     upsideLayout->setSpacing(0);
 
     /* tab */
     tabWidget = new QTabWidget(this);
-    QWidget *vmInfo = new QWidget;
-    QWidget *shortcutInfo = new QWidget;
+
+    /* VM information table */
+    QTableWidget *vmInfo = createVmInfoTable();
     tabWidget->addTab(vmInfo, tr(DETAILED_INFO_VMTAB_TITLE));
+
+    /* shortcut info table */
+    QTableWidget *shortcutInfo = createShortcutInfoTable();
     tabWidget->addTab(shortcutInfo, tr(DETAILED_INFO_SHORTCUTTAB_TITLE));
-    connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotSetMaximumSize(int)));
+    upsideLayout->addWidget(tabWidget);
 
-    /* VM information table */
-    vmInfoTable = new QTableWidget(vmInfo);
-    vmInfoTable->setColumnCount(2);
-    vmInfoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
-    vmInfoTable->setAlternatingRowColors(true);
-    vmInfoTable->verticalHeader()->hide();
+    baseLayout->addLayout(upsideLayout);
+
+    /* downside */
+    downsideLayout = new QHBoxLayout();
+    downsideLayout->setAlignment(Qt::AlignRight);
+    downsideLayout->setMargin(0);
 
-    QStringList header;
-    header << DETAILED_INFO_VMTAB_HEADER1 << DETAILED_INFO_VMTAB_HEADER2;
-    vmInfoTable->setHorizontalHeaderLabels(header);
+    QPushButton *okBtn = new QPushButton("OK", this);
+    connect(okBtn, SIGNAL(clicked()), this, SLOT(close()));
+    downsideLayout->addWidget(okBtn);
 
-    /* shortcut info table */
-    shortcutInfoTable = new QTableWidget(shortcutInfo);
-    shortcutInfoTable->setColumnCount(2);
-    shortcutInfoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
-    shortcutInfoTable->setAlternatingRowColors(true);
-    shortcutInfoTable->verticalHeader()->hide();
+    baseLayout->addLayout(downsideLayout);
+
+    resize(DIALOG_DEF_WIDTH, DIALOG_DEF_HEIGHT);
+}
+
+QTableWidget *DetailedInfoDialog::createVmInfoTable()
+{
+    vmInfoTable = new QTableWidget();
+
+    /* horizontal headers */
+    QStringList headers;
+    headers << DETAILED_INFO_VMTAB_HEADER1 << DETAILED_INFO_VMTAB_HEADER2;
+
+    vmInfoTable->setColumnCount(headers.count());
+    vmInfoTable->setHorizontalHeaderLabels(headers);
+    vmInfoTable->horizontalHeader()->setStretchLastSection(true);
+    vmInfoTable->verticalHeader()->hide();
 
-    header.clear();
-    header << DETAILED_INFO_SHORTCUTTAB_HEADER1 << DETAILED_INFO_SHORTCUTTAB_HEADER2;
-    shortcutInfoTable->setHorizontalHeaderLabels(header);
+    vmInfoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
+    vmInfoTable->setAlternatingRowColors(true);
 
-    /* table items */
+    /* insert table items */
     int index = 0;
-    setDataTable(vmInfoTable, DETAILED_INFO_VM_NAME,
+    insertTableRow(vmInfoTable, DETAILED_INFO_VM_NAME,
         win->uiInfo->vmName, index++);
 
-    setDataTable(vmInfoTable, DETAILED_INFO_SKIN_NAME,
+    insertTableRow(vmInfoTable, DETAILED_INFO_SKIN_NAME,
         win->uiInfo->skinName, index++);
 
-    setDataTable(vmInfoTable, DETAILED_INFO_CPU, "x86", index++);
+    insertTableRow(vmInfoTable, DETAILED_INFO_CPU, "x86", index++);
 
-    setDataTable(vmInfoTable, DETAILED_INFO_RAM_SIZE,
+    insertTableRow(vmInfoTable, DETAILED_INFO_RAM_SIZE,
         QString::number(get_ram_size() >> 20) + " MiB", index++);
-    setDataTable(vmInfoTable, DETAILED_INFO_DPY_RESOLUTION,
+
+    insertTableRow(vmInfoTable, DETAILED_INFO_DPY_RESOLUTION,
         QString::number(win->uiInfo->resolution.width()) + "x" +
         QString::number(win->uiInfo->resolution.height()), index++);
 
-    setDataTable(vmInfoTable, DETAILED_INFO_DPY_DENSITY,
+    insertTableRow(vmInfoTable, DETAILED_INFO_DPY_DENSITY,
         QString::number(get_display_pixel_density()), index++);
 
     QString sharingPath(get_emul_file_sharing_path());
-    setDataTable(vmInfoTable, DETAILED_INFO_HDS_PATH,
+    insertTableRow(vmInfoTable, DETAILED_INFO_HDS_PATH,
         (sharingPath.isEmpty()) ? GENERIC_TEXT_NONE : sharingPath, index++);
 
-    setDataTable(vmInfoTable, DETAILED_INFO_CPU_VT,
+    insertTableRow(vmInfoTable, DETAILED_INFO_CPU_VT,
         (get_emul_cpu_accel()) ? GENERIC_TEXT_ENABLED : GENERIC_TEXT_DISABLED, index++);
 
-    setDataTable(vmInfoTable, DETAILED_INFO_GPU_VT,
+    insertTableRow(vmInfoTable, DETAILED_INFO_GPU_VT,
         (is_gpu_accel_enabled()) ? GENERIC_TEXT_ENABLED : GENERIC_TEXT_DISABLED, index++);
 
+    QStringList imagePathList = getImagePathList();
     for (int i = 0; i < imagePathList.size(); i++) {
-        setDataTable(vmInfoTable, QString(DETAILED_INFO_IMAGE_PATH) + " " +
+        insertTableRow(vmInfoTable, QString(DETAILED_INFO_IMAGE_PATH) + " " +
             QString::number(i + 1), imagePathList[i], index++);
 
         item->setToolTip(imagePathList[i]);
     }
 
-    setDataTable(vmInfoTable, DETAILED_INFO_LOG_PATH, get_log_path(), index++);
+    insertTableRow(vmInfoTable, DETAILED_INFO_LOG_PATH, get_log_path(), index++);
     item->setToolTip(get_log_path());
 
 #if 0
-    setDataTable(vmInfoTable, DETAILED_INFO_TELNET_PORT,
+    insertTableRow(vmInfoTable, DETAILED_INFO_TELNET_PORT,
         QString::number(get_emul_serial_port()), index++);
 #endif
 
     /* add double click event listener */
     connect(vmInfoTable, SIGNAL(cellDoubleClicked(int, int)),
-        this, SLOT(slotDoubleClicked(int, int)));
-
-    int tableHeight = vmInfoTable->horizontalHeader()->height();
-    for (int i = 0; i < vmInfoTable->rowCount(); i++) {
-        tableHeight += vmInfoTable->rowHeight(i);
-    }
-
-    setMinimumWidth(DIALOG_MIN_WIDTH);
-    setMinimumHeight(DIALOG_MIN_HEIGHT);
-    slotSetMaximumSize(tabWidget->currentIndex());
+        this, SLOT(slotCellOpen(int, int)));
 
-    upsideLayout->addWidget(tabWidget);
+    return vmInfoTable;
+}
 
-    baseLayout->addLayout(upsideLayout);
+QTableWidget *DetailedInfoDialog::createShortcutInfoTable()
+{
+    shortcutInfoTable = new QTableWidget();
 
-    /* downside */
-    downsideLayout = new QHBoxLayout(this);
-    downsideLayout->setAlignment(Qt::AlignRight);
-    downsideLayout->setMargin(0);
+    /* horizontal headers */
+    QStringList headers;
+    headers << DETAILED_INFO_SHORTCUTTAB_HEADER1 << DETAILED_INFO_SHORTCUTTAB_HEADER2;
 
-    okBtn = new QPushButton("OK", this);
-    connect(okBtn, SIGNAL(clicked()), this, SLOT(close()));
-    downsideLayout->addWidget(okBtn);
+    shortcutInfoTable->setColumnCount(headers.count());
+    shortcutInfoTable->setHorizontalHeaderLabels(headers);
+    shortcutInfoTable->horizontalHeader()->setStretchLastSection(true);
+    shortcutInfoTable->verticalHeader()->hide();
 
-    baseLayout->addLayout(downsideLayout);
+    shortcutInfoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
+    shortcutInfoTable->setAlternatingRowColors(true);
 
-    resize(DIALOG_DEF_WIDTH, DIALOG_DEF_HEIGHT);
+    return shortcutInfoTable;
 }
 
-void DetailedInfoDialog::slotSetMaximumSize(int tab)
+void DetailedInfoDialog::updateShortcutTableItems()
 {
-    QTableWidget *table = NULL;
-    int tRow = 0;
-    int tHeight = 0;
-    int tWidth = 0;
-
-    switch (tab) {
-        case 0: /* vmInfoTab */
-            table = vmInfoTable;
-            break;
-        case 1: /* shortcutInfoTab */
-            table = shortcutInfoTable;
-            break;
-        default:
-            qWarning() << "unimplemented tab: " << tab;
-            return;
-    }
-
-    table->resizeColumnsToContents();
-
-    /* width */
-    tWidth = table->columnWidth(0) + table->columnWidth(1);
-    tWidth = (tWidth < DIALOG_DEF_WIDTH) ? DIALOG_DEF_WIDTH : tWidth;
-
-    setMaximumWidth(tWidth + TABLE_BORDER_SIZE +
-                             TAB_BORDER_SIZE +
-                             DIALOG_HORIZ_SPACE);
-
-    /* height */
-    tHeight = table->horizontalHeader()->height();
-    for (tRow = 0; tRow < table->rowCount(); tRow++) {
-        tHeight += table->rowHeight(tRow);
-    }
+    qDebug() << "clear" << shortcutInfoTable->rowCount() << "shortcut items";
+    removeTableRows(shortcutInfoTable, 0, shortcutInfoTable->rowCount());
 
-    setMaximumHeight(tHeight + TABLE_BORDER_SIZE +
-                               tabWidget->tabBar()->sizeHint().height() +
-                               DIALOG_VERTIC_SPACE);
+    /* insert shortcut info */
+    setShortcutInfoTable(keyboardShortcut->getPopupMenuShortcutMap(),
+                         keyboardShortcut->getPopupMenuShortcutList());
+    setShortcutInfoTable(keyboardShortcut->getHwKeyShortcutMap(),
+                         keyboardShortcut->getHwKeyShortcutList());
+    setShortcutInfoTable(keyboardShortcut->getControllerShortcutMap(),
+                         keyboardShortcut->getControllerShortcutList());
 
-    table->horizontalHeader()->setStretchLastSection(true);
+    qDebug() << shortcutInfoTable->rowCount() << "shortcut items have been inserted";
 }
 
 void DetailedInfoDialog::setShortcutInfoTable(
@@ -216,9 +210,9 @@ void DetailedInfoDialog::setShortcutInfoTable(
 #ifdef CONFIG_DARWIN
                 QString value = mapIter.value();
                 value.replace("Ctrl", "Cmd");
-                setDataTable(shortcutInfoTable, mapIter.key(), value, row++);
+                insertTableRow(shortcutInfoTable, mapIter.key(), value, row++);
 #else
-                setDataTable(shortcutInfoTable, mapIter.key(), mapIter.value(), row++);
+                insertTableRow(shortcutInfoTable, mapIter.key(), mapIter.value(), row++);
 #endif
                 break;
             }
@@ -228,8 +222,52 @@ void DetailedInfoDialog::setShortcutInfoTable(
     }
 }
 
-void DetailedInfoDialog::setDataTable(
-    QTableWidget* table, QString key, QString value, int index)
+/* override */
+void DetailedInfoDialog::showEvent(QShowEvent *event)
+{
+    updateShortcutTableItems();
+
+    if ((windowState() & Qt::WindowMaximized) == 0) {
+        tabWidget->setCurrentIndex(0);
+        resizeTableToContents(vmInfoTable);
+    }
+
+    move(win->geometry().center().x() - (geometry().size().width() / 2),
+        win->geometry().center().y() - (geometry().size().height() / 2));
+
+    QDialog::showEvent(event);
+}
+
+/* override */
+void DetailedInfoDialog::resizeEvent(QResizeEvent *event)
+{
+    /* do nothing */
+
+    QDialog::resizeEvent(event);
+}
+
+void DetailedInfoDialog::resizeTableToContents(QTableWidget *table)
+{
+    /* width */
+    int tWidth = qMin(table->columnWidth(0) + table->columnWidth(1), DIALOG_DEF_WIDTH);
+    tWidth += TABLE_BORDER_SIZE + TAB_BORDER_SIZE + DIALOG_HORIZ_SPACE;
+
+    /* height */
+    int tHeight = table->horizontalHeader()->height();
+    for (int tRow = 0; tRow < table->rowCount(); tRow++) {
+        tHeight += table->rowHeight(tRow);
+    }
+    tHeight += TABLE_BORDER_SIZE +
+        tabWidget->tabBar()->sizeHint().height() + DIALOG_VERTIC_SPACE;
+
+    resize(tWidth, tHeight);
+
+    shortcutInfoTable->resizeColumnsToContents();
+    vmInfoTable->resizeColumnsToContents();
+}
+
+void DetailedInfoDialog::insertTableRow(
+    QTableWidget *table, QString key, QString value, int index)
 {
     table->insertRow(index);
     item = new QTableWidgetItem(key);
@@ -238,20 +276,10 @@ void DetailedInfoDialog::setDataTable(
     table->setItem(index, 1, item);
 }
 
-void DetailedInfoDialog::resizeEvent(QResizeEvent* event)
-{
-    int tWidth = 0, tHeight = 0;
-    tWidth = event->size().width() - TAB_BORDER_SIZE - DIALOG_HORIZ_SPACE;
-    tHeight = event->size().height() - tabWidget->tabBar()->sizeHint().height() -
-                                       DIALOG_VERTIC_SPACE;
-
-    vmInfoTable->resize(tWidth, tHeight);
-    shortcutInfoTable->resize(tWidth, tHeight);
-}
-
-void DetailedInfoDialog::removeDataTable(QTableWidget* table, int startIndex, int lastIndex)
+void DetailedInfoDialog::removeTableRows(
+    QTableWidget *table, int startIndex, int lastIndex)
 {
-    for (int cnt = startIndex; cnt < lastIndex; cnt++) {
+    for (int index = startIndex; index < lastIndex; index++) {
         table->removeRow(startIndex);
     }
 }
@@ -272,23 +300,23 @@ QStringList DetailedInfoDialog::getImagePathList()
     return imagePathList;
 }
 
-void DetailedInfoDialog::slotDoubleClicked(int nRow, int nCol)
+void DetailedInfoDialog::slotCellOpen(int nRow, int nCol)
 {
-    QTableWidgetItem *item;
-    QString string;
-
-    /* Feature side double click event is occured, ignore it */
-    if (nCol == 0)
+    if (nCol <= 0 || nRow >= vmInfoTable->rowCount()) {
         return;
+    }
+
+    QTableWidgetItem *item = vmInfoTable->item(nRow, 0);
+    qDebug() << item->text() << "item was double clicked";
 
-    item = vmInfoTable->item(nRow, 0);
     if (item->text().compare(DETAILED_INFO_HDS_PATH, Qt::CaseInsensitive) == 0 ||
-            item->text().startsWith(DETAILED_INFO_IMAGE_PATH) == true ||
-            item->text().compare(DETAILED_INFO_LOG_PATH, Qt::CaseInsensitive) == 0) {
-        /* get path name */
+        item->text().compare(DETAILED_INFO_LOG_PATH, Qt::CaseInsensitive) == 0 ||
+        item->text().startsWith(DETAILED_INFO_IMAGE_PATH) == true) {
+        /* get path item */
         item = vmInfoTable->item(nRow, nCol);
-        if (item->text().compare("None", Qt::CaseInsensitive) == 0 ||
-                item->text().compare("", Qt::CaseInsensitive) == 0) {
+
+        if (item->text().compare(GENERIC_TEXT_NONE, Qt::CaseInsensitive) == 0 ||
+            item->text().isEmpty() == true) {
             /* ignore this event */
             return;
         }
@@ -297,59 +325,23 @@ void DetailedInfoDialog::slotDoubleClicked(int nRow, int nCol)
         return;
     }
 
-    if (QFileInfo(item->text()).isDir() == true) {
-        /* path name is a directory name */
-        QDesktopServices::openUrl(QUrl("file:///" + item->text(), QUrl::TolerantMode));
-    } else if (QFileInfo(item->text()).isFile() == true) {
-        /* path name is a file name */
-        QDesktopServices::openUrl(QUrl(
-            "file:///" + QFileInfo(item->text()).absolutePath(), QUrl::TolerantMode));
+    QFileInfo pathInfo(item->text());
+    if (pathInfo.isDir() == true) {
+        /* directory path */
+        QDesktopServices::openUrl(
+            QUrl("file:///" + item->text(), QUrl::TolerantMode));
+    } else if (pathInfo.isFile() == true) {
+        /* file path */
+        QDesktopServices::openUrl(
+            QUrl("file:///" + pathInfo.absolutePath(), QUrl::TolerantMode));
     } else {
-        qWarning("wrong path name");
+        qWarning() << "invalid path info:" << item->text();
     }
 
     return;
 }
 
-void DetailedInfoDialog::showEvent(QShowEvent *event)
-{
-    Q_UNUSED(event)
-
-    QWidget *win = parentWidget();
-    move(win->geometry().center().x() - (geometry().size().width() / 2),
-        win->geometry().center().y() - (geometry().size().height() / 2));
-
-    /* insert shortcut info */
-    removeDataTable(shortcutInfoTable, 0, shortcutInfoTable->rowCount());
-    setShortcutInfoTable(keyboardShortcut->getPopupMenuShortcutMap(),
-                         keyboardShortcut->getPopupMenuShortcutList());
-    setShortcutInfoTable(keyboardShortcut->getHwKeyShortcutMap(),
-                         keyboardShortcut->getHwKeyShortcutList());
-    setShortcutInfoTable(keyboardShortcut->getControllerShortcutMap(),
-                         keyboardShortcut->getControllerShortcutList());
-
-    vmInfoTable->horizontalHeader()->setStretchLastSection(true);
-    shortcutInfoTable->horizontalHeader()->setStretchLastSection(true);
-}
-
-QTableWidget *DetailedInfoDialog::getShortcutInfoTable()
-{
-    return shortcutInfoTable;
-}
-
 DetailedInfoDialog::~DetailedInfoDialog()
 {
     qDebug("destroy detailed info dialog");
-
-    for (int i = 0; i < vmInfoTable->rowCount(); i++) {
-        for (int j = 0; j < vmInfoTable->columnCount(); j++) {
-            delete vmInfoTable->item(i, j);
-        }
-    }
-
-    for (int i = 0; i < shortcutInfoTable->rowCount(); i++) {
-        for (int j = 0; j < shortcutInfoTable->columnCount(); j++) {
-            delete shortcutInfoTable->item(i, j);
-        }
-    }
 }
index 4efe368305c719b0f2910b0f977e6fb61fefba7c..8d9099f87845c4ef54d2177e8b7b3f704eb13f35 100644 (file)
  *
  */
 
-#ifndef DETAILEDINFODIALOG_H
-#define DETAILEDINFODIALOG_H
+#ifndef DETAILEDINFO_DIALOG_H
+#define DETAILEDINFO_DIALOG_H
 
 #include <QtWidgets>
 #include <QDialog>
 
 #include "input/keyboardshortcut.h"
 
-#define TABLE_BORDER_SIZE 2
-#define TAB_BORDER_SIZE 4
-#define DIALOG_HORIZ_SPACE 20
-#define DIALOG_VERTIC_SPACE 60
-#define DIALOG_MIN_WIDTH 200
-#define DIALOG_MIN_HEIGHT 200
-#define DIALOG_DEF_WIDTH 320
-#define DIALOG_DEF_HEIGHT 473
-
 class DetailedInfoDialog : public QDialog
 {
     Q_OBJECT
@@ -52,30 +43,35 @@ public:
     explicit DetailedInfoDialog(QWidget *parent = 0);
     ~DetailedInfoDialog();
 
-    QTableWidget *getShortcutInfoTable();
+    void updateShortcutTableItems();
     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);
+    void insertTableRow(QTableWidget *table, QString key, QString value, int index);
+    void removeTableRows(QTableWidget *table, int startIndex, int lastIndex);
+
+public slots:
+    void slotCellOpen(int nRow, int nCol);
 
 protected:
     void showEvent(QShowEvent *event);
     void resizeEvent(QResizeEvent *event);
 
-public slots:
-    void slotDoubleClicked(int nRow, int nCol);
-    void slotSetMaximumSize(int tab);
-
 private:
-    QStringList getImagePathList();
+    QTableWidget *createVmInfoTable();
+    QTableWidget *createShortcutInfoTable();
+    void resizeTableToContents(QTableWidget *table);
+
+    QStringList getImagePathList(); // TODO:
+
+    MainWindow *win;
     QVBoxLayout *baseLayout;
     QHBoxLayout *upsideLayout;
+    QHBoxLayout *downsideLayout;
+
+    QTabWidget *tabWidget;
     QTableWidget *vmInfoTable;
     QTableWidget *shortcutInfoTable;
     QTableWidgetItem *item;
-    QHBoxLayout *downsideLayout;
-    QPushButton *okBtn;
     KeyboardShortcut* keyboardShortcut;
-    QTabWidget *tabWidget;
 };
 
-#endif // DETAILEDINFODIALOG_H
+#endif // DETAILEDINFO_DIALOG_H