source: trunk/qt/Application.h @ 14539

Last change on this file since 14539 was 14539, checked in by mikedld, 7 years ago

Unify/prettify Qt client headers style

  • Property svn:keywords set to Date Rev Author Id
File size: 1.6 KB
Line 
1/*
2 * This file Copyright (C) 2009-2015 Mnemosyne LLC
3 *
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
6 *
7 * $Id: Application.h 14539 2015-06-12 22:12:12Z mikedld $
8 */
9
10#ifndef QTR_APPLICATION_H
11#define QTR_APPLICATION_H
12
13#include <QApplication>
14#include <QSet>
15#include <QTimer>
16#include <QTranslator>
17
18#include "FaviconCache.h"
19
20class AddData;
21class Prefs;
22class Session;
23class TorrentModel;
24class MainWindow;
25class WatchDir;
26
27class Application: public QApplication
28{
29    Q_OBJECT
30
31  public:
32    Application (int& argc, char ** argv);
33    virtual ~Application ();
34
35    void raise ();
36    bool notifyApp (const QString& title, const QString& body) const;
37
38    FaviconCache& faviconCache ();
39
40  public slots:
41    void addTorrent (const QString&);
42    void addTorrent (const AddData&);
43
44  private:
45    void maybeUpdateBlocklist ();
46    void quitLater ();
47
48  private slots:
49    void consentGiven (int result);
50    void onSessionSourceChanged ();
51    void refreshPref (int key);
52    void refreshTorrents ();
53    void onTorrentsAdded (const QSet<int>& torrents);
54    void onTorrentCompleted (int);
55    void onNewTorrentChanged (int);
56
57  private:
58    Prefs * myPrefs;
59    Session * mySession;
60    TorrentModel * myModel;
61    MainWindow * myWindow;
62    WatchDir * myWatchDir;
63    QTimer myModelTimer;
64    QTimer myStatsTimer;
65    QTimer mySessionTimer;
66    time_t myLastFullUpdateTime;
67    QTranslator qtTranslator;
68    QTranslator appTranslator;
69    FaviconCache myFavicons;
70};
71
72#undef qApp
73#define qApp static_cast<Application*> (Application::instance ())
74
75#endif // QTR_APPLICATION_H
Note: See TracBrowser for help on using the repository browser.