Skip to content

Commit

Permalink
Updater: Added "lastupdated" command
Browse files Browse the repository at this point in the history
Prints the time of the latest update check.
  • Loading branch information
skyjake committed Jun 14, 2012
1 parent 1455e64 commit 68ad5d6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
12 changes: 10 additions & 2 deletions doomsday/engine/data/cphelp.txt
Expand Up @@ -374,6 +374,9 @@ inf = Params: keymap (dkm-file)\nFor example, 'keymap finnish'.
desc = Kick client out of the game (server only).
inf = Params: kick (playernum)\nFor example, 'kick 1'.

[lastupdated]
desc = Show when the latest check for updates was made.

[listcontrols]
desc = List the names of all player controls.

Expand Down Expand Up @@ -537,8 +540,13 @@ desc = Unload the current game or one or more data files.
inf = Params: unload (name) ...\nFor example, 'unload mylevel.wad'.

[update]
desc = Check for new available releases or adjust autoupdate settings.
inf = Examples:\n 'update' checks for new releases.\n 'update config' shows the current settings.
desc = Check for new available releases.

[updateandnotify]
desc = Check for new available releases and open the update notification dialog.

[updatesettings]
desc = Show the settings dialog for configuring automatic updates.

[varstats]
desc = Show detailed statistics for console variables.
Expand Down
5 changes: 5 additions & 0 deletions doomsday/engine/portable/include/updater.h
Expand Up @@ -103,6 +103,11 @@ void Updater_CheckNow(boolean notify);
*/
void Updater_ShowSettings(void);

/**
* Print in the console when the latest update check was made.
*/
void Updater_PrintLastUpdated(void);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
11 changes: 9 additions & 2 deletions doomsday/engine/portable/src/dd_main.c
Expand Up @@ -140,6 +140,12 @@ D_CMD(CheckForUpdatesAndNotify)
return true;
}

D_CMD(LastUpdated)
{
Updater_PrintLastUpdated();
return true;
}

D_CMD(ShowUpdateSettings)
{
Updater_ShowSettings();
Expand All @@ -151,9 +157,10 @@ D_CMD(ShowUpdateSettings)
*/
void DD_Register(void)
{
C_CMD("update", "", CheckForUpdates);
C_CMD("update", "", CheckForUpdates);
C_CMD("updateandnotify", "", CheckForUpdatesAndNotify);
C_CMD("updatesettings", "", ShowUpdateSettings);
C_CMD("updatesettings", "", ShowUpdateSettings);
C_CMD("lastupdated", "", LastUpdated);

DD_RegisterLoop();
DD_RegisterInput();
Expand Down
7 changes: 7 additions & 0 deletions doomsday/engine/portable/src/updater.cpp
Expand Up @@ -545,3 +545,10 @@ void Updater_ShowSettings(void)
}
de::LegacyCore::instance().timer(delay, showSettingsDialog);
}

void Updater_PrintLastUpdated(void)
{
UpdaterSettings st;
Con_Message("Latest update check was made on %s.\n",
st.lastCheckTime().asText(de::Time::FriendlyFormat).toAscii().constData());
}

0 comments on commit 68ad5d6

Please sign in to comment.