From cfb889df8a08ece8f9a0e6007bd0d542ff734ea2 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sun, 24 Apr 2011 22:40:35 +0200 Subject: [PATCH] Some edits in desktopnotificationsfactory + use it when newer version is available and after all downloads are completed --- src/app/mainapplication.cpp | 9 ++ src/app/mainapplication.h | 3 + src/data/icons.qrc | 2 + src/data/icons/notifications/download.png | Bin 0 -> 2041 bytes .../preferences/stock_dialog-question.png | Bin 0 -> 1839 bytes .../desktopnotification.cpp | 2 +- .../desktopnotification.ui | 91 +++++++++++++----- .../desktopnotificationsfactory.cpp | 13 ++- .../desktopnotificationsfactory.h | 1 + src/downloads/downloaditem.cpp | 4 + src/downloads/downloaditem.h | 1 + src/downloads/downloadmanager.cpp | 41 +++++--- src/downloads/downloadmanager.h | 1 + src/main.cpp | 3 +- src/other/aboutdialog.cpp | 2 + src/other/updater.cpp | 45 +-------- src/other/updater.h | 6 -- src/preferences/preferences.ui | 17 +++- 18 files changed, 149 insertions(+), 92 deletions(-) create mode 100644 src/data/icons/notifications/download.png create mode 100644 src/data/icons/preferences/stock_dialog-question.png diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index 45adf694f..25430ac10 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -34,6 +34,7 @@ #include "downloadmanager.h" #include "autofillmodel.h" #include "adblockmanager.h" +#include "desktopnotificationsfactory.h" MainApplication::MainApplication(int &argc, char **argv) : QtSingleApplication("QupZillaWebBrowser", argc, argv) @@ -50,6 +51,7 @@ MainApplication::MainApplication(int &argc, char **argv) ,m_downloadManager(0) ,m_autofill(0) ,m_networkCache(new QNetworkDiskCache) + ,m_desktopNotifications(0) ,m_isClosing(false) ,m_isChanged(false) ,m_isExited(false) @@ -420,6 +422,13 @@ AutoFillModel* MainApplication::autoFill() return m_autofill; } +DesktopNotificationsFactory* MainApplication::desktopNotifications() +{ + if (!m_desktopNotifications) + m_desktopNotifications = new DesktopNotificationsFactory(this); + return m_desktopNotifications; +} + void MainApplication::aboutToCloseWindow(QupZilla* window) { if (!window) diff --git a/src/app/mainapplication.h b/src/app/mainapplication.h index 9e993f38f..455aac896 100644 --- a/src/app/mainapplication.h +++ b/src/app/mainapplication.h @@ -41,6 +41,7 @@ class PluginProxy; class BookmarksModel; class DownloadManager; class AutoFillModel; +class DesktopNotificationsFactory; class MainApplication : public QtSingleApplication { @@ -82,6 +83,7 @@ public: DownloadManager* downManager(); AutoFillModel* autoFill(); QNetworkDiskCache* networkCache() { return m_networkCache; } + DesktopNotificationsFactory* desktopNotifications(); public slots: bool saveStateSlot(); @@ -115,6 +117,7 @@ private: DownloadManager* m_downloadManager; AutoFillModel* m_autofill; QNetworkDiskCache* m_networkCache; + DesktopNotificationsFactory* m_desktopNotifications; QList > m_mainWindows; diff --git a/src/data/icons.qrc b/src/data/icons.qrc index 3b82fb949..1976327da 100644 --- a/src/data/icons.qrc +++ b/src/data/icons.qrc @@ -70,5 +70,7 @@ icons/preferences/stock_keyring.png icons/other/list-add.png icons/other/adblock.png + icons/preferences/stock_dialog-question.png + icons/notifications/download.png diff --git a/src/data/icons/notifications/download.png b/src/data/icons/notifications/download.png new file mode 100644 index 0000000000000000000000000000000000000000..a55e6515e89fae717b467780c572be99d0abf353 GIT binary patch literal 2041 zcmVgJfw~C^QM5Sp&5_U_4 z0<@tB(F=-tg~T7gW$yS3a>Ye1!X<(W5CWly2n8ynK-&a1g%YWWNZM?+kliE=>%=== zug9L5!-ah&F8M2!s$w+0vzt+X1B%Q4|3X zhAnPU6cGdgN-4rH#P|K`!-o$qoH}*tln~;cQpyJqN+~__r7Ksi{CMZiov(YIhhZ2P zhJln4%d(JC#zPAcLTsx5ebl4bY!XEgVHgqw0j}$^yuAGDxw*L?01uQ>q4q!;nBBd5 z_lat?N)QAcvmHedLWp>lq?GYzVbmOpydf==QXS-z9?|D*FR*9Np05M5KozKJ0TwWo zN~Q8^Yik`BY9abu3(@E0wU5UVFqMBc7LfErw;*UuWICOm0H%N?c$@*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QUy^%@`Qn*pI4Wt>uGDA9Af0(wPex8}7T|cjLpo zym9&x5_A%YNkgziAaX>JWwBCb%WV@koT#-e)*C$Yi&qIc2N~-NdFb99sRGNDyW_S& z7At4)JNlB+-o6VW>xgWe1AbH98#PsBzFg&ry)V$&)6e4%407MZFrFtjBpz8yqfw8m ztywJuQG|64@dD0GUE;3s4L4nVF5^+r98Y|1oZWW~1K^xnwNL>ZdG9=)pT|0jMB1i+ z0EE`z9GFZeN8g`j>*%^wSDrM_Gd%g&PDVHO-%_}ap1gqbb6BS+sk)NZfv8yrBq;E^ zH_uY7)v?yLb?02#8(~PPD}yod%9p>}+OJm^IdWzeFX+NrC0eBpcnJYD0gI-@uYUV> z8{qOufAZX)_|A`C=ey5Lt{}JkyYK(>4^*@VH38PTgn*ZXps9cb5sVQsT?0(Md78Cr zj`8sQTUXcA3+U+EgqOW~(-8b}|Jxj&a^!mlu`X7t=~UWw0ikn<2p)oGd~&5>ezyN4 zvscP|?cuxey!ONBn~&_`ftfNND{WhK$27u--@N(`FTF8MVPFi5->ib#mP>8hP()BC zI0Gi=AlE;}r(S+9cWnL&LPKRUl^lU z$neL5@A2F#$0*ZFe&7y_$q+lfcrr0QVhkWe0Fh1Y7-;Hw?J@$#xABPxyV~iw(#R#6EY0(9dn6(kXw2TuUn#i1Fc`{Ct z*OQmHRYm*-Bra1b~RM53yQNCDUe>;hJvLjT)#0r)d;LRGIz5-Sl2h;J*|kC;Fm dsH$oR@Gt#a*z<*|7oGqB002ovPDHLkV1k}gZgcicon->setPixmap(m_icon); - ui->heading->setText(QString("%1").arg(m_heading)); + ui->heading->setText(m_heading); ui->text->setText(m_text); if (!m_settingPosition) { diff --git a/src/desktopnotifications/desktopnotification.ui b/src/desktopnotifications/desktopnotification.ui index a519a506a..13e068f64 100644 --- a/src/desktopnotifications/desktopnotification.ui +++ b/src/desktopnotifications/desktopnotification.ui @@ -7,7 +7,7 @@ 0 0 356 - 91 + 74 @@ -35,26 +35,13 @@ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 #e4ecf1, stop:1 QFrame::Raised - - - - - - 0 - 0 - - - - - - - - + + - 64 - 64 + 48 + 48 @@ -62,15 +49,67 @@ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 #e4ecf1, stop:1 - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + 0 - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + QLabel { +font: bold; +font-size: 13pt; +} + + + + + + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + diff --git a/src/desktopnotifications/desktopnotificationsfactory.cpp b/src/desktopnotifications/desktopnotificationsfactory.cpp index fd8a34bb9..2967efd76 100644 --- a/src/desktopnotifications/desktopnotificationsfactory.cpp +++ b/src/desktopnotifications/desktopnotificationsfactory.cpp @@ -15,7 +15,8 @@ void DesktopNotificationsFactory::loadSettings() settings.beginGroup("Notifications"); m_enabled = settings.value("Enabled", true).toBool(); m_timeout = settings.value("Timeout", 6000).toInt(); -#ifdef Q_WS_X11 +//#ifdef Q_WS_X11 +#if 0 m_notifType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNative : PopupWidget; #else m_notifType = PopupWidget; @@ -26,6 +27,9 @@ void DesktopNotificationsFactory::loadSettings() void DesktopNotificationsFactory::notify(const QPixmap &icon, const QString &heading, const QString &text) { + if (!m_enabled) + return; + switch (m_notifType) { case PopupWidget: if (!m_desktopNotif) @@ -34,15 +38,20 @@ void DesktopNotificationsFactory::notify(const QPixmap &icon, const QString &hea m_desktopNotif->setHeading(heading); m_desktopNotif->setText(text); m_desktopNotif->setTimeout(m_timeout); + m_desktopNotif->move(m_position); m_desktopNotif->show(); break; case DesktopNative: + QFile tmp(QDir::tempPath() + "/qupzilla_notif.png"); + tmp.open(QFile::WriteOnly); + icon.save(tmp.fileName()); + QDBusInterface dbus("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", QDBusConnection::sessionBus()); QVariantList args; args.append("qupzilla"); args.append(m_uint); - args.append(""); //FIXME:store pixmap in temp folder and provide full path to it + args.append(tmp.fileName()); args.append(heading); args.append(text); args.append(QStringList()); diff --git a/src/desktopnotifications/desktopnotificationsfactory.h b/src/desktopnotifications/desktopnotificationsfactory.h index 3d6afe796..bda9f1dea 100644 --- a/src/desktopnotifications/desktopnotificationsfactory.h +++ b/src/desktopnotifications/desktopnotificationsfactory.h @@ -8,6 +8,7 @@ #include #include #include +#include class DesktopNotification; class DesktopNotificationsFactory : public QObject diff --git a/src/downloads/downloaditem.cpp b/src/downloads/downloaditem.cpp index 7a4dd3737..0e4dfd1c5 100644 --- a/src/downloads/downloaditem.cpp +++ b/src/downloads/downloaditem.cpp @@ -128,6 +128,8 @@ void DownloadItem::finished() if (m_openAfterFinish) openFile(); + + emit downloadFinished(true); } void DownloadItem::downloadProgress(qint64 received, qint64 total) @@ -258,6 +260,8 @@ void DownloadItem::stop(bool askForDeleteFile) #endif m_downloading = false; + emit downloadFinished(false); + if (askForDeleteFile) { QMessageBox::StandardButton button = QMessageBox::question(m_item->listWidget()->parentWidget(), tr("Delete file"), tr("Do you want to also delete dowloaded file?"), QMessageBox::Yes | QMessageBox::No); if (button != QMessageBox::Yes) diff --git a/src/downloads/downloaditem.h b/src/downloads/downloaditem.h index 5d186988f..2423b11c1 100644 --- a/src/downloads/downloaditem.h +++ b/src/downloads/downloaditem.h @@ -56,6 +56,7 @@ public: signals: void deleteItem(DownloadItem*); + void downloadFinished(bool success); private slots: void finished(); diff --git a/src/downloads/downloadmanager.cpp b/src/downloads/downloadmanager.cpp index 08bae47da..57c1ce0b7 100644 --- a/src/downloads/downloadmanager.cpp +++ b/src/downloads/downloadmanager.cpp @@ -23,6 +23,7 @@ #include "ecwin7.h" #include "networkmanager.h" #include "qtwin.h" +#include "desktopnotificationsfactory.h" DownloadManager::DownloadManager(QWidget* parent) : QWidget(parent) @@ -77,25 +78,14 @@ void DownloadManager::timerEvent(QTimerEvent* event) } for (int i = 0; i < ui->list->count(); i++) { DownloadItem* downItem = qobject_cast(ui->list->itemWidget(ui->list->item(i))); - if (!downItem || (downItem && downItem->isCancelled())) + if (!downItem || (downItem && downItem->isCancelled()) || !downItem->isDownloading()) continue; - if (!downItem->isDownloading()) { - progresses.append(100); - continue; - } else - progresses.append(downItem->progress()); + progresses.append(downItem->progress()); remTimes.append(downItem->remainingTime()); speeds.append(downItem->currentSpeed()); } - if (remTimes.isEmpty()) { - ui->speedLabel->clear(); - setWindowTitle(tr("Download Manager")); -#ifdef W7API - win7.setProgressValue(0, 0); - win7.setProgressState(win7.Normal); -#endif + if (remTimes.isEmpty()) return; - } QTime remaining; foreach (QTime time, remTimes) { @@ -203,12 +193,35 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, bool askWha QListWidgetItem* item = new QListWidgetItem(ui->list); DownloadItem* downItem = new DownloadItem(item, reply, path, fileName, fileIcon, openFileOptionsChoosed, this); connect(downItem, SIGNAL(deleteItem(DownloadItem*)), this, SLOT(deleteItem(DownloadItem*))); + connect(downItem, SIGNAL(downloadFinished(bool)), this, SLOT(downloadFinished(bool))); ui->list->setItemWidget(item, downItem); item->setSizeHint(downItem->sizeHint()); show(); activateWindow(); } +void DownloadManager::downloadFinished(bool success) +{ + bool downloadingAllFilesFinished = true; + for (int i = 0; i < ui->list->count(); i++) { + DownloadItem* downItem = qobject_cast(ui->list->itemWidget(ui->list->item(i))); + if (!downItem || (downItem && downItem->isCancelled()) || !downItem->isDownloading()) + continue; + downloadingAllFilesFinished = false; + } + + if (downloadingAllFilesFinished) { + if (success) + mApp->desktopNotifications()->notify(QPixmap(":icons/notifications/download.png"), tr("Download Finished"), tr("All files has been successfuly downloaded.")); + ui->speedLabel->clear(); + setWindowTitle(tr("Download Manager")); +#ifdef W7API + win7.setProgressValue(0, 0); + win7.setProgressState(win7.Normal); +#endif + } +} + void DownloadManager::deleteItem(DownloadItem* item) { if (item && !item->isDownloading()) diff --git a/src/downloads/downloadmanager.h b/src/downloads/downloadmanager.h index fb360c06c..a7dce3f38 100644 --- a/src/downloads/downloadmanager.h +++ b/src/downloads/downloadmanager.h @@ -67,6 +67,7 @@ protected: private slots: void clearList(); void deleteItem(DownloadItem* item); + void downloadFinished(bool success); private: #ifdef W7API diff --git a/src/main.cpp b/src/main.cpp index f32cd8511..e986c38bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,5 +37,6 @@ int main(int argc, char *argv[]) std::cout << "QupZilla already running - activating existing window" << std::endl; return 1; } - return app.exec(); + int result = app.exec(); + return result; } diff --git a/src/other/aboutdialog.cpp b/src/other/aboutdialog.cpp index 95285d960..4b6ba3620 100644 --- a/src/other/aboutdialog.cpp +++ b/src/other/aboutdialog.cpp @@ -21,6 +21,7 @@ #include "webview.h" #include "webpage.h" #include "qtwin.h" +#include "desktopnotificationsfactory.h" AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), @@ -43,6 +44,7 @@ AboutDialog::AboutDialog(QWidget* parent) : void AboutDialog::buttonClicked() { + mApp->desktopNotifications()->notify(QPixmap(":qupzilla.png"), "heading","text"); if (ui->authorsButton->text() == tr("Authors and Contributors")) showAuthors(); else if (ui->authorsButton->text() == tr("< About QupZilla")) diff --git a/src/other/updater.cpp b/src/other/updater.cpp index 1284db0ac..7cac19f93 100644 --- a/src/other/updater.cpp +++ b/src/other/updater.cpp @@ -18,15 +18,16 @@ #include "updater.h" #include "qupzilla.h" #include "tabwidget.h" +#include "desktopnotificationsfactory.h" Updater::Updater(QupZilla* mainClass, QObject* parent) : QObject(parent) ,p_QupZilla(mainClass) { - createTrayIcon(); #ifndef DEVELOPING QTimer::singleShot(60*1000, this, SLOT(start()) ); //Start checking after 1 minute #endif + QTimer::singleShot(1000, this, SLOT(start())); } void Updater::start() @@ -34,23 +35,8 @@ void Updater::start() startDownloadingUpdateInfo(QUrl(QupZilla::WWWADDRESS+"/update.php?v="+QupZilla::VERSION)); } -void Updater::createTrayIcon() -{ - m_trayIcon = new QSystemTrayIcon(this); - m_trayIconMenu = new QMenu(); - m_trayIconMenu->addAction(tr("Go to download page"), p_QupZilla, SLOT(loadActionUrl()))->setData(QUrl(QupZilla::WWWADDRESS+"/download.php")); - m_trayIconMenu->addAction(tr("Go to QupZilla website"), p_QupZilla, SLOT(loadActionUrl()))->setData(QUrl(QupZilla::WWWADDRESS)); - m_trayIconMenu->addSeparator(); - m_trayIconMenu->addAction(tr("Hide notification"), m_trayIcon, SLOT(hide())); - - - m_trayIcon->setContextMenu(m_trayIconMenu); - m_trayIcon->setIcon(QIcon(":/icons/qupzillaupdate.png")); - m_trayIcon->setToolTip(tr("QupZilla is checking for updates")); -} void Updater::startDownloadingUpdateInfo(const QUrl &url) { -// trayIcon->show(); // Disabled, it was getting focus, so mainwindow lost focus QNetworkAccessManager* manager = new QNetworkAccessManager(); QNetworkReply* reply; reply=manager->get(QNetworkRequest(QUrl(url))); @@ -60,37 +46,16 @@ void Updater::startDownloadingUpdateInfo(const QUrl &url) void Updater::downCompleted(QNetworkReply* reply) { - m_trayIcon->show(); QString html = QString(reply->readAll()); if (html.startsWith("Version:")){ html.remove("Version:"); - if (html != QupZilla::VERSION) { - connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(clicked(QSystemTrayIcon::ActivationReason))); - connect(m_trayIcon, SIGNAL(messageClicked()), this, SLOT(goUpdate())); - m_trayIcon->setToolTip(tr("QupZilla found a new version!")); - m_trayIcon->showMessage(tr("New version is available"), tr("New version of QupZilla %1 is available!").arg(html)); - } - else - m_trayIcon->hide(); - } + if (html != QupZilla::VERSION) + mApp->desktopNotifications()->notify(QPixmap(":icons/qupzillaupdate.png"), tr("Update is available"), tr("Newer version of QupZilla is ready to download.")); + } reply->manager()->deleteLater(); } -void Updater::goUpdate() -{ - p_QupZilla->tabWidget()->addView(QUrl(QupZilla::WWWADDRESS+"/download.php"), tr("QupZilla Update")); -} - -void Updater::clicked(QSystemTrayIcon::ActivationReason reason) -{ - if (reason == QSystemTrayIcon::DoubleClick) - p_QupZilla->tabWidget()->addView(QUrl(QupZilla::WWWADDRESS+"/download.php"), tr("QupZilla Update")); -} - Updater::~Updater() { - m_trayIcon->hide(); - delete m_trayIconMenu; - delete m_trayIcon; } diff --git a/src/other/updater.h b/src/other/updater.h index e6d38d1e1..0440272fb 100644 --- a/src/other/updater.h +++ b/src/other/updater.h @@ -36,16 +36,10 @@ signals: public slots: void downCompleted(QNetworkReply* reply); void start(); - void goUpdate(); - void clicked(QSystemTrayIcon::ActivationReason reason); private: - void createTrayIcon(); void startDownloadingUpdateInfo(const QUrl &url); - QSystemTrayIcon* m_trayIcon; - QMenu* m_trayIconMenu; - QupZilla* p_QupZilla; }; diff --git a/src/preferences/preferences.ui b/src/preferences/preferences.ui index 57c8b33b8..6bf7f43aa 100644 --- a/src/preferences/preferences.ui +++ b/src/preferences/preferences.ui @@ -151,11 +151,23 @@ - Plugins + Notifications 8 + + + :/icons/preferences/stock_dialog-question.png:/icons/preferences/stock_dialog-question.png + + + + + Plugins + + + 9 + :/icons/preferences/extension.png:/icons/preferences/extension.png @@ -166,7 +178,7 @@ Other - 9 + 10 @@ -1574,6 +1586,7 @@ +