Browse Source

- Fix and improved torrent comment display

- Made links linkable in torrent comments
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
1b82dd315b
  1. 176
      src/propertiesWidget.ui
  2. 4
      src/propertieswidget.cpp

176
src/propertiesWidget.ui

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>540</width>
<height>305</height>
<height>329</height>
</rect>
</property>
<property name="font">
@ -40,8 +40,11 @@ @@ -40,8 +40,11 @@
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="widgetResizable">
<bool>true</bool>
@ -50,23 +53,17 @@ @@ -50,23 +53,17 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>536</width>
<height>265</height>
<y>-85</y>
<width>518</width>
<height>374</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<layout class="QHBoxLayout" name="ProgressHLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="downloaded_pieces_lbl">
<property name="sizePolicy">
@ -120,6 +117,8 @@ @@ -120,6 +117,8 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
@ -317,52 +316,39 @@ @@ -317,52 +316,39 @@
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>97</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupTorrentInfos">
<property name="title">
<string>Information</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="savePath_lbl">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>19</height>
</size>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Save path:</string>
@ -371,6 +357,12 @@ @@ -371,6 +357,12 @@
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Created on:</string>
</property>
@ -378,6 +370,12 @@ @@ -378,6 +370,12 @@
</item>
<item>
<widget class="QLabel" name="hash_lbl2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Torrent hash:</string>
</property>
@ -388,6 +386,9 @@ @@ -388,6 +386,9 @@
<property name="text">
<string>Comment:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
</layout>
@ -396,11 +397,14 @@ @@ -396,11 +397,14 @@
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="save_path">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">path</string>
</property>
@ -411,7 +415,7 @@ @@ -411,7 +415,7 @@
<property name="maximumSize">
<size>
<width>22</width>
<height>19</height>
<height>15</height>
</size>
</property>
<property name="text">
@ -422,17 +426,61 @@ @@ -422,17 +426,61 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="lbl_creationDate">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">date</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="hash_lbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">hash</string>
</property>
@ -442,28 +490,44 @@ @@ -442,28 +490,44 @@
</widget>
</item>
<item>
<widget class="QLabel" name="comment_lbl">
<property name="text">
<string notr="true">comment</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_4">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>517</width>
<height>20</height>
<width>40</width>
<height>14</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QTextBrowser" name="comment_text">
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:8pt; font-weight:400; font-style:normal;&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;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>

4
src/propertieswidget.cpp

@ -164,7 +164,7 @@ void PropertiesWidget::clear() { @@ -164,7 +164,7 @@ void PropertiesWidget::clear() {
save_path->clear();
lbl_creationDate->clear();
hash_lbl->clear();
comment_lbl->clear();
comment_text->clear();
incrementalDownload->setChecked(false);
trackerList->clear();
progressBar->setProgress(QRealArray());
@ -210,7 +210,7 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) { @@ -210,7 +210,7 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
// Hash
hash_lbl->setText(h.hash());
// Comment
comment_lbl->setText(h.comment());
comment_text->setHtml(h.comment());
// Sequential download
incrementalDownload->setChecked(TorrentPersistentData::isSequentialDownload(h.hash()));
// URL seeds

Loading…
Cancel
Save