From 8e270dad67b51c9a3aade532efc448d0aff48294 Mon Sep 17 00:00:00 2001 From: kehugter Date: Mon, 29 Feb 2016 14:31:35 +0100 Subject: [PATCH 1/2] Add direct link with template for submitting new issues Add direct link for submitting new issues in the Settings -> About widget. Use a prefilled template with the information listed in CONTRIBUTING.md. --- src/widget/form/settings/aboutform.cpp | 15 +++++++++------ src/widget/form/settings/aboutsettings.ui | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/widget/form/settings/aboutform.cpp b/src/widget/form/settings/aboutform.cpp index c50831f34..7ecea8840 100644 --- a/src/widget/form/settings/aboutform.cpp +++ b/src/widget/form/settings/aboutform.cpp @@ -49,14 +49,17 @@ AboutForm::AboutForm() : //nightly builds from stable releases. void AboutForm::replaceVersions() { + QString toxcoreVersionString = QString::number(TOX_VERSION_MAJOR) + "." + + QString::number(TOX_VERSION_MINOR) + "." + + QString::number(TOX_VERSION_PATCH); bodyUI->youareusing->setText(bodyUI->youareusing->text().replace("$GIT_DESCRIBE", QString(GIT_DESCRIBE))); bodyUI->gitVersion->setText(bodyUI->gitVersion->text().replace("$GIT_VERSION", QString(GIT_VERSION))); - bodyUI->toxCoreVersion->setText( - bodyUI->toxCoreVersion->text().replace("$TOXCOREVERSION", - QString::number(TOX_VERSION_MAJOR) + "." + - QString::number(TOX_VERSION_MINOR) + "." + - QString::number(TOX_VERSION_PATCH))); - bodyUI->qtVersion->setText(tr("Qt version:") + " " + QT_VERSION_STR); + bodyUI->toxCoreVersion->setText(bodyUI->toxCoreVersion->text().replace("$TOXCOREVERSION", toxcoreVersionString)); + bodyUI->qtVersion->setText(bodyUI->qtVersion->text().replace("$QTVERSION", QT_VERSION_STR)); + bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$GIT_DESCRIBE", QString(GIT_DESCRIBE))); + bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$GIT_VERSION", QString(GIT_VERSION))); + bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$TOXCOREVERSION", toxcoreVersionString)); + bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$QTVERSION", QT_VERSION_STR)); } AboutForm::~AboutForm() diff --git a/src/widget/form/settings/aboutsettings.ui b/src/widget/form/settings/aboutsettings.ui index fde64a4af..ddd68d5ee 100644 --- a/src/widget/form/settings/aboutsettings.ui +++ b/src/widget/form/settings/aboutsettings.ui @@ -85,7 +85,7 @@ - Qt version: + Qt version: $QTVERSION Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse @@ -307,7 +307,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -320,7 +320,7 @@ p, li { white-space: pre-wrap; } - <html><head/><body><p>A list of all known issues may be found at our <a href="https://github.com/tux3/qTox/issues"><span style=" text-decoration: underline; color:#0000ff;">bug-tracker</span></a> at Github. If you discover a bug or security vulnerability within qTox, please report it according to the guidelines in our <a href="https://github.com/tux3/qTox/wiki/Writing-Useful-Bug-Reports"><span style=" text-decoration: underline; color:#0000ff;">Writing Useful Bug Reports</span></a> wiki article.</p></body></html> + <html><head/><body><p>A list of all known issues may be found at our <a href="https://github.com/tux3/qTox/issues"><span style=" text-decoration: underline; color:#0000ff;">bug-tracker</span></a> at Github. If you discover a bug or security vulnerability within qTox, please <a href="https://github.com/tux3/qTox/issues/new?body=%0A%0A%0A%0A---%0A%0AqTox:+$GIT_DESCRIBE%0ACommit+hash:+$GIT_VERSION%0Atoxcore:+$TOXCOREVERSION%0AQt:+$QTVERSION%0AOS+version:"><span style=" text-decoration: underline; color:#0000ff;">report it</span></a> according to the guidelines in our <a href="https://github.com/tux3/qTox/wiki/Writing-Useful-Bug-Reports"><span style=" text-decoration: underline; color:#0000ff;">Writing Useful Bug Reports</span></a> wiki article.</p></body></html> true From d121bd839b1ca36f201b79a9ce9cef3a78ce72e0 Mon Sep 17 00:00:00 2001 From: kehugter Date: Fri, 1 Apr 2016 09:47:47 +0200 Subject: [PATCH 2/2] refractor: abstract HTML out of `new issue` GitHub link Put only translatable text inside of tr() calls. This prevents HTML changes to require a new translation for the whole string. --- src/widget/form/settings/aboutform.cpp | 42 +++++++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/widget/form/settings/aboutform.cpp b/src/widget/form/settings/aboutform.cpp index 7ecea8840..9344ecf9b 100644 --- a/src/widget/form/settings/aboutform.cpp +++ b/src/widget/form/settings/aboutform.cpp @@ -49,17 +49,43 @@ AboutForm::AboutForm() : //nightly builds from stable releases. void AboutForm::replaceVersions() { - QString toxcoreVersionString = QString::number(TOX_VERSION_MAJOR) + "." + - QString::number(TOX_VERSION_MINOR) + "." + - QString::number(TOX_VERSION_PATCH); + QString TOXCORE_VERSION = QString::number(TOX_VERSION_MAJOR) + "." + + QString::number(TOX_VERSION_MINOR) + "." + + QString::number(TOX_VERSION_PATCH); bodyUI->youareusing->setText(bodyUI->youareusing->text().replace("$GIT_DESCRIBE", QString(GIT_DESCRIBE))); bodyUI->gitVersion->setText(bodyUI->gitVersion->text().replace("$GIT_VERSION", QString(GIT_VERSION))); - bodyUI->toxCoreVersion->setText(bodyUI->toxCoreVersion->text().replace("$TOXCOREVERSION", toxcoreVersionString)); + bodyUI->toxCoreVersion->setText(bodyUI->toxCoreVersion->text().replace("$TOXCOREVERSION", TOXCORE_VERSION)); bodyUI->qtVersion->setText(bodyUI->qtVersion->text().replace("$QTVERSION", QT_VERSION_STR)); - bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$GIT_DESCRIBE", QString(GIT_DESCRIBE))); - bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$GIT_VERSION", QString(GIT_VERSION))); - bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$TOXCOREVERSION", toxcoreVersionString)); - bodyUI->knownIssues->setText(bodyUI->knownIssues->text().replace("$QTVERSION", QT_VERSION_STR)); + 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("%1") + .arg(tr("bug-tracker"))) + .arg(QString::fromUtf8("%1") + .arg(tr("Writing Useful Bug Reports"))) + .arg(QString::fromUtf8("%8") + .arg( + QString("%0"), + QString("%2"), + QString("%3"), + QString(GIT_DESCRIBE), + QString(GIT_VERSION), + QString(TOXCORE_VERSION), + QString(QT_VERSION_STR), + tr("report it"))) + ); } AboutForm::~AboutForm()