source: trunk/beos/TRWindow.h @ 2632

Last change on this file since 2632 was 2632, checked in by joshe, 15 years ago

Wait a bit for torrents to stop on exit.

  • Property svn:keywords set to Date Rev Author Id
File size: 1.7 KB
Line 
1// $Id: TRWindow.h 2632 2007-08-05 03:52:45Z joshe $
2
3#ifndef TR_WIND
4#define TR_WIND
5
6#include <Entry.h>
7#include <FilePanel.h>
8#include <ListView.h>
9#include <ListItem.h>
10#include <Window.h>
11
12#include <libtransmission/transmission.h>
13
14#include "TRPrefsWindow.h"
15
16#define TR_INFO 'tNfo'
17
18#define TR_RESUME 'tRes'
19#define TR_PAUSE 'tPse'
20#define TR_REMOVE 'tRmv'
21#define TR_SELECT 'tSel'
22#define TR_SETTINGS 'tSet'
23
24
25
26/**
27 * Transmission Window.
28 */
29class TRWindow : public BWindow {
30public: // BWindow
31        TRWindow();
32        ~TRWindow();
33       
34        virtual void MessageReceived(BMessage *msg);
35        virtual bool QuitRequested();
36        virtual void FrameResized(float width, float height);
37
38public: // TRWindow
39        void AddEntry(BEntry *torrent);
40       
41        void UpdateList(int32 selection, bool menus);
42       
43        void LoadSettings();
44        BString GetFolder(void);
45        void StopTorrent(tr_torrent_t *torrent);
46        void StartTorrent(tr_torrent_t *torrent);
47       
48        static int32 AsynchStopTorrent(void *data);
49        static int32 AsynchStartTorrent(void *data);
50       
51        void RescanTorrents();
52
53private:
54        static BListView *transfers;
55        BFilePanel *openPanel;
56       
57        tr_handle_t *engine;
58       
59        TRPrefsWindow *fSettings;
60       
61        static bool RemovePath(BListItem *item, void *data);
62        static bool CheckQuitStatus(BListItem *item, void *data);
63        static bool UpdateStats(BListItem *item, void *data);
64       
65        bool stopping;
66        BInvoker *quitter;
67};
68
69/**
70 * Used to pass info off to the worker thread that runs AsynchStopTorrent
71 */
72struct worker_info {
73        TRWindow     *window;
74        tr_torrent_t *torrent;
75};
76
77struct remove_info {
78        TRWindow *window;
79        char     path[B_FILE_NAME_LENGTH];
80};
81
82struct quit_info {
83        TRWindow *window;
84        int       running;
85};
86
87struct update_info {
88        TRWindow *window;
89        bool     running;
90        int      selected;
91        int      invalid;
92};
93
94#endif /* TR_WIND */
Note: See TracBrowser for help on using the repository browser.