From be1efb9e6527969acf3a5e7125fabddf5768e060 Mon Sep 17 00:00:00 2001 From: David Zero Date: Sat, 20 Jun 2015 03:59:46 -0700 Subject: [PATCH 1/3] Added a proper About page. Closes #1668 The license text was removed from the Advanced section of the settings menu and placed into its own About section. Users can now also discover the commit hash of the build they are running through the UI, instead of having to comb through logs, or use git. --- qtox.pro | 17 +- src/widget/form/settings/aboutform.cpp | 46 ++++ src/widget/form/settings/aboutform.h | 50 ++++ src/widget/form/settings/aboutsettings.ui | 258 +++++++++++++++++++ src/widget/form/settings/advancedsettings.ui | 55 +--- src/widget/form/settingswidget.cpp | 4 +- src/widget/form/settingswidget.h | 2 +- 7 files changed, 370 insertions(+), 62 deletions(-) create mode 100644 src/widget/form/settings/aboutform.cpp create mode 100644 src/widget/form/settings/aboutform.h create mode 100644 src/widget/form/settings/aboutsettings.ui diff --git a/qtox.pro b/qtox.pro index a66e3428d..5670032d2 100644 --- a/qtox.pro +++ b/qtox.pro @@ -23,18 +23,19 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = qtox TEMPLATE = app FORMS += \ + src/android.ui \ + src/loginscreen.ui \ src/mainwindow.ui \ - src/widget/form/settings/generalsettings.ui \ - src/widget/form/settings/avsettings.ui \ - src/widget/form/settings/privacysettings.ui \ + src/chatlog/content/filetransferwidget.ui \ src/widget/form/profileform.ui \ src/widget/form/loadhistorydialog.ui \ src/widget/form/setpassworddialog.ui \ - src/chatlog/content/filetransferwidget.ui \ + src/widget/form/settings/aboutsettings.ui \ src/widget/form/settings/advancedsettings.ui \ - src/android.ui \ - src/loginscreen.ui - + src/widget/form/settings/avsettings.ui \ + src/widget/form/settings/generalsettings.ui \ + src/widget/form/settings/privacysettings.ui + CONFIG += c++11 QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti @@ -324,6 +325,7 @@ contains(ENABLE_SYSTRAY_GTK_BACKEND, NO) { src/chatlog/chatmessage.h \ src/chatlog/content/image.h \ src/chatlog/customtextdocument.h \ + src/widget/form/settings/aboutform.h \ src/widget/form/settings/advancedform.h \ src/chatlog/content/notificationicon.h \ src/chatlog/content/timestamp.h \ @@ -413,6 +415,7 @@ contains(ENABLE_SYSTRAY_GTK_BACKEND, NO) { src/chatlog/chatmessage.cpp \ src/chatlog/content/image.cpp \ src/chatlog/customtextdocument.cpp\ + src/widget/form/settings/aboutform.cpp \ src/widget/form/settings/advancedform.cpp \ src/chatlog/content/notificationicon.cpp \ src/chatlog/content/timestamp.cpp \ diff --git a/src/widget/form/settings/aboutform.cpp b/src/widget/form/settings/aboutform.cpp new file mode 100644 index 000000000..ddfab18e2 --- /dev/null +++ b/src/widget/form/settings/aboutform.cpp @@ -0,0 +1,46 @@ +/* + Copyright © 2014-2015 by The qTox Project + + This file is part of qTox, a Qt-based graphical interface for Tox. + + 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. + + 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. + + You should have received a copy of the GNU General Public License + along with qTox. If not, see . +*/ + +#include "ui_aboutsettings.h" + +#include "aboutform.h" +#include "src/widget/translator.h" + +AboutForm::AboutForm() : + GenericForm(QPixmap(":/img/settings/general.png")) +{ + bodyUI = new Ui::AboutSettings; + bodyUI->setupUi(this); + //to-do: when we finally have stable releases: build-in a way to tell + //nightly builds from stable releases. + bodyUI->label_4->setText(bodyUI->label_4->text().replace("GIT_VERSION", QString(GIT_VERSION))); + + Translator::registerHandler(std::bind(&AboutForm::retranslateUi, this), this); +} + +AboutForm::~AboutForm() +{ + Translator::unregister(this); + delete bodyUI; +} + +void AboutForm::retranslateUi() +{ + bodyUI->retranslateUi(this); +} diff --git a/src/widget/form/settings/aboutform.h b/src/widget/form/settings/aboutform.h new file mode 100644 index 000000000..1a3e78822 --- /dev/null +++ b/src/widget/form/settings/aboutform.h @@ -0,0 +1,50 @@ +/* + Copyright © 2014-2015 by The qTox Project + + This file is part of qTox, a Qt-based graphical interface for Tox. + + 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. + + 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. + + You should have received a copy of the GNU General Public License + along with qTox. If not, see . +*/ + +#ifndef ABOUTFORM_H +#define ABOUTFORM_H + +#include "genericsettings.h" + +class Core; + +namespace Ui { +class AboutSettings; +} + +class AboutForm final : public GenericForm +{ + Q_OBJECT +public: + AboutForm(); + ~AboutForm(); + virtual QString getFormName() final override {return tr("About");} + +protected: + +private slots: + +private: + void retranslateUi(); + +private: + Ui::AboutSettings* bodyUI; +}; + +#endif // ABOUTFORM_H diff --git a/src/widget/form/settings/aboutsettings.ui b/src/widget/form/settings/aboutsettings.ui new file mode 100644 index 000000000..787c9c0bf --- /dev/null +++ b/src/widget/form/settings/aboutsettings.ui @@ -0,0 +1,258 @@ + + + AboutSettings + + + + 0 + 0 + 530 + 476 + + + + + 0 + 0 + + + + Form + + + + + + true + + + + + 0 + 0 + 492 + 508 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Version + + + + + + + 0 + 0 + + + + + Sans Serif + + + + QFrame::NoFrame + + + <html><head/><body><p>You are using a qTox nightly build.</p><p>Commit hash: <a href="https://github.com/tux3/qTox/commit/GIT_VERSION"><span style=" text-decoration: underline; color:#0000ff;">GIT_VERSION</span></a></p></body></html> + + + -1 + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + 0 + 1 + + + + License + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Qt::NoFocus + + + Qt::NoContextMenu + + + Qt::LeftToRight + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; color:#000000;">Copyright © 2014-2015 by The qTox Project</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;">qTox is a Qt-based graphical interface for Tox.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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. </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;">You should have received a copy of the GNU General Public License along with this program. If not, see </span><a href="https://www.gnu.org/copyleft/gpl.html"><span style=" font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#007af4;">https://www.gnu.org/copyleft/gpl.html</span></a><span style=" font-family:'Ubuntu'; font-size:10pt;">.</span></p></body></html> + + + + + + true + + + true + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Authors + + + + + + + 0 + 0 + + + + + Sans Serif + + + + <html><head/><body><p>Original author: <a href="https://github.com/tux3"><span style=" text-decoration: underline; color:#0000ff;">tux3</span></a></p><p>See a full list of <a href="https://github.com/tux3/qTox/graphs/contributors"><span style=" text-decoration: underline; color:#0000ff;">contributors</span></a> at Github</p></body></html> + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Known Issues + + + + + + + 0 + 0 + + + + + Sans Serif + + + + <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 the <a href="https://github.com/textmate/textmate/wiki/Writing-Bug-Reports"><span style=" text-decoration: underline; color:#0000ff;">textmate/textmate</span></a> repository on Github.</p></body></html> + + + true + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + + + + + VerticalOnlyScroller + QScrollArea +
src/widget/form/settings/verticalonlyscroller.h
+ 1 +
+
+ + +
diff --git a/src/widget/form/settings/advancedsettings.ui b/src/widget/form/settings/advancedsettings.ui index b71e4e53f..fe50a8603 100644 --- a/src/widget/form/settings/advancedsettings.ui +++ b/src/widget/form/settings/advancedsettings.ui @@ -24,8 +24,8 @@ 0 0 - 384 - 510 + 396 + 454 @@ -95,57 +95,6 @@ - - - - - 0 - 0 - - - - License - - - - - - Qt::NoFocus - - - Qt::NoContextMenu - - - Qt::LeftToRight - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; color:#000000;">Copyright © 2014-2015 by The qTox Project</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;">qTox is a Qt-based graphical interface for Tox.</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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.</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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. </span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;">You should have received a copy of the GNU General Public License along with this program. If not, see </span><a href="https://www.gnu.org/copyleft/gpl.html"><span style=" font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#007af4;">https://www.gnu.org/copyleft/gpl.html</span></a><span style=" font-family:'Ubuntu'; font-size:10pt;">.</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;">Author: </span><a href="https://github.com/tux3"><span style=" font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#007af4;">tux3</span></a></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;">Contributors: </span><a href="https://github.com/tux3/qTox/graphs/contributors"><span style=" font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#007af4;">see all on GitHub.com</span></a></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;">Known issues: </span><a href="https://github.com/tux3/qTox/issues"><span style=" font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#007af4;">see all on GitHub.com</span></a></p></body></html> - - - - - - true - - - true - - - - - - diff --git a/src/widget/form/settingswidget.cpp b/src/widget/form/settingswidget.cpp index e9089901c..756f07e71 100644 --- a/src/widget/form/settingswidget.cpp +++ b/src/widget/form/settingswidget.cpp @@ -25,6 +25,7 @@ #include "src/widget/form/settings/privacyform.h" #include "src/widget/form/settings/avform.h" #include "src/widget/form/settings/advancedform.h" +#include "src/widget/form/settings/aboutform.h" #include "src/widget/translator.h" #include @@ -58,8 +59,9 @@ SettingsWidget::SettingsWidget(QWidget* parent) PrivacyForm* pfrm = new PrivacyForm; AVForm* avfrm = new AVForm; AdvancedForm *expfrm = new AdvancedForm; + AboutForm *abtfrm = new AboutForm; - cfgForms = {{ gfrm, pfrm, avfrm, expfrm }}; + cfgForms = {{ gfrm, pfrm, avfrm, expfrm, abtfrm }}; for (GenericForm* cfgForm : cfgForms) settingsWidgets->addTab(cfgForm, cfgForm->getFormIcon(), cfgForm->getFormName()); diff --git a/src/widget/form/settingswidget.h b/src/widget/form/settingswidget.h index f13676049..f1d7e14e3 100644 --- a/src/widget/form/settingswidget.h +++ b/src/widget/form/settingswidget.h @@ -60,7 +60,7 @@ private: QWidget *head, *body; QTabWidget *settingsWidgets; QLabel *nameLabel, *imgLabel; - std::array cfgForms; + std::array cfgForms; int currentIndex; }; From 369cbc32582705ceda92b649495e8c5ec622ce6f Mon Sep 17 00:00:00 2001 From: David Zero Date: Sat, 20 Jun 2015 23:29:52 -0700 Subject: [PATCH 2/3] Updated link to bug report guidelines The link now points to the "Writing Useful Bug Reports" article on our wiki --- src/widget/form/settings/aboutsettings.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/form/settings/aboutsettings.ui b/src/widget/form/settings/aboutsettings.ui index 787c9c0bf..73936bbbf 100644 --- a/src/widget/form/settings/aboutsettings.ui +++ b/src/widget/form/settings/aboutsettings.ui @@ -29,7 +29,7 @@ 0 - 0 + -54 492 508 @@ -223,7 +223,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 the <a href="https://github.com/textmate/textmate/wiki/Writing-Bug-Reports"><span style=" text-decoration: underline; color:#0000ff;">textmate/textmate</span></a> repository on Github.</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 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> true From ed1010ab0a22ec42198b797e62add54a4b73a9b4 Mon Sep 17 00:00:00 2001 From: David Zero Date: Mon, 22 Jun 2015 01:03:38 -0700 Subject: [PATCH 3/3] Fixed commit hash translation issue The commit hash is now correctly displayed after switching languages --- src/widget/form/settings/aboutform.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget/form/settings/aboutform.cpp b/src/widget/form/settings/aboutform.cpp index ddfab18e2..cc65a6e21 100644 --- a/src/widget/form/settings/aboutform.cpp +++ b/src/widget/form/settings/aboutform.cpp @@ -43,4 +43,5 @@ AboutForm::~AboutForm() void AboutForm::retranslateUi() { bodyUI->retranslateUi(this); + bodyUI->label_4->setText(bodyUI->label_4->text().replace("GIT_VERSION", QString(GIT_VERSION))); }