|
|
@ -44,6 +44,7 @@ |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef DISABLE_GUI |
|
|
|
#ifndef DISABLE_GUI |
|
|
|
|
|
|
|
#include <QMessageBox> |
|
|
|
#ifdef Q_OS_WIN |
|
|
|
#ifdef Q_OS_WIN |
|
|
|
#include <QSessionManager> |
|
|
|
#include <QSessionManager> |
|
|
|
#include <QSharedMemory> |
|
|
|
#include <QSharedMemory> |
|
|
@ -61,6 +62,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
#include "base/bittorrent/torrenthandle.h" |
|
|
|
#include "base/bittorrent/torrenthandle.h" |
|
|
|
|
|
|
|
#include "base/exceptions.h" |
|
|
|
#include "base/iconprovider.h" |
|
|
|
#include "base/iconprovider.h" |
|
|
|
#include "base/logger.h" |
|
|
|
#include "base/logger.h" |
|
|
|
#include "base/net/downloadmanager.h" |
|
|
|
#include "base/net/downloadmanager.h" |
|
|
@ -495,6 +497,7 @@ int Application::exec(const QStringList ¶ms) |
|
|
|
GuiIconProvider::initInstance(); |
|
|
|
GuiIconProvider::initInstance(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
BitTorrent::Session::initInstance(); |
|
|
|
BitTorrent::Session::initInstance(); |
|
|
|
connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentFinished, this, &Application::torrentFinished); |
|
|
|
connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentFinished, this, &Application::torrentFinished); |
|
|
|
connect(BitTorrent::Session::instance(), &BitTorrent::Session::allTorrentsFinished, this, &Application::allTorrentsFinished, Qt::QueuedConnection); |
|
|
|
connect(BitTorrent::Session::instance(), &BitTorrent::Session::allTorrentsFinished, this, &Application::allTorrentsFinished, Qt::QueuedConnection); |
|
|
@ -515,6 +518,21 @@ int Application::exec(const QStringList ¶ms) |
|
|
|
|
|
|
|
|
|
|
|
new RSS::Session; // create RSS::Session singleton
|
|
|
|
new RSS::Session; // create RSS::Session singleton
|
|
|
|
new RSS::AutoDownloader; // create RSS::AutoDownloader singleton
|
|
|
|
new RSS::AutoDownloader; // create RSS::AutoDownloader singleton
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (const RuntimeError &err) { |
|
|
|
|
|
|
|
#ifdef DISABLE_GUI |
|
|
|
|
|
|
|
fprintf(stderr, "%s", err.what()); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
QMessageBox msgBox; |
|
|
|
|
|
|
|
msgBox.setIcon(QMessageBox::Critical); |
|
|
|
|
|
|
|
msgBox.setText(tr("Application failed to start.")); |
|
|
|
|
|
|
|
msgBox.setInformativeText(err.message()); |
|
|
|
|
|
|
|
msgBox.show(); // Need to be shown or to moveToCenter does not work
|
|
|
|
|
|
|
|
msgBox.move(Utils::Misc::screenCenter(&msgBox)); |
|
|
|
|
|
|
|
msgBox.exec(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DISABLE_GUI |
|
|
|
#ifdef DISABLE_GUI |
|
|
|
#ifndef DISABLE_WEBUI |
|
|
|
#ifndef DISABLE_WEBUI |
|
|
|