From f5b3564392697df5993976106e2ce1101be67bb2 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 21 Dec 2010 17:52:49 +0000 Subject: [PATCH] Fix compilation error introduced in last commit Display pieces size in torrent properties --- src/preferences/advancedsettings.h | 10 +++--- src/preferences/preferences.h | 2 +- src/properties/propertieswidget.cpp | 3 ++ src/properties/propertieswidget.ui | 52 ++++++++++++++++++++++++++--- 4 files changed, 57 insertions(+), 10 deletions(-) diff --git a/src/preferences/advancedsettings.h b/src/preferences/advancedsettings.h index 606912f6b..362fdc61c 100644 --- a/src/preferences/advancedsettings.h +++ b/src/preferences/advancedsettings.h @@ -12,7 +12,7 @@ enum AdvSettingsCols {PROPERTY, VALUE}; enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT, - #if defined(Q_WS_WIN) || define(Q_WS_MAC) + #if defined(Q_WS_WIN) || defined(Q_WS_MAC) UPDATE_CHECK, #endif ROW_COUNT }; @@ -24,7 +24,7 @@ private: QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen, *spin_tracker_port; QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding, *cb_program_notifications, *cb_tracker_status; QComboBox *combo_iface; -#if defined(Q_WS_WIN) || define(Q_WS_MAC) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) QCheckBox *cb_update_check; #endif @@ -61,7 +61,7 @@ public: delete cb_program_notifications; delete spin_tracker_port; delete cb_tracker_status; -#if defined(Q_WS_WIN) || define(Q_WS_MAC) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) delete cb_update_check; #endif } @@ -103,7 +103,7 @@ public slots: // Tracker pref.setTrackerEnabled(cb_tracker_status->isChecked()); pref.setTrackerPort(spin_tracker_port->value()); -#if defined(Q_WS_WIN) || define(Q_WS_MAC) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) pref.setUpdateCheckEnabled(cb_update_check->isChecked()); #endif } @@ -228,7 +228,7 @@ protected slots: spin_tracker_port->setMaximum(65535); spin_tracker_port->setValue(pref.getTrackerPort()); setCellWidget(TRACKER_PORT, VALUE, spin_tracker_port); -#if defined(Q_WS_WIN) || define(Q_WS_MAC) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) setItem(UPDATE_CHECK, PROPERTY, new QTableWidgetItem(tr("Check for software updates"))); cb_update_check = new QCheckBox(); connect(cb_update_check, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged())); diff --git a/src/preferences/preferences.h b/src/preferences/preferences.h index 72e3ea0bb..262cc1bdb 100644 --- a/src/preferences/preferences.h +++ b/src/preferences/preferences.h @@ -978,7 +978,7 @@ public: setValue(QString::fromUtf8("Preferences/Advanced/trackerPort"), port); } -#if defined(Q_WS_WIN) || define(Q_WS_MAC) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) bool isUpdateCheckEnabled() const { return value(QString::fromUtf8("Preferences/Advanced/updateCheck"), true).toBool(); } diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index 92a15bb22..c55441432 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -177,6 +177,7 @@ void PropertiesWidget::clear() { qDebug("Clearing torrent properties"); save_path->clear(); lbl_creationDate->clear(); + pieceSize_lbl->clear(); hash_lbl->clear(); comment_text->clear(); progress_lbl->clear(); @@ -247,6 +248,8 @@ void PropertiesWidget::loadTorrentInfos(const QTorrentHandle &_h) { if(h.has_metadata()) { // Creation date lbl_creationDate->setText(h.creation_date()); + // Pieces size + pieceSize_lbl->setText(misc::friendlyUnit(h.piece_length())); // Comment comment_text->setHtml(h.comment()); // URL seeds diff --git a/src/properties/propertieswidget.ui b/src/properties/propertieswidget.ui index 6fc32091a..10785888f 100644 --- a/src/properties/propertieswidget.ui +++ b/src/properties/propertieswidget.ui @@ -7,7 +7,7 @@ 0 0 540 - 329 + 274 @@ -53,9 +53,9 @@ 0 - 0 + -92 520 - 355 + 377 @@ -497,6 +497,49 @@ + + + Pieces size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 0 + 0 + + + + piece size + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + + 40 + 14 + + + + + + + Comment: @@ -506,7 +549,7 @@ - + @@ -519,6 +562,7 @@ p, li { white-space: pre-wrap; } <tr> <td style="border: none;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> <p style="-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';"></p></td></tr></table></body></html>