CFlashExpert: Add return value to showMTDSelector() & showFileSelector()

This commit is contained in:
Michael Liebmann
2013-09-26 02:50:48 +02:00
parent 40dc93d9e8
commit 720f52c0a0
2 changed files with 14 additions and 13 deletions

View File

@@ -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;
}