From 452c570521911bb6b46e26754f505305fabc01a1 Mon Sep 17 00:00:00 2001 From: skyjake Date: Sat, 9 Jun 2012 16:23:57 +0300 Subject: [PATCH] Updater: Added "updateandnotify" and better name for the default download folder The "updaterandnotify" command will always show the GUI update notification dialog even though the engine is up to date. --- doomsday/engine/portable/src/dd_main.c | 9 +++++++++ .../portable/src/updater/updatersettingsdialog.cpp | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doomsday/engine/portable/src/dd_main.c b/doomsday/engine/portable/src/dd_main.c index 8dfabcd9cd..ba21d0bb18 100644 --- a/doomsday/engine/portable/src/dd_main.c +++ b/doomsday/engine/portable/src/dd_main.c @@ -132,6 +132,14 @@ D_CMD(CheckForUpdates) return true; } +D_CMD(CheckForUpdatesAndNotify) +{ + /// @todo Combine into the same command with CheckForUpdates? + Con_Message("Checking for available updates...\n"); + Updater_CheckNow(true); + return true; +} + D_CMD(ShowUpdateSettings) { Updater_ShowSettings(); @@ -144,6 +152,7 @@ D_CMD(ShowUpdateSettings) void DD_Register(void) { C_CMD("update", "", CheckForUpdates); + C_CMD("updateandnotify", "", CheckForUpdatesAndNotify); C_CMD("updatesettings", "", ShowUpdateSettings); DD_RegisterLoop(); diff --git a/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp b/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp index debf2bbc79..44bfa98338 100644 --- a/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp +++ b/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp @@ -11,6 +11,16 @@ #include #include +static QString defaultLocationName() +{ + QString name = QDesktopServices::displayName(QDesktopServices::TempLocation); + if(name.isEmpty()) + { + name = "Temporary Files"; + } + return name; +} + struct UpdaterSettingsDialog::Instance { UpdaterSettingsDialog* self; @@ -47,7 +57,7 @@ struct UpdaterSettingsDialog::Instance form->addRow(tr("&Release type:"), channelList); pathList = new QComboBox; - pathList->addItem(QDesktopServices::displayName(QDesktopServices::TempLocation), + pathList->addItem(defaultLocationName(), UpdaterSettings::defaultDownloadPath()); pathList->addItem(tr("Select folder..."), ""); form->addRow(tr("&Download location:"), pathList);