From 3bbf1524ea9c8f50cc00fe5cde6629670fc63b7d Mon Sep 17 00:00:00 2001 From: thilo Date: Fri, 15 Apr 2011 15:05:10 +0000 Subject: [PATCH] *neutrino mtd update: use unified menu width git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1402 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/update.cpp | 16 ++++++++-------- src/gui/update.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index e6d85f94f..7251bc289 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -84,6 +84,7 @@ extern int allow_flash; CFlashUpdate::CFlashUpdate() :CProgressWindow() { + width = w_max (40, 10); setTitle(LOCALE_FLASHUPDATE_HEAD); sysfs = CMTDInfo::getInstance()->findMTDsystem(); printf("Mtd partition to update: %s\n", sysfs.c_str()); @@ -518,6 +519,7 @@ CFlashExpert::CFlashExpert() :CProgressWindow() { selectedMTD = -1; + width = w_max (40, 10); } void CFlashExpert::readmtd(int preadmtd) @@ -592,10 +594,9 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) void CFlashExpert::showMTDSelector(const std::string & actionkey) { //mtd-selector erzeugen - CMenuWidget* mtdselector = new CMenuWidget(LOCALE_FLASHUPDATE_MTDSELECTOR, NEUTRINO_ICON_UPDATE); - mtdselector->addItem(GenericMenuSeparator); - mtdselector->addItem(new CMenuForwarder(LOCALE_MESSAGEBOX_CANCEL)); - mtdselector->addItem(GenericMenuSeparatorLine); + CMenuWidget* mtdselector = new CMenuWidget(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width); + mtdselector->addIntroItems(LOCALE_FLASHUPDATE_MTDSELECTOR, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); + CMTDInfo* mtdInfo =CMTDInfo::getInstance(); for(int lx=0;lxgetMTDCount();lx++) { char sActionKey[20]; @@ -608,10 +609,9 @@ void CFlashExpert::showMTDSelector(const std::string & actionkey) void CFlashExpert::showFileSelector(const std::string & actionkey) { - CMenuWidget* fileselector = new CMenuWidget(LOCALE_FLASHUPDATE_FILESELECTOR, NEUTRINO_ICON_UPDATE); - fileselector->addItem(GenericMenuSeparator); - fileselector->addItem(new CMenuForwarder(LOCALE_MESSAGEBOX_CANCEL)); - fileselector->addItem(GenericMenuSeparatorLine); + CMenuWidget* fileselector = new CMenuWidget(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width); + fileselector->addIntroItems(LOCALE_FLASHUPDATE_FILESELECTOR, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); + struct dirent **namelist; int n = scandir("/tmp", &namelist, 0, alphasort); if (n < 0) diff --git a/src/gui/update.h b/src/gui/update.h index 99b4aaae7..f92d71bac 100644 --- a/src/gui/update.h +++ b/src/gui/update.h @@ -48,6 +48,7 @@ class CFlashUpdate : public CProgressWindow std::string file_md5; std::string sysfs; char fileType; + int width; std::string installedVersion; std::string newVersion; @@ -66,6 +67,7 @@ class CFlashExpert : public CProgressWindow { private: int selectedMTD; + int width; void showMTDSelector(const std::string & actionkey); void showFileSelector(const std::string & actionkey);