From 17da12e5cfa4f6635f6ace5fdeea718fccc15ce8 Mon Sep 17 00:00:00 2001 From: Flavio Date: Sat, 23 Apr 2011 17:32:15 +0200 Subject: [PATCH] Demo message as a "sheet" on the Mac --- src/downloadmanager.cpp | 6 ++++-- src/downloadmanager.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 5363d1e..fbfb0d0 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -6,7 +6,7 @@ static DownloadManager *downloadManagerInstance = 0; -DownloadManager::DownloadManager(QObject *parent) : +DownloadManager::DownloadManager(QWidget *parent) : QObject(parent), downloadModel(new DownloadModel(this, this)) { } @@ -42,13 +42,15 @@ void DownloadManager::addItem(Video *video) { #ifdef APP_DEMO if (video->duration() >= 60*4) { - QMessageBox msgBox; + QMessageBox msgBox(dynamic_cast(parent())->window()); 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); + // make it a "sheet" on the Mac + msgBox.setWindowModality(Qt::WindowModal); QPushButton *quitButton = msgBox.addButton(tr("Continue"), QMessageBox::RejectRole); QPushButton *buyButton = msgBox.addButton(tr("Get the full version"), QMessageBox::ActionRole); diff --git a/src/downloadmanager.h b/src/downloadmanager.h index 15baa7f..789ee03 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -32,7 +32,7 @@ private slots: void gotStreamUrl(QUrl url); private: - DownloadManager(QObject *parent = 0); + DownloadManager(QWidget *parent = 0); QList items; DownloadModel *downloadModel; -- 2.39.5