blob: 8d0af8e396ab86482ade6f9879000168fc92a7ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
/*
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
*
* 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; version 2 of the License.
*
* 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 OWNCLOUDGUI_H
#define OWNCLOUDGUI_H
#include "mirall/systray.h"
#include "mirall/connectionvalidator.h"
#include "mirall/progressdispatcher.h"
#include "mirall/quotainfo.h"
#include <QObject>
#include <QPointer>
#include <QAction>
#include <QMenu>
#include <QSignalMapper>
namespace Mirall {
class SettingsDialog;
class SettingsDialogMac;
class Application;
class LogBrowser;
class ownCloudGui : public QObject
{
Q_OBJECT
public:
explicit ownCloudGui(Application *parent = 0);
void setupContextMenu();
void startupConnected(bool connected , const QStringList &fails);
bool checkAccountExists(bool openSettings);
static void raiseDialog(QWidget *raiseWidget);
void setupOverlayIcons();
signals:
void setupProxy();
public slots:
void slotComputeOverallSyncStatus();
void slotShowTrayMessage(const QString &title, const QString &msg);
void slotShowOptionalTrayMessage(const QString &title, const QString &msg);
void slotFolderOpenAction( const QString& alias );
void slotRefreshQuotaDisplay( qint64 total, qint64 used );
void slotRebuildRecentMenus();
void slotUpdateProgress(const QString &folder, const Progress::Info& progress);
void slotShowGuiMessage(const QString &title, const QString &message);
void slotFoldersChanged();
void slotShowSettings();
void slotShowSyncProtocol();
void slotShutdown();
void slotSyncStateChange( const QString& alias );
void slotTrayClicked( QSystemTrayIcon::ActivationReason reason );
void slotToggleLogBrowser();
void slotOpenOwnCloud();
void slotOpenSettingsDialog( bool openSettings );
void slotHelp();
void slotOpenPath(const QString& path);
void slotAccountStateChanged();
private slots:
void slotDisplayIdle();
private:
void setupActions();
QPointer<Systray> _tray;
#if defined(Q_OS_MAC)
QPointer<SettingsDialogMac> _settingsDialog;
#else
QPointer<SettingsDialog> _settingsDialog;
#endif
QPointer<LogBrowser>_logBrowser;
// tray's menu
QScopedPointer<QMenu> _contextMenu;
QMenu *_recentActionsMenu;
QAction *_actionLogin;
QAction *_actionLogout;
QAction *_actionOpenoC;
QAction *_actionSettings;
QAction *_actionQuota;
QAction *_actionStatus;
QAction *_actionEstimate;
QAction *_actionRecent;
QAction *_actionHelp;
QAction *_actionQuit;
QList<QAction*> _recentItemsActions;
QSignalMapper *_folderOpenActionMapper;
QSignalMapper *_recentItemsMapper;
Application *_app;
QStringList _startupFails;
};
} // namespace Mirall
#endif // OWNCLOUDGUI_H
|