Skip to content

Commit

Permalink
Fixed|Client: Use of version numbers in UI vs. elsewhere
Browse files Browse the repository at this point in the history
The human-readable format is used in the UI, while packages use the
full four-component version for precision.
  • Loading branch information
skyjake committed Feb 7, 2017
1 parent ae24014 commit 22ae557
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/clientapp.cpp
Expand Up @@ -513,7 +513,7 @@ ClientApp::ClientApp(int &argc, char **argv)
QPixmap const pixmap(doomsdaySplashXpm);
QSplashScreen *splash = new QSplashScreen(pixmap);
splash->show();
splash->showMessage(Version::currentBuild().asText(),
splash->showMessage(Version::currentBuild().asHumanReadableText(),
Qt::AlignHCenter | Qt::AlignBottom,
QColor(90, 110, 95));
processEvents();
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/dd_main.cpp
Expand Up @@ -2144,7 +2144,7 @@ D_CMD(Version)
{
DENG2_UNUSED3(src, argc, argv);

LOG_SCR_NOTE(_E(D) DOOMSDAY_NICENAME " %s") << Version::currentBuild().asText();
LOG_SCR_NOTE(_E(D) DOOMSDAY_NICENAME " %s") << Version::currentBuild().asHumanReadableText();
LOG_SCR_MSG(_E(l) "Homepage: " _E(.) _E(i) DOOMSDAY_HOMEURL _E(.)
"\n" _E(l) "Project: " _E(.) _E(i) DENGPROJECT_HOMEURL);

Expand Down Expand Up @@ -2217,7 +2217,7 @@ D_CMD(Help)
#endif
*/

LOG_SCR_NOTE(_E(b) DOOMSDAY_NICENAME " %s Console") << Version::currentBuild().asText();
LOG_SCR_NOTE(_E(b) DOOMSDAY_NICENAME " %s Console") << Version::currentBuild().asHumanReadableText();

#define TABBED(A, B) "\n" _E(Ta) _E(b) " " << A << " " _E(.) _E(Tb) << B

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/dd_pinit.cpp
Expand Up @@ -84,7 +84,7 @@ DENG_DECLARE_API(InternalData) =
#ifdef __CLIENT__
de::String DD_ComposeMainWindowTitle()
{
de::String title = DOOMSDAY_NICENAME " " + Version::currentBuild().baseNumber();
de::String title = DOOMSDAY_NICENAME " " + Version::currentBuild().compactNumber();

if(App_GameLoaded() && gx.GetVariable)
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/dialogs/aboutdialog.cpp
Expand Up @@ -81,7 +81,7 @@ AboutDialog::AboutDialog() : DialogWidget("about"), d(new Impl(this))
.arg(version.cpuBits())
.arg(version.isDebugBuild()? tr(" Debug") : "")
.arg(DOOMSDAY_RELEASE_TYPE)
.arg(version.baseNumber())
.arg(version.compactNumber())
.arg(version.build)
.arg(Time::fromText(__DATE__ " " __TIME__, Time::CompilerDateTime)
.asDateTime().toString(Qt::SystemLocaleShortDate))
Expand Down
1 change: 1 addition & 0 deletions doomsday/apps/client/src/ui/dialogs/alertdialog.cpp
Expand Up @@ -102,6 +102,7 @@ DENG_GUI_PIMPL(AlertDialog)
, maxCount(100)
{
notification.reset(new PopupButtonWidget);
notification->setBehavior(Focusable, false);
notification->setSizePolicy(ui::Expand, ui::Expand);
notification->setImage(style().images().image("alert"));
notification->setOverrideImageSize(style().fonts().font("default").height().value());
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/ui/dialogs/serverinfodialog.cpp
Expand Up @@ -279,7 +279,7 @@ DENG_GUI_PIMPL(ServerInfoDialog)
_E(Ta)_E(l) "%7:" _E(.)_E(Tb) " %8")
.arg(tr("Rules")) .arg(serverInfo.gameConfig())
.arg(tr("Players")).arg(plrDesc)
.arg(tr("Version")).arg(serverInfo.version().asText())
.arg(tr("Version")).arg(serverInfo.version().asHumanReadableText())
.arg(tr("Ping")) .arg(ping < 0.0? String(DENG2_CHAR_MDASH)
: String("%1 ms").arg(ping.asMilliSeconds()));
description->setText(msg);
Expand Down Expand Up @@ -335,7 +335,7 @@ DENG_GUI_PIMPL(ServerInfoDialog)
{
localVersion = Package::versionForFile(*pkgFile);
missing << String("%1 " _E(s) "(you have: %2)" _E(.))
.arg(pkgId).arg(localVersion.asText());
.arg(pkgId).arg(localVersion.fullNumber());
continue;
}
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/widgets/packageswidget.cpp
Expand Up @@ -304,7 +304,7 @@ DENG_GUI_PIMPL(PackagesWidget)
.arg(pkgIdVer.first);
if (!isFile && pkgIdVer.second.isValid())
{
labelText += String(_E(C) " %1" _E(.)).arg(pkgIdVer.second.asText());
labelText += String(_E(C) " %1" _E(.)).arg(pkgIdVer.second.compactNumber());
}
label().setText(labelText);

Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp
Expand Up @@ -230,11 +230,11 @@ DENG_GUI_PIMPL(TaskBarWidget)
Version const currentVersion = Version::currentBuild();
if (String(DOOMSDAY_RELEASE_TYPE) == "Stable")
{
text = _E(b) + currentVersion.baseNumber();
text = _E(b) + currentVersion.compactNumber();
}
else
{
text = _E(b) + currentVersion.baseNumber() + " " +
text = _E(b) + currentVersion.compactNumber() + " " +
_E(l) + String("#%1").arg(currentVersion.build);
}
}
Expand Down
8 changes: 4 additions & 4 deletions doomsday/apps/client/src/updater/updateavailabledialog.cpp
Expand Up @@ -120,14 +120,14 @@ DENG2_OBSERVES(ToggleWidget, Toggle)
self().title().setImage(style().images().image("updater"));
self().message().setText(tr("There is an update available. The latest %1 release is %2, while you are running %3.")
.arg(channel)
.arg(_E(b) + latestVersion.asText() + _E(.))
.arg(currentVersion.asText()));
.arg(_E(b) + latestVersion.asHumanReadableText() + _E(.))
.arg(currentVersion.asHumanReadableText()));
}
else if (channel == builtInType) // same release type
{
self().title().setText(tr("Up to Date"));
self().message().setText(tr("The installed %1 is the latest available %2 build.")
.arg(currentVersion.asText())
.arg(currentVersion.asHumanReadableText())
.arg(_E(b) + channel + _E(.)));
}
else if (latestVersion < currentVersion)
Expand All @@ -136,7 +136,7 @@ DENG2_OBSERVES(ToggleWidget, Toggle)

self().title().setText(tr("Up to Date"));
self().message().setText(tr("The installed %1 is newer than the latest available %2 build.")
.arg(currentVersion.asText())
.arg(currentVersion.asHumanReadableText())
.arg(_E(b) + channel + _E(.)));
}

Expand Down
18 changes: 9 additions & 9 deletions doomsday/apps/client/src/updater/updater.cpp
Expand Up @@ -347,8 +347,8 @@ DENG2_PIMPL(Updater)
Version const currentVersion = Version::currentBuild();

LOG_MSG(_E(b) "Received version information:\n" _E(.)
" - installed version: " _E(>) "%s ") << currentVersion.asText();
LOG_MSG(" - latest version: " _E(>) "%s") << latestVersion.asText();
" - installed version: " _E(>) "%s ") << currentVersion.asHumanReadableText();
LOG_MSG(" - latest version: " _E(>) "%s") << latestVersion.asHumanReadableText();
LOG_MSG(" - package: " _E(>) _E(i) "%s") << latestPackageUri;
LOG_MSG(" - change log: " _E(>) _E(i) "%s") << latestLogUri;

Expand All @@ -364,7 +364,7 @@ DENG2_PIMPL(Updater)
// Is this newer than what we're running?
if (gotUpdate)
{
LOG_NOTE("Found an update: " _E(b)) << latestVersion.asText();
LOG_NOTE("Found an update: " _E(b)) << latestVersion.asHumanReadableText();

if (!alwaysShowNotification)
{
Expand Down Expand Up @@ -445,7 +445,7 @@ DENG2_PIMPL(Updater)
void startInstall(de::String distribPackagePath)
{
#ifdef MACOSX
de::String volName = "Doomsday Engine " + latestVersion.baseNumber();
de::String volName = "Doomsday Engine " + latestVersion.compactNumber();

#ifdef DENG2_QT_5_0_OR_NEWER
QString scriptPath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
Expand All @@ -458,21 +458,21 @@ DENG2_PIMPL(Updater)
if (file.open(QFile::WriteOnly | QFile::Truncate))
{
QTextStream out(&file);
out << "tell application \"System Events\" to set visible of process \"Finder\" to false\n"
out << "tell application \"System Events\" to set visible of process \"Finder\" to true\n"
"tell application \"Finder\"\n"
" open POSIX file \"" << distribPackagePath << "\"\n"
" -- Wait for it to get mounted\n"
" repeat until name of every disk contains \"" << volName << "\"\n"
" delay 1\n"
" end repeat\n"
" -- Start the installer\n"
/*" -- Start the installer\n"
" open file \"" << volName << ":Doomsday.pkg\"\n"
" -- Activate the Installer\n"
" repeat until name of every process contains \"Installer\"\n"
" delay 2\n"
" end repeat\n"
" end repeat\n"*/
"end tell\n"
"delay 1\n"
/*"delay 1\n"
"tell application \"Installer\" to activate\n"
"tell application \"Finder\"\n"
" -- Wait for it to finish\n"
Expand All @@ -481,7 +481,7 @@ DENG2_PIMPL(Updater)
" end repeat\n"
" -- Unmount\n"
" eject disk \"" << volName << "\"\n"
"end tell\n";
"end tell\n"*/;
file.close();
}
else
Expand Down

0 comments on commit 22ae557

Please sign in to comment.