Browse Source

refactor: Remove html tags from author block

reviewable/pr3457/r14
Diadlo 9 years ago
parent
commit
db758e29c5
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
  1. 88
      src/widget/form/settings/aboutform.cpp
  2. 2
      src/widget/form/settings/aboutform.h
  3. 33
      src/widget/form/settings/aboutsettings.ui

88
src/widget/form/settings/aboutform.cpp

@ -65,52 +65,60 @@ void AboutForm::replaceVersions() @@ -65,52 +65,60 @@ void AboutForm::replaceVersions()
bodyUI->gitVersion->setText(bodyUI->gitVersion->text().replace("$GIT_VERSION", QString(GIT_VERSION)));
bodyUI->toxCoreVersion->setText(bodyUI->toxCoreVersion->text().replace("$TOXCOREVERSION", TOXCORE_VERSION));
bodyUI->qtVersion->setText(bodyUI->qtVersion->text().replace("$QTVERSION", QT_VERSION_STR));
QString issueBody = QString(
"##### Brief Description\n\n"
"OS: Windows / OS X / Linux (include version and/or distro)\n"
"qTox version: %1\n"
"Commit hash: %2\n"
"toxcore: %3\n"
"Qt: %4\n"
"Hardware: \n\n\n"
"Reproducible: Always / Almost Always / Sometimes"
" / Rarely / Couldn't Reproduce\n\n"
"##### Steps to reproduce\n\n"
"1. \n2. \n3. …\n\n"
"##### Observed Behavior\n\n\n"
"##### Expected Behavior\n\n\n"
"##### Additional Info\n"
"(links, images, etc go here)\n\n"
"----\n\n"
"More information on how to write good bug reports in the wiki: "
"https://github.com/qTox/qTox/wiki/Writing-Useful-Bug-Reports.\n\n"
"Please remove any unnecessary template section before submitting.")
.arg(GIT_DESCRIBE, GIT_VERSION, TOXCORE_VERSION, QT_VERSION_STR);
issueBody.replace("#", "%23").replace(":", "%3A");
bodyUI->knownIssues->setText(
tr("A list of all known issues may be found at our %1 at Github."
" If you discover a bug or security vulnerability within"
" qTox, please %3 according to the guidelines in our %2"
" wiki article.")
.arg(QString::fromUtf8("<a href=\"https://github.com/qTox/qTox/"
"issues\""
" style=\"text-decoration: underline;"
" color:#0000ff;\">%1</a>")
.arg(tr("bug-tracker")))
.arg(QString::fromUtf8("<a href=\"https://github.com/qTox/qTox/"
"wiki/Writing-Useful-Bug-Reports\""
" style=\"text-decoration: underline;"
" color:#0000ff;\">%1</a>")
.arg(tr("Writing Useful Bug Reports")))
.arg(QStringLiteral(
"<a href=\"https://github.com/qTox/qTox/issues"
"/new?body=%23%23%23%23%23+Brief+Description%0A%0AOS"
"%3A+Windows+%2F+OS+X+%2F+Linux+(include+version+and"
"%2For+distro)%0AqTox+version%3A+") +
QStringLiteral(GIT_DESCRIBE) +
QStringLiteral("%0ACommit+hash%3A+") +
QStringLiteral(GIT_VERSION) +
QStringLiteral("%0Atoxcore%3A+") + TOXCORE_VERSION +
QStringLiteral("%0AQt%3A+") +
QStringLiteral(QT_VERSION_STR) +
QStringLiteral("%0AHardware%3A++%0A%E2%80%A6%0A%0A"
"Reproducible%3A+Always+%2F+Almost+Always+"
"%2F+Sometimes+%2F+Rarely+%2F+Couldn%27t+"
"Reproduce%0A%0A%23%23%23%23%23+Steps+to+"
"reproduce%0A%0A1.+%0A2.+%0A3.+%E2%80%A6"
"%0A%0A%23%23%23%23%23+Observed+Behavior"
"%0A%0A%0A%23%23%23%23%23+Expected+Behavior"
"%0A%0A%0A%23%23%23%23%23+Additional+Info"
"%0A(links%2C+images%2C+etc+go+here)%0A%0A"
"----%0A%0AMore+information+on+how+to+"
"write+good+bug+reports+in+the+wiki%3A+"
"https%3A%2F%2Fgithub.com%2FqTox%2FqTox%2F"
"wiki%2FWriting-Useful-Bug-Reports.%0A%0A"
"Please+remove+any+unnecessary+template+"
"section+before+submitting.\""
" style=\"text-decoration: underline;"
" color:#0000ff;\">") + tr("report it") +
QStringLiteral("</a>")
)
.arg(createLink("https://github.com/qTox/qTox/issues",
tr("bug-tracker")))
.arg(createLink("https://github.com/qTox/qTox/wiki/Writing-Useful-Bug-Reports",
tr("Writing Useful Bug Reports")))
.arg(createLink("https://github.com/qTox/qTox/issues/new?body="
+ QUrl(issueBody).toEncoded(),
tr("report it")))
);
QString authorInfo = QString("<p>%1</p><p>%2</p>")
.arg(tr("Original author: %1")
.arg(createLink("https://github.com/tux3", "tux3")))
.arg(tr("See a full list of %1 at Github")
.arg(createLink("https://github.com/qTox/qTox/graphs/contributors",
tr("contributors"))));
bodyUI->authorInfo->setText(authorInfo);
}
QString AboutForm::createLink(QString path, QString text) const
{
return QString::fromUtf8("<a href=\"%1\" style=\"text-decoration: underline; color:#0000ff;\">%2</a>")
.arg(path, text);
}
AboutForm::~AboutForm()

2
src/widget/form/settings/aboutform.h

@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
class Core;
class QTimer;
class QString;
namespace Ui {
class AboutSettings;
@ -50,6 +51,7 @@ private slots: @@ -50,6 +51,7 @@ private slots:
private:
void retranslateUi();
void replaceVersions();
inline QString createLink(QString path, QString text) const;
private:
Ui::AboutSettings* bodyUI;

33
src/widget/form/settings/aboutsettings.ui

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>530</width>
<height>476</height>
<height>553</height>
</rect>
</property>
<property name="sizePolicy">
@ -29,14 +29,14 @@ @@ -29,14 +29,14 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-72</y>
<width>496</width>
<height>648</height>
<y>0</y>
<width>514</width>
<height>537</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1,0,0">
<item>
<widget class="QGroupBox" name="groupBox_3">
<widget class="QGroupBox" name="versioGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -222,12 +222,12 @@ @@ -222,12 +222,12 @@
<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:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:10pt; color:#000000;&quot;&gt;Copyright © 2014-2016 by The qTox Project&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;qTox is a Qt-based graphical interface for Tox.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:10pt;&quot;&gt;qTox is libre software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:10pt;&quot;&gt;qTox is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;You should have received a copy of the GNU General Public License along with this program. If not, see &lt;/span&gt;&lt;a href=&quot;https://www.gnu.org/copyleft/gpl.html&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#007af4;&quot;&gt;https://www.gnu.org/copyleft/gpl.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; color:#000000;&quot;&gt;Copyright © 2014-2016 by The qTox Project&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu';&quot;&gt;qTox is a Qt-based graphical interface for Tox.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;qTox is libre software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;qTox is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu';&quot;&gt;You should have received a copy of the GNU General Public License along with this program. If not, see &lt;/span&gt;&lt;a href=&quot;https://www.gnu.org/copyleft/gpl.html&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; text-decoration: underline; color:#007af4;&quot;&gt;https://www.gnu.org/copyleft/gpl.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Ubuntu';&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="searchPaths">
<stringlist/>
@ -244,7 +244,7 @@ p, li { white-space: pre-wrap; } @@ -244,7 +244,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="authorGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -262,7 +262,7 @@ p, li { white-space: pre-wrap; } @@ -262,7 +262,7 @@ p, li { white-space: pre-wrap; }
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="authorInfo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -275,7 +275,7 @@ p, li { white-space: pre-wrap; } @@ -275,7 +275,7 @@ p, li { white-space: pre-wrap; }
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Original author: &lt;a href=&quot;https://github.com/tux3&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;tux3&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;See a full list of &lt;a href=&quot;https://github.com/qTox/qTox/graphs/contributors&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;contributors&lt;/span&gt;&lt;/a&gt; at Github&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string notr="true">{AUTHOR INFO}</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@ -289,7 +289,7 @@ p, li { white-space: pre-wrap; } @@ -289,7 +289,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<widget class="QGroupBox" name="knowIssuesGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -319,6 +319,9 @@ p, li { white-space: pre-wrap; } @@ -319,6 +319,9 @@ p, li { white-space: pre-wrap; }
<family>Sans Serif</family>
</font>
</property>
<property name="text">
<string notr="true">{KNOWN ISSUES TEXT}</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>

Loading…
Cancel
Save