mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-28 07:54:49 +03:00
ea1c951006
Created ownCloudGui class to contain all gui related stuff.
118 lines
2.9 KiB
C++
118 lines
2.9 KiB
C++
/*
|
|
* 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 <QNetworkReply>
|
|
#include <QSslError>
|
|
#include <QPointer>
|
|
#include <QQueue>
|
|
|
|
#include "qtsingleapplication.h"
|
|
|
|
#include "mirall/syncresult.h"
|
|
#include "mirall/logbrowser.h"
|
|
#include "mirall/owncloudgui.h"
|
|
#include "mirall/connectionvalidator.h"
|
|
#include "mirall/progressdispatcher.h"
|
|
|
|
class QAction;
|
|
class QMenu;
|
|
class QSystemTrayIcon;
|
|
class QNetworkConfigurationManager;
|
|
class QSignalMapper;
|
|
class QNetworkReply;
|
|
|
|
namespace Mirall {
|
|
class Theme;
|
|
class Folder;
|
|
class FolderWatcher;
|
|
class ownCloudInfo;
|
|
class SslErrorDialog;
|
|
class SettingsDialog;
|
|
class ItemProgressDialog;
|
|
|
|
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 setupContextMenu();
|
|
void setupLogBrowser();
|
|
void enterNextLogFile();
|
|
bool checkConfigExists(bool openSettings);
|
|
|
|
// reimplemented
|
|
#if defined(Q_WS_WIN)
|
|
bool winEventFilter( MSG * message, long * result );
|
|
#endif
|
|
|
|
signals:
|
|
void folderRemoved();
|
|
void folderStateChanged(Folder*);
|
|
|
|
protected slots:
|
|
void slotParseOptions( const QString& );
|
|
void slotCheckConnection();
|
|
void slotConnectionValidatorResult(ConnectionValidator::Status);
|
|
void slotSyncStateChange( const QString& );
|
|
void slotOpenLogBrowser();
|
|
void slotSSLFailed( QNetworkReply *reply, QList<QSslError> errors );
|
|
void slotStartUpdateDetector();
|
|
void slotSetupProxy();
|
|
void slotUseMonoIconsChanged( bool );
|
|
void slotCredentialsFetched();
|
|
void slotCleanup();
|
|
private:
|
|
void setHelp();
|
|
void raiseDialog( QWidget* );
|
|
void rebuildRecentMenus();
|
|
void runValidator();
|
|
|
|
QPointer<ownCloudGui> _gui;
|
|
QNetworkConfigurationManager *_networkMgr;
|
|
|
|
SslErrorDialog *_sslErrorDialog;
|
|
ConnectionValidator *_conValidator;
|
|
|
|
Theme *_theme;
|
|
QPointer<LogBrowser>_logBrowser;
|
|
|
|
QString _logFile;
|
|
QString _logDirectory;
|
|
QStringList _startupFail;
|
|
|
|
int _logExpire;
|
|
bool _showLogWindow;
|
|
bool _logFlush;
|
|
bool _helpOnly;
|
|
};
|
|
|
|
} // namespace Mirall
|
|
|
|
#endif // APPLICATION_H
|