From 59ffc920954b530fd1b867f5edf9d5d910510636 Mon Sep 17 00:00:00 2001 From: Elias Woods Date: Wed, 7 Jul 2010 05:40:12 -0400 Subject: [PATCH 1/1] New UI, Vkbd and unicode support This is experimental not for release! --- Groove.pro | 23 +++- Groove.pro.user | 4 +- bottombar.cpp | 30 +++++ bottombar.h | 28 ++++ bottombar.ui | 197 ++++++++++++++++++++++++++++ general_fullsize.png | Bin 0 -> 616 bytes general_search.png | Bin 0 -> 1549 bytes groove.cpp | 32 ++++- groove.h | 4 + main.cpp | 1 + res.qrc | 19 +++ topbar.cpp | 69 ++++++++++ topbar.h | 38 ++++++ topbar.ui | 96 ++++++++++++++ vkb.cpp | 153 ++++++++++++++++++++++ vkb.h | 62 +++++++++ vkb.ui | 349 ++++++++++++++++++++++++++++++++++++++++++++++++++ 17 files changed, 1096 insertions(+), 9 deletions(-) create mode 100644 bottombar.cpp create mode 100644 bottombar.h create mode 100644 bottombar.ui create mode 100644 general_fullsize.png create mode 100644 general_search.png create mode 100644 res.qrc create mode 100644 topbar.cpp create mode 100644 topbar.h create mode 100644 topbar.ui create mode 100644 vkb.cpp create mode 100644 vkb.h create mode 100644 vkb.ui diff --git a/Groove.pro b/Groove.pro index 1444540..47cee39 100644 --- a/Groove.pro +++ b/Groove.pro @@ -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 diff --git a/Groove.pro.user b/Groove.pro.user index 9863bf3..7cbcb35 100644 --- a/Groove.pro.user +++ b/Groove.pro.user @@ -2,7 +2,7 @@ ProjectExplorer.Project.ActiveTarget - 0 + 1 ProjectExplorer.Project.EditorSettings @@ -194,7 +194,7 @@ 1 - 2010-07-01T03:13:16 + 2010-07-07T05:24:28 diff --git a/bottombar.cpp b/bottombar.cpp new file mode 100644 index 0000000..9ae4ea5 --- /dev/null +++ b/bottombar.cpp @@ -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 index 0000000..69c145f --- /dev/null +++ b/bottombar.h @@ -0,0 +1,28 @@ +#ifndef BOTTOMBAR_H +#define BOTTOMBAR_H + +#include + +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 index 0000000..a8cc04b --- /dev/null +++ b/bottombar.ui @@ -0,0 +1,197 @@ + + + bottomBar + + + + 0 + 0 + 723 + 117 + + + + + 0 + 0 + + + + Form + + + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 15 + + + + + 16777215 + 15 + + + + false + + + + + 51 + 154 + 249 + + + + + + + 0 + 0 + 0 + + + + + false + + + + 0.000000000000000 + 0.000000000000000 + 0.000000000000000 + 0.000000000000000 + + + + + + + + 0 + + + + + + + + + :/groove/icons/general_foldertree.png:/groove/icons/general_foldertree.png + + + true + + + + + + + + + + + :/groove/icons/general_back.png:/groove/icons/general_back.png + + + true + + + + + + + + + + + :/groove/icons/camera_video_stop.png:/groove/icons/camera_video_stop.png + + + true + + + + + + + + + + + :/groove/icons/camera_video_pause.png:/groove/icons/camera_video_pause.png + + + true + + + + + + + + + + + :/groove/icons/general_forward.png:/groove/icons/general_forward.png + + + true + + + + + + + + + + + :/groove/icons/camera_camera_setting.png:/groove/icons/camera_camera_setting.png + + + true + + + + + + + + + + + :/groove/icons/general_add.png:/groove/icons/general_add.png + + + true + + + + + + + + + + + + diff --git a/general_fullsize.png b/general_fullsize.png new file mode 100644 index 0000000000000000000000000000000000000000..fa6477b0a80a1d0751ea003ccc53352550fa361c GIT binary patch literal 616 zcmV-u0+;=XP)#XzwLCyhJ+XG}+G9Y+ zF9tHN47pNh&z?OuLqbA8X>(>y>APmt{aP-z3g#CT%*^y#s*>L`)r0Z=*b>gw7K!XWm57DJ%65DWtWs4av6 zK;l3w38GtDTlWCzcxaLU;do#&Ir<+50LdY#Ck5bi3yPab^ng4N+oL%Krza?IJk30S zv$u!t2?`xgv103H4uHvB=4wh#-I z%>y}j*Jz)3)C0q5R00Ib%F2AYy1MA*C}4-4GchsInQArhU;^m%z-S&A^#HX!aQgJ= zZ-ddHpb)kmF4U8QaoAfggGIV(x4l*P#qyYf|Uita?GO1K5@$~c*J2^S= znFWW3hbL;adTVB8Mx{_F-mb2$B8V9nD&kv!h}h$vFP;$}AK#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a/groove.cpp +++ b/groove.cpp @@ -2,7 +2,8 @@ #if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) #include "qmaemo5rotator.h" #endif - +#include +#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); diff --git a/groove.h b/groove.h index 4abda41..f29f337 100644 --- a/groove.h +++ b/groove.h @@ -9,6 +9,8 @@ #include #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; diff --git a/main.cpp b/main.cpp index e186556..08cbdf1 100755 --- a/main.cpp +++ b/main.cpp @@ -9,6 +9,7 @@ int main(int argc, char *argv[]) #ifdef Q_WS_MAEMO_5 //setAttribute(Qt::WA_Maemo5AutoOrientation,true); //a.setAttribute(Qt::WA_Maemo5AutoOrientation,true); + gs.showFullScreen(); #endif #if defined(Q_WS_S60) gs.showMaximized(); diff --git a/res.qrc b/res.qrc new file mode 100644 index 0000000..b01e7fe --- /dev/null +++ b/res.qrc @@ -0,0 +1,19 @@ + + + groove.png + general_fullsize.png + general_search.png + wmTaskSwitcherIcon.png + wmTaskSwitcherIconHighlight.png + wmTaskSwitcherIconPressed.png + wmTaskModified.png + camera_camera_setting.png + camera_video_pause.png + camera_video_stop.png + general_back.png + general_forward.png + general_close.png + general_foldertree.png + general_add.png + + diff --git a/topbar.cpp b/topbar.cpp new file mode 100644 index 0000000..81daeef --- /dev/null +++ b/topbar.cpp @@ -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 index 0000000..ad3e1ab --- /dev/null +++ b/topbar.h @@ -0,0 +1,38 @@ +#ifndef TOPBAR_H +#define TOPBAR_H + +#include +#include +#include "vkb.h" +#include + +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 index 0000000..0c004e4 --- /dev/null +++ b/topbar.ui @@ -0,0 +1,96 @@ + + + topBar + + + + 0 + 0 + 473 + 45 + + + + + 0 + 0 + + + + + 408 + 33 + + + + Form + + + + 0 + + + + + + + + + :/groove/icons/wmTaskModified.png:/groove/icons/wmTaskModified.png + + + + 43 + 37 + + + + true + + + + + + + + + + + :/groove/icons/general_close.png:/groove/icons/general_close.png + + + true + + + + + + + false + + + + + + + + + + + :/groove/icons/general_search.png:/groove/icons/general_search.png + + + true + + + + + + + taskSwitch + + + + + + diff --git a/vkb.cpp b/vkb.cpp new file mode 100644 index 0000000..507d8a9 --- /dev/null +++ b/vkb.cpp @@ -0,0 +1,153 @@ +#include "vkb.h" +#include "ui_vkb.h" +#include +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 index 0000000..8b108c5 --- /dev/null +++ b/vkb.h @@ -0,0 +1,62 @@ +#ifndef VKB_H +#define VKB_H + +#include +#include + +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 index 0000000..01c55b2 --- /dev/null +++ b/vkb.ui @@ -0,0 +1,349 @@ + + + vkb + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + 0 + + + 0 + + + 0 + + + + + + + true + + + + + + + + + 0 + + + + + 0 + + + + + q + + + true + + + + + + + w + + + true + + + + + + + e + + + true + + + + + + + r + + + true + + + + + + + t + + + true + + + + + + + y + + + true + + + + + + + u + + + true + + + + + + + i + + + true + + + + + + + o + + + true + + + + + + + p + + + true + + + + + + + + + 0 + + + + + a + + + true + + + + + + + s + + + true + + + + + + + d + + + true + + + + + + + f + + + true + + + + + + + g + + + true + + + + + + + h + + + true + + + + + + + j + + + true + + + + + + + k + + + true + + + + + + + l + + + true + + + + + + + + + 0 + + + + + Del + + + true + + + + + + + z + + + true + + + + + + + x + + + true + + + + + + + c + + + true + + + + + + + v + + + true + + + + + + + b + + + true + + + + + + + n + + + true + + + + + + + m + + + true + + + + + + + _ + + + true + + + + + + + + + + + + -- 1.7.9.5