mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
COPKGManager: optimize handling after installation
Show a success message only if restart/reboot is required and user should decide what to do or not. NOTE: marker file should be generated by opkg package itself (eg. with preinstall scripts), so it's controlled by the package maintainer!
This commit is contained in:
@@ -422,9 +422,36 @@ int COPKGManager::showMenu()
|
||||
|
||||
menu->hide ();
|
||||
|
||||
if (!has_err && installed)
|
||||
DisplayInfoMessage(g_Locale->getText(LOCALE_OPKG_SUCCESS_INSTALL));
|
||||
//handling after successful installation
|
||||
string exit_action = "";
|
||||
if (!has_err && installed){
|
||||
/*!
|
||||
Show a success message only if restart/reboot is required and user should decide what to do or not.
|
||||
NOTE: marker file should be generated by opkg package itself (eg. with preinstall scripts),
|
||||
so it's controlled by the package maintainer!
|
||||
*/
|
||||
//restart neutrino: user decision
|
||||
if(!access( "/tmp/.restart", F_OK)){
|
||||
int msg = ShowMsg(LOCALE_OPKG_TITLE, g_Locale->getText(LOCALE_OPKG_SUCCESS_INSTALL), CMsgBox::mbrNo,
|
||||
CMsgBox::mbYesNo,
|
||||
NEUTRINO_ICON_QUESTION,
|
||||
width);
|
||||
if (msg == CMsgBox::mbrYes)
|
||||
exit_action = "restart";
|
||||
}
|
||||
//restart neutrino: forced
|
||||
if (!access( "/tmp/.force_restart", F_OK))
|
||||
exit_action = "restart";
|
||||
//reboot stb: forced
|
||||
if (!access( "/tmp/.reboot", F_OK))
|
||||
exit_action = "reboot";
|
||||
}
|
||||
|
||||
delete menu;
|
||||
|
||||
if (!exit_action.empty())
|
||||
CNeutrinoApp::getInstance()->exec(NULL, exit_action);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user