Browse Source

Added back ability to reorder trackers

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
ac097b9904
  1. 5
      src/properties/propertieswidget.cpp
  2. 31
      src/properties/propertieswidget.ui
  3. 4
      src/properties/trackerlist.cpp

5
src/properties/propertieswidget.cpp

@ -106,13 +106,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra @@ -106,13 +106,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra
ProgressHLayout_2->insertWidget(1, pieces_availability);
// Tracker list
trackerList = new TrackerList(this);
#if LIBTORRENT_VERSION_MINOR > 14
trackerUpButton->setVisible(false);
trackerDownButton->setVisible(false);
#else
connect(trackerUpButton, SIGNAL(clicked()), trackerList, SLOT(moveSelectionUp()));
connect(trackerDownButton, SIGNAL(clicked()), trackerList, SLOT(moveSelectionDown()));
#endif
horizontalLayout_trackers->insertWidget(0, trackerList);
// Peers list
peersList = new PeerListWidget(this);

31
src/properties/propertieswidget.ui

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<width>551</width>
<height>274</height>
</rect>
</property>
@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
<item>
<widget class="QStackedWidget" name="stackedProperties">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_7">
@ -54,8 +54,8 @@ @@ -54,8 +54,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>520</width>
<height>373</height>
<width>531</width>
<height>395</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -557,15 +557,16 @@ @@ -557,15 +557,16 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@ -628,22 +629,6 @@ p, li { white-space: pre-wrap; } @@ -628,22 +629,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>28</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="trackerDownButton">
<property name="sizePolicy">

4
src/properties/trackerlist.cpp

@ -100,7 +100,6 @@ void TrackerList::setRowColor(int row, QColor color) { @@ -100,7 +100,6 @@ void TrackerList::setRowColor(int row, QColor color) {
}
void TrackerList::moveSelectionUp() {
#if LIBTORRENT_VERSION_MINOR < 15
QTorrentHandle h = properties->getCurrentTorrent();
if(!h.is_valid()) {
clear();
@ -134,11 +133,9 @@ void TrackerList::moveSelectionUp() { @@ -134,11 +133,9 @@ void TrackerList::moveSelectionUp() {
h.replace_trackers(trackers);
// Reannounce
h.force_reannounce();
#endif
}
void TrackerList::moveSelectionDown() {
#if LIBTORRENT_VERSION_MINOR < 15
QTorrentHandle h = properties->getCurrentTorrent();
if(!h.is_valid()) {
clear();
@ -172,7 +169,6 @@ void TrackerList::moveSelectionDown() { @@ -172,7 +169,6 @@ void TrackerList::moveSelectionDown() {
h.replace_trackers(trackers);
// Reannounce
h.force_reannounce();
#endif
}
void TrackerList::clear() {

Loading…
Cancel
Save