forked from qt-creator/qt-creator
Core: Make the revision sha in VersionDialog a clickable link
The base URL can be defined via the IDE branding mechanism. If omitted, the revision is plain text, like before this change. Change-Id: If1a74707a10c76e15d3d25b8e6b0c302219fb91d Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -12,3 +12,6 @@ set(IDE_DISPLAY_NAME "Qt Creator") # The IDE display name.
|
||||
set(IDE_ID "qtcreator") # The IDE id (no spaces, lowercase!)
|
||||
set(IDE_CASED_ID "QtCreator") # The cased IDE id (no spaces!)
|
||||
set(IDE_BUNDLE_IDENTIFIER "org.qt-project.${IDE_ID}") # The macOS application bundle identifier.
|
||||
|
||||
set(IDE_REVISION_URL "https://code.qt.io/cgit/qt-creator/qt-creator.git/commit/?id=%1")
|
||||
# The revision url in the version dialog
|
||||
|
@@ -44,6 +44,7 @@ const char IDE_CASED_ID[] = "${IDE_CASED_ID}";
|
||||
|
||||
const char IDE_VERSION_DISPLAY[] = "${IDE_VERSION_DISPLAY}";
|
||||
const char IDE_REVISION_STR[] = "${IDE_REVISION_STR}";
|
||||
const char IDE_REVISION_URL[] = "${IDE_REVISION_URL}";
|
||||
|
||||
// changes the path where the settings are saved to
|
||||
const char IDE_SETTINGSVARIANT_STR[] = "${IDE_SETTINGSVARIANT}";
|
||||
|
@@ -59,7 +59,12 @@ VersionDialog::VersionDialog(QWidget *parent)
|
||||
QString ideRev;
|
||||
#ifdef IDE_REVISION
|
||||
//: This gets conditionally inserted as argument %8 into the description string.
|
||||
ideRev = tr("<br/>From revision %1<br/>").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(10));
|
||||
const QString revUrl = QString::fromLatin1(Constants::IDE_REVISION_URL);
|
||||
const QString revStr = QString::fromLatin1(Constants::IDE_REVISION_STR);
|
||||
ideRev = tr("<br/>From revision %1<br/>")
|
||||
.arg(revUrl.isEmpty() ? revStr.left(10)
|
||||
: QString::fromLatin1("<a href=\"%1\">%2</a>")
|
||||
.arg(revUrl.arg(revStr), revStr.left(10)));
|
||||
#endif
|
||||
QString buildDateInfo;
|
||||
#ifdef QTC_SHOW_BUILD_DATE
|
||||
|
Reference in New Issue
Block a user