2
* This file Copyright (C) 2009 Charles Kerr <charles@transmissionbt.com>
4
* This file is licensed by the GPL version 2. Works owned by the
5
* Transmission project are granted a special exemption to clause 2(b)
6
* so that the bulk of its code can remain under the MIT license.
7
* This exemption does not extend to derived works not owned by
8
* the Transmission project.
18
#include <QFileDialog>
20
#include <QMainWindow>
22
#include <QSystemTrayIcon>
24
#include <QWidgetList>
30
#include "torrent-filter.h"
31
#include "ui_mainwin.h"
33
class ActionDelegator;
36
class TorrentDelegate;
37
class TorrentDelegateMin;
40
class QSortFilterProxyModel;
42
class TrMainWindow: public QMainWindow
47
time_t myLastFullUpdateTime;
48
QDialog * myPrefsDialog;
49
QDialog * myAboutDialog;
50
QDialog * myStatsDialog;
51
QFileDialog * myFileDialog;
52
QCheckBox * myFileDialogOptionsCheck;
53
QSystemTrayIcon myTrayIcon;
54
TorrentFilter myFilterModel;
55
TorrentDelegate * myTorrentDelegate;
56
TorrentDelegateMin * myTorrentDelegateMin;
59
TorrentModel& myModel;
61
QIcon mySpeedModeOffIcon;
62
QIcon mySpeedModeOnIcon;
63
time_t myLastSendTime;
64
time_t myLastReadTime;
65
QTimer myNetworkTimer;
68
QIcon getStockIcon( const QString&, int fallback=-1 );
71
void setShowMode( TorrentFilter::ShowMode );
72
QSet<int> getSelectedTorrents( ) const;
73
void updateNetworkIcon( );
79
void showDownloading( );
83
void filterByFiles( );
84
void filterByTracker( );
85
void showTotalRatio( );
86
void showTotalTransfer( );
87
void showSessionRatio( );
88
void showSessionTransfer( );
89
void refreshVisibleCount( );
90
void refreshStatusBar( );
93
void trayActivated( QSystemTrayIcon::ActivationReason );
94
void refreshPref( int key );
95
void addTorrents( const QStringList& filenames );
98
void openProperties( );
99
void toggleSpeedMode( );
100
void dataReadProgress( );
101
void dataSendProgress( );
102
void toggleWindows( );
106
void startSelected( );
108
void pauseSelected( );
109
void removeSelected( );
110
void deleteSelected( );
111
void verifySelected( );
112
void reannounceSelected( );
113
void addTorrent( const QString& filename );
114
void onNetworkTimer( );
117
void clearSelection( );
120
void setToolbarVisible( bool );
121
void setFilterbarVisible( bool );
122
void setStatusbarVisible( bool );
123
void setTrayIconVisible( bool );
124
void setMinimalView( bool );
125
void refreshActionSensitivity( );
128
TrMainWindow( Session&, Prefs&, TorrentModel&, bool minized );
129
virtual ~TrMainWindow( );