menu: minor enhancements for menu 29/25829/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Fri, 8 Aug 2014 06:24:22 +0000 (15:24 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Mon, 11 Aug 2014 05:23:45 +0000 (14:23 +0900)
add ram size to Detailed Info dialog
add logging telnet port to Detailed Info dialog
add SDK vesion to About dialog
add build date to About dialog
add snapshot name to About dialog
add hyper link to About dialog & etc

Change-Id: Ibf5e0d4eb751174b15921d45ad49558250868694
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/display/qt5_supplement.cpp
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/ui/mainwindow.h
tizen/src/ui/menu/aboutdialog.cpp
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/menu/detailedinfodialog.cpp
vl.c

index 7f4b2337fb7b898bf3c2436ddc87383aec3484ab..07dce80336e43ee18dc7b0a0f84982aef82a704d 100644 (file)
@@ -75,7 +75,7 @@ void qt5_skin_init(void)
     uiInfo->vmName = get_emul_vm_name();
     uiInfo->resolution.setWidth(get_emul_resolution_width());
     uiInfo->resolution.setHeight(get_emul_resolution_height());
-    uiInfo->basePort = get_emul_vm_base_port();
+    uiInfo->basePort = get_emul_vm_base_port() + 1;
 
     uiInfo->skinPath = get_emul_skin_path();
     if (uiInfo->skinPath.endsWith('/') == false) {
index 9711167ec477bb0fa602fb030b512be9f17f57a4..938fde84a4b8353eb30575a91e47adf5d16ebf7b 100644 (file)
@@ -381,6 +381,17 @@ bool get_emul_cpu_accel(void)
     return false;
 }
 
+/* VM ram size */
+void set_emul_ram_size(const char *size)
+{
+    _emul_info.vm_ram_size = size;
+}
+
+const char* get_emul_ram_size(void)
+{
+    return _emul_info.vm_ram_size;
+}
+
 /* file sharing path */
 void set_emul_file_sharing_path(const char *path)
 {
index c9146f9d4f8ed0217848c90b08bf488ba2f6f62d..5f67f70400c358c46e74dd033322b684cceb6b11 100644 (file)
@@ -96,6 +96,7 @@ typedef  struct EmulatorConfigInfo {
     char *skin_path;
     bool gpu_accel_enable;
     const char *file_sharing_path;
+    const char *vm_ram_size;
     /* add here */
 } EmulatorConfigInfo;
 
@@ -132,6 +133,7 @@ void set_emul_vm_name(char *vm_name);
 void set_emul_skin_path(char *path);
 void set_emul_gpu_accel(bool enable);
 void set_emul_file_sharing_path(const char *path);
+void set_emul_ram_size(const char *size);
 
 void set_emulator_condition(int state);
 void set_emul_rotation(short rotation_type);
@@ -155,6 +157,7 @@ char* get_emul_skin_path(void);
 bool get_emul_gpu_accel(void);
 bool get_emul_cpu_accel(void);
 const char* get_emul_file_sharing_path(void);
+const char* get_emul_ram_size(void);
 
 int get_emulator_condition(void);
 short get_emul_rotation(void);
index 0aa90a15d3c211c0f8843d5f4bb7dde4dda48205..43906dba592c8c650e04eabd30c3bf8a96e9ace2 100644 (file)
@@ -15,10 +15,6 @@ extern "C" {
 #include "skin/maruskin_operation.h"
 }
 
-QT_BEGIN_NAMESPACE
-class QLabel;
-QT_END_NAMESPACE
-
 class DisplaySwapper : public QObject
 {
     Q_OBJECT
index 0eaf4451727d72b020bff9cb9f06d098a2f1d734..367179e0981d9b2b223bc8c3aa1d9ea88e9fc029 100644 (file)
@@ -1,7 +1,8 @@
 #include "aboutdialog.h"
+#include "build_info.h"
 
 #define SDK_NAME "Tizen SDK"
-#define URL_TIZEN_ORG "https://developer.tizen.org";
+#define URL_TIZEN_ORG "<a href=\"https://developer.tizen.org\">https://developer.tizen.org</a>";
 
 AboutDialog::AboutDialog(QWidget *parent) :
     QDialog(parent)
@@ -15,7 +16,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
     /* upside */
     QHBoxLayout *upsideLayout = new QHBoxLayout();
     upsideLayout->setMargin(0);
-    upsideLayout->setSpacing(5);
+    upsideLayout->setSpacing(0);
 
     QLabel *imageLabel = new QLabel(this);
     imageLabel->setPixmap(QPixmap(":about.png"));
@@ -24,17 +25,40 @@ AboutDialog::AboutDialog(QWidget *parent) :
     QSettings sdkVersion("../../../sdk.version", QSettings::IniFormat);
     QString version = sdkVersion.value("TIZEN_SDK_VERSION").toString();
     if (version.isEmpty() == true) {
+        qWarning("failed to load SDK version");
         version = "Undefined";
     }
 
-    QString aboutText = QString(SDK_NAME) + "\n\n"
-        + "Version : " + version + '\n'
-        + "Build ID : " + '\n' //TODO:
-        + "SDK Snapshot Name : " + '\n' //TODO:
-        + "\n\nVisit " + URL_TIZEN_ORG;
+    QString SnapshotName = "Undefined";
+    QFile file("../../../install-manager/installmanager.conf");
+    if (file.open(QIODevice::ReadOnly | QIODevice::Text) == true) {
+        QTextStream in(&file);
+        while (!in.atEnd()) {
+            QString line = in.readLine();
+            if (line.startsWith("Snapshot-Path", Qt::CaseInsensitive) == true) {
+                QStringList snapshotPath = line.split(":", QString::SkipEmptyParts)[1].split("/");
+                SnapshotName = snapshotPath.last().trimmed();
+                qDebug() << "Snapshot Name :" << SnapshotName;
+            }
+        }
+
+        file.close();
+    } else {
+        qWarning("failed to load snapshot name");
+    }
+
+    QString aboutText = QString(SDK_NAME) + "<p>"
+        + "Version : " + version + "<br>"
+        + "Build Date : " + QString(build_date) + "<br>"
+        + "SDK Snapshot Name : " + SnapshotName + "<p><br>"
+        + "Visit " + URL_TIZEN_ORG;
 
     QLabel *textLabel = new QLabel(this);
     textLabel->setStyleSheet("background-color: white");
+    textLabel->setTextFormat(Qt::RichText);
+    //textLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
+    textLabel->setOpenExternalLinks(true);
+    textLabel->setMargin(10);
     textLabel->setText(aboutText);
     upsideLayout->addWidget(textLabel);
 
index 890e7c05032182029747dcda80e0c0767183d15d..b3ca118f8964fde1c8111ff33fb7fa5c938fc00e 100644 (file)
@@ -23,41 +23,43 @@ ContextMenu::ContextMenu(QWidget *parent) :
     connect(action, SIGNAL(triggered(bool)), this, SLOT(slotTopMost(bool)));
 
     /* = Rotate menu = */
-    QMenu *rotateMenu = addMenu(QIcon(QPixmap(":/icons/rotate.png")), "Rotate");
-    QActionGroup *rotateGroup = new QActionGroup(this);
-    rotateMapper = new QSignalMapper(this);
-    connect(rotateMapper, SIGNAL(mapped(int)), this, SLOT(slotRotate(int)));
-
-    action = rotateMenu->addAction("Portrait");
-    action->setActionGroup(rotateGroup);
-    action->setCheckable(true);
-    rotateMapper->setMapping(action, 0);
-    connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
-
-    action = rotateMenu->addAction("Landscape");
-    action->setActionGroup(rotateGroup);
-    action->setCheckable(true);
-    rotateMapper->setMapping(action, 270);
-    connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
-
-    action = rotateMenu->addAction("Reverse Portrait");
-    action->setActionGroup(rotateGroup);
-    action->setCheckable(true);
-    rotateMapper->setMapping(action, 180);
-    connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
-
-    action = rotateMenu->addAction("Reverse Landscape");
-    action->setActionGroup(rotateGroup);
-    action->setCheckable(true);
-    rotateMapper->setMapping(action, 90);
-    connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
-
-    action = (QAction *)rotateMapper->mapping(win->getUIState()->formAngle);
-    action->setChecked(true);
+    if (win->uiInfo->formList.count() > 1) {
+        QMenu *rotateMenu = addMenu(QIcon(QPixmap(":/icons/rotate.png")), "&Rotate");
+        QActionGroup *rotateGroup = new QActionGroup(this);
+        rotateMapper = new QSignalMapper(this);
+        connect(rotateMapper, SIGNAL(mapped(int)), this, SLOT(slotRotate(int)));
+
+        action = rotateMenu->addAction("Portrait");
+        action->setActionGroup(rotateGroup);
+        action->setCheckable(true);
+        rotateMapper->setMapping(action, 0);
+        connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
+
+        action = rotateMenu->addAction("Landscape");
+        action->setActionGroup(rotateGroup);
+        action->setCheckable(true);
+        rotateMapper->setMapping(action, 270);
+        connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
+
+        action = rotateMenu->addAction("Reverse Portrait");
+        action->setActionGroup(rotateGroup);
+        action->setCheckable(true);
+        rotateMapper->setMapping(action, 180);
+        connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
+
+        action = rotateMenu->addAction("Reverse Landscape");
+        action->setActionGroup(rotateGroup);
+        action->setCheckable(true);
+        rotateMapper->setMapping(action, 90);
+        connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
+
+        action = (QAction *)rotateMapper->mapping(win->getUIState()->formAngle);
+        action->setChecked(true);
+    }
     /* =============== */
 
     /* = Scale menu = */
-    QMenu *scaleMenu = addMenu(QIcon(QPixmap(":/icons/scale.png")), "Scale");
+    QMenu *scaleMenu = addMenu(QIcon(QPixmap(":/icons/scale.png")), "&Scale");
     QActionGroup *scaleGroup = new QActionGroup(this);
     scaleMapper = new QSignalMapper(this);
     connect(scaleMapper, SIGNAL(mapped(int)), this, SLOT(slotScale(int)));
@@ -112,7 +114,7 @@ ContextMenu::ContextMenu(QWidget *parent) :
     }
 
     /* = Advanced menu = */
-    QMenu *advancedMenu = addMenu(QIcon(QPixmap(":/icons/advanced.png")), "Advanced");
+    QMenu *advancedMenu = addMenu(QIcon(QPixmap(":/icons/advanced.png")), "Ad&vanced");
 
 #if 0
     /* Advanced > Screen Shot menu */
@@ -125,23 +127,23 @@ ContextMenu::ContextMenu(QWidget *parent) :
 
     /* Advanced > About menu */
     aboutDialog = new AboutDialog(win);
-    action = advancedMenu->addAction("About");
+    action = advancedMenu->addAction("&About");
     action->setIcon(QIcon(QPixmap(":/icons/about.png")));
     connect(action, SIGNAL(triggered()), this, SLOT(slotAbout()));
 
     /* Advanced > Force Close menu */
-    action = advancedMenu->addAction("Force Close");
+    action = advancedMenu->addAction("&Force Close");
     action->setIcon(QIcon(QPixmap(":/icons/force_close.png")));
     connect(action, SIGNAL(triggered()), this, SLOT(slotForceClose()));
     /* ================= */
 
     /* Shell menu */
-    action = addAction("Shell");
+    action = addAction("S&hell");
     action->setIcon(QIcon(QPixmap(":/icons/shell.png")));
     connect(action, SIGNAL(triggered()), this, SLOT(slotShell()));
 
     /* Control Panel menu */
-    action = addAction("Control Panel");
+    action = addAction("Control &Panel");
     action->setIcon(QIcon(QPixmap(":/icons/control_panel.png")));
     connect(action, SIGNAL(triggered()), this, SLOT(slotControlPanel()));
 
@@ -214,11 +216,12 @@ void ContextMenu::slotShell()
         return;
     }
 
-    qint32 basePort = get_emul_vm_base_port();
+    MainWindow *win = (MainWindow *)this->parent();
+    qint32 basePort = win->uiInfo->basePort;
     QString sdbPort = QString::number(basePort + 1);
     QString sdbSerial = "emulator-" + sdbPort;
 
-    QString vmName = get_emul_vm_name();
+    QString vmName = win->uiInfo->vmName;
     QString sdbPath;
 #ifdef CONFIG_WIN32
     sdbPath = "..\\..\\ansicon.exe";
index 9b8c6eb1bdbaa56eaf61c769737f01bdf6a59926..d3f082374ae149a90e97037281af7e17ff3151b5 100644 (file)
@@ -10,7 +10,7 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
 {
     MainWindow *win = ((MainWindow *)this->parent());
 
-    setWindowTitle("Detailed Info - " + win->uiInfo->vmName);
+    setWindowTitle("Detailed Info");
 
     QVBoxLayout *baseLayout = new QVBoxLayout(this);
     baseLayout->setMargin(10);
@@ -23,7 +23,7 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
 
     /* VM information table */
     QTableWidget *infoTable = new QTableWidget(this);
-    infoTable->setRowCount(12);
+    infoTable->setRowCount(11);
     infoTable->setColumnCount(2);
     infoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
     infoTable->setAlternatingRowColors(true);
@@ -56,7 +56,7 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
 
     item = new QTableWidgetItem("Ram Size");
     infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem("0"); // TODO:
+    item = new QTableWidgetItem(get_emul_ram_size());
     infoTable->setItem(index++, 1, item);
 
     item = new QTableWidgetItem("Display Resolution");
@@ -65,10 +65,12 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
         + "x" + QString::number(win->uiInfo->resolution.height()));
     infoTable->setItem(index++, 1, item);
 
+#if 0
     item = new QTableWidgetItem("Display Density");
     infoTable->setItem(index, 0, item);
     item = new QTableWidgetItem("0"); // TODO:
     infoTable->setItem(index++, 1, item);
+#endif
 
     item = new QTableWidgetItem("File Sharing Path");
     infoTable->setItem(index, 0, item);
@@ -96,6 +98,12 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
     item = new QTableWidgetItem(get_log_path());
     infoTable->setItem(index++, 1, item);
 
+    /* temp */
+    item = new QTableWidgetItem("Logging Telnet Port");
+    infoTable->setItem(index, 0, item);
+    item = new QTableWidgetItem(QString::number(win->uiInfo->basePort + 4));
+    infoTable->setItem(index++, 1, item);
+
     int tableHeight = infoTable->horizontalHeader()->height();
     for (int i = 0; i < infoTable->rowCount(); i++) {
             tableHeight += infoTable->rowHeight(i);
diff --git a/vl.c b/vl.c
index 289a88d8869592f5a576161e93dee7cb7a92d099..f6a402d536962bf686f9fdea0bd96fb8a388d219 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3390,6 +3390,10 @@ int main(int argc, char **argv, char **envp)
                     fprintf(stderr, "qemu: ram size too large\n");
                     exit(1);
                 }
+
+#ifdef CONFIG_MARU
+                set_emul_ram_size(optarg);
+#endif
                 break;
             }
 #ifdef CONFIG_TPM