nextcloud-desktop/src/mirall/application.h
Daniel Molkentin c164beb040 Commit squashed refactoring branch
- introduce settings dialog
- general settings for general / proxy settings
- standalone proxy settings dialog removed
- standalone status dialog removed
- moved status dialog into settings dialog
- radically cut down links in context menu
- add help link to context menu

This needs more cleanup and testing. Known issues:

- When the wizard is called while the settings dialog
  is open, it will not show old information (see FIXME)
- Some settings are not implemented yet (greyed out)
- The counter in the FileItemDialog is not correct the
  first time around.

Based on the discussion done with Jan and Klaas during the
Nuenberg workshop.
2013-07-04 20:02:44 +02:00

143 lines
3.7 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 "qtsingleapplication.h"
#include "mirall/syncresult.h"
#include "mirall/logbrowser.h"
#include "mirall/folderman.h"
#include "mirall/systray.h"
class QAction;
class QMenu;
class QSystemTrayIcon;
class QNetworkConfigurationManager;
class QSignalMapper;
class QNetworkReply;
namespace Mirall {
class Theme;
class Folder;
class FolderWatcher;
class FolderWizard;
class ownCloudInfo;
class SslErrorDialog;
class SettingsDialog;
class Application : public SharedTools::QtSingleApplication
{
Q_OBJECT
public:
friend class SettingsDialog;
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 setupActions();
void setupSystemTray();
void setupContextMenu();
void setupLogBrowser();
void enterNextLogFile();
//folders have to be disabled while making config changes
void computeOverallSyncStatus();
// reimplemented
#if defined(Q_WS_WIN)
bool winEventFilter( MSG * message, long * result );
#endif
signals:
void folderRemoved();
void folderStateChanged(Folder*);
protected slots:
void slotFoldersChanged();
void slotCheckConfig();
void slotSettings();
void slotParseOptions( const QString& );
void slotShowTrayMessage(const QString&, const QString&);
void slotSyncStateChange( const QString& );
void slotTrayClicked( QSystemTrayIcon::ActivationReason );
void slotFolderOpenAction(const QString & );
void slotOpenOwnCloud();
void slotStartFolderSetup(int result = QDialog::Accepted); // defaulting to Accepted
void slotOwnCloudFound( const QString&, const QString&, const QString&, const QString& );
void slotNoOwnCloudFound( QNetworkReply* );
void slotCheckAuthentication();
void slotAuthCheck( const QString& ,QNetworkReply* );
void slotOpenLogBrowser();
void slotSSLFailed( QNetworkReply *reply, QList<QSslError> errors );
void slotFetchCredentials();
void slotCredentialsFetched( bool );
void slotStartUpdateDetector();
void slotSetupProxy();
void slotRefreshQuotaDisplay( qint64 total, qint64 used );
void slotUseMonoIconsChanged( bool );
void slotHelp();
private:
void setHelp();
void raiseDialog( QWidget* );
Systray *_tray;
QAction *_actionOpenoC;
QAction *_actionSettings;
QAction *_actionQuota;
QAction *_actionHelp;
QAction *_actionQuit;
#if QT_VERSION >= 0x040700
QNetworkConfigurationManager *_networkMgr;
#endif
QPointer<FolderWizard> _folderWizard;
SslErrorDialog *_sslErrorDialog;
// tray's menu
QMenu *_contextMenu;
FolderMan *_folderMan;
Theme *_theme;
QSignalMapper *_folderOpenActionMapper;
LogBrowser *_logBrowser;
QPointer<SettingsDialog> _settingsDialog;
QString _logFile;
QString _logDirectory;
int _logExpire;
bool _showLogWindow;
bool _logFlush;
bool _helpOnly;
};
} // namespace Mirall
#endif // APPLICATION_H