#ifndef Q_WS_X11
#include "extra.h"
#endif
+#ifdef APP_ACTIVATION
+#include "activation.h"
+#endif
+#ifdef APP_MAC
+#include "macutils.h"
+#include "mac_startup.h"
+#endif
AboutView::AboutView(QWidget *parent) : QWidget(parent) {
- QBoxLayout *aboutlayout = new QHBoxLayout(this);
- aboutlayout->setAlignment(Qt::AlignCenter);
- aboutlayout->setMargin(30);
- aboutlayout->setSpacing(30);
+ QBoxLayout *hLayout = new QHBoxLayout(this);
+ hLayout->setAlignment(Qt::AlignCenter);
+ hLayout->setMargin(30);
+ hLayout->setSpacing(30);
QLabel *logo = new QLabel(this);
- QString resource = "app";
-#ifndef Q_WS_X11
- resource = Extra::resourceName(resource);
-#endif
- logo->setPixmap(QPixmap(":/images/" + resource + ".png"));
- aboutlayout->addWidget(logo, 0, Qt::AlignTop);
+ logo->setPixmap(QPixmap(":/images/app.png"));
+ hLayout->addWidget(logo, 0, Qt::AlignTop);
QBoxLayout *layout = new QVBoxLayout();
layout->setAlignment(Qt::AlignCenter);
layout->setSpacing(30);
- aboutlayout->addLayout(layout);
+ hLayout->addLayout(layout);
- QString info = "<html><style>a { color: palette(text); text-decoration: none; font-weight: bold }</style><body><h1>" + QString(Constants::NAME) + "</h1>"
+ QString info = "<html><style>a { color: palette(text); text-decoration: none; font-weight: bold }</style><body>"
+ "<h1>" + QString(Constants::NAME) + "</h1>"
"<p>" + tr("There's life outside the browser!") + "</p>"
"<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
- + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE) +
+ + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE);
- #if !defined(APP_MAC) && !defined(APP_WIN)
- "<p>" + tr("%1 is Free Software but its development takes precious time.").arg(Constants::NAME) + "<br/>"
+#ifdef APP_ACTIVATION
+ if (Activation::instance().isActivated())
+ info += "<p>" + tr("Licensed to: %1").arg("<b>" + Activation::instance().getEmail() + "</b>");
+#endif
+
+#ifdef Q_WS_X11
+ info += "<p>" + tr("%1 is Free Software but its development takes precious time.").arg(Constants::NAME) + "<br/>"
+ tr("Please <a href='%1'>donate</a> to support the continued development of %2.")
- .arg(QString(Constants::WEBSITE).append("#donate"), Constants::NAME) + "</p>"
- #endif
+ .arg(QString(Constants::WEBSITE).append("#donate"), Constants::NAME) + "</p>";
+#endif
- "<p>" + tr("You may want to try my other apps as well:") + "</p>"
- + "<ul>"
+ info += "<p>" + tr("You may want to try my other apps as well:") + "</p>"
+ "<ul>"
- + "<li>" + tr("%1, a YouTube music player")
+ "<li>" + tr("%1, a YouTube music player")
.arg("<a href='http://flavio.tordini.org/musictube'>Musictube</a>")
+ "</li>"
- + "<li>" + tr("%1, a music player")
+ "<li>" + tr("%1, a music player")
.arg("<a href='http://flavio.tordini.org/musique'>Musique</a>")
+ "</li>"
- + "</ul>"
+ "</ul>"
"<p>" + tr("Translate %1 to your native language using %2").arg(Constants::NAME)
.arg("<a href='http://www.transifex.net/projects/p/" + QString(Constants::UNIX_NAME) + "/resource/main/'>Transifex</a>")
+ tr("Icon designed by %1.").arg("<a href='http://www.kolorguild.com/'>David Nel</a>")
+ "</p>"
- #if !defined(APP_MAC) && !defined(APP_WIN)
+ #ifdef Q_WS_X11
"<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
.arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
#endif
layout->addWidget(infoLabel);
QLayout *buttonLayout = new QHBoxLayout();
+ buttonLayout->setMargin(0);
+ buttonLayout->setSpacing(0);
buttonLayout->setAlignment(Qt::AlignLeft);
QPushButton *closeButton = new QPushButton(tr("&Close"), this);
connect(closeButton, SIGNAL(clicked()), parent, SLOT(goBack()));
buttonLayout->addWidget(closeButton);
- /*
- QPushButton *issueButton = new QPushButton(tr("&Report an issue"), this);
- issueButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
- connect(issueButton, SIGNAL(clicked()), window(), SLOT(reportIssue()));
- buttonLayout->addWidget(issueButton);
- */
-
layout->addLayout(buttonLayout);
-
}
void AboutView::paintEvent(QPaintEvent * /*event*/) {
painter.fillRect(0, 0, width(), height(), brush);
#endif
}
+
+void AboutView::appear() {
+#ifdef APP_MAC
+ mac::uncloseWindow(window()->winId());
+#ifdef APP_ACTIVATION
+ mac::CheckForUpdates();
+#endif
+#endif
+}
#include <QtGui>
#include "View.h"
#include "constants.h"
-#ifdef APP_MAC
-#include "macutils.h"
-#endif
class AboutView : public QWidget, public View {
public:
AboutView(QWidget *parent);
- void appear() {
-#ifdef APP_MAC
- mac::uncloseWindow(window()->winId());
-#endif
- }
+ void appear();
void disappear() {}
QMap<QString, QVariant> metadata() {
QMap<QString, QVariant> metadata;
#include "macsupport.h"
#include "macutils.h"
#endif
-#ifndef Q_WS_X11
-#include "extra.h"
-#endif
#include "downloadmanager.h"
#include "youtubesuggest.h"
#include "updatechecker.h"
-#ifdef APP_DEMO
-#include "demostartupview.h"
-#endif
#include "temporary.h"
#ifdef APP_MAC
#include "searchlineedit_mac.h"
#include "searchlineedit.h"
#endif
#include <iostream>
+#ifndef Q_WS_X11
+#include "extra.h"
+#include "updatedialog.h"
+#endif
+#ifdef APP_ACTIVATION
+#include "activation.h"
+#include "activationview.h"
+#include "activationdialog.h"
+#endif
static MainWindow *singleton = 0;
// views mechanism
history = new QStack<QWidget*>();
views = new QStackedWidget(this);
- setCentralWidget(views);
// views
searchView = new SearchView(this);
setMinimumWidth(0);
// show the initial view
-#ifdef APP_DEMO
- QWidget *demoStartupView = new DemoStartupView(this);
- views->addWidget(demoStartupView);
- showWidget(demoStartupView);
-#else
- showSearch();
+ showSearch(false);
+
+#ifdef APP_ACTIVATION
+ if (!Activation::instance().isActivated())
+ showActivationView(false);
#endif
+ setCentralWidget(views);
+
// Global shortcuts
GlobalShortcuts &shortcuts = GlobalShortcuts::instance();
#ifdef Q_WS_X11
action->setCheckable(true);
actions->insert("refine-search", action);
+#ifdef APP_ACTIVATION
+ Extra::createActivationAction(tr("Buy %1...").arg(Constants::NAME));
+#endif
+
// common action properties
foreach (QAction *action, actions->values()) {
// show keyboard shortcuts in the status bar
if (!action->shortcut().isEmpty())
action->setStatusTip(action->statusTip() + " (" + action->shortcut().toString(QKeySequence::NativeText) + ")");
-
- // no icons in menus
- action->setIconVisibleInMenu(false);
-
}
}
QMap<QString, QMenu*> *menus = The::globalMenus();
fileMenu = menuBar()->addMenu(tr("&Application"));
-#ifdef APP_DEMO
- QAction* action = new QAction(tr("Buy %1...").arg(Constants::NAME), this);
- action->setMenuRole(QAction::ApplicationSpecificRole);
- connect(action, SIGNAL(triggered()), SLOT(buy()));
- fileMenu->addAction(action);
+#ifdef APP_ACTIVATION
+ QAction *buyAction = The::globalActions()->value("buy");
+ if (buyAction) fileMenu->addAction(buyAction);
+#ifndef APP_MAC
+ fileMenu->addSeparator();
+#endif
#endif
fileMenu->addAction(clearAct);
#ifndef APP_MAC
}
}
-void MainWindow::showWidget ( QWidget* widget ) {
+void MainWindow::showWidget(QWidget* widget, bool transition) {
if (compactViewAct->isChecked())
compactViewAct->toggle();
if (oldView) {
oldView->disappear();
views->currentWidget()->setEnabled(false);
- }
+ } else qDebug() << "Cannot cast view";
// call show method on the new view
View* newView = dynamic_cast<View *> (widget);
statusBar()->showMessage((metadata.value("description").toString()));
}
- stopAct->setEnabled(widget == mediaView);
- compactViewAct->setEnabled(widget == mediaView);
- webPageAct->setEnabled(widget == mediaView);
- copyPageAct->setEnabled(widget == mediaView);
- copyLinkAct->setEnabled(widget == mediaView);
- findVideoPartsAct->setEnabled(widget == mediaView);
- toolbarSearch->setEnabled(widget == searchView || widget == mediaView || widget == downloadView);
+ const bool isMediaView = widget == mediaView;
+
+ stopAct->setEnabled(isMediaView);
+ compactViewAct->setEnabled(isMediaView);
+ webPageAct->setEnabled(isMediaView);
+ copyPageAct->setEnabled(isMediaView);
+ copyLinkAct->setEnabled(isMediaView);
+ findVideoPartsAct->setEnabled(isMediaView);
+ toolbarSearch->setEnabled(widget == searchView || isMediaView || widget == downloadView);
if (widget == searchView) {
skipAct->setEnabled(false);
The::globalActions()->value("stopafterthis")->setEnabled(false);
}
- The::globalActions()->value("twitter")->setEnabled(widget == mediaView);
- The::globalActions()->value("facebook")->setEnabled(widget == mediaView);
- The::globalActions()->value("buffer")->setEnabled(widget == mediaView);
- The::globalActions()->value("email")->setEnabled(widget == mediaView);
+ The::globalActions()->value("twitter")->setEnabled(isMediaView);
+ The::globalActions()->value("facebook")->setEnabled(isMediaView);
+ The::globalActions()->value("buffer")->setEnabled(isMediaView);
+ The::globalActions()->value("email")->setEnabled(isMediaView);
aboutAct->setEnabled(widget != aboutView);
The::globalActions()->value("downloads")->setChecked(widget == downloadView);
- // toolbar only for the mediaView
- /* mainToolBar->setVisible(
- (widget == mediaView && !compactViewAct->isChecked())
- || widget == downloadView
- ); */
-
setUpdatesEnabled(true);
QWidget *oldWidget = views->currentWidget();
views->setCurrentWidget(widget);
widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
- // adjustSize();
#ifndef Q_WS_X11
- Extra::fadeInWidget(oldWidget, widget);
+ if (transition) Extra::fadeInWidget(oldWidget, widget);
#endif
history->push(widget);
return true;
}
-void MainWindow::showSearch() {
- showWidget(searchView);
+void MainWindow::showSearch(bool transition) {
+ showWidget(searchView, transition);
currentTime->clear();
totalTime->clear();
}
this, SLOT(gotNewVersion(QString)));
updateChecker->checkForUpdate();
settings.setValue(updateCheckKey, unixTime);
-
}
void MainWindow::gotNewVersion(QString version) {
updateChecker = 0;
}
-#if defined(APP_DEMO) || defined(APP_MAC_STORE) || defined(APP_USC)
- return;
-#endif
-
QSettings settings;
QString checkedVersion = settings.value("checkedVersion").toString();
if (checkedVersion == version) return;
+#ifdef APP_SIMPLEUPDATE
+ simpleUpdateDialog(version);
+#endif
+#if defined(APP_ACTIVATION) && !defined(APP_MAC)
+ UpdateDialog *dialog = new UpdateDialog(version, this);
+ dialog->show();
+#endif
+}
+
+void MainWindow::simpleUpdateDialog(QString version) {
QMessageBox msgBox(this);
- msgBox.setIconPixmap(QPixmap(":/images/app.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
+ msgBox.setIconPixmap(
+ QPixmap(":/images/app.png")
+ .scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
msgBox.setText(tr("%1 version %2 is now available.").arg(Constants::NAME, version));
-
msgBox.setModal(true);
- // make it a "sheet" on the Mac
msgBox.setWindowModality(Qt::WindowModal);
-
- QPushButton* laterButton = 0;
- QPushButton* updateButton = 0;
-
-#if defined(APP_MAC) || defined(APP_WIN)
- msgBox.setInformativeText(
- tr("To get the updated version, download %1 again from the link you received via email and reinstall.")
- .arg(Constants::NAME)
- );
- laterButton = msgBox.addButton(tr("Remind me later"), QMessageBox::RejectRole);
- msgBox.addButton(QMessageBox::Ok);
-#else
msgBox.addButton(QMessageBox::Close);
- updateButton = msgBox.addButton(tr("Update"), QMessageBox::AcceptRole);
-#endif
-
+ QPushButton* laterButton = msgBox.addButton(tr("Remind me later"), QMessageBox::RejectRole);
+ QPushButton* updateButton = msgBox.addButton(tr("Update"), QMessageBox::AcceptRole);
msgBox.exec();
-
if (msgBox.clickedButton() != laterButton) {
+ QSettings settings;
settings.setValue("checkedVersion", version);
}
-
- if (updateButton && msgBox.clickedButton() == updateButton) {
- QDesktopServices::openUrl(QUrl(QLatin1String(Constants::WEBSITE) + "#download"));
- }
-
+ if (msgBox.clickedButton() == updateButton) visitSite();
}
void MainWindow::floatOnTop(bool onTop) {
msg += "Go back to the previous video.\n";
std::cout << msg.toLocal8Bit().data();
}
+
+void MainWindow::showMessage(QString message) {
+ statusBar()->showMessage(message, 60000);
+}
+
+#ifdef APP_ACTIVATION
+void MainWindow::showActivationView(bool transition) {
+ QWidget *activationView = ActivationView::instance();
+ if (views->currentWidget() == activationView) {
+ buy();
+ return;
+ }
+ views->addWidget(activationView);
+ showWidget(activationView, transition);
+}
+
+void MainWindow::showActivationDialog() {
+ QTimer::singleShot(0, new ActivationDialog(this), SLOT(show()));
+}
+
+void MainWindow::buy() {
+ Extra::buy();
+}
+
+void MainWindow::hideBuyAction() {
+ QAction *action = The::globalActions()->value("buy");
+ action->setVisible(false);
+ action->setEnabled(false);
+}
+#endif
void messageReceived(const QString &message);
void quit();
void startToolbarSearch(QString query);
+ void goBack();
+ void showMessage(QString message);
+#ifdef APP_ACTIVATION
+ void showActivationView(bool transition = true);
+ void showActivationDialog();
+ void buy();
+ void hideBuyAction();
+#endif
protected:
void changeEvent(QEvent *);
private slots:
void checkForUpdate();
void gotNewVersion(QString version);
- void goBack();
- void showSearch();
+ void showSearch(bool transition = true);
void visitSite();
void donate();
void reportIssue();
void createMenus();
void createToolBars();
void createStatusBar();
- void showWidget(QWidget*);
+ void showWidget(QWidget*, bool transition = true);
static QString formatTime(qint64 time);
bool confirmQuit();
+ void simpleUpdateDialog(QString version);
UpdateChecker *updateChecker;
#ifdef APP_MAC
#include "macfullscreen.h"
#endif
+#ifdef APP_ACTIVATION
+#include "activation.h"
+#endif
namespace The {
NetworkAccess* http();
splitter->addWidget(sidebar);
videoAreaWidget = new VideoAreaWidget(this);
- // videoAreaWidget->setMinimumSize(320,240);
+ videoAreaWidget->setMinimumSize(320,240);
videoWidget = new Phonon::VideoWidget(this);
videoAreaWidget->setVideoWidget(videoWidget);
videoAreaWidget->setListModel(listModel);
workaroundTimer->setInterval(3000);
connect(workaroundTimer, SIGNAL(timeout()), SLOT(timerPlay()));
-#ifdef APP_DEMO
+#ifdef APP_ACTIVATION
demoTimer = new QTimer(this);
demoTimer->setSingleShot(true);
connect(demoTimer, SIGNAL(timeout()), SLOT(demoMessage()));
void MediaView::search(SearchParams *searchParams) {
reallyStopped = false;
-#ifdef APP_DEMO
+#ifdef APP_ACTIVATION
demoTimer->stop();
#endif
workaroundTimer->stop();
timerPlayFlag = false;
// video title in the statusbar
- QMainWindow* mainWindow = dynamic_cast<QMainWindow*>(window());
- if (mainWindow) mainWindow->statusBar()->showMessage(video->title());
-
+ MainWindow::instance()->showMessage(video->title());
// ensure active item is visible
// int row = listModel->activeRow();
listView->scrollTo(index, QAbstractItemView::EnsureVisible);
}
-#ifdef APP_DEMO
- demoTimer->start(60000);
+#ifdef APP_ACTIVATION
+ if (!Activation::instance().isActivated())
+ demoTimer->start(180000);
#endif
}
if (!video) return;
QString address = video->webpage().toString();
QApplication::clipboard()->setText(address);
- 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);
+ MainWindow::instance()->showMessage(message);
}
void MediaView::copyVideoLink() {
QApplication::clipboard()->setText(video->getStreamUrl().toEncoded());
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);
+ MainWindow::instance()->showMessage(message);
}
void MediaView::removeSelected() {
settings.setValue("splitter", splitter->saveState());
}
-#ifdef APP_DEMO
+#ifdef APP_ACTIVATION
static QPushButton *continueButton;
msgBox.exec();
if (msgBox.clickedButton() == buyButton) {
- QDesktopServices::openUrl(QUrl(QString(Constants::WEBSITE) + "#download"));
+ MainWindow::instance()->showActivationView();
} else {
mediaObject->play();
demoTimer->start(600000);
void MediaView::downloadVideo() {
Video* video = listModel->activeVideo();
if (!video) return;
-
DownloadManager::instance()->addItem(video);
-
- // TODO animate
-
The::globalActions()->value("downloads")->setVisible(true);
-
- // The::globalActions()->value("download")->setEnabled(DownloadManager::instance()->itemForVideo(video) == 0);
-
- QMainWindow* mainWindow = dynamic_cast<QMainWindow*>(window());
QString message = tr("Downloading %1").arg(video->title());
- if (mainWindow) mainWindow->statusBar()->showMessage(message);
+ MainWindow::instance()->showMessage(message);
}
void MediaView::snapshot() {
Video* video = listModel->videoAt(index.row());
if (!video) return;
- QString channel = video->author();
+ QString channel = video->authorUri();
+ if (channel.isEmpty()) channel = video->author();
if (channel.isEmpty()) return;
SearchParams *searchParams = new SearchParams();
void searchMostViewed();
// timer
void timerPlay();
-#ifdef APP_DEMO
+#ifdef APP_ACTIVATION
void demoMessage();
void updateContinueButton(int);
#endif
QTimer *workaroundTimer;
Video *skippedVideo;
-#ifdef APP_DEMO
+#ifdef APP_ACTIVATION
QTimer *demoTimer;
#endif
#ifndef Q_WS_X11
#include "extra.h"
#endif
+#ifdef APP_ACTIVATION
+#include "activation.h"
+#endif
+#include "MainWindow.h"
namespace The {
- QMap<QString, QAction*>* globalActions();
+QMap<QString, QAction*>* globalActions();
}
static const QString recentKeywordsKey = "recentKeywords";
message->hide();
mainLayout->addWidget(message);
-#ifdef APP_DEMO
- QLabel *buy = new QLabel(this);
- buy->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
- buy->setText(QString("<a style='color:palette(text);text-decoration:none' href='%1'>%2</a>").arg(
- QString(Constants::WEBSITE) + "#download",
- tr("Get the full version").toUpper()
- ));
- buy->setOpenExternalLinks(true);
- buy->setMargin(7);
- buy->setAlignment(Qt::AlignRight);
- buy->setStyleSheet("QLabel {"
- "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CCD6E0, stop: 1 #ADBCCC);"
- "border-bottom-left-radius: 8px;"
- "border-bottom-right-radius: 8px;"
- "font-size: 10px;"
- "margin-right: 50px;"
- "}");
- mainLayout->addWidget(buy, 0, Qt::AlignRight);
+#ifdef APP_ACTIVATION
+ if (!Activation::instance().isActivated())
+ mainLayout->addWidget(Extra::buyButton(tr("Get the full version")), 0, Qt::AlignCenter);
#endif
mainLayout->addStretch();
mainLayout->addLayout(hLayout);
QLabel *logo = new QLabel(this);
- QString resource = "app";
-#ifndef Q_WS_X11
- resource = Extra::resourceName(resource);
- logo->setMaximumSize(128, 128);
- logo->setScaledContents(true);
-#endif
- logo->setPixmap(QPixmap(":/images/" + resource + ".png"));
+ logo->setPixmap(QPixmap(":/images/app.png"));
hLayout->addWidget(logo, 0, Qt::AlignTop);
hLayout->addSpacing(PADDING);
QBoxLayout *tipLayout = new QHBoxLayout();
tipLayout->setSpacing(10);
- //: "Enter", as in "type". The whole frase says: "Enter a keyword to start watching videos"
+ //: "Enter", as in "type". The whole phrase says: "Enter a keyword to start watching videos"
QLabel *tipLabel = new QLabel(tr("Enter"), this);
tipLabel->setFont(biggerFont);
tipLayout->addWidget(tipLabel);
#include "video.h"
#include "constants.h"
#include "MainWindow.h"
+#ifdef APP_ACTIVATION
+#include "activation.h"
+#endif
+#ifdef Q_WS_MAC
+#include "macutils.h"
+#endif
static DownloadManager *downloadManagerInstance = 0;
void DownloadManager::addItem(Video *video) {
// qDebug() << __FUNCTION__ << video->title();
-#ifdef APP_DEMO
- if (video->duration() >= 60*4) {
- QMessageBox msgBox(MainWindow::instance());
- 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::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);
- // make it a "sheet" on the Mac
- msgBox.setWindowModality(Qt::WindowModal);
-
- 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(QUrl(QString(Constants::WEBSITE) + "#download"));
- }
+#ifdef APP_ACTIVATION
+ if (!Activation::instance().isActivated()) {
+ if (video->duration() >= 60*4) {
+ QMessageBox msgBox(MainWindow::instance());
+ 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::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);
+ // make it a "sheet" on the Mac
+ msgBox.setWindowModality(Qt::WindowModal);
- return;
+ msgBox.addButton(tr("Continue"), QMessageBox::RejectRole);
+ QPushButton *buyButton = msgBox.addButton(tr("Get the full version"), QMessageBox::ActionRole);
+
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == buyButton) {
+ MainWindow::instance()->showActivationView();
+ }
+
+ return;
+ }
}
#endif
#include "updatechecker.h"
#include "networkaccess.h"
#include "constants.h"
+#ifdef APP_ACTIVATION
+#include "activation.h"
+#endif
namespace The {
NetworkAccess* http();
#ifdef APP_WIN
updateUrl.addQueryItem("os", "win");
#endif
-#ifdef APP_DEMO
- updateUrl.addQueryItem("t", "demo");
+#ifdef APP_ACTIVATION
+ QString t = "demo";
+ if (Activation::instance().isActivated()) t = "active";
+ updateUrl.addQueryItem("t", t);
#endif
#ifdef APP_MAC_STORE
updateUrl.addQueryItem("store", "mac");