- class DownloadViewItem;
-
- typedef QHash<QString, DownloadViewItem*> DownloadItems_t;
-
- /**
- @class DownloadView
- @brief A view showing all downloaded torrents
- @author Lassi Väätämöinen <lassi.vaatamoinen@ixonos.com>
- */
- class DownloadView : public QTreeWidget
- {
- Q_OBJECT
-
- public:
- DownloadView(QWidget* parent);
-
- ~DownloadView();
-
- void updateItem(TorrentState const& info, ParamsMap_t other_info);
- QString prepareRemoveSelected();
-
- private slots:
- void on_itemClicked(QTreeWidgetItem * item, int column);
- private:
-
- void addItem_(TorrentState const& info, ParamsMap_t other_info);
- void updateItem_(DownloadViewItem *item
- , TorrentState const& info, ParamsMap_t other_info);
- void removeItem_(DownloadViewItem *item, TorrentState const& info);
-
- // Maps torrent to downloadview item.
- // Key: SHA1 info hash of torrent. Data: View item corresponding to torrent.
- DownloadItems_t items_;
-
- // Private functions.
- static QString GetStatusString(TorrentStatus::Id status);
- static QColor GetStatusColor(TorrentStatus::Id status);
- };
-
-
- /**
- @class DownloadViewItem
- @brief Represents one item row of DownloadView
- */
- class DownloadViewItem : public QTreeWidgetItem {
+class DownloadViewItem;
+
+typedef QHash<QString, DownloadViewItem*> DownloadItems_t;
+
+/**
+ @class DownloadView
+ @brief A view showing all downloaded torrents
+ @author Lassi Väätämöinen <lassi.vaatamoinen@ixonos.com>
+*/
+class DownloadView : public QTreeWidget
+{
+ Q_OBJECT
+
+public:
+ DownloadView(QWidget* parent);
+
+ ~DownloadView();
+
+ void updateItem(TorrentState const& info, ParamsMap_t other_info);
+ QString prepareRemoveSelected();
+
+ /// Saves current view settings via QSettings
+ void saveView();
+ /// Reads view settigns via QSettings
+ void restoreView();
+
+private slots:
+ void on_itemClicked(QTreeWidgetItem * item, int column);
+
+private:
+
+ // Maps torrent to downloadview item.
+ // Key: SHA1 info hash of torrent. Data: View item corresponding to torrent.
+ DownloadItems_t items_;
+ // Used for saving view settings
+ QSettings settings_;
+
+private:
+ // Private functions.
+ void addItem_(TorrentState const& info, ParamsMap_t other_info);
+ void updateItem_(DownloadViewItem *item
+ , TorrentState const& info, ParamsMap_t other_info);
+ void removeItem_(DownloadViewItem *item, TorrentState const& info);
+
+
+ static QString GetStatusString(TorrentStatus::Id status);
+ static QColor GetStatusColor(TorrentStatus::Id status);