diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 6b2196c76..6e81d0fd8 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1342,25 +1342,9 @@ void CInfoViewer::showSNR () BBarY + InfoHeightY_Info / 2 - 2 - 6, 100, 6, per, 100); per = 0; //HD info - if (::statfs(g_settings.network_nfs_recordingdir, &s) == 0) { - switch (s.f_type) - { - case (int) 0xEF53: /*EXT2 & EXT3*/ - case (int) 0x6969: /*NFS*/ - case (int) 0xFF534D42: /*CIFS*/ - case (int) 0x517B: /*SMB*/ - case (int) 0x52654973: /*REISERFS*/ - case (int) 0x65735546: /*fuse for ntfs*/ - case (int) 0x58465342: /*xfs*/ - case (int) 0x4d44: /*msdos*/ - per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); - break; - default: - fprintf( stderr,"%s Unknow File system type: %i\n",g_settings.network_nfs_recordingdir ,s.f_type); - break; - } + if(!check_dir(g_settings.network_nfs_recordingdir)){ + per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); } - hddscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 0:icon_crypt_width )+ icon_xres_width + 2*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?5:6)*2) - 102, BBarY + InfoHeightY_Info / 2 + 2, 100, 6, per, 100); } diff --git a/src/gui/nfs.cpp b/src/gui/nfs.cpp index ad3880da7..2b61df956 100644 --- a/src/gui/nfs.cpp +++ b/src/gui/nfs.cpp @@ -160,12 +160,7 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey ) { parent->hide(); int nr=atoi(actionKey.substr(3,1).c_str()); - CFileBrowser b; - b.Dir_Mode=true; - - if (b.exec(g_settings.network_nfs_local_dir[nr])) - strcpy(g_settings.network_nfs_local_dir[nr], b.getSelectedFile()->Name.c_str()); - + chooserDir(g_settings.network_nfs_local_dir[nr], false, NULL, sizeof(g_settings.network_nfs_local_dir[nr])-1); returnval = menu_return::RETURN_REPAINT; } return returnval; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 55640f6d8..a51c7f488 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1882,7 +1882,6 @@ bool CNeutrinoApp::doGuiRecord(char * preselectedDir, bool addTimer) } else if(preselectedDir == NULL && (g_settings.recording_choose_direct_rec_dir == 1)) { int userDecision = -1; - CMountChooser recDirs(LOCALE_TIMERLIST_RECORDING_DIR,NEUTRINO_ICON_SETTINGS,&userDecision,NULL,g_settings.network_nfs_recordingdir); if (recDirs.hasItem()) { recDirs.exec(NULL,""); @@ -4213,7 +4212,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) parent->hide(); const char *action_str = "plugin"; - if(chooserDir(g_settings.plugin_hdd_dir, true, action_str)){ + if(chooserDir(g_settings.plugin_hdd_dir, false, action_str)){ g_PluginList->loadPlugins(); } @@ -4223,7 +4222,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) parent->hide(); const char *action_str = "logo"; - chooserDir(g_settings.logo_hdd_dir, true, action_str); + chooserDir(g_settings.logo_hdd_dir, false, action_str); return menu_return::RETURN_REPAINT; } diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index c4e728742..06940bc21 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -1108,11 +1108,26 @@ int safe_mkdir(char * path) int check_dir(const char * newdir) { - if(strncmp(newdir, "/media/sda1/", 12) && strncmp(newdir, "/media/sdb1/", 12) && strncmp(newdir, "/mnt/", 5) && strncmp(newdir, "/tmp/", 5) && strncmp(newdir, "/media/", 7)) { - return 1; + + struct statfs s; + if (::statfs(newdir, &s) == 0) { + switch (s.f_type) /* f_type is long */ + { + case 0xEF53L: /*EXT2 & EXT3*/ + case 0x6969L: /*NFS*/ + case 0xFF534D42L: /*CIFS*/ + case 0x517BL: /*SMB*/ + case 0x52654973L: /*REISERFS*/ + case 0x65735546L: /*fuse for ntfs*/ + case 0x58465342L: /*xfs*/ + case 0x4d44L: /*msdos*/ + return 0;//ok + default: + fprintf( stderr,"%s Unknow File system type: %i\n",newdir ,s.f_type); + break; + } } - - return 0; + return 1;//error }