|
|
@ -39,6 +39,9 @@ |
|
|
|
#include "realprogressbarthread.h" |
|
|
|
#include "realprogressbarthread.h" |
|
|
|
#include "bittorrent.h" |
|
|
|
#include "bittorrent.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_BUTTON_CSS "QPushButton {border: 1px solid rgb(85, 81, 91);border-radius: 3px;padding: 2px;}" |
|
|
|
|
|
|
|
#define SELECTED_BUTTON_CSS "QPushButton {border: 1px solid rgb(85, 81, 91);border-radius: 3px;padding: 2px;background-color: rgb(255, 208, 105);}" |
|
|
|
|
|
|
|
|
|
|
|
PropertiesWidget::PropertiesWidget(QWidget *parent, TransferListWidget *transferList, bittorrent* BTSession): QWidget(parent), transferList(transferList), BTSession(BTSession) { |
|
|
|
PropertiesWidget::PropertiesWidget(QWidget *parent, TransferListWidget *transferList, bittorrent* BTSession): QWidget(parent), transferList(transferList), BTSession(BTSession) { |
|
|
|
setupUi(this); |
|
|
|
setupUi(this); |
|
|
|
connect(transferList, SIGNAL(currentTorrentChanged(QTorrentHandle&)), this, SLOT(loadTorrentInfos(QTorrentHandle &))); |
|
|
|
connect(transferList, SIGNAL(currentTorrentChanged(QTorrentHandle&)), this, SLOT(loadTorrentInfos(QTorrentHandle &))); |
|
|
@ -164,10 +167,23 @@ void PropertiesWidget::loadTrackers() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Tab buttons */ |
|
|
|
/* Tab buttons */ |
|
|
|
|
|
|
|
QPushButton* PropertiesWidget::getButtonFromIndex(int index) { |
|
|
|
|
|
|
|
switch(index) { |
|
|
|
|
|
|
|
case TRACKERS_TAB: |
|
|
|
|
|
|
|
return trackers_button; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return main_infos_button; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PropertiesWidget::on_main_infos_button_clicked() { |
|
|
|
void PropertiesWidget::on_main_infos_button_clicked() { |
|
|
|
|
|
|
|
getButtonFromIndex(stackedProperties->currentIndex())->setStyleSheet(DEFAULT_BUTTON_CSS); |
|
|
|
stackedProperties->setCurrentIndex(MAIN_TAB); |
|
|
|
stackedProperties->setCurrentIndex(MAIN_TAB); |
|
|
|
|
|
|
|
main_infos_button->setStyleSheet(SELECTED_BUTTON_CSS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PropertiesWidget::on_trackers_button_clicked() { |
|
|
|
void PropertiesWidget::on_trackers_button_clicked() { |
|
|
|
|
|
|
|
getButtonFromIndex(stackedProperties->currentIndex())->setStyleSheet(DEFAULT_BUTTON_CSS); |
|
|
|
stackedProperties->setCurrentIndex(TRACKERS_TAB); |
|
|
|
stackedProperties->setCurrentIndex(TRACKERS_TAB); |
|
|
|
|
|
|
|
trackers_button->setStyleSheet(SELECTED_BUTTON_CSS); |
|
|
|
} |
|
|
|
} |
|
|
|