mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
CFlashExpert: Add return value to showMTDSelector() & showFileSelector()
This commit is contained in:
@@ -664,7 +664,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber)
|
||||
}
|
||||
}
|
||||
|
||||
void CFlashExpert::showMTDSelector(const std::string & actionkey)
|
||||
int CFlashExpert::showMTDSelector(const std::string & actionkey)
|
||||
{
|
||||
int shortcut = 0;
|
||||
|
||||
@@ -698,11 +698,12 @@ void CFlashExpert::showMTDSelector(const std::string & actionkey)
|
||||
if (actionkey == "writemtd")
|
||||
mtdselector->addItem(new CMenuForwarderNonLocalized("systemFS with settings", true, NULL, this, "writemtd10", CRCInput::convertDigitToKey(shortcut++)));
|
||||
#endif
|
||||
mtdselector->exec(NULL,"");
|
||||
int res = mtdselector->exec(NULL,"");
|
||||
delete mtdselector;
|
||||
return res;
|
||||
}
|
||||
|
||||
void CFlashExpert::showFileSelector(const std::string & actionkey)
|
||||
int CFlashExpert::showFileSelector(const std::string & actionkey)
|
||||
{
|
||||
CMenuWidget* fileselector = new CMenuWidget(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_FILESELECTOR);
|
||||
fileselector->addIntroItems(LOCALE_FLASHUPDATE_FILESELECTOR, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
|
||||
@@ -729,12 +730,14 @@ void CFlashExpert::showFileSelector(const std::string & actionkey)
|
||||
}
|
||||
free(namelist);
|
||||
}
|
||||
fileselector->exec(NULL,"");
|
||||
int res = fileselector->exec(NULL,"");
|
||||
delete fileselector;
|
||||
return res;
|
||||
}
|
||||
|
||||
int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
{
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
if(parent)
|
||||
parent->hide();
|
||||
|
||||
@@ -742,13 +745,13 @@ int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
readmtd(-1);
|
||||
}
|
||||
else if(actionKey=="writeflash") {
|
||||
showFileSelector("");
|
||||
res = showFileSelector("");
|
||||
}
|
||||
else if(actionKey=="readflashmtd") {
|
||||
showMTDSelector("readmtd");
|
||||
res = showMTDSelector("readmtd");
|
||||
}
|
||||
else if(actionKey=="writeflashmtd") {
|
||||
showMTDSelector("writemtd");
|
||||
res = showMTDSelector("writemtd");
|
||||
}
|
||||
else {
|
||||
int iReadmtd = -1;
|
||||
@@ -774,10 +777,8 @@ int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
selectedMTD=-1;
|
||||
}
|
||||
}
|
||||
hide();
|
||||
return menu_return::RETURN_EXIT_ALL;
|
||||
res = menu_return::RETURN_REPAINT;
|
||||
}
|
||||
|
||||
hide();
|
||||
return menu_return::RETURN_REPAINT;
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user