From 4143f33fb6b10cfdbffb55e93af691b7f52f7558 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Tue, 4 Aug 2015 15:12:39 +0200 Subject: [PATCH] Add t param to YT page. Subscription status messages --- src/mediaview.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mediaview.cpp b/src/mediaview.cpp index a2c4587..9130394 100644 --- a/src/mediaview.cpp +++ b/src/mediaview.cpp @@ -690,7 +690,8 @@ void MediaView::openWebPage() { #ifdef APP_PHONON mediaObject->pause(); #endif - QDesktopServices::openUrl(video->webpage()); + QString url = video->webpage() + QLatin1String("&t=") + QString::number(mediaObject->currentTime() / 1000); + QDesktopServices::openUrl(url); } void MediaView::copyWebPage() { @@ -1160,8 +1161,13 @@ void MediaView::toggleSubscription() { QString userId = video->channelId(); if (userId.isEmpty()) return; bool subscribed = YTChannel::isSubscribed(userId); - if (subscribed) YTChannel::unsubscribe(userId); - else YTChannel::subscribe(userId); + if (subscribed) { + YTChannel::unsubscribe(userId); + MainWindow::instance()->showMessage(tr("Unsubscribed from %1").arg(video->channelTitle())); + } else { + YTChannel::subscribe(userId); + MainWindow::instance()->showMessage(tr("Subscribed to %1").arg(video->channelTitle())); + } updateSubscriptionAction(video, !subscribed); } -- 2.39.5