menu: add about dialog contents 28/25428/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Tue, 5 Aug 2014 02:19:41 +0000 (11:19 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Tue, 5 Aug 2014 02:26:25 +0000 (11:26 +0900)
Change-Id: Ic24dc3d2e1b53977ee962643a1cd9e8267aa3544
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/display/qt5_supplement.cpp
tizen/src/ui/controllerwidget.cpp
tizen/src/ui/mainwindow.cpp
tizen/src/ui/menu/aboutdialog.cpp
tizen/src/ui/menu/aboutdialog.h
tizen/src/ui/resource/about.png [new file with mode: 0644]
tizen/src/ui/resource/resource.qrc
tizen/src/ui/skincontrollerview.cpp
tizen/src/ui/skinview.cpp

index 22dc0d79028384887bbbde5671e98fe1ddfe64ef..c84dc25151eb36d3c488716abb20ba4e3a058b61 100644 (file)
@@ -64,6 +64,9 @@ static UIInformation *uiInfo;
 
 void qt5_skin_init(void)
 {
+    qDebug() << "* Qt version :" << QT_VERSION_STR;
+    qDebug() << "* working directory :" << QDir::currentPath();
+
     uiInfo = new UIInformation();
 
     /* parameter parsing */
index 2978f7f2c4842f0aab271217673ca70d022dfd6b..a425d82512cddb56ffa0a4d4e8524dee608f3d42 100644 (file)
@@ -31,7 +31,7 @@ void ControllerWidget::showEvent(QShowEvent *event)
 
 void ControllerWidget::setRegion(QImage baseImage)
 {
-    qDebug("set region");
+    //qDebug("set region");
 
     QImage region = baseImage.createAlphaMask();
 
index 475e25241f00a8de967bd029092073144007bbac..e89585670a877271e84766a8ffb5660cb2601230 100644 (file)
@@ -235,7 +235,7 @@ void MainWindow::updateSkin() // TODO: temp
 
 void MainWindow::setRegion(QImage baseImage)
 {
-    qDebug("set region");
+    //qDebug("set region");
 
     QImage region = baseImage.createAlphaMask().scaled(
                 baseImage.width() * getUIState()->getScaleFactor(),
index 45e2819e29b3f48deee7f089c6de90de64ea947f..c52947e20c96050868fa8f615c6f9c3a88868d38 100644 (file)
@@ -1,18 +1,64 @@
 #include "aboutdialog.h"
 
+#define SDK_NAME "Tizen SDK"
+#define URL_TIZEN_ORG "https://developer.tizen.org";
+
 AboutDialog::AboutDialog(QWidget *parent) :
     QDialog(parent)
 {
     setWindowTitle("About Emulator");
+
+    QVBoxLayout *baseLayout = new QVBoxLayout(this);
+    baseLayout->setMargin(0);
+    baseLayout->setSpacing(5);
+
+    /* upside */
+    QHBoxLayout *upsideLayout = new QHBoxLayout();
+    upsideLayout->setMargin(0);
+    upsideLayout->setSpacing(5);
+
+    QLabel *imageLabel = new QLabel(this);
+    imageLabel->setPixmap(QPixmap(":about.png"));
+    upsideLayout->addWidget(imageLabel);
+
+    QSettings *sdkVersion = new QSettings("../../../sdk.version", QSettings::IniFormat);
+    QString version = sdkVersion->value("TIZEN_SDK_VERSION").toString();
+    if (version.isEmpty() == true) {
+        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;
+
+    QLabel *textLabel = new QLabel(this);
+    textLabel->setStyleSheet("background-color: white");
+    textLabel->setText(aboutText);
+    upsideLayout->addWidget(textLabel);
+
+    baseLayout->addLayout(upsideLayout);
+
+    /* downside */
+    QHBoxLayout *downsideLayout = new QHBoxLayout();
+    downsideLayout->setAlignment(Qt::AlignRight);
+    downsideLayout->setMargin(10);
+
+    QPushButton *okBtn = new QPushButton("OK", this);
+    connect(okBtn, SIGNAL(clicked()), this, SLOT(close()));
+    downsideLayout->addWidget(okBtn);
+
+    baseLayout->addLayout(downsideLayout);
 }
 
 void AboutDialog::showEvent(QShowEvent *event)
 {
     Q_UNUSED(event)
 
-    QWidget *parent = ((QWidget *)this->parent());
-    move(parent->geometry().center().x() - (geometry().size().width() / 2),
-         parent->geometry().center().y() - (geometry().size().height() / 2));
+    QWidget *win = ((QWidget *)this->parent());
+    move(win->geometry().center().x() - (geometry().size().width() / 2),
+        win->geometry().center().y() - (geometry().size().height() / 2));
 }
 
 AboutDialog::~AboutDialog()
index 1f23a4cd7ed32122334bf7a8e4c9a57522cf3585..36a3e5affd2ae7d1f966149b1fade70fb631ecc3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ABOUTDIALOG_H
 #define ABOUTDIALOG_H
 
-#include <QDialog>
+#include <QtWidgets>
 
 class AboutDialog : public QDialog
 {
diff --git a/tizen/src/ui/resource/about.png b/tizen/src/ui/resource/about.png
new file mode 100644 (file)
index 0000000..b276703
Binary files /dev/null and b/tizen/src/ui/resource/about.png differ
index 8b561db5bdd31cd575d4a69258b3201a9bbb4302..4ec3b7d3bea72541aa2b6e7c6ab66255d43effef 100644 (file)
@@ -20,6 +20,7 @@
         <file>mobile-720x1280-3btn/layout.qml</file>
     </qresource>
     <qresource prefix="/">
+        <file>about.png</file>
         <file>icons/emulator_icon.ico</file>
         <file>icons/shell.png</file>
         <file>icons/about.png</file>
index 8704bc5bd70a3e20f4191f8a51e298dba1b73261..1e4cbf3c04f5dd3ad71f4f0352e55aad1a75ddb3 100644 (file)
@@ -40,7 +40,7 @@ void SkinControllerView::createItems(ControllerLayout *conLayout)
 
 void SkinControllerView::resizeEvent(QResizeEvent *event)
 {
-    qDebug("resize con view");
+    //qDebug("resize con view");
 
     Q_UNUSED(event)
 }
index c25e5ca4ac8f1187736b5f7414e273d00a4dc22d..3943e25e00db1e175caf5cb3e3ced0dcdb7fd2a3 100644 (file)
@@ -121,8 +121,10 @@ void SkinView::autoKeyRelease(void)
         this->keyCodeList.removeLast();
     }
 
+#if 0
     clear_finger_slot(false);
     qDebug() << "disable multi-touch";
+#endif
 }
 
 void SkinView::focusOutEvent(QFocusEvent *event)
@@ -154,6 +156,7 @@ void SkinView::keyPressEvent(QKeyEvent *event)
 {
     qDebug() << "key pressed :" << event->key() << event->text() << event->nativeScanCode() << event->modifiers();
 
+#if 0
     /* TODO: multi-touch */
     if (get_emul_max_touch_point() > 1) {
         /* multi-touch checking */
@@ -168,6 +171,7 @@ void SkinView::keyPressEvent(QKeyEvent *event)
             qDebug() << "enable multi-touch = mode 1";
         }
     }
+#endif
 
     if (event->key() == Qt::Key_NumLock) {
         set_emul_num_lock_state(get_emul_num_lock_state() ^ 1); //toggle
@@ -212,6 +216,7 @@ void SkinView::keyReleaseEvent(QKeyEvent *event)
 {
     qDebug() << "key released :" <<  event->key() << event->text() << event->nativeScanCode() << event->modifiers();
 
+#if 0
     /* TODO: multi-touch */
     if (event->key() == Qt::Key_Shift && event->modifiers() == Qt::ControlModifier) {
         get_emul_multi_touch_state()->multitouch_enable = 1;
@@ -220,6 +225,7 @@ void SkinView::keyReleaseEvent(QKeyEvent *event)
         clear_finger_slot(false);
         qDebug() << "disable multi-touch";
     }
+#endif
 
     if (event->key() == Qt::Key_NumLock || event->key() == Qt::Key_CapsLock) {
         return;