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. 578
      src/propertiesWidget.ui
  2. 4
      src/propertieswidget.cpp

578
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">
@ -121,248 +118,237 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="title"> <item>
<string>Transfer</string> <widget class="QGroupBox" name="groupBox">
</property> <property name="title">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <string>Transfer</string>
<property name="leftMargin"> </property>
<number>3</number> <layout class="QHBoxLayout" name="horizontalLayout_3">
</property> <property name="leftMargin">
<property name="rightMargin"> <number>3</number>
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<layout class="QVBoxLayout" name="_4">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property> </property>
<item> <property name="rightMargin">
<widget class="QLabel" name="label_5"> <number>3</number>
<property name="text">
<string>Uploaded:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Downloaded:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Wasted:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="_5">
<item>
<widget class="QLabel" name="upTotal">
<property name="text">
<string notr="true">0 Kb</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dlTotal">
<property name="text">
<string notr="true">0 Kb</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="wasted">
<property name="text">
<string notr="true">0 kb</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="bottomMargin">
<size> <number>3</number>
<width>97</width>
<height>20</height>
</size>
</property> </property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>UP limit:</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label_2"> <layout class="QVBoxLayout" name="_4">
<property name="text"> <property name="spacing">
<string>DL limit:</string> <number>6</number>
</property> </property>
</widget> <property name="margin">
</item> <number>0</number>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Time elapsed:</string>
</property> </property>
</widget> <item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Uploaded:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Downloaded:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Wasted:</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
<widget class="QLabel" name="lbl_uplimit"> <layout class="QVBoxLayout" name="_5">
<property name="text"> <item>
<string notr="true">∞</string> <widget class="QLabel" name="upTotal">
</property> <property name="text">
</widget> <string notr="true">0 Kb</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dlTotal">
<property name="text">
<string notr="true">0 Kb</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="wasted">
<property name="text">
<string notr="true">0 kb</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="lbl_dllimit"> <spacer name="horizontalSpacer_2">
<property name="text"> <property name="orientation">
<string notr="true">∞</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
<item> <width>97</width>
<widget class="QLabel" name="lbl_elapsed"> <height>20</height>
<property name="text"> </size>
<string notr="true">∞</string>
</property> </property>
</widget> </spacer>
</item> </item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>98</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item> <item>
<widget class="QLabel" name="lbl_ratio"> <layout class="QVBoxLayout" name="verticalLayout_4">
<property name="text"> <item>
<string>Share ratio:</string> <widget class="QLabel" name="label">
</property> <property name="text">
</widget> <string>UP limit:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>DL limit:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Time elapsed:</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_4"> <layout class="QVBoxLayout" name="verticalLayout_6">
<property name="text"> <item>
<string>Connections:</string> <widget class="QLabel" name="lbl_uplimit">
</property> <property name="text">
</widget> <string notr="true">∞</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_dllimit">
<property name="text">
<string notr="true">∞</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_elapsed">
<property name="text">
<string notr="true">∞</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_10"> <spacer name="horizontalSpacer_5">
<property name="text"> <property name="orientation">
<string notr="true"/> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
</layout> <width>98</width>
</item> <height>20</height>
<item> </size>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QLabel" name="shareRatio">
<property name="text">
<string notr="true">1.0</string>
</property> </property>
</widget> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="lbl_connections"> <layout class="QVBoxLayout" name="verticalLayout_12">
<property name="text"> <item>
<string notr="true">0</string> <widget class="QLabel" name="lbl_ratio">
</property> <property name="text">
</widget> <string>Share ratio:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Connections:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_11"> <layout class="QVBoxLayout" name="verticalLayout_11">
<property name="text"> <item>
<string notr="true"/> <widget class="QLabel" name="shareRatio">
</property> <property name="text">
</widget> <string notr="true">1.0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_connections">
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </widget>
<item> </item>
<spacer name="horizontalSpacer_3"> <item>
<property name="orientation"> <spacer name="horizontalSpacer_9">
<enum>Qt::Horizontal</enum> <property name="orientation">
</property> <enum>Qt::Horizontal</enum>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="sizeHint" stdset="0">
<width>97</width> <size>
<height>20</height> <width>40</width>
</size> <height>20</height>
</property> </size>
</spacer> </property>
</item> </spacer>
</layout> </item>
</widget> </layout>
</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,47 +426,107 @@
</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> <item>
<widget class="QLabel" name="lbl_creationDate"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="text"> <item>
<string notr="true">date</string> <widget class="QLabel" name="lbl_creationDate">
</property> <property name="sizePolicy">
</widget> <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>
<item> <item>
<widget class="QLabel" name="hash_lbl"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="text"> <item>
<string notr="true">hash</string> <widget class="QLabel" name="hash_lbl">
</property> <property name="sizePolicy">
<property name="textInteractionFlags"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
</widget> </sizepolicy>
</property>
<property name="text">
<string notr="true">hash</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<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>
<item> <item>
<widget class="QLabel" name="comment_lbl"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="text"> <item>
<string notr="true">comment</string> <widget class="QTextBrowser" name="comment_text">
</property> <property name="html">
</widget> <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> </item>
</layout> </layout>
</item> </item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>517</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</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