Browse Source

Merge pull request #3270 from Chocobo1/info_box

Reorder layout in information box
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
14013c80c0
  1. 2
      src/core/utils/misc.cpp
  2. 4
      src/gui/properties/propertieswidget.cpp
  3. 153
      src/gui/properties/propertieswidget.ui

2
src/core/utils/misc.cpp

@ -467,6 +467,8 @@ QString Utils::Misc::parseHtmlLinks(const QString &raw_text)
static QRegExp reNoScheme("<a\\s+href=\"(?!http(s?))([a-zA-Z0-9\\?%=&/_\\.-:#]+)\\s*\">"); static QRegExp reNoScheme("<a\\s+href=\"(?!http(s?))([a-zA-Z0-9\\?%=&/_\\.-:#]+)\\s*\">");
result.replace(reNoScheme, "<a href=\"http://\\1\">"); result.replace(reNoScheme, "<a href=\"http://\\1\">");
// to preserve plain text formatting
result = "<p style=\"white-space: pre-wrap;\">" + result + "</p>";
return result; return result;
} }

4
src/gui/properties/propertieswidget.cpp

@ -280,7 +280,7 @@ void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent
label_total_size_val->setText(Utils::Misc::friendlyUnit(m_torrent->totalSize())); label_total_size_val->setText(Utils::Misc::friendlyUnit(m_torrent->totalSize()));
// Comment // Comment
comment_text->setHtml(Utils::Misc::parseHtmlLinks(m_torrent->comment())); comment_text->setText(Utils::Misc::parseHtmlLinks(m_torrent->comment()));
// URL seeds // URL seeds
loadUrlSeeds(); loadUrlSeeds();
@ -363,7 +363,7 @@ void PropertiesWidget::loadDynamicData() {
lbl_elapsed->setText(elapsed_txt); lbl_elapsed->setText(elapsed_txt);
lbl_connections->setText(QString::number(m_torrent->connectionsCount())); lbl_connections->setText(QString::number(m_torrent->connectionsCount()) + " (" + tr("%1 max", "e.g. 10 max").arg(QString::number(m_torrent->connectionsLimit())) + ")");
label_eta_val->setText(Utils::Misc::userFriendlyDuration(m_torrent->eta())); label_eta_val->setText(Utils::Misc::userFriendlyDuration(m_torrent->eta()));
// Update next announce time // Update next announce time

153
src/gui/properties/propertieswidget.ui

@ -98,6 +98,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading</set> <set>Qt::AlignLeading</set>
</property> </property>
@ -138,7 +141,7 @@
<item> <item>
<widget class="QLabel" name="avail_average_lbl"> <widget class="QLabel" name="avail_average_lbl">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -152,6 +155,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading</set> <set>Qt::AlignLeading</set>
</property> </property>
@ -205,6 +211,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
@ -234,6 +243,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="4"> <item row="0" column="4">
@ -263,6 +275,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
@ -292,6 +307,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
@ -321,6 +339,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item row="1" column="4">
@ -350,6 +371,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
@ -379,6 +403,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="2">
@ -408,6 +435,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="4"> <item row="2" column="4">
@ -437,6 +467,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
@ -466,6 +499,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="3" column="2">
@ -495,6 +531,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="4"> <item row="3" column="4">
@ -524,6 +563,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
@ -553,6 +595,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="4" column="2">
@ -582,6 +627,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="4"> <item row="4" column="4">
@ -611,6 +659,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -655,6 +706,9 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
@ -684,10 +738,13 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="0" column="4">
<widget class="QLabel" name="label_added_on"> <widget class="QLabel" name="label_created_by">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -695,15 +752,15 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Added On:</string> <string>Created By:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="0" column="5">
<widget class="QLabel" name="label_added_on_val"> <widget class="QLabel" name="label_created_by_val">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -713,10 +770,13 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="0">
<widget class="QLabel" name="label_completed_on"> <widget class="QLabel" name="label_added_on">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -724,15 +784,15 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Completed On:</string> <string>Added On:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="1" column="1">
<widget class="QLabel" name="label_completed_on_val"> <widget class="QLabel" name="label_added_on_val">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -742,10 +802,13 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="1" column="2">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_completed_on">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -753,15 +816,15 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Created On:</string> <string>Completed On:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="1" column="3">
<widget class="QLabel" name="lbl_creationDate"> <widget class="QLabel" name="label_completed_on_val">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -771,10 +834,13 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="1" column="4">
<widget class="QLabel" name="label_created_by"> <widget class="QLabel" name="label_9">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -782,15 +848,15 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Created By:</string> <string>Created On:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="1" column="5">
<widget class="QLabel" name="label_created_by_val"> <widget class="QLabel" name="lbl_creationDate">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -800,9 +866,12 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="2" column="0">
<widget class="QLabel" name="hash_lbl2"> <widget class="QLabel" name="hash_lbl2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -818,7 +887,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1" colspan="3"> <item row="2" column="1" colspan="5">
<widget class="QLabel" name="hash_lbl"> <widget class="QLabel" name="hash_lbl">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@ -829,12 +898,15 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="3" column="0">
<widget class="QLabel" name="savePath_lbl"> <widget class="QLabel" name="savePath_lbl">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -846,11 +918,11 @@
<string>Save Path:</string> <string>Save Path:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="3"> <item row="3" column="1" colspan="5">
<widget class="QLabel" name="save_path"> <widget class="QLabel" name="save_path">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@ -861,12 +933,21 @@
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="4" column="0">
<widget class="QLabel" name="comment_lbl2"> <widget class="QLabel" name="comment_lbl2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -882,18 +963,30 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1" colspan="3"> <item row="4" column="1" colspan="5">
<widget class="QTextBrowser" name="comment_text"> <widget class="QLabel" name="comment_text">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks"> <property name="openExternalLinks">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="openLinks"> <property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
<property name="openLinks" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>

Loading…
Cancel
Save