Revision 1776 trunk/client/gui_qt/WidgetDownloadQueue.h

WidgetDownloadQueue.h (revision 1776)
5 5
#include 
6 6
#include 
7 7
#include "ProgressBarDelegateDownloadQueue.h"
8
#include "DownloadQueueModel.h"
8 9

                
9 10
namespace Ui {
10 11
    class WidgetDownloadQueue;
... ...
16 17
    WidgetDownloadQueue(QNNTPGrabGlue *glue, QAction *actionRemoveSelectedFiles, QWidget *parent = 0);
17 18
    ~WidgetDownloadQueue();
18 19

                
19
    enum field {
20
        FIELD_STATE_STR,
21
        FIELD_SUBJECT,
22
        FIELD_POSTER,
23
        FIELD_GROUPS,
24
        FIELD_FILE_SIZE_STR,
25
        FIELD_FILE_SIZE_REMAINING_STR,
26
        FIELD_STAMP,
27
        FIELD_ESTIMATED_TIME_REMAINING_STR,
28
        FIELD_ESTIMATED_TIME_TO_FINISH_STR,
29
        FIELD_PROGRESS,
30
        FIELD_FILE_SIZE,
31
        FIELD_FILE_SIZE_REMAINING,
32
        FIELD_REAL_FILENAME,
33
        NUM_FIELDS
34
    };
20
    void hideField(DownloadQueueItem::field f);
21
    void showField(DownloadQueueItem::field f);
35 22

                
36
    void hideField(field f);
37
    void showField(field f);
38

                
39 23
protected:
40 24
    void changeEvent(QEvent *e);
41 25

                
... ...
44 28
    QNNTPGrabGlue *glue;
45 29
    ProgressBarDelegateDownloadQueue *progressbarDelegate;
46 30
    QAction *actionRemoveSelectedFiles;
31
    DownloadQueueModel *model;
47 32

                
48 33
    enum moveDirection {
49 34
        MOVE_DIRECTION_TOP,
... ...
56 41
    int calculateNewPosition(int current_position, moveDirection direction);
57 42
    void processSelectionAndMoveItems(moveDirection direction);
58 43

                
59
    int calculateProgress(quint64 total_file_size, quint64 file_size_remaining);
44
#if 0
60 45
    QTreeWidgetItem *getTreeWidgetByCollection(QString collection_name);
61 46
    QTreeWidgetItem *getTreeWidgetBySubject(QTreeWidgetItem *collection_node, QString subject);
47
#endif
62 48

                
63 49
private slots:
64 50
    void btnQueueMoveToTop_clicked(void);
... ...
66 52
    void btnQueueMoveDown_clicked(void);
67 53
    void btnQueueMoveToBottom_clicked(void);
68 54

                
69
    void onFileDownloadStateUpdate(QString collection_name, QString subject, int num_parts_total, int num_parts_done, int num_parts_failed, quint64 file_size, quint64 file_size_remaining, quint64 total_size, quint64 total_size_remaining);
70
    void onFileStateChanged(QString collection_name, QString subject, QString real_filename, QNNTPGrabGlue::TaskState old_state, QNNTPGrabGlue::TaskState new_state);
71

                
72
    void onFileAdded(QString collection_name, QString subject, QString poster, QDateTime stamp, quint64 file_size, quint64 total_size, quint64 total_size_remaining, QNNTPGrabGlue::TaskState state, int num_parts, QList groups);
73
    void onFileRemoved(QString collection_name, QString subject, quint64 total_size, quint64 total_size_remaining);
74
    void onFileMoved(QString orig_collection_name, QString subject, QString new_collection_name, int old_position, int new_position);
75

                
76
    void onCollectionAdded(QString collection_name, QString poster);
77
    void onCollectionRemoved(QString collection_name);
78
    void onCollectionModified(QString collection_name, QString poster);
79
    void onCollectionMoved(QString collection_name, int old_position, int new_position);
80

                
81
    void onTrafficMonitorUpdate(int bytes_received1, int bytes_received2, int bytes_received3, int bytes_received4, int bytes_received5, int bytes_received6, int bytes_received7, int bytes_received8, int bytes_received9, int bytes_received10, QDateTime stamp, double average);
82

                
83 55
    void onItemSelectionChanged(void);
84 56

                
85 57
    void actionRemoveSelectedFiles_activated(void);

Also available in: Unified diff