menu: add Host Keyboard menu 29/26829/2
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 25 Aug 2014 11:33:07 +0000 (20:33 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Mon, 1 Sep 2014 11:51:25 +0000 (20:51 +0900)
Change-Id: Ib82120e626ca459d73d6b20730eeb0c51626a1c6
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/maruskin_operation.c
tizen/src/ui/menu/aboutdialog.cpp
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/menu/contextmenu.h
tizen/src/ui/menu/detailedinfodialog.cpp
tizen/src/ui/resource/icons/host_keyboard.png [new file with mode: 0644]
tizen/src/ui/resource/resource.qrc
tizen/src/ui/uistate.h

index e4bb30a079026f1236e66d6dddb1f7b304779b36..4b7c08e6b00e8cde3d6f77d055ea8b2b6ed7e179 100644 (file)
@@ -185,6 +185,11 @@ void do_mouse_event(int button_type, int event_type,
 }
 
 void do_qt_keyboard_key_event(int event_type, int keycode) {
+    if (is_host_keyboard_attached() == false) {
+        TRACE("ignore key event because keyboard device was dettached\n");
+        return;
+    }
+
     if (KEY_PRESSED == event_type) {
         TRACE("key pressed: %d\n", keycode);
         virtio_keyboard_event(keycode);
index 1b18d6c1f99cb3631fccf8afe65f1c1c0a61d695..87faece1cbc69ee56794f9da6b23de20420559f8 100644 (file)
@@ -78,8 +78,8 @@ AboutDialog::AboutDialog(QWidget *parent) :
 
     QString aboutText = QString(SDK_NAME) + "<p>"
         + "Version : " + version + "<br>"
-        + "Build Date : " + QString(build_date) + "<br>"
-        + "SDK Snapshot Name : " + SnapshotName + "<p><br>"
+        + "Snapshot : " + SnapshotName + "<br>"
+        + "Build Date : " + QString(build_date) + "<p><br>"
         + "Visit " + URL_TIZEN_ORG;
 
     QLabel *textLabel = new QLabel(this);
index c9019510522ae3f1cc258798ed4c6ebae4c2030f..29076176317a3d6026d9b63e3f5e82202ecfd98d 100644 (file)
@@ -164,10 +164,24 @@ void ContextMenu::createItems() {
     // TODO:
 #endif
 
+    /* = Host Keyboard menu = */
+    QMenu *keyboardMenu = advancedMenu->addMenu(
+        QIcon(QPixmap(":/icons/host_keyboard.png")), "&Host Keyboard");
+    QActionGroup *keyboardGroup = new QActionGroup(this);
+
+    action = keyboardMenu->addAction("On");
+    action->setActionGroup(keyboardGroup);
+    action->setCheckable(true);
+    connect(action, SIGNAL(toggled(bool)), this, SLOT(slotHostKeyboard(bool)));
+
+    action = keyboardMenu->addAction("Off");
+    action->setActionGroup(keyboardGroup);
+    action->setCheckable(true);
+    action->setChecked(true);
+
     advancedMenu->addSeparator();
 
     /* Advanced > About menu */
-    aboutDialog = new AboutDialog(win);
     action = advancedMenu->addAction("&About");
     action->setIcon(QIcon(QPixmap(":/icons/about.png")));
     connect(action, SIGNAL(triggered()), this, SLOT(slotAbout()));
@@ -226,12 +240,12 @@ void ContextMenu::slotDetailedInfo()
     infoDialog->show();
 }
 
-void ContextMenu::slotTopMost(bool check)
+void ContextMenu::slotTopMost(bool on)
 {
-    qDebug("stays on top : %s", check? "true" : "false");
+    qDebug("stays on top : %s", on? "on" : "off");
 
     QWidget *win = ((QWidget *)this->parent());
-    if (check == true) {
+    if (on == true) {
         win->setWindowFlags(win->windowFlags() | Qt::WindowStaysOnTopHint);
     } else {
         win->setWindowFlags(win->windowFlags() & ~(Qt::WindowStaysOnTopHint));
@@ -397,6 +411,13 @@ void ContextMenu::slotControlPanel()
     }
 }
 
+void ContextMenu::slotHostKeyboard(bool on)
+{
+    qDebug("host keyboard : %s", on? "on" : "off");
+
+    do_host_kbd_enable(on);
+}
+
 void ContextMenu::slotAbout()
 {
     qDebug("about");
index 1a6cea45f3e5935450312e92fa68307260c73b71..6738431012ac82f4fcaa2f8c59a16499fc934435 100644 (file)
@@ -60,12 +60,13 @@ signals:
 
 public slots:
     void slotDetailedInfo();
-    void slotTopMost(bool check);
+    void slotTopMost(bool on);
     void slotRotate(int angle);
     void slotScale(int scale);
     void slotController(int index);
     void slotShell();
     void slotControlPanel();
+    void slotHostKeyboard(bool on);
     void slotAbout();
     void slotForceClose();
     void slotForceCloseSelected(QAbstractButton *);
index 1ab41579621cfb9ad37279fc0ef4ab76c5d010f7..3a5055032f272327535a88178203b54ba27c86cc 100644 (file)
@@ -138,7 +138,7 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
             tableHeight += infoTable->rowHeight(i);
     }
 
-    infoTable->setMinimumWidth(450);
+    infoTable->setMinimumWidth(500);
     infoTable->setMinimumHeight(tableHeight + 2/*border*/);
     upsideLayout->addWidget(infoTable);
 
diff --git a/tizen/src/ui/resource/icons/host_keyboard.png b/tizen/src/ui/resource/icons/host_keyboard.png
new file mode 100644 (file)
index 0000000..69a87f3
Binary files /dev/null and b/tizen/src/ui/resource/icons/host_keyboard.png differ
index 4ca194b80b2801a863729159fa7d8b5365984108..10a3059c92ee412bea98d11ba6363edc1b6c5e28 100644 (file)
@@ -12,5 +12,6 @@
         <file>icons/control_panel.png</file>
         <file>icons/detailed_info.png</file>
         <file>icons/screen_shot.png</file>
+        <file>icons/host_keyboard.png</file>
     </qresource>
 </RCC>
index 9bba679ae961d7c7916c4c2b3819c100eb74ce51..6ed323719bc63fc4cc835a343bc4da3433b66803 100644 (file)
@@ -46,6 +46,7 @@ public:
 
     int formAngle;
     int formScale; /* percentage */
+
     ControllerWidget *activatedCon;
 };