Welcome to mirror list, hosted at ThFree Co, Russian Federation.

application.h « mirall « src - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 02690cc990216db9d49c0940fc07b9c390b17397 (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
116
/*
 * 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 "mirall/syncresult.h"
#include "mirall/logbrowser.h"
#include "mirall/owncloudgui.h"
#include "mirall/connectionvalidator.h"
#include "mirall/progressdispatcher.h"
#include "mirall/clientproxy.h"
#include "mirall/folderman.h"

class QMessageBox;
class QSystemTrayIcon;
class QSocket;

namespace Mirall {
class Theme;
class Folder;
class SslErrorDialog;

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<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