diff options
author | Thomas Preud'homme <robotux@celest.fr> | 2019-02-03 00:10:52 +0000 |
---|---|---|
committer | Thomas Preud'homme <robotux@celest.fr> | 2019-02-03 00:10:52 +0000 |
commit | 9b10c21f5cad0e2ec27d23c59e65af7141a226f3 (patch) | |
tree | bf81d75a9ed990bb76488c502767600fcf7550b7 /EventDispatcher.cpp | |
parent | 594fcba67600704bee9115c86e18927b2237b304 (diff) |
New upstream version 1.6.1.3
Diffstat (limited to 'EventDispatcher.cpp')
-rw-r--r-- | EventDispatcher.cpp | 73 |
1 files changed, 26 insertions, 47 deletions
diff --git a/EventDispatcher.cpp b/EventDispatcher.cpp index b2595fb..c3fc61f 100644 --- a/EventDispatcher.cpp +++ b/EventDispatcher.cpp @@ -14,6 +14,7 @@ #include "CompilerInfo.h" #include "ThemesManager.h" #include "cpp11addition.h" +#include "ProductKey.h" #ifdef Q_OS_UNIX #include <unistd.h> @@ -37,10 +38,6 @@ #include <QDomElement> #endif -#ifdef ULTRACOPIER_VERSION_ULTIMATE -#include <QInputDialog> -#endif - /// \brief Initiate the ultracopier event dispatcher and check if no other session is running EventDispatcher::EventDispatcher() { @@ -166,49 +163,6 @@ EventDispatcher::EventDispatcher() if(a>5) OptionEngine::optionEngine->setOptionValue("Ultracopier","GroupWindowWhen","0"); - #ifdef ULTRACOPIER_VERSION_ULTIMATE - #ifdef ULTRACOPIER_ILLEGAL - static bool crackedVersion=true; - #else - static bool crackedVersion=false; - #endif - if(!crackedVersion) - { - while(1) - { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"ultimate key"); - QString key=QString::fromStdString(OptionEngine::optionEngine->getOptionValue("Ultracopier","key")); - if(!key.isEmpty()) - { - QCryptographicHash hash(QCryptographicHash::Sha224); - hash.addData(QStringLiteral("U2NgvbKVrVwlaXnx").toUtf8()); - hash.addData(key.toUtf8()); - const QByteArray &result=hash.result(); - if(!result.isEmpty() && result.at(0)==0x00 && result.at(1)==0x00) - break; - } - key=QInputDialog::getText(NULL,tr("Key"),tr("Give the key of this software, more information on <a href=\"http://ultracopier.first-world.info/\">ultracopier.first-world.info</a>")); - if(key.isEmpty()) - { - QCoreApplication::quit(); - stopIt=true; - return; - } - { - QCryptographicHash hash(QCryptographicHash::Sha224); - hash.addData(QStringLiteral("U2NgvbKVrVwlaXnx").toUtf8()); - hash.addData(key.toUtf8()); - const QByteArray &result=hash.result(); - if(!result.isEmpty() && result.at(0)==0x00 && result.at(1)==0x00) - { - OptionEngine::optionEngine->setOptionValue("Ultracopier","key",key.toStdString()); - break; - } - } - } - } - #endif - connect(&cliParser, &CliParser::newTransferList,core, &Core::newTransferList); } @@ -322,6 +276,16 @@ void EventDispatcher::initFunction() std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; abort(); } + if(!connect(backgroundIcon, &SystrayIcon::showProductKey, ProductKey::productKey, &ProductKey::show,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(ProductKey::productKey, &ProductKey::changeToUltimate,backgroundIcon, &SystrayIcon::changeToUltimate,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } if(!connect(&cliParser, &CliParser::showOptions, &optionDialog, &OptionDialog::show,Qt::DirectConnection)) { std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; @@ -385,6 +349,21 @@ void EventDispatcher::initFunction() std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; abort(); } + if(!connect(&theHelp,&HelpDialog::checkUpdate, &internetUpdater,&InternetUpdater::checkUpdate)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(&internetUpdater,&InternetUpdater::newUpdate, &theHelp,&HelpDialog::newUpdate)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(&internetUpdater,&InternetUpdater::noNewUpdate, &theHelp,&HelpDialog::noNewUpdate)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } #endif copyEngineList->setIsConnected(); copyServer->resendState(); |