FLUID: Add dialog box when processes are still runing when user tries to quit.

This commit is contained in:
Matthias Melcher
2023-11-30 15:02:15 +01:00
parent a1a3a31090
commit 2025481f8c
3 changed files with 13 additions and 1 deletions
+5
View File
@@ -813,6 +813,11 @@ void revert_cb(Fl_Widget *,void *) {
If the design was modified, a dialog will ask for confirmation.
*/
void exit_cb(Fl_Widget *,void *) {
if (shell_command_running()) {
fl_alert("Previous shell command still running!");
return;
}
flush_text_widgets();
// verify user intention
+7 -1
View File
@@ -105,7 +105,12 @@
static Fl_String fltk_config_cmd;
static Fl_Process s_proc;
/**
See if shell command is running (public)
*/
bool shell_command_running() {
return s_proc.desc() ? true : false;
}
/**
Reads an entry from the group. A default value must be
@@ -285,6 +290,7 @@ void Fl_Process::clean_close(HANDLE& h) {
#endif
/**
Prepare FLUID for running a shell command according to the command flags.
+1
View File
@@ -43,6 +43,7 @@ char preferences_get(Fl_Preferences &prefs, const char *key, Fl_String &value, c
char preferences_set(Fl_Preferences &prefs, const char *key, const Fl_String &value);
void run_shell_command(const Fl_String &cmd, int flags);
bool shell_command_running(void);
class Fl_Process {
public: