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) @@ -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*\">");
result.replace(reNoScheme, "<a href=\"http://\\1\">");
// to preserve plain text formatting
result = "<p style=\"white-space: pre-wrap;\">" + result + "</p>";
return result;
}

4
src/gui/properties/propertieswidget.cpp

@ -280,7 +280,7 @@ void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent @@ -280,7 +280,7 @@ void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent
label_total_size_val->setText(Utils::Misc::friendlyUnit(m_torrent->totalSize()));
// Comment
comment_text->setHtml(Utils::Misc::parseHtmlLinks(m_torrent->comment()));
comment_text->setText(Utils::Misc::parseHtmlLinks(m_torrent->comment()));
// URL seeds
loadUrlSeeds();
@ -363,7 +363,7 @@ void PropertiesWidget::loadDynamicData() { @@ -363,7 +363,7 @@ void PropertiesWidget::loadDynamicData() {
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()));
// Update next announce time

153
src/gui/properties/propertieswidget.ui

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

Loading…
Cancel
Save