gui/update_settings.cpp: always enable both url and local dir option:

local dir also used as target to download image from inet


Origin commit data
------------------
Branch: ni/coolstream
Commit: cce9ced9f3
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-11-16 (Fri, 16 Nov 2012)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-11-16 19:49:25 +04:00
parent 9968abbbf2
commit 56c937e64e

View File

@@ -1,27 +1,27 @@
/* /*
Neutrino-GUI - DBoxII-Project Neutrino-GUI - DBoxII-Project
Update settings implementation - Neutrino-GUI Update settings implementation - Neutrino-GUI
Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2001 Steffen Hehn 'McClean'
and some other guys and some other guys
Homepage: http://dbox.cyberphoria.org/ Homepage: http://dbox.cyberphoria.org/
Copyright (C) 2012 T. Graf 'dbt' Copyright (C) 2012 T. Graf 'dbt'
Homepage: http://www.dbox2-tuning.net/ Homepage: http://www.dbox2-tuning.net/
License: GPL License: GPL
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the License along with this program; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
@@ -70,32 +70,32 @@ int CUpdateSettings::exec(CMenuTarget* parent, const std::string &actionKey)
{ {
dprintf(DEBUG_DEBUG, "init software-update settings\n"); dprintf(DEBUG_DEBUG, "init software-update settings\n");
int res = menu_return::RETURN_REPAINT; int res = menu_return::RETURN_REPAINT;
if (parent) if (parent)
parent->hide(); parent->hide();
if(actionKey == "update_dir") { if(actionKey == "update_dir") {
const char *action_str = "update"; const char *action_str = "update";
if(chooserDir(g_settings.update_dir, true, action_str, sizeof(g_settings.update_dir)-1)) if(chooserDir(g_settings.update_dir, true, action_str, sizeof(g_settings.update_dir)-1))
printf("[neutrino] new %s dir %s\n", action_str, g_settings.update_dir); printf("[neutrino] new %s dir %s\n", action_str, g_settings.update_dir);
return res; return res;
} }
#ifndef USE_SMS_INPUT #ifndef USE_SMS_INPUT
else if(actionKey == "select_url_config_file"){ else if(actionKey == "select_url_config_file"){
CFileBrowser fileBrowser; CFileBrowser fileBrowser;
CFileFilter fileFilter; CFileFilter fileFilter;
fileFilter.addFilter("conf"); fileFilter.addFilter("conf");
fileFilter.addFilter("urls"); fileFilter.addFilter("urls");
fileBrowser.Filter = &fileFilter; fileBrowser.Filter = &fileFilter;
if (fileBrowser.exec("/var/etc") == true) if (fileBrowser.exec("/var/etc") == true)
strncpy(g_settings.softupdate_url_file, fileBrowser.getSelectedFile()->Name.c_str(), 30); strncpy(g_settings.softupdate_url_file, fileBrowser.getSelectedFile()->Name.c_str(), 30);
return res; return res;
} }
#endif #endif
res = initMenu(); res = initMenu();
return res; return res;
} }
@@ -104,31 +104,37 @@ int CUpdateSettings::exec(CMenuTarget* parent, const std::string &actionKey)
int CUpdateSettings::initMenu() int CUpdateSettings::initMenu()
{ {
CMenuWidget w_upsettings(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE_SETTINGS); CMenuWidget w_upsettings(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE_SETTINGS);
w_upsettings.addIntroItems(LOCALE_FLASHUPDATE_SETTINGS); w_upsettings.addIntroItems(LOCALE_FLASHUPDATE_SETTINGS);
#if 0
#ifdef USE_SMS_INPUT #ifdef USE_SMS_INPUT
CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, input_url_file, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, input_url_file, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
#else #else
CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
#endif #endif
CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, !g_settings.softupdate_mode, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, !g_settings.softupdate_mode, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
CUrlConfigSetupNotifier url_setup_notifier(fw_url, fw_update_dir, updateItem); CUrlConfigSetupNotifier url_setup_notifier(fw_url, fw_update_dir, updateItem);
CMenuOptionChooser *oj_mode = new CMenuOptionChooser(LOCALE_FLASHUPDATE_UPDATEMODE, &g_settings.softupdate_mode, FLASHUPDATE_UPDATEMODE_OPTIONS, FLASHUPDATE_UPDATEMODE_OPTION_COUNT, true, &url_setup_notifier); CMenuOptionChooser *oj_mode = new CMenuOptionChooser(LOCALE_FLASHUPDATE_UPDATEMODE, &g_settings.softupdate_mode, FLASHUPDATE_UPDATEMODE_OPTIONS, FLASHUPDATE_UPDATEMODE_OPTION_COUNT, true, &url_setup_notifier);
#endif
CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, true, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, true, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
#if 0
w_upsettings.addItem(oj_mode, true); w_upsettings.addItem(oj_mode, true);
w_upsettings.addItem(GenericMenuSeparatorLine); w_upsettings.addItem(GenericMenuSeparatorLine);
#endif
w_upsettings.addItem(fw_update_dir); w_upsettings.addItem(fw_update_dir);
w_upsettings.addItem(fw_url); w_upsettings.addItem(fw_url);
int res = w_upsettings.exec (NULL, ""); int res = w_upsettings.exec (NULL, "");
return res; return res;
} }
#if 0
CUrlConfigSetupNotifier::CUrlConfigSetupNotifier( CMenuItem* i1, CMenuItem* i2, CMenuForwarder * f1) CUrlConfigSetupNotifier::CUrlConfigSetupNotifier( CMenuItem* i1, CMenuItem* i2, CMenuForwarder * f1)
{ {
toDisable[0] = i1; toDisable[0] = i1;
@@ -149,3 +155,4 @@ bool CUrlConfigSetupNotifier::changeNotify(const neutrino_locale_t, void *)
} }
return false; return false;
} }
#endif