From 409c8fc01cd44a728e597ba47aa10449e361c883 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Sat, 18 Sep 2010 19:28:30 +0200 Subject: [PATCH] Demo stuff --- locale/ar.ts | 16 +++ locale/bg_BG.ts | 16 +++ locale/cs_CZ.ts | 44 ++++-- locale/de_DE.ts | 44 ++++-- locale/el_GR.ts | 16 +++ locale/en_US.ts | 312 +++++++++++++++++++++------------------- locale/es.ts | 16 +++ locale/es_AR.ts | 16 +++ locale/es_ES.ts | 16 +++ locale/fi_FI.ts | 16 +++ locale/fr_FR.ts | 16 +++ locale/gl.ts | 16 +++ locale/he_IL.ts | 16 +++ locale/hr_HR.ts | 16 +++ locale/hu_HU.ts | 16 +++ locale/it_IT.ts | 16 +++ locale/ja_JP.ts | 16 +++ locale/lat.ts | 16 +++ locale/nb_NO.ts | 16 +++ locale/nl_NL.ts | 16 +++ locale/pl_PL.ts | 16 +++ locale/pt_BR.ts | 16 +++ locale/pt_PT.ts | 16 +++ locale/ro_RO.ts | 16 +++ locale/ru_RU.ts | 16 +++ locale/tr_TR.ts | 16 +++ locale/uk.ts | 16 +++ locale/zh_CN.ts | 16 +++ src/MediaView.cpp | 26 ++-- src/MediaView.h | 6 +- src/downloadmanager.cpp | 25 ++++ 31 files changed, 672 insertions(+), 185 deletions(-) diff --git a/locale/ar.ts b/locale/ar.ts index e495ecf..30d21a8 100644 --- a/locale/ar.ts +++ b/locale/ar.ts @@ -116,6 +116,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/bg_BG.ts b/locale/bg_BG.ts index dc56c7f..40f04d6 100644 --- a/locale/bg_BG.ts +++ b/locale/bg_BG.ts @@ -111,6 +111,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/cs_CZ.ts b/locale/cs_CZ.ts index 60ede2c..e21319a 100644 --- a/locale/cs_CZ.ts +++ b/locale/cs_CZ.ts @@ -140,8 +140,28 @@ DownloadManager + + + This is just the demo version of %1. + + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + + Continue + + + + + Get the full version + + - + %n Download(s) @@ -638,52 +658,52 @@ MediaView - + Most relevant Nalezená videa - + Most recent Nejnovější - + Most viewed Nejsledovanější - + You can now paste the YouTube link into another application Nyní můžete vložit odkaz na video na YouTube do jiného programu - + You can now paste the video stream URL into another application Nyní můžete vložit odkaz na video stream do jiné aplikace - + The link will be valid only for a limited time. Tento odkaz platí jen po omezenou dobu. - + This is just the demo version of %1. - + It allows you to test the application and see if it works for you. - + Continue - + Get the full version @@ -762,7 +782,7 @@ SearchLineEdit - + Search Hledat diff --git a/locale/de_DE.ts b/locale/de_DE.ts index 8dec216..328b18a 100644 --- a/locale/de_DE.ts +++ b/locale/de_DE.ts @@ -140,8 +140,28 @@ DownloadManager + + + This is just the demo version of %1. + + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + + Continue + + + + + Get the full version + + - + %n Download(s) @@ -693,52 +713,52 @@ MediaView - + Most relevant Die bedeutsamsten - + Most recent Die neusten - + Most viewed Meist gesehen - + You can now paste the YouTube link into another application Du kann den YouTube Link nun in einer anderen Anwendung einfügen - + You can now paste the video stream URL into another application Die kannst die Video URL nun in einer anderen Anwendung einfügen - + The link will be valid only for a limited time. Der Link wird nur eine beschränkte Zeit gültig sein. - + This is just the demo version of %1. - + It allows you to test the application and see if it works for you. - + Continue - + Get the full version @@ -817,7 +837,7 @@ SearchLineEdit - + Search Suche diff --git a/locale/el_GR.ts b/locale/el_GR.ts index eab0aab..631de63 100644 --- a/locale/el_GR.ts +++ b/locale/el_GR.ts @@ -125,6 +125,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/en_US.ts b/locale/en_US.ts index 46f7ce5..048e1d0 100644 --- a/locale/en_US.ts +++ b/locale/en_US.ts @@ -4,67 +4,67 @@ AboutView - + There's life outside the browser! - + Version %1 - + %1 is Free Software but its development takes precious time. - + Please <a href='%1'>donate</a> to support the continued development of %2. - + Report bugs and send in your ideas to %1 - + Icon designed by %1. - + Compact mode contributed by %1. - + HTTP proxy support contributed by %1. - + Translated by %1 - + Released under the <a href='%1'>GNU General Public License</a> - + &Close - + About - + What you always wanted to know about %1 and never dared to ask @@ -72,7 +72,7 @@ ClearButton - + Clear @@ -80,55 +80,75 @@ DownloadItem - + bytes - + KB - + MB - + bytes/sec - + KB/sec - + MB/sec - + seconds - + minutes - + %4 %5 remaining DownloadManager + + + This is just the demo version of %1. + + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + + Continue + + + + + Get the full version + + - + %n Download(s) 1 Download @@ -139,27 +159,27 @@ DownloadSettings - + Change location... - + Choose the download location - + Download location changed. - + Current downloads will still go in the previous location. - + Downloading to: %1 @@ -167,8 +187,8 @@ DownloadView - - + + Downloads @@ -176,62 +196,62 @@ GlobalShortcuts - + Play - + Pause - + Play/Pause - + Stop - + Stop playing after current track - + Next track - + Previous track - + Increase volume - + Decrease volume - + Mute - + Seek forward - + Seek backward @@ -239,22 +259,22 @@ ListModel - + Searching... - + Show %1 More - + No videos - + No more videos @@ -262,7 +282,7 @@ LoadingWidget - + Error @@ -270,317 +290,317 @@ MainWindow - + &Stop - + Stop playback and go back to the search view - + S&kip - + Skip to the next video - - + + &Pause - - + + Pause playback - - + + &Full Screen - + Go full screen - + &Compact mode - + Hide the playlist and the toolbar - + Open the &YouTube page - + Go to the YouTube video page and pause playback - + Copy the YouTube &link - + Copy the current video YouTube link to the clipboard - + Copy the video stream &URL - + Copy the current video stream URL to the clipboard - + &Remove - + Remove the selected videos from the playlist - + Move &Up - + Move up the selected videos in the playlist - + Move &Down - + Move down the selected videos in the playlist - + &Clear recent keywords - + Clear the search history. Cannot be undone. - + &Quit - + Ctrl+Q - + Bye - + &Website - + %1 on the Web - + Make a &donation - + Please support the continued development of %1 - + &About - + Info about %1 - + Search - + Mute volume - + Ctrl+M - - + + &Downloads - + Show details about video downloads - + &Download - + Download the current video - + &Application - + &Playlist - + &Video - + &Help - + Press %1 to raise the volume, %2 to lower it - - + + Opening %1 - + Do you want to exit %1 with a download in progress? - + If you close %1 now, this download will be cancelled. - + Close and cancel download - + Wait for download to finish - + Fatal error: %1 - + Error: %1 - + &Play - + Resume playback - + Exit &Full Screen - + Remaining time: %1 - + Volume at %1% - + Volume is muted - + Volume is unmuted - + Maximum video definition set to %1 - + Your privacy is now safe - + Downloads complete @@ -588,62 +608,62 @@ MediaView - + Most relevant - + Most recent - + Most viewed - + You can now paste the YouTube link into another application - + You can now paste the video stream URL into another application - + The link will be valid only for a limited time. - + This is just the demo version of %1. - + It allows you to test the application and see if it works for you. - + Continue - + Get the full version - + Downloading %1 - + You're watching "%1" @@ -651,7 +671,7 @@ NetworkAccess - + Network error: %1 @@ -659,52 +679,52 @@ PrettyItemDelegate - + %1 views - + %1 of %2 (%3) ? %4 - + Preparing - + Failed - + Completed - + Stopped - + Stop downloading - + Show in %1 - + Open parent folder - + Restart downloading @@ -712,7 +732,7 @@ SearchLineEdit - + Search @@ -720,32 +740,32 @@ SearchView - + Welcome to <a href='%1'>%2</a>, - + Enter a keyword to start watching videos. - + Watch - + Recent keywords - + A new version of %1 is available. Please <a href='%2'>update to version %3</a> - + Make yourself comfortable @@ -753,7 +773,7 @@ Video - + Network error: %1 for %2 diff --git a/locale/es.ts b/locale/es.ts index e34f480..7928752 100644 --- a/locale/es.ts +++ b/locale/es.ts @@ -123,6 +123,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/es_AR.ts b/locale/es_AR.ts index 6aaabb1..70225ff 100644 --- a/locale/es_AR.ts +++ b/locale/es_AR.ts @@ -120,6 +120,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/es_ES.ts b/locale/es_ES.ts index e2cd5a7..ab98bef 100644 --- a/locale/es_ES.ts +++ b/locale/es_ES.ts @@ -124,6 +124,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/fi_FI.ts b/locale/fi_FI.ts index 444dec9..061d14d 100644 --- a/locale/fi_FI.ts +++ b/locale/fi_FI.ts @@ -112,6 +112,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/fr_FR.ts b/locale/fr_FR.ts index a2cb0a5..042f13a 100644 --- a/locale/fr_FR.ts +++ b/locale/fr_FR.ts @@ -123,6 +123,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/gl.ts b/locale/gl.ts index 2f4d472..b4ec53a 100644 --- a/locale/gl.ts +++ b/locale/gl.ts @@ -123,6 +123,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/he_IL.ts b/locale/he_IL.ts index 16e124b..63bc5de 100644 --- a/locale/he_IL.ts +++ b/locale/he_IL.ts @@ -132,6 +132,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/hr_HR.ts b/locale/hr_HR.ts index 7f2a841..0c7ebd2 100644 --- a/locale/hr_HR.ts +++ b/locale/hr_HR.ts @@ -111,6 +111,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/hu_HU.ts b/locale/hu_HU.ts index 919b3f9..df570c6 100644 --- a/locale/hu_HU.ts +++ b/locale/hu_HU.ts @@ -123,6 +123,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/it_IT.ts b/locale/it_IT.ts index 5018836..1b802d6 100644 --- a/locale/it_IT.ts +++ b/locale/it_IT.ts @@ -124,6 +124,22 @@ %n download + + This is just the demo version of %1. + Questa è solo la versione demo di %1. + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + Puoi scaricare solo video più corti di %1 minuti, così puoi testare la funzionalità dei download. + + + Continue + Continua + + + Get the full version + Compra la versione completa + DownloadSettings diff --git a/locale/ja_JP.ts b/locale/ja_JP.ts index 47f2d7e..ea2aeef 100644 --- a/locale/ja_JP.ts +++ b/locale/ja_JP.ts @@ -119,6 +119,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/lat.ts b/locale/lat.ts index 724e118..3c1f6c4 100644 --- a/locale/lat.ts +++ b/locale/lat.ts @@ -125,6 +125,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/nb_NO.ts b/locale/nb_NO.ts index d4b1cc4..a45220c 100644 --- a/locale/nb_NO.ts +++ b/locale/nb_NO.ts @@ -124,6 +124,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/nl_NL.ts b/locale/nl_NL.ts index 192caee..35ba018 100644 --- a/locale/nl_NL.ts +++ b/locale/nl_NL.ts @@ -112,6 +112,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/pl_PL.ts b/locale/pl_PL.ts index dff8b69..e4615c2 100644 --- a/locale/pl_PL.ts +++ b/locale/pl_PL.ts @@ -125,6 +125,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/pt_BR.ts b/locale/pt_BR.ts index d8b8fcb..bc1237e 100644 --- a/locale/pt_BR.ts +++ b/locale/pt_BR.ts @@ -124,6 +124,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/pt_PT.ts b/locale/pt_PT.ts index cccf890..5a1d82c 100644 --- a/locale/pt_PT.ts +++ b/locale/pt_PT.ts @@ -112,6 +112,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/ro_RO.ts b/locale/ro_RO.ts index 194efd2..3ede0d8 100644 --- a/locale/ro_RO.ts +++ b/locale/ro_RO.ts @@ -125,6 +125,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/ru_RU.ts b/locale/ru_RU.ts index e352a83..3fba019 100644 --- a/locale/ru_RU.ts +++ b/locale/ru_RU.ts @@ -125,6 +125,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/tr_TR.ts b/locale/tr_TR.ts index 87d2cf0..f256759 100644 --- a/locale/tr_TR.ts +++ b/locale/tr_TR.ts @@ -123,6 +123,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/uk.ts b/locale/uk.ts index ec02533..4b7c29a 100644 --- a/locale/uk.ts +++ b/locale/uk.ts @@ -125,6 +125,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/locale/zh_CN.ts b/locale/zh_CN.ts index 3d8146a..6b29757 100644 --- a/locale/zh_CN.ts +++ b/locale/zh_CN.ts @@ -111,6 +111,22 @@ + + This is just the demo version of %1. + + + + It can only download videos shorter than %1 minutes so you can test the download functionality. + + + + Continue + + + + Get the full version + + DownloadSettings diff --git a/src/MediaView.cpp b/src/MediaView.cpp index 7cda1cb..739c595 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -14,10 +14,6 @@ namespace The { MediaView::MediaView(QWidget *parent) : QWidget(parent) { -#ifdef APP_DEMO - tracksPlayed = 0; -#endif - reallyStopped = false; QBoxLayout *layout = new QHBoxLayout(); @@ -118,6 +114,13 @@ MediaView::MediaView(QWidget *parent) : QWidget(parent) { workaroundTimer->setInterval(3000); connect(workaroundTimer, SIGNAL(timeout()), SLOT(timerPlay())); +#ifdef APP_DEMO + demoTimer = new QTimer(this); + demoTimer->setSingleShot(true); + demoTimer->setInterval(60000); + connect(demoTimer, SIGNAL(timeout()), SLOT(demoMessage())); +#endif + } void MediaView::initialize() { @@ -142,7 +145,7 @@ void MediaView::search(SearchParams *searchParams) { reallyStopped = false; #ifdef APP_DEMO - tracksPlayed = 0; + demoTimer->stop(); #endif videoAreaWidget->clear(); @@ -302,8 +305,7 @@ void MediaView::gotStreamUrl(QUrl streamUrl) { } #ifdef APP_DEMO - if (tracksPlayed > 1) demoExpired(); - else tracksPlayed++; + demoTimer->start(); #endif } @@ -454,14 +456,14 @@ void MediaView::saveSplitterState() { } #ifdef APP_DEMO -void MediaView::demoExpired() { +void MediaView::demoMessage() { + if (mediaObject->state() != Phonon::PlayingState) return; mediaObject->pause(); QMessageBox msgBox; msgBox.setIconPixmap(QPixmap(":/images/app.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation)); - msgBox.setText(tr("This is just the demo version of %1.").arg(Constants::APP_NAME) + " " + - tr("It allows you to test the application and see if it works for you.") - ); + msgBox.setText(tr("This is just the demo version of %1.").arg(Constants::APP_NAME)); + msgBox.setInformativeText(tr("It allows you to test the application and see if it works for you.")); msgBox.setModal(true); QPushButton *quitButton = msgBox.addButton(tr("Continue"), QMessageBox::RejectRole); @@ -474,8 +476,6 @@ void MediaView::demoExpired() { } else { mediaObject->play(); } - - tracksPlayed = 1; } #endif diff --git a/src/MediaView.h b/src/MediaView.h index 90f066d..7a19d68 100644 --- a/src/MediaView.h +++ b/src/MediaView.h @@ -75,6 +75,9 @@ private slots: void searchMostViewed(); // timer void timerPlay(); +#ifdef APP_DEMO + void demoMessage(); +#endif private: @@ -108,8 +111,7 @@ private: Video *skippedVideo; #ifdef APP_DEMO - void demoExpired(); - int tracksPlayed; + QTimer *demoTimer; #endif }; diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 011b5bb..36ede9b 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -2,6 +2,7 @@ #include "downloaditem.h" #include "downloadmodel.h" #include "video.h" +#include "constants.h" static DownloadManager *downloadManagerInstance = 0; @@ -38,6 +39,30 @@ DownloadItem* DownloadManager::itemForVideo(Video* video) { void DownloadManager::addItem(Video *video) { // qDebug() << __FUNCTION__ << video->title(); + +#ifdef APP_DEMO + if (video->duration() >= 60*4) { + QMessageBox msgBox; + msgBox.setIconPixmap(QPixmap(":/images/app.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + msgBox.setText(tr("This is just the demo version of %1.").arg(Constants::APP_NAME)); + msgBox.setInformativeText( + tr("It can only download videos shorter than %1 minutes so you can test the download functionality.") + .arg(4)); + msgBox.setModal(true); + + QPushButton *quitButton = msgBox.addButton(tr("Continue"), QMessageBox::RejectRole); + QPushButton *buyButton = msgBox.addButton(tr("Get the full version"), QMessageBox::ActionRole); + + msgBox.exec(); + + if (msgBox.clickedButton() == buyButton) { + QDesktopServices::openUrl(QString(Constants::WEBSITE) + "#download"); + } + + return; + } +#endif + DownloadItem *item = itemForVideo(video); if (item != 0) { -- 2.39.5