From 9b10c21f5cad0e2ec27d23c59e65af7141a226f3 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sun, 3 Feb 2019 00:10:52 +0000 Subject: New upstream version 1.6.1.3 --- SystrayIcon.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'SystrayIcon.cpp') diff --git a/SystrayIcon.cpp b/SystrayIcon.cpp index ab3c3e0..eb09f3b 100644 --- a/SystrayIcon.cpp +++ b/SystrayIcon.cpp @@ -12,6 +12,7 @@ #include "ThemesManager.h" #include "LanguagesManager.h" #include "HelpDialog.h" +#include "ProductKey.h" #ifdef Q_OS_MAC //extern void qt_mac_set_dock_menu(QMenu *menu); @@ -33,6 +34,7 @@ SystrayIcon::SystrayIcon(QObject * parent) : #endif actionMenuQuit = new QAction(this); actionOptions = new QAction(this); + actionProductKey = new QAction(this); //actionTransfer = new QAction(this); #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) copyMenu = NULL; @@ -61,6 +63,7 @@ SystrayIcon::SystrayIcon(QObject * parent) : connect(actionMenuQuit, &QAction::triggered, this, &SystrayIcon::quit); connect(actionMenuAbout, &QAction::triggered, this, &SystrayIcon::showHelp); connect(actionOptions, &QAction::triggered, this, &SystrayIcon::showOptions); + connect(actionProductKey, &QAction::triggered, this, &SystrayIcon::showProductKey); connect(this, &SystrayIcon::activated, this, &SystrayIcon::CatchAction); #ifdef ULTRACOPIER_INTERNET_SUPPORT connect(this, &QSystemTrayIcon::messageClicked, this, &SystrayIcon::messageClicked); @@ -77,6 +80,8 @@ SystrayIcon::SystrayIcon(QObject * parent) : #ifdef ULTRACOPIER_DEBUG systrayMenu->addAction(actionSaveBugReport); #endif + if(!ProductKey::productKey->isUltimate()) + systrayMenu->addAction(actionProductKey); systrayMenu->addAction(actionMenuQuit); #ifndef Q_OS_MAC systrayMenu->insertSeparator(actionOptions); @@ -111,6 +116,7 @@ SystrayIcon::~SystrayIcon() #endif delete actionMenuAbout; delete actionOptions; + delete actionProductKey; delete systrayMenu; #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) if(copyMenu!=NULL) @@ -172,7 +178,8 @@ void SystrayIcon::showSystrayMessage(const std::string& text) #ifdef ULTRACOPIER_INTERNET_SUPPORT void SystrayIcon::messageClicked() { - QDesktopServices::openUrl(QString::fromStdString(HelpDialog::getUpdateUrl())); + if(!QDesktopServices::openUrl(QString::fromStdString(HelpDialog::getUpdateUrl()))) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"start, haveListenerInfo "+std::to_string((int)haveListenerInfo)+", havePluginLoaderInfo: "+std::to_string((int)havePluginLoaderInfo)); } #endif @@ -346,6 +353,8 @@ void SystrayIcon::updateCurrentTheme() IconOptions=QIcon(""); actionOptions->setIcon(IconOptions); + actionProductKey->setIcon(IconInfo); + tempIcon=ThemesManager::themesManager->loadIcon("SystemTrayIcon/add.png"); if(!tempIcon.isNull()) IconAdd=QIcon(tempIcon); @@ -438,6 +447,7 @@ void SystrayIcon::retranslateTheUI() #endif actionMenuQuit ->setText(tr("&Quit")); actionOptions ->setText(tr("&Options")); + actionProductKey ->setText(tr("&Product key")); reloadEngineList(); updateSystrayIcon(); } @@ -475,7 +485,7 @@ void SystrayIcon::newUpdate(const std::string &version) /*if(version==lastVersion) return;*/ lastVersion=version; - showSystrayMessage((tr("New version: %1").arg(QString::fromStdString(version))+"\n"+tr("Click here to go on download page")).toStdString()); + showSystrayMessage((tr("New version: %1").arg(QString::fromStdString(version))+"\n"+tr("Go to the download page:")).toStdString()+"\n"+HelpDialog::getUpdateUrl()); } #endif @@ -557,3 +567,8 @@ void SystrayIcon::reloadEngineList() } setContextMenu(systrayMenu); } + +void SystrayIcon::changeToUltimate() +{ + systrayMenu->removeAction(actionProductKey); +} -- cgit v1.2.3