transmission/qt/app.h

73 lines
1.4 KiB
C
Raw Normal View History

2009-04-09 18:55:47 +00:00
/*
* This file Copyright (C) 2009-2014 Mnemosyne LLC
2009-04-09 18:55:47 +00:00
*
* It may be used under the GNU Public License v2 or v3 licenses,
* or any future license endorsed by Mnemosyne LLC.
2009-04-09 18:55:47 +00:00
*
* $Id$
2009-04-09 18:55:47 +00:00
*/
#ifndef QTR_APP_H
#define QTR_APP_H
#include <QApplication>
#include <QSet>
2009-04-09 18:55:47 +00:00
#include <QTimer>
#include <QTranslator>
#include "favicon.h"
2009-04-09 18:55:47 +00:00
class AddData;
2009-04-09 18:55:47 +00:00
class Prefs;
class Session;
class TorrentModel;
class TrMainWindow;
class WatchDir;
class MyApp: public QApplication
{
Q_OBJECT
2009-04-09 18:55:47 +00:00
public:
MyApp (int& argc, char ** argv);
virtual ~MyApp ();
2009-04-09 18:55:47 +00:00
public:
void raise ();
bool notify (const QString& title, const QString& body) const;
public:
Favicons favicons;
private:
Prefs * myPrefs;
Session * mySession;
TorrentModel * myModel;
TrMainWindow * myWindow;
WatchDir * myWatchDir;
QTimer myModelTimer;
QTimer myStatsTimer;
QTimer mySessionTimer;
time_t myLastFullUpdateTime;
QTranslator qtTranslator;
QTranslator appTranslator;
2009-04-09 18:55:47 +00:00
private slots:
void consentGiven ();
void onSessionSourceChanged ();
void refreshPref (int key);
void refreshTorrents ();
void onTorrentsAdded (QSet<int>);
void onTorrentCompleted (int);
void onNewTorrentChanged (int);
public slots:
void addTorrent (const QString&);
void addTorrent (const AddData&);
2009-04-09 18:55:47 +00:00
private:
void maybeUpdateBlocklist ();
2009-04-09 18:55:47 +00:00
};
#endif