]> git.sur5r.net Git - minitube/commitdiff
Demo message as a "sheet" on the Mac
authorFlavio <flavio@odisseo.local>
Sat, 23 Apr 2011 15:32:15 +0000 (17:32 +0200)
committerFlavio <flavio@odisseo.local>
Sat, 23 Apr 2011 15:32:15 +0000 (17:32 +0200)
src/downloadmanager.cpp
src/downloadmanager.h

index 5363d1ea74782a9c08e69c06961292a41f56a761..fbfb0d0201ded6761073b3b7ac0ddb15f240807e 100644 (file)
@@ -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<QWidget*>(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);
index 15baa7f748fe850a7de590bfb601d737a5fa22b5..789ee03782536aeed86cba6b82e750ede131faf2 100644 (file)
@@ -32,7 +32,7 @@ private slots:
     void gotStreamUrl(QUrl url);
 
 private:
-    DownloadManager(QObject *parent = 0);
+    DownloadManager(QWidget *parent = 0);
 
     QList<DownloadItem*> items;
     DownloadModel *downloadModel;