mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
add chooserDir function
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1032 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: a302018803
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2011-01-18 (Tue, 18 Jan 2011)
Origin message was:
------------------
-add chooserDir function
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1032 e54a6e83-5905-42d5-8d5c-058d10e6a962
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1379,6 +1379,33 @@ void CFileBrowser::paintHead()
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+10,y+theight+1, width-11, l_name, COL_MENUHEAD, 0, true); // UTF-8
|
||||
}
|
||||
|
||||
bool chooserDir(char *setting_dir, bool test_dir, const char *action_str, size_t str_leng)
|
||||
{
|
||||
std::string tmp_setting_dir = setting_dir;
|
||||
if(chooserDir(tmp_setting_dir, test_dir, action_str)){
|
||||
strncpy(setting_dir,tmp_setting_dir.c_str(), str_leng);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool chooserDir(std::string &setting_dir, bool test_dir, const char *action_str)
|
||||
{
|
||||
const char *wrong_str = "Wrong/unsupported";
|
||||
CFileBrowser b;
|
||||
b.Dir_Mode=true;
|
||||
if (b.exec(setting_dir.c_str())) {
|
||||
const char * newdir = b.getSelectedFile()->Name.c_str();
|
||||
if(test_dir && check_dir(newdir)){
|
||||
printf("%s %s dir %s\n",wrong_str ,action_str, newdir);
|
||||
return false;
|
||||
}else {
|
||||
setting_dir = b.getSelectedFile()->Name;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
const struct button_label FileBrowserButtons[3] =
|
||||
|
Reference in New Issue
Block a user