From: Flavio Date: Mon, 13 Aug 2012 15:02:50 +0000 (+0200) Subject: Share via Buffer app X-Git-Tag: 1.9~16 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6e5011b3126ebfdae5b8183bc272f2ee02432ae9;p=minitube Share via Buffer app --- diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e9b6a0b..600d794 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -407,6 +407,11 @@ void MainWindow::createActions() { actions->insert("facebook", action); connect(action, SIGNAL(triggered()), mediaView, SLOT(shareViaFacebook())); + action = new QAction("&Buffer", this); + action->setStatusTip(shareTip.arg("Buffer")); + actions->insert("buffer", action); + connect(action, SIGNAL(triggered()), mediaView, SLOT(shareViaBuffer())); + action = new QAction(tr("&Email"), this); action->setStatusTip(shareTip.arg(tr("Email"))); actions->insert("email", action); @@ -534,6 +539,8 @@ void MainWindow::createMenus() { shareMenu->addSeparator(); shareMenu->addAction(The::globalActions()->value("twitter")); shareMenu->addAction(The::globalActions()->value("facebook")); + shareMenu->addAction(The::globalActions()->value("buffer")); + shareMenu->addSeparator(); shareMenu->addAction(The::globalActions()->value("email")); #ifdef APP_MAC @@ -1276,7 +1283,6 @@ void MainWindow::toggleDownloads(bool show) { } void MainWindow::startToolbarSearch(QString query) { - query = query.trimmed(); // check for empty query diff --git a/src/MediaView.cpp b/src/MediaView.cpp index 8ad65ba..50736ae 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -845,6 +845,18 @@ void MediaView::shareViaFacebook() { QDesktopServices::openUrl(url); } +void MediaView::shareViaBuffer() { + Video* video = listModel->activeVideo(); + if (!video) return; + QUrl url("http://bufferapp.com/add"); + url.addQueryItem("via", "minitubeapp"); + url.addQueryItem("text", video->title()); + url.addQueryItem("url", video->webpage().toString()); + if (!video->thumbnailUrls().isEmpty()) + url.addQueryItem("picture", video->thumbnailUrls().first().toString()); + QDesktopServices::openUrl(url); +} + void MediaView::shareViaEmail() { Video* video = listModel->activeVideo(); if (!video) return; diff --git a/src/MediaView.h b/src/MediaView.h index a69bef3..e4dec2a 100644 --- a/src/MediaView.h +++ b/src/MediaView.h @@ -55,6 +55,7 @@ public slots: void copyVideoLink(); void shareViaTwitter(); void shareViaFacebook(); + void shareViaBuffer(); void shareViaEmail(); void removeSelected(); void moveUpSelected(); diff --git a/src/playlistview.cpp b/src/playlistview.cpp index 2705c4d..d976b09 100644 --- a/src/playlistview.cpp +++ b/src/playlistview.cpp @@ -18,6 +18,7 @@ void PlaylistView::leaveEvent(QEvent * /* event */) { } void PlaylistView::mouseMoveEvent(QMouseEvent *event) { + QListView::mouseMoveEvent(event); QWidget::mouseMoveEvent(event); if (isHoveringAuthor(event)) {