mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Saving controller file now prompts user on overwrite
This commit is contained in:
parent
5bf93ac39a
commit
ff462b06fe
1 changed files with 8 additions and 1 deletions
|
@ -219,9 +219,16 @@ int DiskWriter::writeControllerFile(std::string name ,
|
|||
{
|
||||
// file exists: ask user overwrite or rename?
|
||||
LUPPP_WARN("Controller filename exists: prompting user to overwrite y/n?");
|
||||
controllerCfgPath << ".newCtlr";
|
||||
int overwrite = fl_choice("Controller filename exists, overwrite?", "no", "yes", 0);
|
||||
if ( !overwrite )
|
||||
{
|
||||
// return OK, as user has chosen to *not* write the file
|
||||
return LUPPP_RETURN_OK;
|
||||
}
|
||||
}
|
||||
|
||||
LUPPP_NOTE("Writing .ctlr file to disk");
|
||||
|
||||
ofstream controllerCfgFile;
|
||||
controllerCfgFile.open ( controllerCfgPath.str().c_str() );
|
||||
controllerCfgFile << cJSON_Print( controllerJson );
|
||||
|
|
Loading…
Add table
Reference in a new issue