diff options
author | GiWoong Kim <giwoong.kim@samsung.com> | 2014-08-25 20:33:07 +0900 |
---|---|---|
committer | GiWoong Kim <giwoong.kim@samsung.com> | 2014-09-01 20:51:25 +0900 |
commit | 0ed00edf9b0fa403aa66b3f4a1c487cec56b624b (patch) | |
tree | cf1e4663d1a9d2449ea826242ef40164d7c0499b /tizen | |
parent | e9efd1c27181560bb9430d3d1c213cdf567caf7a (diff) | |
download | qemu-0ed00edf9b0fa403aa66b3f4a1c487cec56b624b.tar.gz qemu-0ed00edf9b0fa403aa66b3f4a1c487cec56b624b.tar.bz2 qemu-0ed00edf9b0fa403aa66b3f4a1c487cec56b624b.zip |
menu: add Host Keyboard menu
Change-Id: Ib82120e626ca459d73d6b20730eeb0c51626a1c6
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
Diffstat (limited to 'tizen')
-rw-r--r-- | tizen/src/skin/maruskin_operation.c | 5 | ||||
-rw-r--r-- | tizen/src/ui/menu/aboutdialog.cpp | 4 | ||||
-rw-r--r-- | tizen/src/ui/menu/contextmenu.cpp | 29 | ||||
-rw-r--r-- | tizen/src/ui/menu/contextmenu.h | 3 | ||||
-rw-r--r-- | tizen/src/ui/menu/detailedinfodialog.cpp | 2 | ||||
-rw-r--r-- | tizen/src/ui/resource/icons/host_keyboard.png | bin | 0 -> 3436 bytes | |||
-rw-r--r-- | tizen/src/ui/resource/resource.qrc | 1 | ||||
-rw-r--r-- | tizen/src/ui/uistate.h | 1 |
8 files changed, 37 insertions, 8 deletions
diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index e4bb30a079..4b7c08e6b0 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -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); diff --git a/tizen/src/ui/menu/aboutdialog.cpp b/tizen/src/ui/menu/aboutdialog.cpp index 1b18d6c1f9..87faece1cb 100644 --- a/tizen/src/ui/menu/aboutdialog.cpp +++ b/tizen/src/ui/menu/aboutdialog.cpp @@ -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); diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index c901951052..2907617631 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -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"); diff --git a/tizen/src/ui/menu/contextmenu.h b/tizen/src/ui/menu/contextmenu.h index 1a6cea45f3..6738431012 100644 --- a/tizen/src/ui/menu/contextmenu.h +++ b/tizen/src/ui/menu/contextmenu.h @@ -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 *); diff --git a/tizen/src/ui/menu/detailedinfodialog.cpp b/tizen/src/ui/menu/detailedinfodialog.cpp index 1ab4157962..3a5055032f 100644 --- a/tizen/src/ui/menu/detailedinfodialog.cpp +++ b/tizen/src/ui/menu/detailedinfodialog.cpp @@ -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 Binary files differnew file mode 100644 index 0000000000..69a87f3207 --- /dev/null +++ b/tizen/src/ui/resource/icons/host_keyboard.png diff --git a/tizen/src/ui/resource/resource.qrc b/tizen/src/ui/resource/resource.qrc index 4ca194b80b..10a3059c92 100644 --- a/tizen/src/ui/resource/resource.qrc +++ b/tizen/src/ui/resource/resource.qrc @@ -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> diff --git a/tizen/src/ui/uistate.h b/tizen/src/ui/uistate.h index 9bba679ae9..6ed323719b 100644 --- a/tizen/src/ui/uistate.h +++ b/tizen/src/ui/uistate.h @@ -46,6 +46,7 @@ public: int formAngle; int formScale; /* percentage */ + ControllerWidget *activatedCon; }; |