|
|
@ -45,7 +45,7 @@ |
|
|
|
#include <vector> |
|
|
|
#include <vector> |
|
|
|
#include "qinisettings.h" |
|
|
|
#include "qinisettings.h" |
|
|
|
|
|
|
|
|
|
|
|
PeerListWidget::PeerListWidget(PropertiesWidget *parent): properties(parent), display_flags(false) { |
|
|
|
PeerListWidget::PeerListWidget(PropertiesWidget *parent): QTreeView(parent), properties(parent), display_flags(false) { |
|
|
|
// Visual settings
|
|
|
|
// Visual settings
|
|
|
|
setRootIsDecorated(false); |
|
|
|
setRootIsDecorated(false); |
|
|
|
setItemsExpandable(false); |
|
|
|
setItemsExpandable(false); |
|
|
@ -78,6 +78,9 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent): properties(parent), di |
|
|
|
loadSettings(); |
|
|
|
loadSettings(); |
|
|
|
// IP to Hostname resolver
|
|
|
|
// IP to Hostname resolver
|
|
|
|
updatePeerHostNameResolutionState(); |
|
|
|
updatePeerHostNameResolutionState(); |
|
|
|
|
|
|
|
// SIGNAL/SLOT
|
|
|
|
|
|
|
|
connect(header(), SIGNAL(sectionClicked(int)), SLOT(handleSortColumnChanged(int))); |
|
|
|
|
|
|
|
handleSortColumnChanged(header()->sortIndicatorSection()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PeerListWidget::~PeerListWidget() { |
|
|
|
PeerListWidget::~PeerListWidget() { |
|
|
@ -400,3 +403,13 @@ void PeerListWidget::handleResolved(QString ip, QString hostname) { |
|
|
|
//listModel->setData(listModel->index(item->row(), IP), hostname);
|
|
|
|
//listModel->setData(listModel->index(item->row(), IP), hostname);
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PeerListWidget::handleSortColumnChanged(int col) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(col == 0) { |
|
|
|
|
|
|
|
qDebug("Sorting by decoration"); |
|
|
|
|
|
|
|
proxyModel->setSortRole(Qt::ToolTipRole); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
proxyModel->setSortRole(Qt::DisplayRole); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|