transmission 2.83
[tomato.git] / release / src-rt-6.x.4708 / router / transmission / qt / app.h
blob8005c1d73c491a06c7ff8814386426a1d658d44b
1 /*
2 * This file Copyright (C) 2009-2014 Mnemosyne LLC
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
7 * $Id: app.h 14272 2014-05-09 02:32:28Z jordan $
8 */
10 #ifndef QTR_APP_H
11 #define QTR_APP_H
13 #include <QApplication>
14 #include <QSet>
15 #include <QTimer>
16 #include <QTranslator>
18 #include "favicon.h"
20 class AddData;
21 class Prefs;
22 class Session;
23 class TorrentModel;
24 class TrMainWindow;
25 class WatchDir;
27 class MyApp: public QApplication
29 Q_OBJECT
31 public:
32 MyApp (int& argc, char ** argv);
33 virtual ~MyApp ();
35 public:
36 void raise ();
37 bool notifyApp (const QString& title, const QString& body) const;
39 public:
40 Favicons favicons;
42 private:
43 Prefs * myPrefs;
44 Session * mySession;
45 TorrentModel * myModel;
46 TrMainWindow * myWindow;
47 WatchDir * myWatchDir;
48 QTimer myModelTimer;
49 QTimer myStatsTimer;
50 QTimer mySessionTimer;
51 time_t myLastFullUpdateTime;
52 QTranslator qtTranslator;
53 QTranslator appTranslator;
55 private slots:
56 void consentGiven ();
57 void onSessionSourceChanged ();
58 void refreshPref (int key);
59 void refreshTorrents ();
60 void onTorrentsAdded (QSet<int>);
61 void onTorrentCompleted (int);
62 void onNewTorrentChanged (int);
64 public slots:
65 void addTorrent (const QString&);
66 void addTorrent (const AddData&);
68 private:
69 void maybeUpdateBlocklist ();
72 #endif