From 4d5512dccad180471eab8b16f50cc79e1183da61 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 21 Jun 2015 13:20:19 +0800 Subject: [PATCH 1/6] Reorder layout in information box --- src/gui/properties/propertieswidget.ui | 74 +++++++++++++------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/gui/properties/propertieswidget.ui b/src/gui/properties/propertieswidget.ui index 59276403d..696e8662b 100644 --- a/src/gui/properties/propertieswidget.ui +++ b/src/gui/properties/propertieswidget.ui @@ -686,6 +686,35 @@ + + + + + 0 + 0 + + + + Created By: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + @@ -744,7 +773,7 @@ - + @@ -760,7 +789,7 @@ - + @@ -773,36 +802,7 @@ - - - - - 0 - 0 - - - - Created By: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - - + @@ -818,7 +818,7 @@ - + @@ -834,7 +834,7 @@ - + @@ -850,7 +850,7 @@ - + @@ -866,7 +866,7 @@ - + @@ -882,7 +882,7 @@ - + From 50b3a243716087daea9f753f68687294812a614c Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 21 Jun 2015 13:44:06 +0800 Subject: [PATCH 2/6] Change Comment field from QTextBrowser to QLabel --- src/gui/properties/propertieswidget.cpp | 2 +- src/gui/properties/propertieswidget.ui | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index d4eab984c..3c19601e7 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/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())); // Comment - comment_text->setHtml(Utils::Misc::parseHtmlLinks(m_torrent->comment())); + comment_text->setText(Utils::Misc::parseHtmlLinks(m_torrent->comment())); // URL seeds loadUrlSeeds(); diff --git a/src/gui/properties/propertieswidget.ui b/src/gui/properties/propertieswidget.ui index 696e8662b..0a001e16c 100644 --- a/src/gui/properties/propertieswidget.ui +++ b/src/gui/properties/propertieswidget.ui @@ -883,17 +883,26 @@ - + 0 0 + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + true - + + Qt::TextBrowserInteraction + + true From 661ddd75b6074be8ac443e257ebd612c4f3fa220 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 22 Jun 2015 13:32:32 +0800 Subject: [PATCH 3/6] Allow wordWrap for "Save Path" & "Comment" --- src/gui/properties/propertieswidget.ui | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/properties/propertieswidget.ui b/src/gui/properties/propertieswidget.ui index 0a001e16c..2434fe685 100644 --- a/src/gui/properties/propertieswidget.ui +++ b/src/gui/properties/propertieswidget.ui @@ -846,7 +846,7 @@ Save Path: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing @@ -861,6 +861,9 @@ + + true + Qt::TextSelectableByMouse @@ -896,6 +899,9 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + true + true From b318f54fdfdafb35fb1757aac02a0f7bd7cb5657 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 22 Jun 2015 13:42:24 +0800 Subject: [PATCH 4/6] Force set "plain text" format to reduce attack vector. --- src/gui/properties/propertieswidget.ui | 80 +++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/src/gui/properties/propertieswidget.ui b/src/gui/properties/propertieswidget.ui index 2434fe685..55e899498 100644 --- a/src/gui/properties/propertieswidget.ui +++ b/src/gui/properties/propertieswidget.ui @@ -98,6 +98,9 @@ + + Qt::PlainText + Qt::AlignLeading @@ -138,7 +141,7 @@ - + 0 0 @@ -152,6 +155,9 @@ + + Qt::PlainText + Qt::AlignLeading @@ -205,6 +211,9 @@ + + Qt::PlainText + @@ -234,6 +243,9 @@ + + Qt::PlainText + @@ -263,6 +275,9 @@ + + Qt::PlainText + @@ -292,6 +307,9 @@ + + Qt::PlainText + @@ -321,6 +339,9 @@ + + Qt::PlainText + @@ -350,6 +371,9 @@ + + Qt::PlainText + @@ -379,6 +403,9 @@ + + Qt::PlainText + @@ -408,6 +435,9 @@ + + Qt::PlainText + @@ -437,6 +467,9 @@ + + Qt::PlainText + @@ -466,6 +499,9 @@ + + Qt::PlainText + @@ -495,6 +531,9 @@ + + Qt::PlainText + @@ -524,6 +563,9 @@ + + Qt::PlainText + @@ -553,6 +595,9 @@ + + Qt::PlainText + @@ -582,6 +627,9 @@ + + Qt::PlainText + @@ -611,6 +659,9 @@ + + Qt::PlainText + @@ -655,6 +706,9 @@ + + Qt::PlainText + @@ -684,6 +738,9 @@ + + Qt::PlainText + @@ -713,6 +770,9 @@ + + Qt::PlainText + @@ -742,6 +802,9 @@ + + Qt::PlainText + @@ -771,6 +834,9 @@ + + Qt::PlainText + @@ -800,6 +866,9 @@ + + Qt::PlainText + @@ -829,6 +898,9 @@ + + Qt::PlainText + Qt::TextSelectableByMouse @@ -861,6 +933,12 @@ + + Qt::PlainText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + true From 9d5cfbcda9ed284af932d5e12df8391a5bd340fb Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 24 Jun 2015 18:49:31 +0800 Subject: [PATCH 5/6] Preserve plain text formatting --- src/core/utils/misc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/utils/misc.cpp b/src/core/utils/misc.cpp index ae4840ae2..fa0df81e4 100644 --- a/src/core/utils/misc.cpp +++ b/src/core/utils/misc.cpp @@ -467,6 +467,8 @@ QString Utils::Misc::parseHtmlLinks(const QString &raw_text) static QRegExp reNoScheme(""); result.replace(reNoScheme, ""); + // to preserve plain text formatting + result = "

" + result + "

"; return result; } From 776d91f663094512a73a0c775e47e8c76b36716f Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 28 Jun 2015 18:15:17 +0800 Subject: [PATCH 6/6] Add connectionsLimit() back --- src/gui/properties/propertieswidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 3c19601e7..1ef29e7f7 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -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