X-Git-Url: http://git.maemo.org/git/?p=groove;a=blobdiff_plain;f=groove.cpp;h=c996e4b6458c06d126ef62243205aaa75ea06014;hp=7d0df67158ac74d31721b72423ca5be1f1cee645;hb=0b3634745b89622ed8779575c5367bfe43a2bc0b;hpb=4adbefb36e52cb33564e704d8ea6a49425db8caf diff --git a/groove.cpp b/groove.cpp index 7d0df67..c996e4b 100644 --- a/groove.cpp +++ b/groove.cpp @@ -1,13 +1,15 @@ #include "groove.h" #if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) #include "qmaemo5rotator.h" -#endif #include -#include "bottombar.h" +#endif + groove::groove(QWidget *parent) : QWidget(parent) { + //mpg = new mpgplayer(); + //mpg->start(); mBar = new QMenuBar(); //mBar->addAction("test"); sMethod = new QPushButton("Song:"); @@ -30,12 +32,10 @@ groove::groove(QWidget *parent) : pushMenu->addAction("Song:"); //pushMenu->addAction("Artist:"); //pushMenu->addAction("Album:"); - pd = new grooveProgressBar(this); - pd->hide(); QMenu *moreAction = new QMenu(); //moreAction->addAction("Playlist"); connect(moreAction->addAction("Play Now"),SIGNAL(triggered()),this,SLOT(play())); - connect(moreAction->addAction("Show download Progress"),SIGNAL(triggered()),pd,SLOT(show())); + //connect(moreAction->addAction("Show download Progress"),SIGNAL(triggered()),pd,SLOT(show())); moreButton->setMenu(moreAction); //sMethod->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Maximum); @@ -70,7 +70,7 @@ groove::groove(QWidget *parent) : //vlayout->addLayout(layout); vlayout->addWidget(resultView); //vlayout->addLayout(bottomLayout); - bottomBar *bBar = new bottomBar(); + bBar = new bottomBar(); vlayout->addWidget(bBar); vlayout->setSpacing(0); bottomLayout->addWidget(dButton); @@ -92,11 +92,11 @@ groove::groove(QWidget *parent) : connect(stopButton,SIGNAL(clicked()),this,SLOT(stop())); connect(moreButton,SIGNAL(clicked()),this,SLOT(moreB())); //connect(rotator,SIGNAL(orientationChanged(Orientation)),this,SLOT(orientationChanged())); - pl = new playlist(); + pl = new playlist(this); pl->setGscom(gs); player->setPlaylist(pl); connect(pl,SIGNAL(downloadProgress(int,qint64,qint64)),this,SLOT(progressUpdate(int,qint64,qint64))); - connect(pl,SIGNAL(bufferReady(int)),pd,SLOT(close())); + //connect(pl,SIGNAL(bufferReady(int)),pd,SLOT(close())); connect(pl,SIGNAL(freeze(bool)),resultView,SLOT(setDisabled(bool))); connect(pl,SIGNAL(freeze(bool)),pushMenu,SLOT(setDisabled(bool))); connect(pl,SIGNAL(freeze(bool)),dButton,SLOT(setDisabled(bool))); @@ -107,8 +107,11 @@ groove::groove(QWidget *parent) : connect(bBar,SIGNAL(addB()),this,SLOT(addSongPlaylist())); connect(bBar,SIGNAL(nextB()),player,SLOT(playNext())); connect(bBar,SIGNAL(pause()),this,SLOT(stop())); + connect(bBar,SIGNAL(back()),player,SLOT(back())); - bBar->setPlaybackProgress(80,100); + bBar->setPlaybackProgress(100,100); + //pwindow = new pListWin(0); + //pwindow->show(); } void groove::performSearch(QString s) @@ -162,11 +165,15 @@ void groove::changeS( QAction * action) sMethod->setText(action->text()); sMethod->setMaximumWidth(sMethod->sizeHint().rwidth()); } + void groove::showOthers() { +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) QDBusConnection c = QDBusConnection::sessionBus(); QDBusMessage m = QDBusMessage::createSignal("/", "com.nokia.hildon_desktop", "exit_app_view"); + c.send(m); +#endif } void groove::play() @@ -179,9 +186,6 @@ void groove::play() return; //gs->getSong(); player->play(pl->addSong(item)); - pd->setMaximum(100); - pd->setValue(0); - pd->show(); } //selected. //if @@ -201,16 +205,15 @@ void groove::addSongPlaylist() } else pl->addSong(item); - pd->setMaximum(100); - pd->setValue(0); - pd->show(); model->item(selected.first().row(),1)->setText("Added to Playlist");; } + //pwindow->updateList(); } void groove::stop() { player->pause(); + //mpg->pause(); } void groove::moreB() { @@ -220,10 +223,7 @@ void groove::progressUpdate(int p, qint64 d, qint64 t) { //if(!pd->isHidden()) //{ - - - pd->setMaximum(t); - pd->setValue(d); + bBar->setPlaybackProgress(d,t); //} }