summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-12-01 15:02:52 +0100
committerMatthias Melcher <github@matthiasm.com>2024-12-01 16:44:04 +0100
commit13bb611b4efabae584f13af6c3531360263ceb7d (patch)
tree62ea35ec09814a3a557737bcc705aac488946aa4 /fluid
parent5160567728be407ef83445601f4da19b4e5b5bee (diff)
FLUID: Fixing Project Modflags when adding shell commands.
Diffstat (limited to 'fluid')
-rw-r--r--fluid/settings_panel.cxx16
-rw-r--r--fluid/settings_panel.fl22
-rw-r--r--fluid/shell_command.cxx8
3 files changed, 30 insertions, 16 deletions
diff --git a/fluid/settings_panel.cxx b/fluid/settings_panel.cxx
index 0546883f5..23a7bb388 100644
--- a/fluid/settings_panel.cxx
+++ b/fluid/settings_panel.cxx
@@ -913,10 +913,12 @@ static void cb_a(Fl_Button*, void* v) {
w_settings_shell_list->insert(selected+1, cmd->name.c_str());
w_settings_shell_list->deselect();
w_settings_shell_list->value(selected+1);
- if (cmd->storage == FD_STORE_USER)
+ if (cmd->storage == FD_STORE_USER) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_user->image());
- else if (cmd->storage == FD_STORE_PROJECT)
+ } else if (cmd->storage == FD_STORE_PROJECT) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_project->image());
+ set_modflag(1);
+ }
w_settings_shell_list->do_callback();
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
@@ -940,12 +942,13 @@ static void cb_w_settings_shell_dup(Fl_Button* o, void* v) {
g_shell_config->insert(selected, cmd);
w_settings_shell_list->insert(selected+1, cmd->name.c_str());
w_settings_shell_list->deselect();
- w_settings_shell_list->deselect();
w_settings_shell_list->value(selected+1);
- if (cmd->storage == FD_STORE_USER)
+ if (cmd->storage == FD_STORE_USER) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_user->image());
- else if (cmd->storage == FD_STORE_PROJECT)
+ } else if (cmd->storage == FD_STORE_PROJECT) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_project->image());
+ set_modflag(1);
+ }
w_settings_shell_list->do_callback();
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
@@ -968,6 +971,7 @@ static void cb_w_settings_shell_remove(Fl_Button* o, void* v) {
int ret = fl_choice("Delete the shell command\n\"%s\"?\n\nThis can not be undone.",
"Delete", "Cancel", NULL, g_shell_config->list[selected-1]->name.c_str());
if (ret==1) return;
+ if (g_shell_config->at(selected-1)->storage == FD_STORE_PROJECT) set_modflag(1);
g_shell_config->remove(selected-1);
w_settings_shell_list->remove(selected);
if (selected <= w_settings_shell_list->size())
@@ -2442,6 +2446,7 @@ Fl_Double_Window* make_settings_window() {
w_settings_general_tab->image( image_general_64() );
w_settings_general_tab->image()->scale(36, 24, 0, 1);
w_settings_general_tab->labelsize(11);
+ w_settings_general_tab->hide();
{ Fl_Group* o = new Fl_Group(120, 78, 130, 25);
o->callback((Fl_Callback*)cb_);
{ scheme_choice = new Fl_Scheme_Choice(120, 78, 120, 25, "Scheme: ");
@@ -3003,7 +3008,6 @@ Fl_Double_Window* make_settings_window() {
w_settings_shell_tab->image()->scale(36, 24, 0, 1);
w_settings_shell_tab->labelsize(11);
w_settings_shell_tab->callback((Fl_Callback*)propagate_load);
- w_settings_shell_tab->hide();
{ Fl_Group* o = new Fl_Group(10, 90, 320, 132);
o->callback((Fl_Callback*)propagate_load);
{ w_settings_shell_list = new Fl_Browser(100, 90, 220, 110, "Shell\ncommand\nlist:");
diff --git a/fluid/settings_panel.fl b/fluid/settings_panel.fl
index ed5a2d7c3..adb26234e 100644
--- a/fluid/settings_panel.fl
+++ b/fluid/settings_panel.fl
@@ -82,7 +82,7 @@ decl {\#include <FL/Fl_Scheme_Choice.H>} {public local
decl {\#include <FL/Fl_Preferences.H>} {private global
}
-decl {\#include <FL/Fl_Tooltip.H>} {selected private global
+decl {\#include <FL/Fl_Tooltip.H>} {private global
}
decl {\#include <FL/fl_ask.H>} {private global
@@ -197,7 +197,7 @@ Function {make_settings_window()} {open
} {
Fl_Group w_settings_general_tab {
label General open
- scale_image {36 24} image {icons/general_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 resizable
+ scale_image {36 24} image {icons/general_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide resizable
} {
Fl_Group {} {
callback {propagate_load(o, v);} open
@@ -893,7 +893,7 @@ g_layout_list.update_dialogs();}
Fl_Group w_settings_shell_tab {
label Shell
callback propagate_load open
- scale_image {36 24} image {icons/shell_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
+ scale_image {36 24} image {icons/shell_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11
} {
Fl_Group {} {
callback propagate_load open
@@ -927,7 +927,7 @@ list:}
}
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
-}}
+}} selected
xywh {100 90 220 110} type Multi labelfont 1 labelsize 11 align 4 textsize 13 resizable
}
Fl_Group w_settings_shell_toolbox {
@@ -945,10 +945,12 @@ list:}
w_settings_shell_list->insert(selected+1, cmd->name.c_str());
w_settings_shell_list->deselect();
w_settings_shell_list->value(selected+1);
- if (cmd->storage == FD_STORE_USER)
+ if (cmd->storage == FD_STORE_USER) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_user->image());
- else if (cmd->storage == FD_STORE_PROJECT)
+ } else if (cmd->storage == FD_STORE_PROJECT) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_project->image());
+ set_modflag(1);
+ }
w_settings_shell_list->do_callback();
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
@@ -971,12 +973,13 @@ if (v==LOAD) {
g_shell_config->insert(selected, cmd);
w_settings_shell_list->insert(selected+1, cmd->name.c_str());
w_settings_shell_list->deselect();
- w_settings_shell_list->deselect();
w_settings_shell_list->value(selected+1);
- if (cmd->storage == FD_STORE_USER)
+ if (cmd->storage == FD_STORE_USER) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_user->image());
- else if (cmd->storage == FD_STORE_PROJECT)
+ } else if (cmd->storage == FD_STORE_PROJECT) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_project->image());
+ set_modflag(1);
+ }
w_settings_shell_list->do_callback();
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
@@ -998,6 +1001,7 @@ if (v==LOAD) {
int ret = fl_choice("Delete the shell command\\n\\"%s\\"?\\n\\nThis can not be undone.",
"Delete", "Cancel", NULL, g_shell_config->list[selected-1]->name.c_str());
if (ret==1) return;
+ if (g_shell_config->at(selected-1)->storage == FD_STORE_PROJECT) set_modflag(1);
g_shell_config->remove(selected-1);
w_settings_shell_list->remove(selected);
if (selected <= w_settings_shell_list->size())
diff --git a/fluid/shell_command.cxx b/fluid/shell_command.cxx
index b1dd6d16c..fc61294ea 100644
--- a/fluid/shell_command.cxx
+++ b/fluid/shell_command.cxx
@@ -64,7 +64,13 @@
// FEATURE: Fd_Tool_Store icons are currently redundant with @file and @save and could be improved
// FEATURE: hostname, username, getenv support?
-// FEATURE: ad the files ./fluid.prefs and ./fluid.user.prefs as tool locations
+// FEATURE: add the files ./fluid.prefs and ./fluid.user.prefs as tool locations
+// FEATURE: interpret compiler output, for example: clang, and highlight errors and warnings
+// `.../shell_command.cxx:71:2: error: test`
+// `71 | #error test`
+// `clang++: error: no such file or directory: '.../shell_command.o'`
+// would make the error message clickable in the shell window and could select the widget,
+// open the matching editor in the widget panel, and highlight the line in SourceView.
/*
Some ideas: