summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtSwift.cpp')
-rw-r--r--Swift/QtUI/QtSwift.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 7c0a2bd..7f11b5c 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -1,71 +1,70 @@
/*
* Copyright (c) 2010-2011 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include "QtSwift.h"
#include <string>
#include <QSplitter>
#include <QFile>
#include <boost/bind.hpp>
#include <QMessageBox>
#include <QApplication>
#include "QtLoginWindow.h"
#include "QtChatTabs.h"
#include "QtSystemTray.h"
#include "QtSoundPlayer.h"
#include "QtSwiftUtil.h"
#include "QtUIFactory.h"
#include "QtChatWindowFactory.h"
#include <Swiften/Base/Log.h>
#include <Swift/Controllers/Storages/CertificateFileStorageFactory.h>
#include "Swift/Controllers/Storages/FileStoragesFactory.h"
#include "SwifTools/Application/PlatformApplicationPathProvider.h"
#include <string>
#include "Swiften/Base/Platform.h"
#include "Swiften/Elements/Presence.h"
#include "Swiften/Client/Client.h"
#include "Swift/Controllers/MainController.h"
#include "Swift/Controllers/ApplicationInfo.h"
#include "Swift/Controllers/BuildVersion.h"
#include "SwifTools/AutoUpdater/AutoUpdater.h"
#include "SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h"
-#include "Swiften/Base/Paths.h"
#if defined(SWIFTEN_PLATFORM_WINDOWS)
#include "WindowsNotifier.h"
#elif defined(HAVE_GROWL)
#include "SwifTools/Notifier/GrowlNotifier.h"
#elif defined(SWIFTEN_PLATFORM_LINUX)
#include "FreeDesktopNotifier.h"
#else
#include "SwifTools/Notifier/NullNotifier.h"
#endif
#if defined(SWIFTEN_PLATFORM_MACOSX)
#include "SwifTools/Dock/MacOSXDock.h"
#else
#include "SwifTools/Dock/NullDock.h"
#endif
#if defined(SWIFTEN_PLATFORM_MACOSX)
#include "QtURIHandler.h"
#elif defined(SWIFTEN_PLATFORM_WIN32)
#include <SwifTools/URIHandler/NullURIHandler.h>
#else
#include "QtDBUSURIHandler.h"
#endif
namespace Swift{
#if defined(SWIFTEN_PLATFORM_MACOSX)
#define SWIFT_APPCAST_URL "http://swift.im/appcast/swift-mac-dev.xml"
#else
#define SWIFT_APPCAST_URL ""
#endif
po::options_description QtSwift::getOptionsDescription() {
po::options_description result("Options");
@@ -143,90 +142,67 @@ QtSwift::QtSwift(const po::variables_map& options) : networkFactories_(&clientMa
#elif defined(SWIFTEN_PLATFORM_WIN32)
uriHandler_ = new NullURIHandler();
#else
uriHandler_ = new QtDBUSURIHandler();
#endif
if (splitter_) {
splitter_->show();
}
for (int i = 0; i < numberOfAccounts; i++) {
if (i > 0) {
// Don't add the first tray (see note above)
systemTrays_.push_back(new QtSystemTray());
}
QtUIFactory* uiFactory = new QtUIFactory(settings_, tabs_, splitter_, systemTrays_[i], chatWindowFactory_, startMinimized, eagleMode);
uiFactories_.push_back(uiFactory);
MainController* mainController = new MainController(
&clientMainThreadCaller_,
&networkFactories_,
uiFactory,
settings_,
systemTrays_[i],
soundPlayer_,
storagesFactory_,
certificateStorageFactory_,
dock_,
notifier_,
uriHandler_,
&idleDetector_,
options.count("latency-debug") > 0,
eagleMode);
mainControllers_.push_back(mainController);
}
- if (eagleMode) {
- QString clickThroughPath(P2QSTRING((Paths::getExecutablePath() / "eagle-banner.txt").string()));
- QFile clickThroughFile(clickThroughPath);
- if (clickThroughFile.exists() && clickThroughFile.open(QIODevice::ReadOnly)) {
- QString banner;
- while (!clickThroughFile.atEnd()) {
- QByteArray line = clickThroughFile.readLine();
- banner += line + "\n";
- }
- if (!banner.isEmpty()) {
- QMessageBox msgBox;
- msgBox.setWindowTitle(tr("Confirm terms of use"));
- msgBox.setText(tr("Do you agree to the terms of use?"));
- msgBox.setInformativeText(banner);
- msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msgBox.setDefaultButton(QMessageBox::No);
- if (msgBox.exec() != QMessageBox::Yes) {
- exit(0);
- }
- }
- }
- }
-
// PlatformAutoUpdaterFactory autoUpdaterFactory;
// if (autoUpdaterFactory.isSupported()) {
// autoUpdater_ = autoUpdaterFactory.createAutoUpdater(SWIFT_APPCAST_URL);
// autoUpdater_->checkForUpdates();
// }
}
QtSwift::~QtSwift() {
delete notifier_;
delete autoUpdater_;
foreach (QtUIFactory* factory, uiFactories_) {
delete factory;
}
foreach (MainController* controller, mainControllers_) {
delete controller;
}
delete settings_;
foreach (QtSystemTray* tray, systemTrays_) {
delete tray;
}
delete tabs_;
delete splitter_;
delete uriHandler_;
delete dock_;
delete soundPlayer_;
delete chatWindowFactory_;
delete certificateStorageFactory_;
delete storagesFactory_;
}
}