]> git.sur5r.net Git - minitube/commitdiff
Added ability to copy the YouTube link to the clipboard
authorFlavio Tordini <flavio.tordini@gmail.com>
Mon, 12 Apr 2010 22:13:42 +0000 (00:13 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Mon, 12 Apr 2010 22:13:42 +0000 (00:13 +0200)
Removed unused code for the "back" action
Removed PayPal from donation strings
Removed the "Technology Preview" paragraph

src/AboutView.cpp
src/MainWindow.cpp
src/MainWindow.h
src/MediaView.cpp
src/MediaView.h

index 020b4e13f5043f96511b9a5cdd29b649ce13eaba..5ae351208f51c702ec85f5ee83e2d9ac5fb77f44 100644 (file)
@@ -21,14 +21,13 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
                    "<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
                    + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE) +
 
-                   "<p>" + tr("This is a \"Technology Preview\" release, do not expect it to be perfect.") + "<br/>"
-                   + tr("Report bugs and send in your ideas to %1")
-                   .arg(QString("<a href=\"mailto:%1\">%1</a>").arg(Constants::EMAIL)) + "</p>"
-
                    "<p>" +  tr("%1 is Free Software but its development takes precious time.").arg(Constants::APP_NAME) + "<br/>"
-                   + tr("Please <a href='%1'>donate via PayPal</a> to support the continued development of %2.")
+                   + tr("Please <a href='%1'>donate</a> to support the continued development of %2.")
                    .arg(QString(Constants::WEBSITE).append("#donate"), Constants::APP_NAME) + "</p>"
 
+                   "<p>" + tr("Report bugs and send in your ideas to %1")
+                   .arg(QString("<a href=\"mailto:%1\">%1</a>").arg(Constants::EMAIL)) + "</p>"
+
                    "<p>"
                    + tr("Icon designed by %1.").arg("Sebastian Kraft")
                    + "<br>" + tr("Compact mode contributed by %1.").arg("Stefan Brück")
index 42bf542fc657e844465f56f118be0dbb4d917497..897f1da669ecb56d35486591c1085443316ddee2 100755 (executable)
@@ -77,13 +77,6 @@ void MainWindow::createActions() {
 
     QMap<QString, QAction*> *actions = The::globalActions();
 
-    backAct = new QAction(tr("&Back"), this);
-    backAct->setEnabled(false);
-    backAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Left));
-    backAct->setStatusTip(tr("Go to the previous view"));
-    actions->insert("back", backAct);
-    connect(backAct, SIGNAL(triggered()), this, SLOT(goBack()));
-
     stopAct = new QAction(QtIconLoader::icon("media-playback-stop", QIcon(":/images/media-playback-stop.png")), tr("&Stop"), this);
     stopAct->setStatusTip(tr("Stop playback and go back to the search view"));
     stopAct->setShortcuts(QList<QKeySequence>() << QKeySequence(Qt::Key_Escape) << QKeySequence(Qt::Key_MediaStop));
@@ -120,16 +113,23 @@ void MainWindow::createActions() {
     actions->insert("compactView", compactViewAct);
     connect(compactViewAct, SIGNAL(toggled(bool)), this, SLOT(compactView(bool)));
 
-    webPageAct = new QAction(tr("Open &YouTube page"), this);
-    webPageAct->setStatusTip(tr("Open the YouTube video page and pause playback"));
+    webPageAct = new QAction(tr("Open the &YouTube page"), this);
+    webPageAct->setStatusTip(tr("Go to the YouTube video page and pause playback"));
     webPageAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Y));
     webPageAct->setEnabled(false);
     actions->insert("webpage", webPageAct);
     connect(webPageAct, SIGNAL(triggered()), mediaView, SLOT(openWebPage()));
 
-    copyLinkAct = new QAction(tr("Copy video &link"), this);
-    copyLinkAct->setStatusTip(tr("Copy the current stream URL to the clipboard"));
-    copyLinkAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
+    copyPageAct = new QAction(tr("Copy the YouTube &link"), this);
+    copyPageAct->setStatusTip(tr("Copy the current video YouTube link to the clipboard"));
+    copyPageAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
+    copyPageAct->setEnabled(false);
+    actions->insert("pagelink", copyPageAct);
+    connect(copyPageAct, SIGNAL(triggered()), mediaView, SLOT(copyWebPage()));
+
+    copyLinkAct = new QAction(tr("Copy the video stream &URL"), this);
+    copyLinkAct->setStatusTip(tr("Copy the current video stream URL to the clipboard"));
+    copyLinkAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U));
     copyLinkAct->setEnabled(false);
     actions->insert("videolink", copyLinkAct);
     connect(copyLinkAct, SIGNAL(triggered()), mediaView, SLOT(copyVideoLink()));
@@ -178,7 +178,7 @@ void MainWindow::createActions() {
     actions->insert("site", siteAct);
     connect(siteAct, SIGNAL(triggered()), this, SLOT(visitSite()));
 
-    donateAct = new QAction(tr("&Donate via PayPal"), this);
+    donateAct = new QAction(tr("&Donate"), this);
     donateAct->setStatusTip(tr("Please support the continued development of %1").arg(Constants::APP_NAME));
     actions->insert("donate", donateAct);
     connect(donateAct, SIGNAL(triggered()), this, SLOT(donate()));
@@ -278,6 +278,7 @@ void MainWindow::createMenus() {
     viewMenu->addAction(skipAct);
     viewMenu->addSeparator();
     viewMenu->addAction(webPageAct);
+    viewMenu->addAction(copyPageAct);
     viewMenu->addAction(copyLinkAct);
     viewMenu->addSeparator();
     viewMenu->addAction(compactViewAct);
@@ -308,7 +309,10 @@ void MainWindow::createToolBars() {
     }
     mainToolBar->setFont(smallerFont);
 
+#ifdef Q_WS_MAC
     mainToolBar->setIconSize(QSize(32, 32));
+#endif
+
     mainToolBar->addAction(stopAct);
     mainToolBar->addAction(pauseAct);
     mainToolBar->addAction(skipAct);
@@ -415,11 +419,11 @@ void MainWindow::showWidget ( QWidget* widget ) {
         statusBar()->showMessage((metadata.value("description").toString()));
     }
 
-    // backAct->setEnabled(history->size() > 1);
     stopAct->setEnabled(widget == mediaView);
     fullscreenAct->setEnabled(widget == mediaView);
     compactViewAct->setEnabled(widget == mediaView);
     webPageAct->setEnabled(widget == mediaView);
+    copyPageAct->setEnabled(widget == mediaView);
     copyLinkAct->setEnabled(widget == mediaView);
     aboutAct->setEnabled(widget != aboutView);
 
@@ -565,7 +569,9 @@ void MainWindow::fullscreen() {
 
     // Also no Youtube action since it opens a new window
     webPageAct->setVisible(m_fullscreen);
+    copyPageAct->setVisible(m_fullscreen);
     copyLinkAct->setVisible(m_fullscreen);
+
     stopAct->setVisible(m_fullscreen);
 
     // workaround: prevent focus on the search bar
index 9c297d266309fab445e779872f8cd7088548c5f7..bdb13967e3abaa63c698dab6b2875b79ad71423c 100755 (executable)
@@ -97,6 +97,7 @@ private:
     QAction *fullscreenAct;
     QAction *compactViewAct;
     QAction *webPageAct;
+    QAction *copyPageAct;
     QAction *copyLinkAct;
     QAction *downloadAct;
     QAction *volumeUpAct;
index 1a14660582bf521df7f47735029af510504394c8..2e2d8bcabbf2f6f9365519ff547effbf0efb2bd8 100644 (file)
@@ -361,15 +361,21 @@ void MediaView::openWebPage() {
     QDesktopServices::openUrl(video->webpage());
 }
 
+void MediaView::copyWebPage() {
+    Video* video = listModel->activeVideo();
+    if (!video) return;
+    QApplication::clipboard()->setText(video->webpage().toString());
+    QMainWindow* mainWindow = dynamic_cast<QMainWindow*>(window());
+    QString message = tr("You can now paste the YouTube link into another application");
+    if (mainWindow) mainWindow->statusBar()->showMessage(message);
+}
+
 void MediaView::copyVideoLink() {
     Video* video = listModel->activeVideo();
-    QString message;
-    if (video) {
-        QApplication::clipboard()->setText(video->getStreamUrl().toString());
-        message = tr("You can now paste the video link into another application. The link will be valid only for a limited time.");
-    } else {
-        message = tr("No video is playing. The link has not been copied.");
-    }
+    if (!video) return;
+    QApplication::clipboard()->setText(video->getStreamUrl().toString());
+    QString message = tr("You can now paste the video stream URL into another application")
+                      + ". " + tr("The link will be valid only for a limited time.");
     QMainWindow* mainWindow = dynamic_cast<QMainWindow*>(window());
     if (mainWindow) mainWindow->statusBar()->showMessage(message);
 }
index c4ddd4cff0c1f34b1a1059ff69a9449571494e09..f26f22ae95bfd15312d33309b1d110fbb117e4f3 100644 (file)
@@ -42,6 +42,7 @@ public slots:
     void skip();
     void skipVideo();
     void openWebPage();
+    void copyWebPage();
     void copyVideoLink();
     void removeSelected();
     void moveUpSelected();