COPKGManager: remember for last selected update directory

Use g_settings to handle local package directory.
Extra settings handler via gui for this directory is not intended. Default update directory
is the same like in flash settings.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 1606cf8a30
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-11-28 (Fri, 28 Nov 2014)



------------------
This commit was generated by Migit
This commit is contained in:
2014-11-28 09:19:38 +01:00
parent 3572fc60e9
commit 1f005ea369
4 changed files with 12 additions and 5 deletions

View File

@@ -90,7 +90,7 @@ COPKGManager::COPKGManager()
list_installed_done = false; list_installed_done = false;
list_upgradeable_done = false; list_upgradeable_done = false;
expert_mode = false; expert_mode = false;
local_dir = g_settings.update_dir.c_str(); local_dir = &g_settings.update_dir_opkg;
CFileHelpers::createDir("/tmp/.opkg"); CFileHelpers::createDir("/tmp/.opkg");
} }
@@ -148,11 +148,11 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey)
CFileBrowser fileBrowser; CFileBrowser fileBrowser;
fileBrowser.Filter = &fileFilter; fileBrowser.Filter = &fileFilter;
if (fileBrowser.exec(local_dir.c_str())) if (fileBrowser.exec((*local_dir).c_str()))
{ {
string pgk_name = fileBrowser.getSelectedFile()->Name; string pgk_name = fileBrowser.getSelectedFile()->Name;
int r = execCmd(pkg_types[OM_INSTALL] + pgk_name, true, true); int r = execCmd(pkg_types[OM_INSTALL] + pgk_name, true, true);
local_dir = fileBrowser.getCurrentDir(); *local_dir = fileBrowser.getCurrentDir();
if (r) { if (r) {
showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), strerror(errno), pgk_name); showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), strerror(errno), pgk_name);
} else } else

View File

@@ -57,7 +57,7 @@ class COPKGManager : public CMenuTarget
bool installed; bool installed;
bool expert_mode; bool expert_mode;
int menu_offset; int menu_offset;
std::string local_dir; std::string *local_dir;
int execCmd(const char* cmdstr, bool verbose = false, bool acknowledge = false); int execCmd(const char* cmdstr, bool verbose = false, bool acknowledge = false);
int execCmd(std::string cmdstr, bool verbose = false, bool acknowledge = false) { int execCmd(std::string cmdstr, bool verbose = false, bool acknowledge = false) {

View File

@@ -766,7 +766,9 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.font_file = configfile.getString("font_file", FONTDIR"/neutrino.ttf"); g_settings.font_file = configfile.getString("font_file", FONTDIR"/neutrino.ttf");
g_settings.ttx_font_file = configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf"); g_settings.ttx_font_file = configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf");
ttx_font_file = g_settings.ttx_font_file.c_str(); ttx_font_file = g_settings.ttx_font_file.c_str();
g_settings.update_dir = configfile.getString("update_dir", "/tmp"); g_settings.update_dir = configfile.getString("update_dir", "/tmp");
g_settings.update_dir_opkg = configfile.getString("update_dir_opkg", g_settings.update_dir);
// parentallock // parentallock
if (!parentallocked) { if (!parentallocked) {
@@ -1239,6 +1241,8 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setString("softupdate_proxypassword" , g_settings.softupdate_proxypassword ); configfile.setString("softupdate_proxypassword" , g_settings.softupdate_proxypassword );
configfile.setString("update_dir", g_settings.update_dir); configfile.setString("update_dir", g_settings.update_dir);
configfile.setString("update_dir_opkg", g_settings.update_dir_opkg);
configfile.setString("font_file", g_settings.font_file); configfile.setString("font_file", g_settings.font_file);
configfile.setString("ttx_font_file", g_settings.ttx_font_file); configfile.setString("ttx_font_file", g_settings.ttx_font_file);

View File

@@ -608,6 +608,9 @@ struct SNeutrinoSettings
int flashupdate_createimage_add_spare; int flashupdate_createimage_add_spare;
int flashupdate_createimage_add_kernel; int flashupdate_createimage_add_kernel;
std::string update_dir;
std::string update_dir_opkg;
//BouquetHandling //BouquetHandling
int bouquetlist_mode; int bouquetlist_mode;
@@ -725,7 +728,7 @@ struct SNeutrinoSettings
int sms_channel; int sms_channel;
std::string font_file; std::string font_file;
std::string ttx_font_file; std::string ttx_font_file;
std::string update_dir;
// USERMENU // USERMENU
typedef enum typedef enum
{ {