Browse Source

Fix compilation error introduced in last commit

Display pieces size in torrent properties
adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
f5b3564392
  1. 10
      src/preferences/advancedsettings.h
  2. 2
      src/preferences/preferences.h
  3. 3
      src/properties/propertieswidget.cpp
  4. 52
      src/properties/propertieswidget.ui

10
src/preferences/advancedsettings.h

@ -12,7 +12,7 @@ @@ -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: @@ -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: @@ -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: @@ -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: @@ -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()));

2
src/preferences/preferences.h

@ -978,7 +978,7 @@ public: @@ -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();
}

3
src/properties/propertieswidget.cpp

@ -177,6 +177,7 @@ void PropertiesWidget::clear() { @@ -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) { @@ -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

52
src/properties/propertieswidget.ui

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>540</width>
<height>329</height>
<height>274</height>
</rect>
</property>
<property name="font">
@ -53,9 +53,9 @@ @@ -53,9 +53,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-92</y>
<width>520</width>
<height>355</height>
<height>377</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -497,6 +497,49 @@ @@ -497,6 +497,49 @@
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Pieces size:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="pieceSize_lbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">piece size</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>14</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="comment_lbl2">
<property name="text">
<string>Comment:</string>
@ -506,7 +549,7 @@ @@ -506,7 +549,7 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QTextBrowser" name="comment_text">
@ -519,6 +562,7 @@ p, li { white-space: pre-wrap; } @@ -519,6 +562,7 @@ p, li { white-space: pre-wrap; }
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-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';&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">

Loading…
Cancel
Save