]> git.sur5r.net Git - minitube/commitdiff
Better statustips for the sort bar
authorFlavio Tordini <flavio.tordini@gmail.com>
Mon, 2 Nov 2009 20:22:36 +0000 (21:22 +0100)
committerFlavio Tordini <flavio.tordini@gmail.com>
Mon, 2 Nov 2009 20:22:36 +0000 (21:22 +0100)
try to improve the Mac playback workaround

src/MediaView.cpp

index fb74443cc976a64c5acb36ba21b486df1af29e36..8427aa6db037f4228527ffe7e058c6131f35a60c 100644 (file)
@@ -24,21 +24,21 @@ MediaView::MediaView(QWidget *parent) : QWidget(parent) {
     mostRelevantAction = new QAction(tr("Most relevant"), this);
     QKeySequence keySequence(Qt::CTRL + Qt::Key_1);
     mostRelevantAction->setShortcut(keySequence);
-    mostRelevantAction->setStatusTip(keySequence.toString(QKeySequence::NativeText));
+    mostRelevantAction->setStatusTip(mostRelevantAction->text() + " (" + keySequence.toString(QKeySequence::NativeText) + ")");
     addAction(mostRelevantAction);
     connect(mostRelevantAction, SIGNAL(triggered()), this, SLOT(searchMostRelevant()), Qt::QueuedConnection);
     sortBar->addAction(mostRelevantAction);
     mostRecentAction = new QAction(tr("Most recent"), this);
     keySequence = QKeySequence(Qt::CTRL + Qt::Key_2);
     mostRecentAction->setShortcut(keySequence);
-    mostRecentAction->setStatusTip(keySequence.toString(QKeySequence::NativeText));
+    mostRecentAction->setStatusTip(mostRecentAction->text() + " (" + keySequence.toString(QKeySequence::NativeText) + ")");
     addAction(mostRecentAction);
     connect(mostRecentAction, SIGNAL(triggered()), this, SLOT(searchMostRecent()), Qt::QueuedConnection);
     sortBar->addAction(mostRecentAction);
     mostViewedAction = new QAction(tr("Most viewed"), this);
     keySequence = QKeySequence(Qt::CTRL + Qt::Key_3);
     mostViewedAction->setShortcut(keySequence);
-    mostViewedAction->setStatusTip(keySequence.toString(QKeySequence::NativeText));
+    mostViewedAction->setStatusTip(mostViewedAction->text() + " (" + keySequence.toString(QKeySequence::NativeText) + ")");
     addAction(mostViewedAction);
     connect(mostViewedAction, SIGNAL(triggered()), this, SLOT(searchMostViewed()), Qt::QueuedConnection);
     sortBar->addAction(mostViewedAction);
@@ -109,7 +109,7 @@ MediaView::MediaView(QWidget *parent) : QWidget(parent) {
 
     workaroundTimer = new QTimer(this);
     workaroundTimer->setSingleShot(true);
-    workaroundTimer->setInterval(1000);
+    workaroundTimer->setInterval(3000);
     connect(workaroundTimer, SIGNAL(timeout()), SLOT(timerPlay()));
 
 }
@@ -399,11 +399,13 @@ void MediaView::setPlaylistVisible(bool visible) {
 }
 
 void MediaView::timerPlay() {
-    // qDebug() << mediaObject->currentTime();
     // Workaround Phonon bug on Mac OSX
+    qDebug() << mediaObject->currentTime();
     if (mediaObject->currentTime() <= 0 && mediaObject->state() == Phonon::PlayingState) {
+        // qDebug() << "Mac playback workaround";
         mediaObject->pause();
-        mediaObject->play();
+        QTimer::singleShot(1000, mediaObject, SLOT(play()));
+        // mediaObject->play();
     }
 }