From e6be82615acc6a24133249e5ca3c6b1c032fe9f6 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 16 Nov 2012 16:49:58 +0400 Subject: [PATCH] gui/update.cpp: return result from file browser or image select menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/76947173c0ac2dca9e329c06568b3ee0077fe75c Author: [CST] Focus Date: 2012-11-16 (Fri, 16 Nov 2012) --- src/gui/update.cpp | 9 ++++++--- src/gui/update.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 591dcaba9..e64dfb39b 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -243,7 +243,7 @@ bool CFlashUpdate::selectHttpImage(void) else ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_NOTFOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); - SelectionWidget.exec(NULL, ""); + menu_ret = SelectionWidget.exec(NULL, ""); for (std::vector::iterator it = update_t_list.begin(); it != update_t_list.end(); ++it) delete (*it); @@ -343,8 +343,10 @@ printf("[update] mode is %d\n", g_settings.softupdate_mode); UpdatesBrowser.Filter = &UpdatesFilter; CFile * CFileSelected = NULL; - if (!(UpdatesBrowser.exec(g_settings.update_dir))) + if (!(UpdatesBrowser.exec(g_settings.update_dir))) { + menu_ret = UpdatesBrowser.getMenuRet(); return false; + } CFileSelected = UpdatesBrowser.getSelectedFile(); @@ -386,6 +388,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &) if(parent) parent->hide(); + menu_ret = menu_return::RETURN_REPAINT; paint(); if(sysfs.size() < 8) { @@ -395,7 +398,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &) } if(!checkVersion4Update()) { hide(); - return menu_return::RETURN_REPAINT; + return menu_ret; //menu_return::RETURN_REPAINT; } #ifdef VFD_UPDATE diff --git a/src/gui/update.h b/src/gui/update.h index 98122db86..487ff3eb8 100644 --- a/src/gui/update.h +++ b/src/gui/update.h @@ -53,6 +53,7 @@ class CFlashUpdate : public CProgressWindow std::string installedVersion; std::string newVersion; + int menu_ret; bool selectHttpImage(void); bool getUpdateImage(const std::string & version);