parent
f9004352b4
commit
f37347dd6e
@ -20,6 +20,7 @@ Subchapters:
|
||||
\li \ref fluid_i18n
|
||||
\li \ref fluid_limitations
|
||||
\li \ref fluid_hotkeys
|
||||
\li \ref fluid_licenses
|
||||
|
||||
\section fluid_what_is_fluid What is FLUID?
|
||||
|
||||
@ -1679,6 +1680,12 @@ On Apple computers, use the Apple Command key instead of Ctrl.
|
||||
<tr><td> `Shift-Ctrl-Arrow` </td><td> resize by grid units </td></tr>
|
||||
</table>
|
||||
|
||||
\section fluid_licenses Licenses
|
||||
|
||||
FLUID uses graphical images based on the Zendesk Garden Stroke icon set:
|
||||
<a href="">https://github.com/zendeskgarden</a>.
|
||||
Garden Stroke is licensed under the Apache License, Version 2.0:
|
||||
<a href="">https://www.apache.org/licenses/LICENSE-2.0.html</a>.
|
||||
|
||||
\htmlonly
|
||||
<hr>
|
||||
|
||||
@ -561,8 +561,8 @@ void Fd_Layout_List::update_dialogs() {
|
||||
assert(current_preset_ < 3);
|
||||
layout = list_[current_suite_].layout[current_preset_];
|
||||
assert(layout);
|
||||
if (grid_window) {
|
||||
grid_window->do_callback(grid_window, LOAD);
|
||||
if (w_settings_layout_tab) {
|
||||
w_settings_layout_tab->do_callback(w_settings_layout_tab, LOAD);
|
||||
layout_choice->redraw();
|
||||
}
|
||||
preset_menu[current_preset_].setonly(preset_menu);
|
||||
|
||||
@ -164,8 +164,6 @@ Fl_Type *Fl_Menu_Item_Type::make(Strategy strategy) {
|
||||
}
|
||||
if (!o) {
|
||||
o = new Fl_Button(0,0,100,20); // create template widget
|
||||
o->labelsize(layout->labelsize);
|
||||
o->labelfont(layout->labelfont);
|
||||
}
|
||||
|
||||
Fl_Menu_Item_Type* t = submenuflag ? new Fl_Submenu_Type() : new Fl_Menu_Item_Type();
|
||||
|
||||
@ -62,10 +62,15 @@ static void update_xywh() {
|
||||
}
|
||||
}
|
||||
|
||||
void i18n_type_cb(Fl_Choice *c, void *) {
|
||||
void i18n_type_cb(Fl_Choice *c, void *v) {
|
||||
if (v == LOAD) {
|
||||
c->value(g_project.i18n_type);
|
||||
} else {
|
||||
undo_checkpoint();
|
||||
|
||||
switch (g_project.i18n_type = c->value()) {
|
||||
g_project.i18n_type = c->value();
|
||||
set_modflag(1);
|
||||
}
|
||||
switch (g_project.i18n_type) {
|
||||
case 0 : /* None */
|
||||
i18n_include_input->hide();
|
||||
i18n_conditional_input->hide();
|
||||
@ -108,83 +113,11 @@ void i18n_type_cb(Fl_Choice *c, void *) {
|
||||
break;
|
||||
}
|
||||
|
||||
set_modflag(1);
|
||||
}
|
||||
|
||||
void i18n_text_cb(Fl_Input *i, void *) {
|
||||
undo_checkpoint();
|
||||
|
||||
if (i == i18n_function_input)
|
||||
g_project.i18n_function = i->value();
|
||||
else if (i == i18n_static_function_input)
|
||||
g_project.i18n_static_function = i->value();
|
||||
else if (i == i18n_file_input)
|
||||
g_project.i18n_file = i->value();
|
||||
else if (i == i18n_include_input)
|
||||
g_project.i18n_include = i->value();
|
||||
else if (i == i18n_conditional_input)
|
||||
g_project.i18n_conditional = i->value();
|
||||
|
||||
set_modflag(1);
|
||||
}
|
||||
|
||||
void i18n_int_cb(Fl_Int_Input *i, void *) {
|
||||
undo_checkpoint();
|
||||
|
||||
if (i == i18n_set_input)
|
||||
g_project.i18n_set = i->value();
|
||||
|
||||
set_modflag(1);
|
||||
}
|
||||
|
||||
void show_project_cb(Fl_Widget *, void *) {
|
||||
if(project_window==0) make_project_window();
|
||||
include_H_from_C_button->value(g_project.include_H_from_C);
|
||||
use_FL_COMMAND_button->value(g_project.use_FL_COMMAND);
|
||||
utf8_in_src_button->value(g_project.utf8_in_src);
|
||||
avoid_early_includes_button->value(g_project.avoid_early_includes);
|
||||
header_file_input->value(g_project.header_file_name.c_str());
|
||||
code_file_input->value(g_project.code_file_name.c_str());
|
||||
i18n_type_chooser->value(g_project.i18n_type);
|
||||
i18n_function_input->value(g_project.i18n_function.c_str());
|
||||
i18n_static_function_input->value(g_project.i18n_static_function.c_str());
|
||||
i18n_file_input->value(g_project.i18n_file.c_str());
|
||||
i18n_set_input->value(g_project.i18n_set.c_str());
|
||||
i18n_include_input->value(g_project.i18n_include.c_str());
|
||||
i18n_conditional_input->value(g_project.i18n_conditional.c_str());
|
||||
switch (g_project.i18n_type) {
|
||||
case 0 : /* None */
|
||||
i18n_include_input->hide();
|
||||
i18n_conditional_input->hide();
|
||||
i18n_file_input->hide();
|
||||
i18n_set_input->hide();
|
||||
i18n_function_input->hide();
|
||||
i18n_static_function_input->hide();
|
||||
break;
|
||||
case 1 : /* GNU gettext */
|
||||
i18n_include_input->show();
|
||||
i18n_conditional_input->show();
|
||||
i18n_file_input->hide();
|
||||
i18n_set_input->hide();
|
||||
i18n_function_input->show();
|
||||
i18n_static_function_input->show();
|
||||
break;
|
||||
case 2 : /* POSIX cat */
|
||||
i18n_include_input->show();
|
||||
i18n_conditional_input->show();
|
||||
i18n_file_input->show();
|
||||
i18n_set_input->show();
|
||||
i18n_function_input->hide();
|
||||
i18n_static_function_input->hide();
|
||||
break;
|
||||
}
|
||||
project_window->hotspot(project_window);
|
||||
project_window->show();
|
||||
}
|
||||
|
||||
void show_grid_cb(Fl_Widget *, void *) {
|
||||
grid_window->hotspot(grid_window);
|
||||
grid_window->show();
|
||||
settings_window->show();
|
||||
w_settings_tabs->value(w_settings_layout_tab);
|
||||
}
|
||||
|
||||
void show_settings_cb(Fl_Widget *, void *) {
|
||||
@ -192,46 +125,6 @@ void show_settings_cb(Fl_Widget *, void *) {
|
||||
settings_window->show();
|
||||
}
|
||||
|
||||
void header_input_cb(Fl_Input* i, void*) {
|
||||
if (strcmp(g_project.header_file_name.c_str(), i->value()))
|
||||
set_modflag(1);
|
||||
g_project.header_file_name = i->value();
|
||||
}
|
||||
|
||||
void code_input_cb(Fl_Input* i, void*) {
|
||||
if (strcmp(g_project.code_file_name.c_str(), i->value()))
|
||||
set_modflag(1);
|
||||
g_project.code_file_name = i->value();
|
||||
}
|
||||
|
||||
void include_H_from_C_button_cb(Fl_Check_Button* b, void*) {
|
||||
if (g_project.include_H_from_C != b->value()) {
|
||||
set_modflag(1);
|
||||
g_project.include_H_from_C = b->value();
|
||||
}
|
||||
}
|
||||
|
||||
void use_FL_COMMAND_button_cb(Fl_Check_Button* b, void*) {
|
||||
if (g_project.use_FL_COMMAND != b->value()) {
|
||||
set_modflag(1);
|
||||
g_project.use_FL_COMMAND = b->value();
|
||||
}
|
||||
}
|
||||
|
||||
void utf8_in_src_cb(Fl_Check_Button *b, void*) {
|
||||
if (g_project.utf8_in_src != b->value()) {
|
||||
set_modflag(1);
|
||||
g_project.utf8_in_src = b->value();
|
||||
}
|
||||
}
|
||||
|
||||
void avoid_early_includes_cb(Fl_Check_Button *b, void*) {
|
||||
if (g_project.avoid_early_includes != b->value()) {
|
||||
set_modflag(1);
|
||||
g_project.avoid_early_includes = b->value();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
Fl_Menu_Item window_type_menu[] = {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -33,47 +33,17 @@
|
||||
*/
|
||||
void init_scheme(void);
|
||||
extern struct Fl_Menu_Item *dbmanager_item;
|
||||
#include <FL/Fl_Double_Window.H>
|
||||
#include <FL/Fl_Preferences.H>
|
||||
#include <FL/Fl_Tooltip.H>
|
||||
extern Fl_Double_Window *project_window;
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Tabs.H>
|
||||
#include <FL/Fl_Group.H>
|
||||
#include <FL/Fl_Box.H>
|
||||
#include <FL/Fl_Input.H>
|
||||
extern void header_input_cb(Fl_Input*, void*);
|
||||
extern Fl_Input *header_file_input;
|
||||
extern void code_input_cb(Fl_Input*, void*);
|
||||
extern Fl_Input *code_file_input;
|
||||
#include <FL/Fl_Check_Button.H>
|
||||
extern void include_H_from_C_button_cb(Fl_Check_Button*, void*);
|
||||
extern Fl_Check_Button *include_H_from_C_button;
|
||||
extern void use_FL_COMMAND_button_cb(Fl_Check_Button*, void*);
|
||||
extern Fl_Check_Button *use_FL_COMMAND_button;
|
||||
extern void utf8_in_src_cb(Fl_Check_Button*, void*);
|
||||
extern Fl_Check_Button *utf8_in_src_button;
|
||||
extern void avoid_early_includes_cb(Fl_Check_Button*, void*);
|
||||
extern Fl_Check_Button *avoid_early_includes_button;
|
||||
#include <FL/Fl_Choice.H>
|
||||
extern void i18n_type_cb(Fl_Choice*, void*);
|
||||
extern Fl_Choice *i18n_type_chooser;
|
||||
extern void i18n_text_cb(Fl_Input*, void*);
|
||||
extern Fl_Input *i18n_include_input;
|
||||
extern Fl_Input *i18n_conditional_input;
|
||||
extern Fl_Input *i18n_file_input;
|
||||
#include <FL/Fl_Int_Input.H>
|
||||
extern void i18n_int_cb(Fl_Int_Input*, void*);
|
||||
extern Fl_Int_Input *i18n_set_input;
|
||||
extern Fl_Input *i18n_function_input;
|
||||
extern Fl_Input *i18n_static_function_input;
|
||||
Fl_Double_Window* make_project_window();
|
||||
extern Fl_Menu_Item menu_i18n_type_chooser[];
|
||||
extern void i18n_cb(Fl_Choice *,void *);
|
||||
extern void scheme_cb(Fl_Scheme_Choice *, void *);
|
||||
#include <FL/Fl_Double_Window.H>
|
||||
extern Fl_Double_Window *settings_window;
|
||||
#include <FL/Fl_Tabs.H>
|
||||
extern Fl_Tabs *w_settings_tabs;
|
||||
#include <FL/Fl_Group.H>
|
||||
extern void scheme_cb(Fl_Scheme_Choice*, void*);
|
||||
extern Fl_Scheme_Choice *scheme_choice;
|
||||
#include <FL/Fl_Box.H>
|
||||
#include <FL/Fl_Check_Button.H>
|
||||
extern Fl_Check_Button *tooltips_button;
|
||||
extern Fl_Check_Button *completion_button;
|
||||
extern Fl_Check_Button *openlast_button;
|
||||
@ -82,22 +52,19 @@ extern Fl_Check_Button *show_comments_button;
|
||||
#include <FL/Fl_Spinner.H>
|
||||
extern Fl_Spinner *recent_spinner;
|
||||
extern Fl_Check_Button *use_external_editor_button;
|
||||
#include <FL/Fl_Input.H>
|
||||
extern Fl_Input *editor_command_input;
|
||||
Fl_Double_Window* make_settings_window();
|
||||
extern Fl_Double_Window *shell_window;
|
||||
extern Fl_Input *shell_command_input;
|
||||
extern Fl_Check_Button *shell_savefl_button;
|
||||
extern Fl_Check_Button *shell_writecode_button;
|
||||
extern Fl_Check_Button *shell_writemsgs_button;
|
||||
extern Fl_Check_Button *shell_use_fl_button;
|
||||
#include <FL/Fl_Return_Button.H>
|
||||
extern Fl_Double_Window *shell_run_window;
|
||||
#include <FL/Fl_Simple_Terminal.H>
|
||||
extern Fl_Simple_Terminal *shell_run_terminal;
|
||||
extern Fl_Return_Button *shell_run_button;
|
||||
Fl_Double_Window* make_shell_window();
|
||||
extern Fl_Double_Window *grid_window;
|
||||
extern Fl_Group *w_settings_project_tab;
|
||||
extern Fl_Input *header_file_input;
|
||||
extern Fl_Input *code_file_input;
|
||||
extern Fl_Check_Button *include_H_from_C_button;
|
||||
extern Fl_Check_Button *use_FL_COMMAND_button;
|
||||
extern Fl_Check_Button *utf8_in_src_button;
|
||||
extern Fl_Check_Button *avoid_early_includes_button;
|
||||
extern Fl_Group *w_settings_layout_tab;
|
||||
#include <FL/Fl_Choice.H>
|
||||
extern Fl_Choice *layout_choice;
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Menu_Button.H>
|
||||
extern Fl_Menu_Button *w_layout_menu;
|
||||
#include <FL/Fl_Native_File_Chooser.H>
|
||||
@ -106,7 +73,20 @@ extern void edit_layout_preset_cb(Fl_Button*, long);
|
||||
extern Fl_Button *preset_choice[3];
|
||||
#include <FL/Fl_Value_Input.H>
|
||||
extern Fl_Menu_Item fontmenu[];
|
||||
Fl_Double_Window* make_layout_window();
|
||||
extern Fl_Group *w_settings_shell_tab;
|
||||
extern Fl_Check_Button *shell_use_fl_button;
|
||||
#include <FL/Fl_Return_Button.H>
|
||||
extern Fl_Group *w_settings_i18n_tab;
|
||||
extern void i18n_type_cb(Fl_Choice*, void*);
|
||||
extern Fl_Choice *i18n_type_chooser;
|
||||
extern Fl_Input *i18n_include_input;
|
||||
extern Fl_Input *i18n_conditional_input;
|
||||
extern Fl_Input *i18n_file_input;
|
||||
#include <FL/Fl_Int_Input.H>
|
||||
extern Fl_Int_Input *i18n_set_input;
|
||||
extern Fl_Input *i18n_function_input;
|
||||
extern Fl_Input *i18n_static_function_input;
|
||||
Fl_Double_Window* make_settings_window();
|
||||
extern Fl_Menu_Item menu_layout_choice[];
|
||||
extern Fl_Menu_Item menu_w_layout_menu[];
|
||||
#define w_layout_menu_rename (menu_w_layout_menu+0)
|
||||
@ -114,4 +94,10 @@ extern Fl_Menu_Item *w_layout_menu_storage[4];
|
||||
#define w_layout_menu_load (menu_w_layout_menu+5)
|
||||
#define w_layout_menu_save (menu_w_layout_menu+6)
|
||||
#define w_layout_menu_delete (menu_w_layout_menu+7)
|
||||
extern Fl_Menu_Item menu_i18n_type_chooser[];
|
||||
extern Fl_Double_Window *shell_run_window;
|
||||
#include <FL/Fl_Simple_Terminal.H>
|
||||
extern Fl_Simple_Terminal *shell_run_terminal;
|
||||
extern Fl_Return_Button *shell_run_button;
|
||||
Fl_Double_Window* make_shell_window();
|
||||
#endif
|
||||
|
||||
@ -296,11 +296,6 @@ void Fd_Project_Reader::read_children(Fl_Type *p, int paste, Strategy strategy,
|
||||
g_project.i18n_conditional = read_word();
|
||||
goto CONTINUE;
|
||||
}
|
||||
if (!strcmp(c,"i18n_type"))
|
||||
{
|
||||
g_project.i18n_type = atoi(read_word());
|
||||
goto CONTINUE;
|
||||
}
|
||||
if (!strcmp(c,"header_name")) {
|
||||
if (!g_project.header_file_set) g_project.header_file_name = read_word();
|
||||
else read_word();
|
||||
|
||||
@ -281,6 +281,13 @@ void Fluid_Project::reset() {
|
||||
code_file_name = ".cxx";
|
||||
}
|
||||
|
||||
void Fluid_Project::update_settings_dialog() {
|
||||
if (settings_window) {
|
||||
w_settings_project_tab->do_callback(w_settings_project_tab, LOAD);
|
||||
w_settings_i18n_tab->do_callback(w_settings_i18n_tab, LOAD);
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Sourceview definition
|
||||
|
||||
void update_sourceview_position();
|
||||
@ -635,6 +642,7 @@ void revert_cb(Fl_Widget *,void *) {
|
||||
if (!read_file(filename, 0)) {
|
||||
undo_resume();
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
fl_message("Can't read %s: %s", filename, strerror(errno));
|
||||
return;
|
||||
}
|
||||
@ -642,6 +650,7 @@ void revert_cb(Fl_Widget *,void *) {
|
||||
undo_resume();
|
||||
set_modflag(0, 0);
|
||||
undo_clear();
|
||||
g_project.update_settings_dialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -775,6 +784,7 @@ void open_cb(Fl_Widget *, void *v) {
|
||||
if (!read_file(c, v!=0)) {
|
||||
undo_resume();
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
fl_message("Can't read %s: %s", c, strerror(errno));
|
||||
free((void *)filename);
|
||||
filename = oldfilename;
|
||||
@ -794,6 +804,7 @@ void open_cb(Fl_Widget *, void *v) {
|
||||
undo_clear();
|
||||
if (oldfilename) free((void *)oldfilename);
|
||||
}
|
||||
g_project.update_settings_dialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -826,6 +837,7 @@ void open_history_cb(Fl_Widget *, void *v) {
|
||||
free((void *)filename);
|
||||
filename = oldfilename;
|
||||
if (main_window) main_window->label(filename);
|
||||
g_project.update_settings_dialog();
|
||||
return;
|
||||
}
|
||||
set_modflag(0, 0);
|
||||
@ -836,6 +848,7 @@ void open_history_cb(Fl_Widget *, void *v) {
|
||||
free((void *)oldfilename);
|
||||
oldfilename = 0L;
|
||||
}
|
||||
g_project.update_settings_dialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -864,6 +877,7 @@ void new_cb(Fl_Widget *, void *v) {
|
||||
set_filename(NULL);
|
||||
set_modflag(0, 0);
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -964,6 +978,7 @@ void new_from_template_cb(Fl_Widget *w, void *v) {
|
||||
}
|
||||
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
set_modflag(0);
|
||||
undo_clear();
|
||||
}
|
||||
@ -1425,8 +1440,7 @@ Fl_Menu_Item Main_Menu[] = {
|
||||
{"Hide Guides",FL_COMMAND+FL_SHIFT+'g',toggle_guides},
|
||||
{"Show Widget &Bin...",FL_ALT+'b',toggle_widgetbin_cb},
|
||||
{"Show Source Code...",FL_ALT+FL_SHIFT+'s', (Fl_Callback*)toggle_sourceview_cb, 0, FL_MENU_DIVIDER},
|
||||
{"Pro&ject Settings...",FL_ALT+'p',show_project_cb},
|
||||
{"GU&I Settings...",FL_ALT+FL_SHIFT+'p',show_settings_cb},
|
||||
{"Settings...",FL_ALT+'p',show_settings_cb},
|
||||
{0},
|
||||
{"&New", 0, 0, (void *)New_Menu, FL_SUBMENU_POINTER},
|
||||
{"&Layout",0,0,0,FL_SUBMENU},
|
||||
@ -1612,7 +1626,6 @@ void make_main_window() {
|
||||
fluid_prefs.get("show_guides", show_guides, 0);
|
||||
fluid_prefs.get("show_comments", show_comments, 1);
|
||||
shell_prefs_get();
|
||||
make_layout_window();
|
||||
make_shell_window();
|
||||
}
|
||||
|
||||
@ -1812,8 +1825,8 @@ void set_modflag(int mf, int mfc) {
|
||||
}
|
||||
|
||||
// Enable/disable the Save menu item...
|
||||
if (modflag) save_item->activate();
|
||||
else save_item->deactivate();
|
||||
// if (modflag) save_item->activate();
|
||||
// else save_item->deactivate();
|
||||
}
|
||||
|
||||
// ---- Sourceview implementation
|
||||
@ -2134,9 +2147,6 @@ int main(int argc,char **argv) {
|
||||
#endif // _WIN32
|
||||
|
||||
undo_clear();
|
||||
if (g_shell_command)
|
||||
::free(g_shell_command);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@ -86,6 +86,7 @@ public:
|
||||
Fluid_Project();
|
||||
~Fluid_Project();
|
||||
void reset();
|
||||
void update_settings_dialog();
|
||||
|
||||
int i18n_type;
|
||||
Fl_String i18n_include;
|
||||
|
||||
BIN
fluid/icons/document_64.png
Normal file
BIN
fluid/icons/document_64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 927 B |
BIN
fluid/icons/general_64.png
Normal file
BIN
fluid/icons/general_64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
fluid/icons/language_64.png
Normal file
BIN
fluid/icons/language_64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
fluid/icons/layout_64.png
Normal file
BIN
fluid/icons/layout_64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 481 B |
BIN
fluid/icons/shell-48.png
Normal file
BIN
fluid/icons/shell-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 200 B |
BIN
fluid/icons/shell_64.png
Normal file
BIN
fluid/icons/shell_64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 802 B |
@ -33,7 +33,7 @@ Shell_Settings shell_settings_linux = { };
|
||||
Shell_Settings shell_settings_macos = { };
|
||||
|
||||
/// Current shell command, stored in .fl file for each platform, and in app prefs
|
||||
char *g_shell_command = NULL;
|
||||
Fl_String g_shell_command;
|
||||
|
||||
/// Save .fl file before running, stored in .fl file for each platform, and in app prefs
|
||||
int g_shell_save_fl = 1;
|
||||
@ -85,11 +85,7 @@ void shell_settings_read()
|
||||
#else
|
||||
Shell_Settings &shell_settings = shell_settings_linux;
|
||||
#endif
|
||||
if (g_shell_command)
|
||||
free((void*)g_shell_command);
|
||||
g_shell_command = NULL;
|
||||
if (shell_settings.command)
|
||||
g_shell_command = fl_strdup(shell_settings.command);
|
||||
g_shell_command = shell_settings.command;
|
||||
g_shell_save_fl = ((shell_settings.flags&1)==1);
|
||||
g_shell_save_code = ((shell_settings.flags&2)==2);
|
||||
g_shell_save_strings = ((shell_settings.flags&4)==4);
|
||||
@ -112,8 +108,8 @@ void shell_settings_write()
|
||||
if (shell_settings.command)
|
||||
free((void*)shell_settings.command);
|
||||
shell_settings.command = NULL;
|
||||
if (g_shell_command)
|
||||
shell_settings.command = fl_strdup(g_shell_command);
|
||||
if (!g_shell_command.empty())
|
||||
shell_settings.command = fl_strdup(g_shell_command.c_str());
|
||||
shell_settings.flags = 0;
|
||||
if (g_shell_save_fl)
|
||||
shell_settings.flags |= 1;
|
||||
@ -244,13 +240,13 @@ void Fl_Process::clean_close(HANDLE& h) {
|
||||
|
||||
// Shell command support...
|
||||
|
||||
static bool prepare_shell_command(const char * &command) { // common pre-shell command code all platforms
|
||||
shell_window->hide();
|
||||
static bool prepare_shell_command() {
|
||||
// settings_window->hide();
|
||||
if (s_proc.desc()) {
|
||||
fl_alert("Previous shell command still running!");
|
||||
return false;
|
||||
}
|
||||
if ((command = g_shell_command) == NULL || !*command) {
|
||||
if (g_shell_command.empty()) {
|
||||
fl_alert("No shell command entered!");
|
||||
return false;
|
||||
}
|
||||
@ -282,17 +278,15 @@ void shell_pipe_cb(FL_SOCKET, void*) {
|
||||
}
|
||||
|
||||
void do_shell_command(Fl_Return_Button*, void*) {
|
||||
const char *command=NULL; // Command to run
|
||||
|
||||
if (!prepare_shell_command(command)) return;
|
||||
if (!prepare_shell_command()) return;
|
||||
|
||||
// Show the output window and clear things...
|
||||
shell_run_terminal->text("");
|
||||
shell_run_terminal->append(command);
|
||||
shell_run_terminal->append(g_shell_command.c_str());
|
||||
shell_run_terminal->append("\n");
|
||||
shell_run_window->label("Shell Command Running...");
|
||||
|
||||
if (s_proc.popen((char *)command) == NULL) {
|
||||
if (s_proc.popen((char *)g_shell_command.c_str()) == NULL) {
|
||||
fl_alert("Unable to run shell command: %s", strerror(errno));
|
||||
return;
|
||||
}
|
||||
@ -343,31 +337,7 @@ void do_shell_command(Fl_Return_Button*, void*) {
|
||||
Fluid app settings are saved per user and per machine.
|
||||
*/
|
||||
void show_shell_window() {
|
||||
update_shell_window();
|
||||
shell_window->hotspot(shell_command_input);
|
||||
shell_window->show();
|
||||
}
|
||||
|
||||
/**
|
||||
Update the shell properties dialog box.
|
||||
*/
|
||||
void update_shell_window() {
|
||||
shell_command_input->value(g_shell_command);
|
||||
shell_savefl_button->value(g_shell_save_fl);
|
||||
shell_writecode_button->value(g_shell_save_code);
|
||||
shell_writemsgs_button->value(g_shell_save_strings);
|
||||
shell_use_fl_button->value(g_shell_use_fl_settings);
|
||||
}
|
||||
|
||||
/**
|
||||
Copy the sshe;l settings from the dialog box into the variables.
|
||||
*/
|
||||
void apply_shell_window() {
|
||||
if (g_shell_command)
|
||||
free((void*)g_shell_command);
|
||||
g_shell_command = fl_strdup(shell_command_input->value());
|
||||
g_shell_save_fl = shell_savefl_button->value();
|
||||
g_shell_save_code = shell_writecode_button->value();
|
||||
g_shell_save_strings = shell_writemsgs_button->value();
|
||||
settings_window->show();
|
||||
w_settings_tabs->value(w_settings_shell_tab);
|
||||
}
|
||||
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <FL/Fl_String.H>
|
||||
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# include <direct.h>
|
||||
# include <windows.h>
|
||||
@ -32,8 +34,6 @@
|
||||
#endif
|
||||
|
||||
void show_shell_window();
|
||||
void update_shell_window();
|
||||
void apply_shell_window();
|
||||
void do_shell_command(class Fl_Return_Button*, void*);
|
||||
|
||||
typedef struct {
|
||||
@ -45,7 +45,7 @@ extern Shell_Settings shell_settings_windows;
|
||||
extern Shell_Settings shell_settings_linux;
|
||||
extern Shell_Settings shell_settings_macos;
|
||||
|
||||
extern char *g_shell_command;
|
||||
extern Fl_String g_shell_command;
|
||||
extern int g_shell_save_fl;
|
||||
extern int g_shell_save_code;
|
||||
extern int g_shell_save_strings;
|
||||
|
||||
@ -88,6 +88,7 @@ void redo_cb(Fl_Widget *, void *) {
|
||||
if (!read_file(undo_filename(undo_current + 1), 0)) {
|
||||
// Unable to read checkpoint file, don't redo...
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
undo_resume();
|
||||
return;
|
||||
}
|
||||
@ -104,6 +105,7 @@ void redo_cb(Fl_Widget *, void *) {
|
||||
// Update modified flag...
|
||||
set_modflag(undo_current != undo_save);
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
|
||||
// Update undo/redo menu items...
|
||||
if (undo_current >= undo_last) Main_Menu[redo_item].deactivate();
|
||||
@ -129,6 +131,7 @@ void undo_cb(Fl_Widget *, void *) {
|
||||
if (!read_file(undo_filename(undo_current - 1), 0)) {
|
||||
// Unable to read checkpoint file, don't undo...
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
undo_resume();
|
||||
return;
|
||||
}
|
||||
@ -151,6 +154,7 @@ void undo_cb(Fl_Widget *, void *) {
|
||||
if (undo_current <= 0) Main_Menu[undo_item].deactivate();
|
||||
Main_Menu[redo_item].activate();
|
||||
widget_browser->rebuild();
|
||||
g_project.update_settings_dialog();
|
||||
undo_resume();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user