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 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>540</width> <width>540</width>
<height>305</height> <height>329</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -40,8 +40,11 @@
</property> </property>
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <widget class="QScrollArea" name="scrollArea">
<property name="verticalScrollBarPolicy"> <property name="sizePolicy">
<enum>Qt::ScrollBarAsNeeded</enum> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
@ -50,23 +53,17 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>-85</y>
<width>536</width> <width>518</width>
<height>265</height> <height>374</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_8">
<property name="spacing">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="ProgressHLayout"> <layout class="QHBoxLayout" name="ProgressHLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item> <item>
<widget class="QLabel" name="downloaded_pieces_lbl"> <widget class="QLabel" name="downloaded_pieces_lbl">
<property name="sizePolicy"> <property name="sizePolicy">
@ -120,6 +117,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
@ -317,52 +316,39 @@
</item> </item>
</layout> </layout>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="horizontalSpacer_9">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>97</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupTorrentInfos"> <widget class="QGroupBox" name="groupTorrentInfos">
<property name="title"> <property name="title">
<string>Information</string> <string>Information</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<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>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QLabel" name="savePath_lbl"> <widget class="QLabel" name="savePath_lbl">
<property name="maximumSize"> <property name="sizePolicy">
<size> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<width>16777215</width> <horstretch>0</horstretch>
<height>19</height> <verstretch>0</verstretch>
</size> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Save path:</string> <string>Save path:</string>
@ -371,6 +357,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="label_9"> <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"> <property name="text">
<string>Created on:</string> <string>Created on:</string>
</property> </property>
@ -378,6 +370,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="hash_lbl2"> <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"> <property name="text">
<string>Torrent hash:</string> <string>Torrent hash:</string>
</property> </property>
@ -388,6 +386,9 @@
<property name="text"> <property name="text">
<string>Comment:</string> <string>Comment:</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -396,11 +397,14 @@
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<item> <item>
<widget class="QLabel" name="save_path"> <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"> <property name="text">
<string notr="true">path</string> <string notr="true">path</string>
</property> </property>
@ -411,7 +415,7 @@
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>22</width> <width>22</width>
<height>19</height> <height>15</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
@ -422,17 +426,61 @@
</property> </property>
</widget> </widget>
</item> </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> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QLabel" name="lbl_creationDate"> <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"> <property name="text">
<string notr="true">date</string> <string notr="true">date</string>
</property> </property>
</widget> </widget>
</item> </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> <item>
<widget class="QLabel" name="hash_lbl"> <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"> <property name="text">
<string notr="true">hash</string> <string notr="true">hash</string>
</property> </property>
@ -442,28 +490,44 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="comment_lbl"> <spacer name="horizontalSpacer_7">
<property name="text">
<string notr="true">comment</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>517</width> <width>40</width>
<height>20</height> <height>14</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </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> </widget>
</item> </item>
<item> <item>

4
src/propertieswidget.cpp

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

Loading…
Cancel
Save