1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-09 22:37:59 +00:00

- show piece related bar only for downloading torrents (no use for completed ones)

This commit is contained in:
Christophe Dumez 2009-11-21 19:47:54 +00:00
parent 47d545633d
commit 0c617f0a03
3 changed files with 26 additions and 9 deletions

View File

@ -132,6 +132,15 @@ PropertiesWidget::~PropertiesWidget() {
delete actionHigh; delete actionHigh;
} }
void PropertiesWidget::showPieceBars(bool show) {
avail_pieces_lbl->setVisible(show);
pieces_availability->setVisible(show);
downloaded_pieces_lbl->setVisible(show);
downloaded_pieces->setVisible(show);
progress_lbl->setVisible(show);
line_2->setVisible(show);
}
void PropertiesWidget::reduce() { void PropertiesWidget::reduce() {
if(state == VISIBLE) { if(state == VISIBLE) {
QSplitter *hSplitter = static_cast<QSplitter*>(parentWidget()); QSplitter *hSplitter = static_cast<QSplitter*>(parentWidget());
@ -180,6 +189,7 @@ void PropertiesWidget::clear() {
shareRatio->clear(); shareRatio->clear();
listWebSeeds->clear(); listWebSeeds->clear();
PropListModel->clear(); PropListModel->clear();
showPieceBars(false);
setEnabled(false); setEnabled(false);
} }
@ -200,6 +210,10 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
setEnabled(true); setEnabled(true);
try { try {
if(!h.is_seed())
showPieceBars(true);
else
showPieceBars(false);
// Save path // Save path
save_path->setText(TorrentPersistentData::getSavePath(h.hash())); save_path->setText(TorrentPersistentData::getSavePath(h.hash()));
// Creation date // Creation date
@ -309,6 +323,7 @@ void PropertiesWidget::loadDynamicData() {
} }
} }
shareRatio->setText(QString(QByteArray::number(ratio, 'f', 1))); shareRatio->setText(QString(QByteArray::number(ratio, 'f', 1)));
if(!h.is_seed()) {
// Downloaded pieces // Downloaded pieces
downloaded_pieces->setProgress(h.pieces()); downloaded_pieces->setProgress(h.pieces());
// Pieces availability // Pieces availability
@ -317,6 +332,7 @@ void PropertiesWidget::loadDynamicData() {
pieces_availability->setAvailability(avail); pieces_availability->setAvailability(avail);
// Progress // Progress
progress_lbl->setText(QString::number(h.progress()*100., 'f', 1)+"%"); progress_lbl->setText(QString::number(h.progress()*100., 'f', 1)+"%");
}
return; return;
} }
if(stackedProperties->currentIndex() == TRACKERS_TAB) { if(stackedProperties->currentIndex() == TRACKERS_TAB) {

View File

@ -95,6 +95,7 @@ protected slots:
void displayFilesListMenu(const QPoint& pos); void displayFilesListMenu(const QPoint& pos);
void on_changeSavePathButton_clicked(); void on_changeSavePathButton_clicked();
void filteredFilesChanged(); void filteredFilesChanged();
void showPieceBars(bool show);
public slots: public slots:
void loadDynamicData(); void loadDynamicData();

View File

@ -116,7 +116,7 @@
<enum>QLayout::SetDefaultConstraint</enum> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
<item> <item>
<widget class="QLabel" name="downloaded_pieces_lbl_2"> <widget class="QLabel" name="avail_pieces_lbl">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>