diff --git a/src/gui/webtv_setup.cpp b/src/gui/webtv_setup.cpp index 4b0b039d6..e5cfe48f0 100644 --- a/src/gui/webtv_setup.cpp +++ b/src/gui/webtv_setup.cpp @@ -70,8 +70,10 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey) CMenuItem* item = m->getItem(selected); CMenuForwarder *f = static_cast(item); std::string dirname(f->getName()); - if (fileBrowser.exec(dirname.substr(0, dirname.rfind('/')).c_str())) { + dirname = dirname.substr(0, dirname.rfind('/')); + if (fileBrowser.exec(dirname.c_str())) { f->setName(fileBrowser.getSelectedFile()->Name); + g_settings.last_webtv_dir = dirname; changed = true; } return res; @@ -81,9 +83,10 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey) CFileFilter fileFilter; fileFilter.addFilter("xml"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec("/") == true) { + if (fileBrowser.exec(g_settings.last_webtv_dir.c_str()) == true) { std::string s = fileBrowser.getSelectedFile()->Name; m->addItem(new CMenuForwarder(s, true, NULL, this, "c")); + g_settings.last_webtv_dir = s.substr(0, s.rfind('/')).c_str(); changed = true; } return res; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d53bee84f..24d67ee38 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -576,6 +576,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.network_nfs_recordingdir = configfile.getString( "network_nfs_recordingdir", "/media/sda1/movies" ); g_settings.timeshiftdir = configfile.getString( "timeshiftdir", "" ); g_settings.downloadcache_dir = configfile.getString( "downloadcache_dir", g_settings.network_nfs_recordingdir.c_str()); + g_settings.last_webtv_dir = configfile.getString( "last_webtv_dir", "/var/tuxbox/config"); g_settings.temp_timeshift = configfile.getInt32( "temp_timeshift", 0 ); g_settings.auto_timeshift = configfile.getInt32( "auto_timeshift", 0 ); @@ -1104,6 +1105,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString( "network_nfs_recordingdir", g_settings.network_nfs_recordingdir); configfile.setString( "timeshiftdir", g_settings.timeshiftdir); configfile.setString( "downloadcache_dir", g_settings.downloadcache_dir); + configfile.setString( "last_webtv_dir", g_settings.last_webtv_dir); configfile.setBool ("filesystem_is_utf8" , g_settings.filesystem_is_utf8 ); //recording (server + vcr) diff --git a/src/system/settings.h b/src/system/settings.h index 132506a1a..9fa4a64e7 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -396,6 +396,7 @@ struct SNeutrinoSettings std::string network_nfs_recordingdir; std::string timeshiftdir; std::string downloadcache_dir; + std::string last_webtv_dir; //recording int recording_type;