From d8c6e2bcc6989d92d2562d70c64a87ea9a24099d Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 12 Nov 2009 19:44:47 +0000 Subject: [PATCH] - Added Peers tab (not functional yet) --- src/propertiesWidget.ui | 104 +++++++++++++++++++++++++++++++++++++-- src/propertieswidget.cpp | 17 +++++++ src/propertieswidget.h | 4 +- 3 files changed, 119 insertions(+), 6 deletions(-) diff --git a/src/propertiesWidget.ui b/src/propertiesWidget.ui index 7623c00d7..fc74259d0 100644 --- a/src/propertiesWidget.ui +++ b/src/propertiesWidget.ui @@ -2,6 +2,14 @@ PropertiesWidget + + + 0 + 0 + 540 + 305 + + 8 @@ -42,9 +50,9 @@ 0 - -39 - 714 - 285 + 0 + 536 + 268 @@ -278,7 +286,7 @@ - + @@ -303,7 +311,7 @@ - + @@ -721,6 +729,61 @@ + + + + + + false + + + false + + + true + + + false + + + + IP + + + + + Client + + + + + Progress + + + + + Down speed + + + + + Up speed + + + + + Downloaded + + + + + Uploaded + + + + + + @@ -935,6 +998,37 @@ margin-left: 3px; margin-right: 3px; + + + + + 0 + 24 + + + + QPushButton { +border: 1px solid rgb(85, 81, 91); +border-radius: 3px; +padding: 2px; +margin-left: 3px; margin-right: 3px; +} + + + Peers + + + + :/Icons/oxygen/peer.png:/Icons/oxygen/peer.png + + + + 16 + 16 + + + + diff --git a/src/propertieswidget.cpp b/src/propertieswidget.cpp index 74c1af20c..9f0367746 100644 --- a/src/propertieswidget.cpp +++ b/src/propertieswidget.cpp @@ -252,6 +252,10 @@ void PropertiesWidget::saveSettings() { settings.setValue(QString::fromUtf8("TorrentProperties/filesColsWidth"), contentColsWidths); } +void PropertiesWidget::loadPeers() { + // TODO +} + void PropertiesWidget::loadDynamicData() { if(!h.is_valid()) return; try { @@ -360,6 +364,8 @@ QPushButton* PropertiesWidget::getButtonFromIndex(int index) { switch(index) { case TRACKERS_TAB: return trackers_button; + case PEERS_TAB: + return peers_button; case URLSEEDS_TAB: return url_seeds_button; case FILES_TAB: @@ -391,6 +397,17 @@ void PropertiesWidget::on_trackers_button_clicked() { } } +void PropertiesWidget::on_peers_button_clicked() { + if(state == VISIBLE && stackedProperties->currentIndex() == PEERS_TAB) { + reduce(); + } else { + slide(); + getButtonFromIndex(stackedProperties->currentIndex())->setStyleSheet(DEFAULT_BUTTON_CSS); + stackedProperties->setCurrentIndex(PEERS_TAB); + peers_button->setStyleSheet(SELECTED_BUTTON_CSS); + } +} + void PropertiesWidget::on_url_seeds_button_clicked() { if(state == VISIBLE && stackedProperties->currentIndex() == URLSEEDS_TAB) { reduce(); diff --git a/src/propertieswidget.h b/src/propertieswidget.h index a299f034d..2fa87273d 100644 --- a/src/propertieswidget.h +++ b/src/propertieswidget.h @@ -46,7 +46,7 @@ class PropListDelegate; class QAction; class torrent_file; -enum Tab {MAIN_TAB, TRACKERS_TAB, URLSEEDS_TAB, FILES_TAB}; +enum Tab {MAIN_TAB, TRACKERS_TAB, PEERS_TAB, URLSEEDS_TAB, FILES_TAB}; enum SlideState {REDUCED, VISIBLE}; class PropertiesWidget : public QWidget, private Ui::PropertiesWidget { @@ -79,8 +79,10 @@ protected slots: void setIncrementalDownload(int checkboxState); void loadTrackers(); void loadUrlSeeds(); + void loadPeers(); void on_main_infos_button_clicked(); void on_trackers_button_clicked(); + void on_peers_button_clicked(); void on_url_seeds_button_clicked(); void on_files_button_clicked(); void ignoreSelection();