diff options
Diffstat (limited to 'Swift/QtUI/QtAboutWidget.cpp')
| -rw-r--r-- | Swift/QtUI/QtAboutWidget.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/Swift/QtUI/QtAboutWidget.cpp b/Swift/QtUI/QtAboutWidget.cpp index 3de95f4..7145384 100644 --- a/Swift/QtUI/QtAboutWidget.cpp +++ b/Swift/QtUI/QtAboutWidget.cpp | |||
| @@ -1,22 +1,24 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010 Isode Limited. | 2 | * Copyright (c) 2010-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include "Swift/QtUI/QtAboutWidget.h" | 7 | #include <Swift/QtUI/QtAboutWidget.h> |
| 8 | 8 | ||
| 9 | #include <QCoreApplication> | 9 | #include <QCoreApplication> |
| 10 | #include <QFile> | ||
| 10 | #include <QIcon> | 11 | #include <QIcon> |
| 11 | #include <QLabel> | 12 | #include <QLabel> |
| 12 | #include <QVBoxLayout> | ||
| 13 | #include <QtGlobal> | ||
| 14 | #include <QPushButton> | 13 | #include <QPushButton> |
| 15 | #include <QTextEdit> | 14 | #include <QTextEdit> |
| 16 | #include <QFile> | ||
| 17 | #include <QTextStream> | 15 | #include <QTextStream> |
| 16 | #include <QVBoxLayout> | ||
| 17 | #include <QtGlobal> | ||
| 18 | |||
| 19 | #include <Swiften/Base/Platform.h> | ||
| 18 | 20 | ||
| 19 | namespace Swift { | 21 | namespace Swift { |
| 20 | 22 | ||
| 21 | QtAboutWidget::QtAboutWidget() : QDialog() { | 23 | QtAboutWidget::QtAboutWidget() : QDialog() { |
| 22 | #ifndef Q_OS_MAC | 24 | #ifndef Q_OS_MAC |
| @@ -48,15 +50,30 @@ QtAboutWidget::QtAboutWidget() : QDialog() { | |||
| 48 | 50 | ||
| 49 | if (QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR") != "TRANSLATION_AUTHOR") { | 51 | if (QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR") != "TRANSLATION_AUTHOR") { |
| 50 | mainLayout->addWidget(new QLabel(QString("<center><font size='-1'>") + QString(tr("Using the English translation by\n%1")).arg(QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR")).replace("\n", "<br/>") + "</font></center>", this)); | 52 | mainLayout->addWidget(new QLabel(QString("<center><font size='-1'>") + QString(tr("Using the English translation by\n%1")).arg(QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR")).replace("\n", "<br/>") + "</font></center>", this)); |
| 51 | } | 53 | } |
| 52 | QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_LICENSE", "This string contains the license under which this translation is licensed. We ask you to license the translation under the BSD license. Please read http://www.opensource.org/licenses/bsd-license.php, and if you agree to release your translation under this license, use the following (untranslated) text: 'This translation is licensed under the BSD License. See http://www.opensource.org/licenses/bsd-license.php'"); | 54 | QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_LICENSE", "This string contains the license under which this translation is licensed. We ask you to license the translation under the BSD license. Please read http://www.opensource.org/licenses/bsd-license.php, and if you agree to release your translation under this license, use the following (untranslated) text: 'This translation is licensed under the BSD License. See http://www.opensource.org/licenses/bsd-license.php'"); |
| 53 | 55 | #if defined(SWIFTEN_PLATFORM_WINDOWS) || defined(SWIFTEN_PLATFORM_MACOSX) | |
| 54 | QPushButton* licenseButton = new QPushButton(tr("View License"), this); | 56 | QPushButton* licenseButton = new QPushButton(tr("View License"), this); |
| 55 | mainLayout->addWidget(licenseButton); | 57 | mainLayout->addWidget(licenseButton); |
| 56 | connect(licenseButton, SIGNAL(clicked()), this, SLOT(handleLicenseClicked())); | 58 | connect(licenseButton, SIGNAL(clicked()), this, SLOT(handleLicenseClicked())); |
| 59 | #else | ||
| 60 | // Some Linux desktops have dialog window decorations without close window buttons. | ||
| 61 | // This code adds a dedicated button to close the about window dialog. | ||
| 62 | QHBoxLayout* buttonLayout = new QHBoxLayout(); | ||
| 63 | mainLayout->addLayout(buttonLayout); | ||
| 64 | |||
| 65 | QPushButton* licenseButton = new QPushButton(tr("View License"), this); | ||
| 66 | buttonLayout->addWidget(licenseButton); | ||
| 67 | connect(licenseButton, SIGNAL(clicked()), this, SLOT(handleLicenseClicked())); | ||
| 68 | |||
| 69 | buttonLayout->addItem(new QSpacerItem(20,20)); | ||
| 57 | 70 | ||
| 71 | QPushButton* closeButton = new QPushButton(tr("Close"), this); | ||
| 72 | buttonLayout->addWidget(closeButton); | ||
| 73 | connect(closeButton, SIGNAL(clicked()), this, SLOT(accept())); | ||
| 74 | #endif | ||
| 58 | setFixedSize(minimumSizeHint()); | 75 | setFixedSize(minimumSizeHint()); |
| 59 | } | 76 | } |
| 60 | 77 | ||
| 61 | void QtAboutWidget::handleLicenseClicked() { | 78 | void QtAboutWidget::handleLicenseClicked() { |
| 62 | QTextEdit* text = new QTextEdit(); | 79 | QTextEdit* text = new QTextEdit(); |
Swift