UPDATES: Implement Check now button in Options

This commit is contained in:
Eugene Sandulenko 2016-03-31 13:59:01 +02:00
parent 82963f7446
commit 2cde45fe6d
7 changed files with 22 additions and 1 deletions

View file

@ -62,7 +62,8 @@ enum {
kChooseExtraDirCmd = 'chex', kChooseExtraDirCmd = 'chex',
kExtraPathClearCmd = 'clex', kExtraPathClearCmd = 'clex',
kChoosePluginsDirCmd = 'chpl', kChoosePluginsDirCmd = 'chpl',
kChooseThemeCmd = 'chtf' kChooseThemeCmd = 'chtf',
kUpdatesCheckCmd = 'updc'
}; };
enum { enum {
@ -1245,6 +1246,8 @@ GlobalOptionsDialog::GlobalOptionsDialog()
_updatesPopUp->setSelectedTag(ConfMan.getInt("updates_check")); _updatesPopUp->setSelectedTag(ConfMan.getInt("updates_check"));
else else
_updatesPopUp->setSelectedTag(Common::UpdateManager::kUpdateIntervalNotSupported); _updatesPopUp->setSelectedTag(Common::UpdateManager::kUpdateIntervalNotSupported);
new ButtonWidget(tab, "GlobalOptions_Misc.UpdatesCheckManuallyButton", _("Check now"), 0, kUpdatesCheckCmd);
#endif #endif
// Activate the first tab // Activate the first tab
@ -1518,6 +1521,12 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
case kFluidSynthSettingsCmd: case kFluidSynthSettingsCmd:
_fluidSynthSettingsDialog->runModal(); _fluidSynthSettingsDialog->runModal();
break; break;
#endif
#ifdef USE_UPDATES
case kUpdatesCheckCmd:
if (g_system->getUpdateManager())
g_system->getUpdateManager()->checkForUpdates();
break;
#endif #endif
default: default:
OptionsDialog::handleCommand(sender, cmd, data); OptionsDialog::handleCommand(sender, cmd, data);

Binary file not shown.

View file

@ -514,6 +514,9 @@
<widget name = 'UpdatesPopup' <widget name = 'UpdatesPopup'
type = 'PopUp' type = 'PopUp'
/> />
<widget name = 'UpdatesCheckManuallyButton'
type = 'Button'
/>
</layout> </layout>
<widget name='KeysButton' <widget name='KeysButton'
type='Button' type='Button'

View file

@ -519,6 +519,9 @@
<widget name = 'UpdatesPopup' <widget name = 'UpdatesPopup'
type = 'PopUp' type = 'PopUp'
/> />
<widget name = 'UpdatesCheckManuallyButton'
type = 'Button'
/>
</layout> </layout>
<widget name='KeysButton' <widget name='KeysButton'
type='Button' type='Button'

Binary file not shown.

View file

@ -528,6 +528,9 @@
<widget name = 'UpdatesPopup' <widget name = 'UpdatesPopup'
type = 'PopUp' type = 'PopUp'
/> />
<widget name = 'UpdatesCheckManuallyButton'
type = 'Button'
/>
</layout> </layout>
<widget name='KeysButton' <widget name='KeysButton'
type='Button' type='Button'

View file

@ -517,6 +517,9 @@
<widget name = 'UpdatesPopup' <widget name = 'UpdatesPopup'
type = 'PopUp' type = 'PopUp'
/> />
<widget name = 'UpdatesCheckManuallyButton'
type = 'Button'
/>
</layout> </layout>
<widget name='KeysButton' <widget name='KeysButton'
type='Button' type='Button'