• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • transfer-plugins
  • bittorrent
  • advanceddetails
fileview.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2007 by Joris Guisson *
3  * joris.guisson@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 #ifndef KTFILEVIEW_H
21 #define KTFILEVIEW_H
22 
23 #include <QTreeView>
24 #include <util/constants.h>
25 #include <ksharedconfig.h>
26 
27 class KMenu;
28 class QSortFilterProxyModel;
29 
30 namespace bt
31 {
32  class TorrentInterface;
33  class TorrentFileInterface;
34 }
35 
36 namespace kt
37 {
38  class TorrentFileModel;
39 
43  class FileView : public QTreeView
44  {
45  Q_OBJECT
46  public:
47  FileView(QWidget *parent);
48  virtual ~FileView();
49 
50  void changeTC(bt::TorrentInterface* tc,KSharedConfigPtr cfg);
51  void setShowListOfFiles(bool on,KSharedConfigPtr cfg);
52  void saveState(KSharedConfigPtr cfg);
53  void loadState(KSharedConfigPtr cfg);
54  void update();
55  void filePercentageChanged(bt::TorrentFileInterface* file,float percentage);
56  void filePreviewChanged(bt::TorrentFileInterface* file,bool preview);
57 
58  public slots:
59  void onTorrentRemoved(bt::TorrentInterface* tc);
60 
61  private slots:
62  void showContextMenu(const QPoint & p);
63  void onDoubleClicked(const QModelIndex & index);
64  void onMissingFileMarkedDND(bt::TorrentInterface* tc);
65 
66  private:
67  void changePriority(bt::Priority newpriority);
68  void expandCollapseTree(const QModelIndex& idx, bool expand);
69  void expandCollapseSelected(bool expand);
70  virtual bool viewportEvent(QEvent *event);
71  virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
72 
73  private slots:
74  void open();
75  void downloadFirst();
76  void downloadLast();
77  void downloadNormal();
78  void doNotDownload();
79  void deleteFiles();
80  void moveFiles();
81  void collapseTree();
82  void expandTree();
83 
84  private:
85  bool redraw;
86  bt::TorrentInterface* curr_tc;
87  TorrentFileModel* model;
88 
89  KMenu* context_menu;
90  QAction* open_action;
91  QAction* download_first_action;
92  QAction* download_normal_action;
93  QAction* download_last_action;
94  QAction* dnd_action;
95  QAction* delete_action;
96  QAction* move_files_action;
97  QAction* collapse_action;
98  QAction* expand_action;
99 
100  QString preview_path;
101  bool show_list_of_files;
102  QMap<bt::TorrentInterface*,QByteArray> expanded_state_map;
103  QSortFilterProxyModel* proxy_model;
104  };
105 
106 }
107 
108 #endif
kt::FileView::filePercentageChanged
void filePercentageChanged(bt::TorrentFileInterface *file, float percentage)
Definition: fileview.cpp:448
kt::FileView::FileView
FileView(QWidget *parent)
Definition: fileview.cpp:51
QWidget
kt::FileView::setShowListOfFiles
void setShowListOfFiles(bool on, KSharedConfigPtr cfg)
Definition: fileview.cpp:408
kt::FileView
Definition: fileview.h:43
kt::FileView::filePreviewChanged
void filePreviewChanged(bt::TorrentFileInterface *file, bool preview)
Definition: fileview.cpp:454
kt::FileView::loadState
void loadState(KSharedConfigPtr cfg)
Definition: fileview.cpp:379
kt::FileView::update
void update()
Definition: fileview.cpp:391
QTreeView
QSortFilterProxyModel
kt::FileView::~FileView
virtual ~FileView()
Definition: fileview.cpp:91
kt::FileView::changeTC
void changeTC(bt::TorrentInterface *tc, KSharedConfigPtr cfg)
Definition: fileview.cpp:94
kt::FileView::onTorrentRemoved
void onTorrentRemoved(bt::TorrentInterface *tc)
Definition: fileview.cpp:403
kt::FileView::saveState
void saveState(KSharedConfigPtr cfg)
Definition: fileview.cpp:369
kt::TorrentFileModel
Definition: torrentfilemodel.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal