kget
fileview.h
Go to the documentation of this file.00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KTFILEVIEW_H
00023 #define KTFILEVIEW_H
00024
00025 #include <QTreeView>
00026 #include <util/constants.h>
00027 #include <ksharedconfig.h>
00028
00029 class KMenu;
00030
00031 namespace bt
00032 {
00033 class TorrentInterface;
00034 }
00035
00036 namespace kt
00037 {
00038 class TorrentFileModel;
00039
00043 class FileView : public QTreeView
00044 {
00045 Q_OBJECT
00046 public:
00047 FileView(QWidget *parent);
00048 virtual ~FileView();
00049
00050 void changeTC(bt::TorrentInterface* tc,KSharedConfigPtr cfg);
00051 void setShowListOfFiles(bool on,KSharedConfigPtr cfg);
00052 void saveState(KSharedConfigPtr cfg);
00053 void loadState(KSharedConfigPtr cfg);
00054 void update();
00055 public slots:
00056 void onTorrentRemoved(bt::TorrentInterface* tc);
00057
00058 private slots:
00059 void showContextMenu(const QPoint & p);
00060 void onDoubleClicked(const QModelIndex & index);
00061 void onMissingFileMarkedDND(bt::TorrentInterface* tc);
00062
00063 private:
00064 void changePriority(bt::Priority newpriority);
00065
00066 private slots:
00067 void open();
00068 void downloadFirst();
00069 void downloadLast();
00070 void downloadNormal();
00071 void doNotDownload();
00072 void deleteFiles();
00073 void moveFiles();
00074
00075 private:
00076 bt::TorrentInterface* curr_tc;
00077 TorrentFileModel* model;
00078
00079 KMenu* context_menu;
00080 QAction* open_action;
00081 QAction* download_first_action;
00082 QAction* download_normal_action;
00083 QAction* download_last_action;
00084 QAction* dnd_action;
00085 QAction* delete_action;
00086 QAction* move_files_action;
00087
00088 QString preview_path;
00089 bool show_list_of_files;
00090 QMap<bt::TorrentInterface*,QByteArray> expanded_state_map;
00091 };
00092
00093 }
00094
00095 #endif