summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-10-23 11:46:41 +0200
committerMatthias Melcher <github@matthiasm.com>2023-10-23 11:46:56 +0200
commit667d5b9b72ca1c22b0ca63bd8c4cf0725a19e4a2 (patch)
tree9869c85d32e614abd3b55fbfb84dd50f2559188c /fluid
parent39a157a7dd83e1626c9f67e0b09d6deb23aa7c76 (diff)
FLUID: Fixes completion dialog, early shell read.
* when saving the source code from a shell command, the completion dialog is suppressed because the shell window pops up anyway, confirming our action * when reading no project at startup, the user shell commands were read, but the shell main menu was not updated
Diffstat (limited to 'fluid')
-rw-r--r--fluid/fluid.cxx15
-rw-r--r--fluid/fluid.h2
-rw-r--r--fluid/shell_command.cxx2
3 files changed, 10 insertions, 9 deletions
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index 90be6a00e..ae4284f3c 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1212,7 +1212,7 @@ Fl_String Fluid_Project::basename() const {
\return 1 if the operation failed, 0 if it succeeded
*/
-int write_code_files()
+int write_code_files(bool dont_show_completion_dialog)
{
// -- handle user interface issues
flush_text_widgets();
@@ -1250,7 +1250,7 @@ int write_code_files()
strerror(errno));
} else {
set_modflag(-1, 0);
- if (completion_button->value()) {
+ if (dont_show_completion_dialog==false && completion_button->value()) {
fl_message("Wrote %s and %s",
code_filename_rel.c_str(),
header_filename_rel.c_str());
@@ -1835,8 +1835,6 @@ void make_main_window() {
if (!batch_mode) {
load_history();
g_shell_config = new Fd_Shell_Command_List;
- // TODO: load example commands if this is the very first time we use this
-// g_shell_config->restore_defaults();
make_settings_window();
}
}
@@ -2139,12 +2137,15 @@ int main(int argc,char **argv) {
Fl_File_Icon::load_system_icons();
main_window->callback(exit_cb);
position_window(main_window,"main_window_pos", 1, 10, 30, WINWIDTH, WINHEIGHT );
+ if (g_shell_config) {
+ g_shell_config->read(fluid_prefs, FD_STORE_USER);
+ g_shell_config->update_settings_dialog();
+ g_shell_config->rebuild_shell_menu();
+ }
+ g_layout_list.read(fluid_prefs, FD_STORE_USER);
main_window->show(argc,argv);
toggle_widgetbin_cb(0,0);
toggle_sourceview_cb(0,0);
- if (g_shell_config)
- g_shell_config->read(fluid_prefs, FD_STORE_USER);
- g_layout_list.read(fluid_prefs, FD_STORE_USER);
if (!c && openlast_button->value() && absolute_history[0][0]) {
// Open previous file when no file specified...
open_project_file(absolute_history[0]);
diff --git a/fluid/fluid.h b/fluid/fluid.h
index 201b7dc30..1e39f8095 100644
--- a/fluid/fluid.h
+++ b/fluid/fluid.h
@@ -155,7 +155,7 @@ extern void save_template_cb(Fl_Widget *, void *);
extern void revert_cb(Fl_Widget *,void *);
extern void exit_cb(Fl_Widget *,void *);
-extern int write_code_files();
+extern int write_code_files(bool dont_show_completion_dialog=false);
extern void write_strings_cb(Fl_Widget *, void *);
extern void align_widget_cb(Fl_Widget *, long);
extern void toggle_widgetbin_cb(Fl_Widget *, void *);
diff --git a/fluid/shell_command.cxx b/fluid/shell_command.cxx
index 053f47178..b2fe85373 100644
--- a/fluid/shell_command.cxx
+++ b/fluid/shell_command.cxx
@@ -301,7 +301,7 @@ static bool prepare_shell_command(int flags) {
save_cb(0, 0);
}
if (flags & Fd_Shell_Command::SAVE_SOURCECODE) {
- write_code_files();
+ write_code_files(true);
}
if (flags & Fd_Shell_Command::SAVE_STRINGS) {
write_strings_cb(0, 0);