Browse Source

- Added Peers tab (not functional yet)

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
d8c6e2bcc6
  1. 104
      src/propertiesWidget.ui
  2. 17
      src/propertieswidget.cpp
  3. 4
      src/propertieswidget.h

104
src/propertiesWidget.ui

@ -2,6 +2,14 @@
<ui version="4.0"> <ui version="4.0">
<class>PropertiesWidget</class> <class>PropertiesWidget</class>
<widget class="QWidget" name="PropertiesWidget"> <widget class="QWidget" name="PropertiesWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>305</height>
</rect>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>8</pointsize> <pointsize>8</pointsize>
@ -42,9 +50,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-39</y> <y>0</y>
<width>714</width> <width>536</width>
<height>285</height> <height>268</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_10">
@ -278,7 +286,7 @@
<item> <item>
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="text"> <property name="text">
<string notr="true"> </string> <string notr="true"/>
</property> </property>
</widget> </widget>
</item> </item>
@ -303,7 +311,7 @@
<item> <item>
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
<property name="text"> <property name="text">
<string notr="true"> </string> <string notr="true"/>
</property> </property>
</widget> </widget>
</item> </item>
@ -721,6 +729,61 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_5">
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<widget class="QTreeWidget" name="peersList">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="expandsOnDoubleClick">
<bool>false</bool>
</property>
<column>
<property name="text">
<string>IP</string>
</property>
</column>
<column>
<property name="text">
<string>Client</string>
</property>
</column>
<column>
<property name="text">
<string>Progress</string>
</property>
</column>
<column>
<property name="text">
<string>Down speed</string>
</property>
</column>
<column>
<property name="text">
<string>Up speed</string>
</property>
</column>
<column>
<property name="text">
<string>Downloaded</string>
</property>
</column>
<column>
<property name="text">
<string>Uploaded</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_3"> <widget class="QWidget" name="page_3">
<layout class="QVBoxLayout" name="verticalLayout_9"> <layout class="QVBoxLayout" name="verticalLayout_9">
<item> <item>
@ -935,6 +998,37 @@ margin-left: 3px; margin-right: 3px;
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="peers_button">
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="styleSheet">
<string>QPushButton {
border: 1px solid rgb(85, 81, 91);
border-radius: 3px;
padding: 2px;
margin-left: 3px; margin-right: 3px;
}</string>
</property>
<property name="text">
<string>Peers</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/Icons/oxygen/peer.png</normaloff>:/Icons/oxygen/peer.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="url_seeds_button"> <widget class="QPushButton" name="url_seeds_button">
<property name="styleSheet"> <property name="styleSheet">

17
src/propertieswidget.cpp

@ -252,6 +252,10 @@ void PropertiesWidget::saveSettings() {
settings.setValue(QString::fromUtf8("TorrentProperties/filesColsWidth"), contentColsWidths); settings.setValue(QString::fromUtf8("TorrentProperties/filesColsWidth"), contentColsWidths);
} }
void PropertiesWidget::loadPeers() {
// TODO
}
void PropertiesWidget::loadDynamicData() { void PropertiesWidget::loadDynamicData() {
if(!h.is_valid()) return; if(!h.is_valid()) return;
try { try {
@ -360,6 +364,8 @@ QPushButton* PropertiesWidget::getButtonFromIndex(int index) {
switch(index) { switch(index) {
case TRACKERS_TAB: case TRACKERS_TAB:
return trackers_button; return trackers_button;
case PEERS_TAB:
return peers_button;
case URLSEEDS_TAB: case URLSEEDS_TAB:
return url_seeds_button; return url_seeds_button;
case FILES_TAB: 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() { void PropertiesWidget::on_url_seeds_button_clicked() {
if(state == VISIBLE && stackedProperties->currentIndex() == URLSEEDS_TAB) { if(state == VISIBLE && stackedProperties->currentIndex() == URLSEEDS_TAB) {
reduce(); reduce();

4
src/propertieswidget.h

@ -46,7 +46,7 @@ class PropListDelegate;
class QAction; class QAction;
class torrent_file; 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}; enum SlideState {REDUCED, VISIBLE};
class PropertiesWidget : public QWidget, private Ui::PropertiesWidget { class PropertiesWidget : public QWidget, private Ui::PropertiesWidget {
@ -79,8 +79,10 @@ protected slots:
void setIncrementalDownload(int checkboxState); void setIncrementalDownload(int checkboxState);
void loadTrackers(); void loadTrackers();
void loadUrlSeeds(); void loadUrlSeeds();
void loadPeers();
void on_main_infos_button_clicked(); void on_main_infos_button_clicked();
void on_trackers_button_clicked(); void on_trackers_button_clicked();
void on_peers_button_clicked();
void on_url_seeds_button_clicked(); void on_url_seeds_button_clicked();
void on_files_button_clicked(); void on_files_button_clicked();
void ignoreSelection(); void ignoreSelection();

Loading…
Cancel
Save