diff options
author | Daniel Molkentin <danimo@owncloud.com> | 2014-07-11 02:31:24 +0400 |
---|---|---|
committer | Daniel Molkentin <danimo@owncloud.com> | 2014-07-11 13:07:31 +0400 |
commit | df3c3bca025a7cdb5f20e55fc2ecc37618e7cc8d (patch) | |
tree | 22fa58b5a09ec9f93ad376dce2edd6272483fc1a /src/gui/application.h | |
parent | d1b991e1984ef0c4ed803c5c5ead1ce3bfe00266 (diff) |
Split into three separate projects: library, gui and cmd
Diffstat (limited to 'src/gui/application.h')
-rw-r--r-- | src/gui/application.h | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/src/gui/application.h b/src/gui/application.h new file mode 100644 index 000000000..97c6ee617 --- /dev/null +++ b/src/gui/application.h @@ -0,0 +1,118 @@ +/* + * Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#ifndef APPLICATION_H +#define APPLICATION_H + +#include <QApplication> +#include <QPointer> +#include <QQueue> +#include <QTimer> + +#include "qtsingleapplication.h" + +#include "syncresult.h" +#include "logbrowser.h" +#include "owncloudgui.h" +#include "connectionvalidator.h" +#include "progressdispatcher.h" +#include "clientproxy.h" +#include "folderman.h" + +class QMessageBox; +class QSystemTrayIcon; +class QSocket; + +namespace Mirall { +class Theme; +class Folder; +class SslErrorDialog; +class SocketApi; + +class Application : public SharedTools::QtSingleApplication +{ + Q_OBJECT +public: + explicit Application(int &argc, char **argv); + ~Application(); + + bool giveHelp(); + void showHelp(); + +public slots: + // TODO: this should not be public + void slotownCloudWizardDone(int); + +protected: + void parseOptions(const QStringList& ); + void setupTranslations(); + void setupLogging(); + void enterNextLogFile(); + bool checkConfigExists(bool openSettings); + + // reimplemented +#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(5,0,0) + bool winEventFilter( MSG * message, long * result ); +#endif + +signals: + void folderRemoved(); + void folderStateChanged(Folder*); + +protected slots: + void slotParseOptions( const QString&, QObject* ); + void slotCheckConnection(); + void slotConnectionValidatorResult(ConnectionValidator::Status); + void slotStartUpdateDetector(); + void slotUseMonoIconsChanged( bool ); + void slotLogin(); + void slotLogout(); + void slotCleanup(); + void slotAccountChanged(Account *newAccount, Account *oldAccount = 0); + void slotCredentialsFetched(); + void slotToggleFolderman(int state); + +private: + void setHelp(); + + QPointer<ownCloudGui> _gui; + QPointer<SocketApi> _socketApi; + + QPointer<ConnectionValidator> _conValidator; + + Theme *_theme; + + bool _helpOnly; + bool _startupNetworkError; + + // options from command line: + bool _showLogWindow; + QString _logFile; + QString _logDir; + int _logExpire; + bool _logFlush; + bool _userTriggeredConnect; + + ClientProxy _proxy; + + QTimer _checkConnectionTimer; + + FolderMan folderManager; + + friend class ownCloudGui; // for _startupNetworkError +}; + +} // namespace Mirall + +#endif // APPLICATION_H |