// For license of this file, see /LICENSE.md. #include "gui/dialogs/formabout.h" #include "definitions/definitions.h" #include "exceptions/applicationexception.h" #include "gui/guiutilities.h" #include "miscellaneous/iconfactory.h" #include "miscellaneous/settingsproperties.h" #include "miscellaneous/textfactory.h" #include #include FormAbout::FormAbout(QWidget* parent) : QDialog(parent) { m_ui.setupUi(this); m_ui.m_lblIcon->setPixmap(QPixmap(APP_ICON_PATH)); GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("help-about")), tr("About %1").arg(APP_NAME)); loadLicenseAndInformation(); loadSettingsAndPaths(); } FormAbout::~FormAbout() { qDebug() << QSslSocket::sslLibraryVersionString(); } void FormAbout::loadSettingsAndPaths() { if (qApp->settings()->type() == SettingsProperties::Portable) { m_ui.m_txtPathsSettingsType->setText(tr("FULLY portable")); } else { m_ui.m_txtPathsSettingsType->setText(tr("NOT portable")); } m_ui.m_txtPathsDatabaseRoot->setText(QDir::toNativeSeparators(qApp->userDataFolder() + QDir::separator() + QString(APP_DB_SQLITE_PATH))); m_ui.m_txtPathsSettingsFile->setText(QDir::toNativeSeparators(qApp->settings()->fileName())); m_ui.m_txtPathsSkinsRoot->setText(QDir::toNativeSeparators(qApp->skins()->customSkinBaseFolder())); } void FormAbout::loadLicenseAndInformation() { try { m_ui.m_txtLicenseGnu->setText(IOFactory::readFile(APP_INFO_PATH + QL1S("/COPYING_GNU_GPL_HTML"))); } catch (...) { m_ui.m_txtLicenseGnu->setText(tr("License not found.")); } try { m_ui.m_txtLicenseGnu->setText(IOFactory::readFile(APP_INFO_PATH + QL1S("/COPYING_GNU_GPL_HTML"))); } catch (...) { m_ui.m_txtLicenseGnu->setText(tr("License not found.")); } try { m_ui.m_txtChangelog->setText(IOFactory::readFile(APP_INFO_PATH + QL1S("/CHANGELOG"))); } catch (...) { m_ui.m_txtChangelog->setText(tr("Changelog not found.")); } try { m_ui.m_txtLicenseBsd->setText(IOFactory::readFile(APP_INFO_PATH + QL1S("/COPYING_BSD"))); } catch (...) { m_ui.m_txtLicenseBsd->setText(tr("License not found.")); } // Set other informative texts. m_ui.m_lblDesc->setText(tr("%8
" "Version: %1 (built on %2/%3)
" "Revision: %4
" "Build date: %5
" "Qt: %6 (compiled against %7)
").arg( qApp->applicationVersion(), APP_SYSTEM_NAME, APP_SYSTEM_VERSION, APP_REVISION, QLocale().toString(TextFactory::parseDateTime(QString("%1 %2").arg(__DATE__, __TIME__)), QLocale::FormatType::ShortFormat), qVersion(), QT_VERSION_STR, APP_NAME)); m_ui.m_txtInfo->setText(tr("%5 is a (very) tiny feed reader." "

This software is distributed under the terms of GNU General Public License, version 3." "

Contacts:" "
  • %1 ~e-mail
  • " "
  • %2 ~website
" "You can obtain source code for %5 from its website." "


Copyright (C) 2011-%3 %4").arg(APP_EMAIL, APP_URL, QString::number(QDateTime::currentDateTime() .date() .year()), APP_AUTHOR, APP_NAME)); }