New UI, Vkbd and unicode support
authorElias Woods <EliasWoods@gmail.com>
Wed, 7 Jul 2010 09:40:12 +0000 (05:40 -0400)
committerElias Woods <EliasWoods@gmail.com>
Wed, 7 Jul 2010 09:40:12 +0000 (05:40 -0400)
This is experimental not for release!

17 files changed:
Groove.pro
Groove.pro.user
bottombar.cpp [new file with mode: 0644]
bottombar.h [new file with mode: 0644]
bottombar.ui [new file with mode: 0644]
general_fullsize.png [new file with mode: 0644]
general_search.png [new file with mode: 0644]
groove.cpp
groove.h
main.cpp
res.qrc [new file with mode: 0644]
topbar.cpp [new file with mode: 0644]
topbar.h [new file with mode: 0644]
topbar.ui [new file with mode: 0644]
vkb.cpp [new file with mode: 0644]
vkb.h [new file with mode: 0644]
vkb.ui [new file with mode: 0644]

index 1444540..47cee39 100644 (file)
@@ -20,6 +20,7 @@ LIBS += -L/usr/local/lib -lqjson ##Armel Target
 #LIBS += -L../qjson/lib -lqjson ##X86 maemo
 QT += network
 QT += phonon
+QT += dbus
 # Input
 SOURCES += main.cpp \
     groove.cpp \
@@ -28,7 +29,10 @@ SOURCES += main.cpp \
     streamio.cpp \
     playlist.cpp \
     downloadmanager.cpp \
-    grooveprogressbar.cpp
+    grooveprogressbar.cpp \
+    topbar.cpp \
+    bottombar.cpp \
+    vkb.cpp
 
 HEADERS += \
     groove.h \
@@ -37,7 +41,10 @@ HEADERS += \
     streamio.h \
     playlist.h \
     downloadmanager.h \
-    grooveprogressbar.h
+    grooveprogressbar.h \
+    topbar.h \
+    bottombar.h \
+    vkb.h
 
 maemo5 {
 SOURCES += qmaemo5rotator.cpp
@@ -45,7 +52,9 @@ HEADERS += qmaemo5rotator.h
 }
 OTHER_FILES += \
     icon.svg \
-    groove.png
+    groove.png \
+    general_fullsize.png \
+    general_search.png
 unix {
   PREFIX = /usr
   BINDIR = $$PREFIX/bin
@@ -65,3 +74,11 @@ unix {
   icon64.path = $$DATADIR/icons/hicolor/64x64/apps
   icon64.files += groove.png
 }
+
+RESOURCES += \
+    res.qrc
+
+FORMS += \
+    topbar.ui \
+    bottombar.ui \
+    vkb.ui
index 9863bf3..7cbcb35 100644 (file)
@@ -2,7 +2,7 @@
 <qtcreator>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
-  <value type="int">0</value>
+  <value type="int">1</value>
  </data>
  <data>
   <variable>ProjectExplorer.Project.EditorSettings</variable>
     </valuemap>
     <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">1</value>
     <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
-     <value key="192.168.1.3" type="QDateTime">2010-07-01T03:13:16</value>
+     <value key="192.168.1.3" type="QDateTime">2010-07-07T05:24:28</value>
     </valuemap>
     <value key="Qt4ProjectManager.MaemoRunConfiguration.Simulator" type="QString"></value>
    </valuemap>
diff --git a/bottombar.cpp b/bottombar.cpp
new file mode 100644 (file)
index 0000000..9ae4ea5
--- /dev/null
@@ -0,0 +1,30 @@
+#include "bottombar.h"
+#include "ui_bottombar.h"
+
+bottomBar::bottomBar(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::bottomBar)
+{
+    ui->setupUi(this);
+}
+
+bottomBar::~bottomBar()
+{
+    delete ui;
+}
+void bottomBar::on_addButton_clicked()
+{
+    emit this->addB();
+}
+
+void bottomBar::changeEvent(QEvent *e)
+{
+    QWidget::changeEvent(e);
+    switch (e->type()) {
+    case QEvent::LanguageChange:
+        ui->retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
diff --git a/bottombar.h b/bottombar.h
new file mode 100644 (file)
index 0000000..69c145f
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef BOTTOMBAR_H
+#define BOTTOMBAR_H
+
+#include <QWidget>
+
+namespace Ui {
+    class bottomBar;
+}
+
+class bottomBar : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit bottomBar(QWidget *parent = 0);
+    ~bottomBar();
+signals:
+    void addB();
+protected:
+    void changeEvent(QEvent *e);
+private slots:
+    void on_addButton_clicked();
+
+private:
+    Ui::bottomBar *ui;
+};
+
+#endif // BOTTOMBAR_H
diff --git a/bottombar.ui b/bottombar.ui
new file mode 100644 (file)
index 0000000..a8cc04b
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>bottomBar</class>
+ <widget class="QWidget" name="bottomBar">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>723</width>
+    <height>117</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <property name="styleSheet">
+   <string notr="true"/>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="spacing">
+    <number>0</number>
+   </property>
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QGraphicsView" name="graphicsView">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>0</width>
+       <height>15</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>15</height>
+      </size>
+     </property>
+     <property name="autoFillBackground">
+      <bool>false</bool>
+     </property>
+     <property name="backgroundBrush">
+      <brush brushstyle="SolidPattern">
+       <color alpha="255">
+        <red>51</red>
+        <green>154</green>
+        <blue>249</blue>
+       </color>
+      </brush>
+     </property>
+     <property name="foregroundBrush">
+      <brush brushstyle="SolidPattern">
+       <color alpha="255">
+        <red>0</red>
+        <green>0</green>
+        <blue>0</blue>
+       </color>
+      </brush>
+     </property>
+     <property name="interactive">
+      <bool>false</bool>
+     </property>
+     <property name="sceneRect">
+      <rectf>
+       <x>0.000000000000000</x>
+       <y>0.000000000000000</y>
+       <width>0.000000000000000</width>
+       <height>0.000000000000000</height>
+      </rectf>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QPushButton" name="pushButton_3">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset resource="res.qrc">
+         <normaloff>:/groove/icons/general_foldertree.png</normaloff>:/groove/icons/general_foldertree.png</iconset>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="backB">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset resource="res.qrc">
+         <normaloff>:/groove/icons/general_back.png</normaloff>:/groove/icons/general_back.png</iconset>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_5">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset resource="res.qrc">
+         <normaloff>:/groove/icons/camera_video_stop.png</normaloff>:/groove/icons/camera_video_stop.png</iconset>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pauseB">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset resource="res.qrc">
+         <normaloff>:/groove/icons/camera_video_pause.png</normaloff>:/groove/icons/camera_video_pause.png</iconset>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="nextB">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset resource="res.qrc">
+         <normaloff>:/groove/icons/general_forward.png</normaloff>:/groove/icons/general_forward.png</iconset>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_2">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset resource="res.qrc">
+         <normaloff>:/groove/icons/camera_camera_setting.png</normaloff>:/groove/icons/camera_camera_setting.png</iconset>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="addButton">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset resource="res.qrc">
+         <normaloff>:/groove/icons/general_add.png</normaloff>:/groove/icons/general_add.png</iconset>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="res.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/general_fullsize.png b/general_fullsize.png
new file mode 100644 (file)
index 0000000..fa6477b
Binary files /dev/null and b/general_fullsize.png differ
diff --git a/general_search.png b/general_search.png
new file mode 100644 (file)
index 0000000..e1cf574
Binary files /dev/null and b/general_search.png differ
index f8c30c0..f763ae2 100644 (file)
@@ -2,7 +2,8 @@
 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON)
 #include "qmaemo5rotator.h"
 #endif
-
+#include <QtDBus>
+#include "bottombar.h"
 
 groove::groove(QWidget *parent) :
     QWidget(parent)
@@ -20,6 +21,7 @@ groove::groove(QWidget *parent) :
     QPushButton *stopButton = new QPushButton("Pause");
     QPushButton *moreButton = new QPushButton("...");
     QPushButton *nextB = new QPushButton("->");
+    topBar *ok = new topBar(this);
     resultView = new QTableView();
     QMenu *pushMenu = new QMenu();
     //showFullScreen();
@@ -63,16 +65,21 @@ groove::groove(QWidget *parent) :
     //this->setAttribute(Qt::WA_Maemo5AutoOrientation);
     layout->addWidget(lineEdit);
     layout->addWidget(button);
-    vlayout->addLayout(layout);
+    vlayout->addWidget(ok);
+    //vlayout->addLayout(layout);
     vlayout->addWidget(resultView);
-    vlayout->addLayout(bottomLayout);
+    //vlayout->addLayout(bottomLayout);
+    bottomBar *bBar = new bottomBar();
+    vlayout->addWidget(bBar);
+    vlayout->setSpacing(0);
     bottomLayout->addWidget(dButton);
     bottomLayout->addWidget(stopButton);
     bottomLayout->addWidget(nextB);
     bottomLayout->addWidget(moreButton);
     vlayout->setMenuBar(mBar);
+    vlayout->setContentsMargins(QMargins());
     setLayout(vlayout);
-    setWindowTitle("GrooveShark");
+    setWindowTitle("Groove");
     //Create New Grooveshark connection
     gs = new gscom();
     //Connections
@@ -93,7 +100,17 @@ groove::groove(QWidget *parent) :
     connect(pl,SIGNAL(freeze(bool)),pushMenu,SLOT(setDisabled(bool)));
     connect(pl,SIGNAL(freeze(bool)),dButton,SLOT(setDisabled(bool)));
     connect(nextB,SIGNAL(clicked()),player,SLOT(playNext()));
+    connect(ok,SIGNAL(changeTask()),this,SLOT(showOthers()));
+    connect(ok,SIGNAL(searchRequest(QString)),this,SLOT(performSearch(QString)));
+    connect(ok,SIGNAL(closeApp()),this,SLOT(close()));
+    connect(bBar,SIGNAL(addB()),this,SLOT(addSongPlaylist()));
+}
+void groove::performSearch(QString s)
+{
+    qDebug() << s;
+    resultView->setModel(gs->getSongModel(s));
 }
+
 void groove::search()
 {
     if(!lineEdit->text().isEmpty())
@@ -139,6 +156,13 @@ void groove::changeS( QAction * action)
     sMethod->setText(action->text());
     sMethod->setMaximumWidth(sMethod->sizeHint().rwidth());
 }
+void groove::showOthers()
+{
+    QDBusConnection c = QDBusConnection::sessionBus();
+    QDBusMessage m = QDBusMessage::createSignal("/", "com.nokia.hildon_desktop", "exit_app_view");
+    c.send(m);
+}
+
 void groove::play()
 {
     QModelIndexList selected = resultView->selectionModel()->selectedRows(0);
index 4abda41..f29f337 100644 (file)
--- a/groove.h
+++ b/groove.h
@@ -9,6 +9,8 @@
 #include <QMenuBar>
 #include "playlist.h"
 #include "grooveprogressbar.h"
+#include "topbar.h"
+#include "vkb.h"
 
 class groove : public QWidget
 {
@@ -26,9 +28,11 @@ public slots:
     void stop();
     void moreB();
     void orientationChanged();
+    void performSearch(QString);
 private slots:
     void progressUpdate(int,qint64,qint64);
     void addSongPlaylist();
+    void showOthers();
 private:
     sPlayer *player;
     QMenuBar *mBar;
index e186556..08cbdf1 100755 (executable)
--- a/main.cpp
+++ b/main.cpp
@@ -9,6 +9,7 @@ int main(int argc, char *argv[])
 #ifdef Q_WS_MAEMO_5\r
     //setAttribute(Qt::WA_Maemo5AutoOrientation,true);\r
     //a.setAttribute(Qt::WA_Maemo5AutoOrientation,true);\r
+    gs.showFullScreen();\r
 #endif\r
 #if defined(Q_WS_S60)\r
     gs.showMaximized();\r
diff --git a/res.qrc b/res.qrc
new file mode 100644 (file)
index 0000000..b01e7fe
--- /dev/null
+++ b/res.qrc
@@ -0,0 +1,19 @@
+<RCC>
+    <qresource prefix="/groove/icons">
+        <file>groove.png</file>
+        <file>general_fullsize.png</file>
+        <file>general_search.png</file>
+        <file>wmTaskSwitcherIcon.png</file>
+        <file>wmTaskSwitcherIconHighlight.png</file>
+        <file>wmTaskSwitcherIconPressed.png</file>
+        <file>wmTaskModified.png</file>
+        <file>camera_camera_setting.png</file>
+        <file>camera_video_pause.png</file>
+        <file>camera_video_stop.png</file>
+        <file>general_back.png</file>
+        <file>general_forward.png</file>
+        <file>general_close.png</file>
+        <file>general_foldertree.png</file>
+        <file>general_add.png</file>
+    </qresource>
+</RCC>
diff --git a/topbar.cpp b/topbar.cpp
new file mode 100644 (file)
index 0000000..81daeef
--- /dev/null
@@ -0,0 +1,69 @@
+#include "topbar.h"
+#include "ui_topbar.h"
+
+topBar::topBar(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::topBar)
+{
+    ui->setupUi(this);
+    kb = NULL;
+    ui->sBox->installEventFilter(this);
+}
+
+topBar::~topBar()
+{
+    delete ui;
+}
+void topBar::on_taskSwitch_clicked()
+{
+    emit this->changeTask();
+}
+void topBar::on_sButton_clicked()
+{
+    emit this->searchRequest(ui->sBox->text());
+}
+void topBar::on_closeButton_clicked()
+{
+    emit this->closeApp();
+}
+
+void topBar::changeEvent(QEvent *e)
+{
+    QWidget::changeEvent(e);
+    switch (e->type()) {
+    case QEvent::LanguageChange:
+        ui->retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+void topBar::resizeEvent(QResizeEvent *e)
+{
+    if(e->type() == QEvent::Resize)
+    {
+        if(((QWidget *)this->parent())->testAttribute(Qt::WA_Maemo5PortraitOrientation))
+        {
+            ui->sBox->setReadOnly(true);
+            //ui->sBox->setText("Portrait");
+        }
+        else
+            ui->sBox->setReadOnly(false);
+    }
+}
+
+bool topBar::eventFilter(QObject *obj, QEvent *e)
+{
+    if(obj == ui->sBox && ui->sBox->isReadOnly() && e->type() == QEvent::MouseButtonRelease)
+    {
+        if(!kb)
+        {
+            this->kb = new vkb(this);
+            connect(kb,SIGNAL(submitText(QString)),ui->sBox,SLOT(setText(QString)));
+        }
+        kb->setText(ui->sBox->text());
+        kb->show();
+    }
+    else
+        return QWidget::eventFilter(obj,e);
+}
diff --git a/topbar.h b/topbar.h
new file mode 100644 (file)
index 0000000..ad3e1ab
--- /dev/null
+++ b/topbar.h
@@ -0,0 +1,38 @@
+#ifndef TOPBAR_H
+#define TOPBAR_H
+
+#include <QWidget>
+#include <QString>
+#include "vkb.h"
+#include <QResizeEvent>
+
+namespace Ui {
+    class topBar;
+}
+
+class topBar : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit topBar(QWidget *parent = 0);
+    ~topBar();
+signals:
+    void changeTask();
+    void searchRequest(QString);
+    void closeApp();
+protected:
+    void changeEvent(QEvent *e);
+    bool eventFilter(QObject *, QEvent *);
+    void resizeEvent(QResizeEvent *);
+
+private slots:
+    void on_taskSwitch_clicked();
+    void on_sButton_clicked();
+    void on_closeButton_clicked();
+private:
+    Ui::topBar *ui;
+    vkb *kb;
+};
+
+#endif // TOPBAR_H
diff --git a/topbar.ui b/topbar.ui
new file mode 100644 (file)
index 0000000..0c004e4
--- /dev/null
+++ b/topbar.ui
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>topBar</class>
+ <widget class="QWidget" name="topBar">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>473</width>
+    <height>45</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>408</width>
+    <height>33</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QHBoxLayout" name="horizontalLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QPushButton" name="taskSwitch">
+     <property name="text">
+      <string/>
+     </property>
+     <property name="icon">
+      <iconset resource="res.qrc">
+       <normaloff>:/groove/icons/wmTaskModified.png</normaloff>:/groove/icons/wmTaskModified.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>43</width>
+       <height>37</height>
+      </size>
+     </property>
+     <property name="flat">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QPushButton" name="closeButton">
+     <property name="text">
+      <string/>
+     </property>
+     <property name="icon">
+      <iconset resource="res.qrc">
+       <normaloff>:/groove/icons/general_close.png</normaloff>:/groove/icons/general_close.png</iconset>
+     </property>
+     <property name="flat">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QLineEdit" name="sBox">
+     <property name="readOnly">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QPushButton" name="sButton">
+     <property name="text">
+      <string/>
+     </property>
+     <property name="icon">
+      <iconset resource="res.qrc">
+       <normaloff>:/groove/icons/general_search.png</normaloff>:/groove/icons/general_search.png</iconset>
+     </property>
+     <property name="flat">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <tabstops>
+  <tabstop>taskSwitch</tabstop>
+ </tabstops>
+ <resources>
+  <include location="res.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/vkb.cpp b/vkb.cpp
new file mode 100644 (file)
index 0000000..507d8a9
--- /dev/null
+++ b/vkb.cpp
@@ -0,0 +1,153 @@
+#include "vkb.h"
+#include "ui_vkb.h"
+#include <QMouseEvent>
+vkb::vkb(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::vkb)
+{
+    ui->setupUi(this);
+}
+void vkb::setText(QString s)
+{
+    ui->tBox->setText(s);
+}
+void vkb::closeEvent(QCloseEvent *)
+{
+    emit this->submitText(ui->tBox->text());
+}
+
+vkb::~vkb()
+{
+    delete ui;
+}
+void vkb::addText(QString s)
+{
+    ui->tBox->setText(ui->tBox->text().append(s));
+}
+void vkb::on_delB_clicked()
+{
+    QString a = ui->tBox->text();
+    a.chop(1);
+    ui->tBox->setText(a);
+}
+void vkb::on_spaceB_clicked()
+{
+    this->addText(" ");
+}
+
+void vkb::changeEvent(QEvent *e)
+{
+    QDialog::changeEvent(e);
+    switch (e->type()) {
+    case QEvent::LanguageChange:
+        ui->retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+void vkb::on_aB_clicked()
+{
+    this->addText("a");
+}
+void vkb::on_bB_clicked()
+{
+    this->addText("b");
+}
+void vkb::on_cB_clicked()
+{
+    this->addText("c");
+}
+void vkb::on_dB_clicked()
+{
+    this->addText("d");
+}
+void vkb::on_eB_clicked()
+{
+    this->addText("e");
+}
+void vkb::on_fB_clicked()
+{
+    this->addText("f");
+}
+void vkb::on_gB_clicked()
+{
+    this->addText("g");
+}
+void vkb::on_hB_clicked()
+{
+    this->addText("h");
+}
+void vkb::on_iB_clicked()
+{
+    this->addText("i");
+}
+void vkb::on_jB_clicked()
+{
+    this->addText("j");
+}
+void vkb::on_kB_clicked()
+{
+    this->addText("k");
+}
+void vkb::on_lB_clicked()
+{
+    this->addText("l");
+}
+void vkb::on_mB_clicked()
+{
+    this->addText("m");
+}
+void vkb::on_nB_clicked()
+{
+    this->addText("n");
+}
+void vkb::on_oB_clicked()
+{
+    this->addText("o");
+}
+void vkb::on_pB_clicked()
+{
+    this->addText("p");
+}
+void vkb::on_qB_clicked()
+{
+    this->addText("q");
+}
+void vkb::on_rB_clicked()
+{
+    this->addText("r");
+}
+void vkb::on_sB_clicked()
+{
+    this->addText("s");
+}
+void vkb::on_tB_clicked()
+{
+    this->addText("t");
+}
+void vkb::on_uB_clicked()
+{
+    this->addText("u");
+}
+void vkb::on_vB_clicked()
+{
+    this->addText("v");
+}
+void vkb::on_wB_clicked()
+{
+    this->addText("w");
+}
+void vkb::on_xB_clicked()
+{
+    this->addText("x");
+}
+void vkb::on_yB_clicked()
+{
+    this->addText("y");
+}
+void vkb::on_zB_clicked()
+{
+    this->addText("z");
+}
+
diff --git a/vkb.h b/vkb.h
new file mode 100644 (file)
index 0000000..8b108c5
--- /dev/null
+++ b/vkb.h
@@ -0,0 +1,62 @@
+#ifndef VKB_H
+#define VKB_H
+
+#include <QDialog>
+#include <QCloseEvent>
+
+namespace Ui {
+    class vkb;
+}
+
+class vkb : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit vkb(QWidget *parent = 0);
+    void setText(QString);
+
+    ~vkb();
+signals:
+    void submitText(QString);
+protected:
+    void closeEvent(QCloseEvent *);
+    void changeEvent(QEvent *e);
+private slots:
+    void on_aB_clicked();
+    void on_bB_clicked();
+    void on_cB_clicked();
+    void on_dB_clicked();
+    void on_eB_clicked();
+    void on_fB_clicked();
+    void on_gB_clicked();
+    void on_hB_clicked();
+    void on_iB_clicked();
+    void on_jB_clicked();
+    void on_kB_clicked();
+    void on_lB_clicked();
+    void on_mB_clicked();
+    void on_nB_clicked();
+    void on_oB_clicked();
+    void on_pB_clicked();
+    void on_qB_clicked();
+    void on_rB_clicked();
+    void on_sB_clicked();
+    void on_tB_clicked();
+    void on_uB_clicked();
+    void on_vB_clicked();
+    void on_wB_clicked();
+    void on_xB_clicked();
+    void on_yB_clicked();
+    void on_zB_clicked();
+    void on_delB_clicked();
+    void on_spaceB_clicked();
+
+
+
+private:
+    Ui::vkb *ui;
+    void addText(QString);
+};
+
+#endif // VKB_H
diff --git a/vkb.ui b/vkb.ui
new file mode 100644 (file)
index 0000000..01c55b2
--- /dev/null
+++ b/vkb.ui
@@ -0,0 +1,349 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>vkb</class>
+ <widget class="QDialog" name="vkb">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <property name="spacing">
+    <number>0</number>
+   </property>
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QLineEdit" name="tBox">
+       <property name="readOnly">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QPushButton" name="qB">
+         <property name="text">
+          <string>q</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="wB">
+         <property name="text">
+          <string>w</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="eB">
+         <property name="text">
+          <string>e</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="rB">
+         <property name="text">
+          <string>r</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="tB">
+         <property name="text">
+          <string>t</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="yB">
+         <property name="text">
+          <string>y</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="uB">
+         <property name="text">
+          <string>u</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="iB">
+         <property name="text">
+          <string>i</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="oB">
+         <property name="text">
+          <string>o</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pB">
+         <property name="text">
+          <string>p</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_4">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QPushButton" name="aB">
+         <property name="text">
+          <string>a</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="sB">
+         <property name="text">
+          <string>s</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="dB">
+         <property name="text">
+          <string>d</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="fB">
+         <property name="text">
+          <string>f</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="gB">
+         <property name="text">
+          <string>g</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="hB">
+         <property name="text">
+          <string>h</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="jB">
+         <property name="text">
+          <string>j</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="kB">
+         <property name="text">
+          <string>k</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="lB">
+         <property name="text">
+          <string>l</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_3">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QPushButton" name="delB">
+         <property name="text">
+          <string>Del</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="zB">
+         <property name="text">
+          <string>z</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="xB">
+         <property name="text">
+          <string>x</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="cB">
+         <property name="text">
+          <string>c</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="vB">
+         <property name="text">
+          <string>v</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="bB">
+         <property name="text">
+          <string>b</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="nB">
+         <property name="text">
+          <string>n</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="mB">
+         <property name="text">
+          <string>m</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="spaceB">
+         <property name="text">
+          <string>_</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>