]> git.sur5r.net Git - minitube/commitdiff
Clear the loadingWidget when doing a new search
authorFlavio Tordini <flavio.tordini@gmail.com>
Tue, 21 Jul 2009 10:01:09 +0000 (12:01 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Tue, 21 Jul 2009 10:01:09 +0000 (12:01 +0200)
src/MediaView.cpp
src/loadingwidget.cpp
src/loadingwidget.h

index 1f178bd98480ad649c1913c4edd193fb6c9b9166..bd3eb7a227ddf346675104ab7952469d7962471a 100644 (file)
@@ -104,11 +104,15 @@ void MediaView::setMediaObject(Phonon::MediaObject *mediaObject) {
 void MediaView::search(SearchParams *searchParams) {
     this->searchParams = searchParams;
 
+    // start serching for videos
+    listModel->search(searchParams);
+
     // this implies that the enum and the bar action order is the same
     sortBar->setCheckedAction(searchParams->sortBy()-1);
 
-    listModel->search(searchParams);
     listView->setFocus();
+
+    loadingWidget->clear();
 }
 
 void MediaView::disappear() {
@@ -138,9 +142,12 @@ void MediaView::stateChanged(Phonon::State newState, Phonon::State /*oldState*/)
         // play() has already been called when setting the source
         // but Phonon on Linux needs a little more help to start playback
         mediaObject->play();
+
+        // Workaround for Mac playback start problem
         if (!timerPlayFlag) {
             QTimer::singleShot(1000, this, SLOT(timerPlay()));
         }
+
         break;
 
          case Phonon::PausedState:
index bf6c3f35c17d400625bf9f207cf02601c208b603..d9596dc34789ce9d99146d568b43f8c90eb279b5 100644 (file)
@@ -67,3 +67,9 @@ void LoadingWidget::bufferStatus(int percent) {
     progressBar->setValue(percent);
     */
 }
+
+void LoadingWidget::clear() {
+    titleLabel->clear();
+    descriptionLabel->clear();
+    // progressBar->hide();
+}
index ba7ff105975db5382128d2dda70fa32f60ee5668..3117bad578ee7ddd46aa722aa83519184f5f34e8 100644 (file)
@@ -11,6 +11,7 @@ class LoadingWidget : public QWidget {
 public:
     LoadingWidget(QWidget *parent);
     void setVideo(Video *video);
+    void clear();
 
 public slots:
     void bufferStatus(int);