mirror of
https://github.com/fltk/fltk.git
synced 2026-05-18 00:05:33 +08:00
FLUID: Add dialog box when processes are still runing when user tries to quit.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user