~hendrik-grewe/transmission/private-patch

« back to all changes in this revision

Viewing changes to qt/mainwin.h

  • Committer: charles
  • Date: 2009-04-09 17:55:47 UTC
  • Revision ID: svn-v4:f4695dd4-2c0a-0410-b89c-da849a56a58e:trunk:8188
(trunk) add the Qt beta into svn 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file Copyright (C) 2009 Charles Kerr <charles@transmissionbt.com>
 
3
 *
 
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.
 
9
 *
 
10
 * $Id:$
 
11
 */
 
12
 
 
13
#ifndef MAIN_WINDOW_H
 
14
#define MAIN_WINDOW_H
 
15
 
 
16
#include <ctime>
 
17
#include <QCheckBox>
 
18
#include <QFileDialog>
 
19
#include <QIcon>
 
20
#include <QMainWindow>
 
21
#include <QSet>
 
22
#include <QSystemTrayIcon>
 
23
#include <QTimer>
 
24
#include <QWidgetList>
 
25
 
 
26
extern "C" {
 
27
    struct tr_benc;
 
28
};
 
29
 
 
30
#include "torrent-filter.h"
 
31
#include "ui_mainwin.h"
 
32
 
 
33
class ActionDelegator;
 
34
class Prefs;
 
35
class Session;
 
36
class TorrentDelegate;
 
37
class TorrentDelegateMin;
 
38
class TorrentModel;
 
39
class QModelIndex;
 
40
class QSortFilterProxyModel;
 
41
 
 
42
class TrMainWindow: public QMainWindow
 
43
{
 
44
        Q_OBJECT
 
45
 
 
46
    private:
 
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;
 
57
        Session& mySession;
 
58
        Prefs& myPrefs;
 
59
        TorrentModel& myModel;
 
60
        Ui_MainWindow ui;
 
61
        QIcon mySpeedModeOffIcon;
 
62
        QIcon mySpeedModeOnIcon;
 
63
        time_t myLastSendTime;
 
64
        time_t myLastReadTime;
 
65
        QTimer myNetworkTimer;
 
66
 
 
67
    private:
 
68
        QIcon getStockIcon( const QString&, int fallback=-1 );
 
69
 
 
70
    private:
 
71
        void setShowMode( TorrentFilter::ShowMode );
 
72
        QSet<int> getSelectedTorrents( ) const;
 
73
        void updateNetworkIcon( );
 
74
        QWidgetList myHidden;
 
75
 
 
76
    private slots:
 
77
        void showAll( );
 
78
        void showActive( );
 
79
        void showDownloading( );
 
80
        void showSeeding( );
 
81
        void showPaused( );
 
82
        void filterByName( );
 
83
        void filterByFiles( );
 
84
        void filterByTracker( );
 
85
        void showTotalRatio( );
 
86
        void showTotalTransfer( );
 
87
        void showSessionRatio( );
 
88
        void showSessionTransfer( );
 
89
        void refreshVisibleCount( );
 
90
        void refreshStatusBar( );
 
91
        void openTorrent( );
 
92
        void newTorrent( );
 
93
        void trayActivated( QSystemTrayIcon::ActivationReason );
 
94
        void refreshPref( int key );
 
95
        void addTorrents( const QStringList& filenames );
 
96
        void openHelp( );
 
97
        void openFolder( );
 
98
        void openProperties( );
 
99
        void toggleSpeedMode( );
 
100
        void dataReadProgress( );
 
101
        void dataSendProgress( );
 
102
        void toggleWindows( );
 
103
 
 
104
     public slots:
 
105
        void startAll( );
 
106
        void startSelected( );
 
107
        void pauseAll( );
 
108
        void pauseSelected( );
 
109
        void removeSelected( );
 
110
        void deleteSelected( );
 
111
        void verifySelected( );
 
112
        void reannounceSelected( );
 
113
        void addTorrent( const QString& filename );
 
114
        void onNetworkTimer( );
 
115
 
 
116
    private:
 
117
        void clearSelection( );
 
118
 
 
119
    public slots:
 
120
        void setToolbarVisible( bool );
 
121
        void setFilterbarVisible( bool );
 
122
        void setStatusbarVisible( bool );
 
123
        void setTrayIconVisible( bool );
 
124
        void setMinimalView( bool );
 
125
        void refreshActionSensitivity( );
 
126
 
 
127
    public:
 
128
        TrMainWindow( Session&, Prefs&, TorrentModel&, bool minized );
 
129
        virtual ~TrMainWindow( );
 
130
};
 
131
 
 
132
#endif