Commit 9a69a05f authored by Eike Ziller's avatar Eike Ziller

Core: Allow adding additional information to about dialog.

Purpose is to get rid of hard coded license information string in the Qt
Creator binary.

Change-Id: I867e2aed010f8a622adfbb89ac96dccbc8229161
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 525c33f9
...@@ -572,6 +572,16 @@ void ICore::saveSettings() ...@@ -572,6 +572,16 @@ void ICore::saveSettings()
ICore::settings(QSettings::UserScope)->sync(); ICore::settings(QSettings::UserScope)->sync();
} }
QStringList ICore::additionalAboutInformation()
{
return m_mainwindow->additionalAboutInformation();
}
void ICore::appendAboutInformation(const QString &line)
{
m_mainwindow->appendAboutInformation(line);
}
void ICore::validateNewItemDialogIsRunning() void ICore::validateNewItemDialogIsRunning()
{ {
static bool wasRunning = false; static bool wasRunning = false;
......
...@@ -146,6 +146,11 @@ signals: ...@@ -146,6 +146,11 @@ signals:
void contextChanged(const Core::Context &context); void contextChanged(const Core::Context &context);
void themeChanged(); void themeChanged();
public:
/* internal use */
static QStringList additionalAboutInformation();
static void appendAboutInformation(const QString &line);
private: private:
static void validateNewItemDialogIsRunning(); static void validateNewItemDialogIsRunning();
static void newItemDialogOpened(); static void newItemDialogOpened();
......
...@@ -239,6 +239,16 @@ void MainWindow::setOverrideColor(const QColor &color) ...@@ -239,6 +239,16 @@ void MainWindow::setOverrideColor(const QColor &color)
m_overrideColor = color; m_overrideColor = color;
} }
QStringList MainWindow::additionalAboutInformation() const
{
return m_aboutInformation;
}
void MainWindow::appendAboutInformation(const QString &line)
{
m_aboutInformation.append(line);
}
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
// explicitly delete window support, because that calls methods from ICore that call methods // explicitly delete window support, because that calls methods from ICore that call methods
......
...@@ -110,6 +110,9 @@ public: ...@@ -110,6 +110,9 @@ public:
void setOverrideColor(const QColor &color); void setOverrideColor(const QColor &color);
QStringList additionalAboutInformation() const;
void appendAboutInformation(const QString &line);
signals: signals:
void newItemDialogRunningChanged(); void newItemDialogRunningChanged();
...@@ -152,6 +155,7 @@ private: ...@@ -152,6 +155,7 @@ private:
void writeSettings(); void writeSettings();
ICore *m_coreImpl; ICore *m_coreImpl;
QStringList m_aboutInformation;
Context m_highPrioAdditionalContexts; Context m_highPrioAdditionalContexts;
Context m_lowPrioAdditionalContexts; Context m_lowPrioAdditionalContexts;
SettingsDatabase *m_settingsDatabase; SettingsDatabase *m_settingsDatabase;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <app/app_version.h> #include <app/app_version.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/algorithm.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
...@@ -68,14 +69,19 @@ VersionDialog::VersionDialog(QWidget *parent) ...@@ -68,14 +69,19 @@ VersionDialog::VersionDialog(QWidget *parent)
buildDateInfo = tr("<br/>Built on %1 %2<br/>").arg(QLatin1String(__DATE__), QLatin1String(__TIME__)); buildDateInfo = tr("<br/>Built on %1 %2<br/>").arg(QLatin1String(__DATE__), QLatin1String(__TIME__));
#endif #endif
const QString br = QLatin1String("<br/>");
const QStringList additionalInfoLines = ICore::additionalAboutInformation();
const QString additionalInfo = Utils::transform(additionalInfoLines, &QString::toHtmlEscaped)
.join(br);
const QString description = tr( const QString description = tr(
"<h3>%1</h3>" "<h3>%1</h3>"
"%2<br/>" "%2<br/>"
"%3" "%3"
"%4" "%4"
"%5"
"<br/>" "<br/>"
"Copyright 2008-%5 %6. All rights reserved.<br/>" "Copyright 2008-%6 %7. All rights reserved.<br/>"
"<br/>" "<br/>"
"The program is provided AS IS with NO WARRANTY OF ANY KIND, " "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
...@@ -84,6 +90,7 @@ VersionDialog::VersionDialog(QWidget *parent) ...@@ -84,6 +90,7 @@ VersionDialog::VersionDialog(QWidget *parent)
ICore::buildCompatibilityString(), ICore::buildCompatibilityString(),
buildDateInfo, buildDateInfo,
ideRev, ideRev,
additionalInfo.isEmpty() ? QString() : br + additionalInfo + br,
QLatin1String(Constants::IDE_YEAR), QLatin1String(Constants::IDE_YEAR),
QLatin1String(Constants::IDE_AUTHOR)); QLatin1String(Constants::IDE_AUTHOR));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment