File indexing completed on 2024-05-05 04:59:14
0001 /*************************************************************************** 0002 * Copyright (C) 2006-2007 by Joris Guisson, Ivan Vasic * 0003 * joris.guisson@gmail.com * 0004 * ivasic@gmail.com * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU General Public License as published by * 0008 * the Free Software Foundation; either version 2 of the License, or * 0009 * (at your option) any later version. * 0010 * * 0011 * This program is distributed in the hope that it will be useful, * 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0014 * GNU General Public License for more details. * 0015 * * 0016 * You should have received a copy of the GNU General Public License * 0017 * along with this program; if not, write to the * 0018 * Free Software Foundation, Inc., * 0019 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0020 ***************************************************************************/ 0021 #ifndef TRACKERVIEW_H 0022 #define TRACKERVIEW_H 0023 0024 #include "ui_trackerview.h" 0025 #include <KSharedConfig> 0026 #include <QSortFilterProxyModel> 0027 0028 namespace bt 0029 { 0030 class TorrentInterface; 0031 } 0032 0033 namespace kt 0034 { 0035 class TrackerModel; 0036 0037 /** 0038 * @author Ivan Vasic <ivan@ktorrent.org> 0039 */ 0040 class TrackerView : public QWidget, public Ui_TrackerView 0041 { 0042 Q_OBJECT 0043 public: 0044 TrackerView(QWidget *parent); 0045 ~TrackerView() override; 0046 0047 void update(); 0048 void changeTC(bt::TorrentInterface *ti); 0049 void saveState(KSharedConfigPtr cfg); 0050 void loadState(KSharedConfigPtr cfg); 0051 0052 public Q_SLOTS: 0053 virtual void updateClicked(); 0054 virtual void restoreClicked(); 0055 virtual void changeClicked(); 0056 virtual void removeClicked(); 0057 virtual void addClicked(); 0058 virtual void scrapeClicked(); 0059 void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); 0060 0061 private: 0062 void torrentChanged(bt::TorrentInterface *ti); 0063 0064 private: 0065 bt::TorrentInterface *tc; 0066 TrackerModel *model; 0067 QSortFilterProxyModel *proxy_model; 0068 }; 0069 } 0070 #endif