|
|
@ -30,31 +30,34 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "trackerlist.h" |
|
|
|
#include "trackerlist.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <QApplication> |
|
|
|
|
|
|
|
#include <QTreeWidgetItem> |
|
|
|
|
|
|
|
#include <QStringList> |
|
|
|
|
|
|
|
#include <QMenu> |
|
|
|
|
|
|
|
#include <QHash> |
|
|
|
|
|
|
|
#include <QAction> |
|
|
|
#include <QAction> |
|
|
|
|
|
|
|
#include <QApplication> |
|
|
|
#include <QColor> |
|
|
|
#include <QColor> |
|
|
|
#include <QDebug> |
|
|
|
#include <QDebug> |
|
|
|
#include <QUrl> |
|
|
|
#include <QHash> |
|
|
|
|
|
|
|
#include <QHeaderView> |
|
|
|
|
|
|
|
#include <QMenu> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QMessageBox> |
|
|
|
|
|
|
|
#include <QStringList> |
|
|
|
#include <QTableView> |
|
|
|
#include <QTableView> |
|
|
|
#include <QHeaderView> |
|
|
|
#include <QTreeWidgetItem> |
|
|
|
|
|
|
|
#include <QUrl> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "base/bittorrent/peerinfo.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
#include "base/bittorrent/torrenthandle.h" |
|
|
|
#include "base/bittorrent/torrenthandle.h" |
|
|
|
#include "base/bittorrent/peerinfo.h" |
|
|
|
|
|
|
|
#include "base/bittorrent/trackerentry.h" |
|
|
|
#include "base/bittorrent/trackerentry.h" |
|
|
|
#include "base/preferences.h" |
|
|
|
#include "base/preferences.h" |
|
|
|
#include "base/utils/misc.h" |
|
|
|
#include "base/utils/misc.h" |
|
|
|
|
|
|
|
#include "autoexpandabledialog.h" |
|
|
|
|
|
|
|
#include "guiiconprovider.h" |
|
|
|
#include "propertieswidget.h" |
|
|
|
#include "propertieswidget.h" |
|
|
|
#include "trackersadditiondlg.h" |
|
|
|
#include "trackersadditiondlg.h" |
|
|
|
#include "guiiconprovider.h" |
|
|
|
|
|
|
|
#include "autoexpandabledialog.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), properties(properties) { |
|
|
|
TrackerList::TrackerList(PropertiesWidget *properties) |
|
|
|
|
|
|
|
: QTreeWidget() |
|
|
|
|
|
|
|
, properties(properties) |
|
|
|
|
|
|
|
{ |
|
|
|
// Graphical settings
|
|
|
|
// Graphical settings
|
|
|
|
setRootIsDecorated(false); |
|
|
|
setRootIsDecorated(false); |
|
|
|
setAllColumnsShowFocus(true); |
|
|
|
setAllColumnsShowFocus(true); |
|
|
@ -98,11 +101,12 @@ TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), propertie |
|
|
|
loadSettings(); |
|
|
|
loadSettings(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TrackerList::~TrackerList() { |
|
|
|
TrackerList::~TrackerList() |
|
|
|
delete editHotkey; |
|
|
|
{ |
|
|
|
delete deleteHotkey; |
|
|
|
delete editHotkey; |
|
|
|
delete copyHotkey; |
|
|
|
delete deleteHotkey; |
|
|
|
saveSettings(); |
|
|
|
delete copyHotkey; |
|
|
|
|
|
|
|
saveSettings(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QList<QTreeWidgetItem*> TrackerList::getSelectedTrackerItems() const { |
|
|
|
QList<QTreeWidgetItem*> TrackerList::getSelectedTrackerItems() const { |
|
|
@ -524,13 +528,15 @@ void TrackerList::showTrackerListMenu(QPoint) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TrackerList::loadSettings() { |
|
|
|
void TrackerList::loadSettings() |
|
|
|
if (!header()->restoreState(Preferences::instance()->getPropTrackerListState())) { |
|
|
|
{ |
|
|
|
setColumnWidth(0, 30); |
|
|
|
if (!header()->restoreState(Preferences::instance()->getPropTrackerListState())) { |
|
|
|
setColumnWidth(1, 300); |
|
|
|
setColumnWidth(0, 30); |
|
|
|
} |
|
|
|
setColumnWidth(1, 300); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TrackerList::saveSettings() const { |
|
|
|
void TrackerList::saveSettings() const |
|
|
|
Preferences::instance()->setPropTrackerListState(header()->saveState()); |
|
|
|
{ |
|
|
|
|
|
|
|
Preferences::instance()->setPropTrackerListState(header()->saveState()); |
|
|
|
} |
|
|
|
} |
|
|
|