diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-09-26 00:29:14 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-09-26 00:29:26 +0200 |
| commit | 0a2f05a2fe2898ee1407319a6764018fdf54e562 (patch) | |
| tree | c71eb3a9c9bbab15b38730bde6b0f4a429e62c02 /fluid/fluid.cxx | |
| parent | b8fa522ca42407515f28dcdba4caddefe211ca27 (diff) | |
FLUID: Fixes regression #777
Wrote wrong path in #inlude statement under certain
conditions. Also removed 'snap' tag if not needed.
Diffstat (limited to 'fluid/fluid.cxx')
| -rw-r--r-- | fluid/fluid.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 2a95cfd0b..7fc5b3add 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -311,6 +311,10 @@ void Fluid_Project::reset() { code_file_set = 0; header_file_name = ".h"; code_file_name = ".cxx"; + + g_layout_list.remove_all(FD_STORE_PROJECT); + g_layout_list.current_suite(0); + g_layout_list.current_preset(0); } void Fluid_Project::update_settings_dialog() { @@ -1127,29 +1131,31 @@ int write_code_files() // -- write the code and header files if (!batch_mode) enter_project_dir(); int x = f.write_code(code_filename.c_str(), header_filename.c_str()); + Fl_String code_filename_rel = fl_filename_relative(code_filename); + Fl_String header_filename_rel = fl_filename_relative(header_filename); if (!batch_mode) leave_project_dir(); // -- print error message in batch mode or pop up an error or confirmation dialog box if (batch_mode) { if (!x) { fprintf(stderr, "%s and %s: %s\n", - code_filename.c_str(), - header_filename.c_str(), + code_filename_rel.c_str(), + header_filename_rel.c_str(), strerror(errno)); exit(1); } } else { if (!x) { - fl_message("Can't write %s and %s: %s", - code_filename.c_str(), - header_filename.c_str(), + fl_message("Can't write %s or %s: %s", + code_filename_rel.c_str(), + header_filename_rel.c_str(), strerror(errno)); } else { set_modflag(-1, 0); if (completion_button->value()) { fl_message("Wrote %s and %s", - g_project.codefile_name().c_str(), - g_project.headerfile_name().c_str()); + code_filename_rel.c_str(), + header_filename_rel.c_str()); } } } @@ -2080,7 +2086,7 @@ int main(int argc,char **argv) { exit(0); } - // don't lock up if silly command line arguments were given + // don't lock up if inconsistent command line arguments were given if (batch_mode) exit(0); |
