2009-04-09 18:55:47 +00:00
|
|
|
/*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This file Copyright (C) Mnemosyne LLC
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2009-05-31 19:33:48 +00:00
|
|
|
* $Id$
|
2009-04-09 18:55:47 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QTR_APP_H
|
|
|
|
#define QTR_APP_H
|
|
|
|
|
|
|
|
#include <QApplication>
|
2010-08-01 14:51:28 +00:00
|
|
|
#include <QSet>
|
2009-04-09 18:55:47 +00:00
|
|
|
#include <QTimer>
|
2010-11-25 03:00:25 +00:00
|
|
|
#include <QTranslator>
|
2010-08-01 18:55:04 +00:00
|
|
|
|
2010-07-25 17:16:03 +00:00
|
|
|
#include "favicon.h"
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2010-08-01 18:55:04 +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
|
|
|
|
|
|
|
|
public:
|
|
|
|
MyApp( int& argc, char ** argv );
|
|
|
|
virtual ~MyApp( );
|
|
|
|
|
2010-04-27 03:10:32 +00:00
|
|
|
public:
|
|
|
|
void raise( );
|
2010-08-01 15:47:42 +00:00
|
|
|
bool notify( const QString& title, const QString& body ) const;
|
2010-04-27 03:10:32 +00:00
|
|
|
|
2010-07-25 17:16:03 +00:00
|
|
|
public:
|
|
|
|
Favicons favicons;
|
|
|
|
|
2009-04-09 18:55:47 +00:00
|
|
|
private:
|
|
|
|
Prefs * myPrefs;
|
|
|
|
Session * mySession;
|
|
|
|
TorrentModel * myModel;
|
|
|
|
TrMainWindow * myWindow;
|
|
|
|
WatchDir * myWatchDir;
|
|
|
|
QTimer myModelTimer;
|
|
|
|
QTimer myStatsTimer;
|
|
|
|
QTimer mySessionTimer;
|
|
|
|
time_t myLastFullUpdateTime;
|
2010-11-25 03:00:25 +00:00
|
|
|
QTranslator qtTranslator;
|
|
|
|
QTranslator appTranslator;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
private slots:
|
2009-10-02 22:53:19 +00:00
|
|
|
void consentGiven( );
|
2010-06-16 03:11:10 +00:00
|
|
|
void onSessionSourceChanged( );
|
2009-04-09 18:55:47 +00:00
|
|
|
void refreshPref( int key );
|
|
|
|
void refreshTorrents( );
|
2010-08-02 03:07:42 +00:00
|
|
|
void onTorrentsAdded( QSet<int> );
|
|
|
|
void onNewTorrentChanged( int );
|
2010-04-27 03:10:32 +00:00
|
|
|
|
|
|
|
public slots:
|
2009-04-09 18:55:47 +00:00
|
|
|
void addTorrent( const QString& );
|
2010-08-01 18:55:04 +00:00
|
|
|
void addTorrent( const AddData& );
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void maybeUpdateBlocklist( );
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|