diff --git a/Common/Context.h b/Common/Context.h index 9528aaed6dec2f7fc4d05aedb83efa87ea6543bb..fbfccbfee9855817f6bb4a390a59a8fe4c1dde53 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -96,8 +96,8 @@ class CTX { int terminal; // number of graphical windows/tiles int numWindows, numTiles; - // text editor and web browser command (with included '%s') - std::string editor, webBrowser; + // text editor command (with included '%s') + std::string editor; // pattern of files to watch out for std::string watchFilePattern; // show tootips in the GUI? diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 23e71f2c09097354d1c230d5780be85fa99ed556..2dce56137df12d1572e2e5233c36a542976bef20 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -109,16 +109,6 @@ StringXString GeneralOptions_String[] = { #endif "Temporary file used by the geometry module" }, - { F|O, "WebBrowser" , opt_general_web_browser , -#if defined(WIN32) - "explorer.exe %s" , -#elif defined(__APPLE__) - "open %s" , -#else - "sensible-browser %s" , -#endif - "System command to launch a web browser" }, - { F, "WatchFilePattern", opt_general_watch_file_pattern , "" , "Pattern of files to merge as they become available"}, diff --git a/Common/Options.cpp b/Common/Options.cpp index 20ae7a5516720eb696fc837ef6062d0e202f1051..5d2b22ecb9315ba0fe164c0669fd90ed73897d7b 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1183,18 +1183,6 @@ std::string opt_general_editor(OPT_ARGS_STR) return CTX::instance()->editor; } -std::string opt_general_web_browser(OPT_ARGS_STR) -{ - if(action & GMSH_SET) - CTX::instance()->webBrowser = val; -#if defined(HAVE_FLTK) - if(FlGui::available() && (action & GMSH_GUI)) - FlGui::instance()->options->general.input[2]->value - (CTX::instance()->webBrowser.c_str()); -#endif - return CTX::instance()->webBrowser; -} - std::string opt_general_watch_file_pattern(OPT_ARGS_STR) { if(action & GMSH_SET) diff --git a/Common/Options.h b/Common/Options.h index ee1006cf6868c2005ddd7d52b51caf6f2ffdf6e4..8446614eeff3c0a6ef8e5102c202adfc61dbbe91 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -47,7 +47,6 @@ std::string opt_general_recent_file2(OPT_ARGS_STR); std::string opt_general_recent_file3(OPT_ARGS_STR); std::string opt_general_recent_file4(OPT_ARGS_STR); std::string opt_general_editor(OPT_ARGS_STR); -std::string opt_general_web_browser(OPT_ARGS_STR); std::string opt_general_watch_file_pattern(OPT_ARGS_STR); std::string opt_general_gui_theme(OPT_ARGS_STR); std::string opt_general_graphics_font(OPT_ARGS_STR); diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 19c1ab3d8c1bc22ed79a593a0b79343f7655927a..f4ff9c4df52be2c11e1138cc2618f5191c7e74c2 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -525,8 +525,7 @@ void file_watch_cb(Fl_Widget *w, void *data) static void help_online_cb(Fl_Widget *w, void *data) { - std::string prog = FixWindowsPath(CTX::instance()->webBrowser); - SystemCall(ReplaceSubString("%s", "http://geuz.org/gmsh/doc/texinfo/", prog)); + fl_open_uri("http://geuz.org/gmsh/doc/texinfo/"); } static void help_basic_cb(Fl_Widget *w, void *data) diff --git a/Fltk/helpWindow.cpp b/Fltk/helpWindow.cpp index 93a52c6e01574d1c5b063da4da10228a71b40efb..2d83de40a84750e5373aeb8c723f6c4ea0e336a3 100644 --- a/Fltk/helpWindow.cpp +++ b/Fltk/helpWindow.cpp @@ -22,8 +22,7 @@ static const char *help_link(Fl_Widget *w, const char *uri) { - std::string prog = FixWindowsPath(CTX::instance()->webBrowser); - SystemCall(ReplaceSubString("%s", uri, prog)); + fl_open_uri(uri); return 0; } diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index add6bf1d3edf13196773d823fc8ec23c23fe5586..578336e76604e8b68858af233726e2a1bd4e4cc6 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -330,7 +330,6 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) opt_general_default_filename(0, GMSH_SET, o->general.input[0]->value()); opt_general_editor(0, GMSH_SET, o->general.input[1]->value()); - opt_general_web_browser(0, GMSH_SET, o->general.input[2]->value()); opt_general_axes_format0(0, GMSH_SET, o->general.input[3]->value()); opt_general_axes_format1(0, GMSH_SET, o->general.input[4]->value()); opt_general_axes_format2(0, GMSH_SET, o->general.input[5]->value()); @@ -1400,60 +1399,54 @@ optionWindow::optionWindow(int deltaFontSize) Fl_Group *o = new Fl_Group (L + WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Advanced"); + general.butt[7] = new Fl_Check_Button + (L + 2 * WB, 2 * WB + 1 * BH, BW, BH, "Print messages on terminal"); + general.butt[7]->type(FL_TOGGLE_BUTTON); + general.butt[7]->callback(general_options_ok_cb); + + general.value[5] = new Fl_Value_Input + (L + 2 * WB, 2 * WB + 2 * BH, IW, BH, "Message verbosity"); + general.value[5]->minimum(0); + general.value[5]->maximum(10); + general.value[5]->step(1); + general.value[5]->align(FL_ALIGN_RIGHT); + general.value[5]->callback(general_options_ok_cb); + general.input[1] = new Fl_Input - (L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Text editor command"); + (L + 2 * WB, 2 * WB + 3 * BH, IW, BH, "Text editor command"); general.input[1]->align(FL_ALIGN_RIGHT); general.input[1]->callback(general_options_ok_cb); - general.input[2] = new Fl_Input - (L + 2 * WB, 2 * WB + 2 * BH, IW, BH, "Web browser command"); - general.input[2]->align(FL_ALIGN_RIGHT); - general.input[2]->callback(general_options_ok_cb); + general.input[0] = new Fl_Input + (L + 2 * WB, 2 * WB + 4 * BH, IW, BH, "Default file name"); + general.input[0]->align(FL_ALIGN_RIGHT); + general.input[0]->callback(general_options_ok_cb); - general.butt[7] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 3 * BH, BW, BH, "Print messages on terminal"); - general.butt[7]->type(FL_TOGGLE_BUTTON); - general.butt[7]->callback(general_options_ok_cb); + general.butt[14] = new Fl_Check_Button + (L + 2 * WB, 2 * WB + 5 * BH, BW, BH, "Ask confirmation before overwriting files"); + general.butt[14]->type(FL_TOGGLE_BUTTON); + general.butt[14]->callback(general_options_ok_cb); general.butt[8] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 4 * BH, BW, BH, "Save session information on exit"); + (L + 2 * WB, 2 * WB + 6 * BH, BW, BH, "Save session information on exit"); general.butt[8]->type(FL_TOGGLE_BUTTON); general.butt[8]->callback(general_options_ok_cb); Fl_Button *b0 = new Fl_Button - (L + width - 2 * WB - BW/3, 2 * WB + 4 * BH, BW/3, BH, "Show file path"); + (L + width - 2 * WB - BW/3, 2 * WB + 6 * BH, BW/3, BH, "Show file path"); b0->callback(options_show_file_cb, (void*)"session"); general.butt[9] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 5 * BH, BW/2-WB, BH, "Save options on exit"); + (L + 2 * WB, 2 * WB + 7 * BH, BW/2-WB, BH, "Save options on exit"); general.butt[9]->type(FL_TOGGLE_BUTTON); general.butt[9]->callback(general_options_ok_cb); Fl_Button *b1 = new Fl_Button - (L + width - 2 * WB - BW/3, 2 * WB + 5 * BH, BW/3, BH, "Show file path"); + (L + width - 2 * WB - BW/3, 2 * WB + 7 * BH, BW/3, BH, "Show file path"); b1->callback(options_show_file_cb, (void*)"option"); - general.butt[14] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 6 * BH, BW, BH, - "Ask confirmation before overwriting files"); - general.butt[14]->type(FL_TOGGLE_BUTTON); - general.butt[14]->callback(general_options_ok_cb); - - general.value[5] = new Fl_Value_Input - (L + 2 * WB, 2 * WB + 7 * BH, IW, BH, "Message verbosity"); - general.value[5]->minimum(0); - general.value[5]->maximum(10); - general.value[5]->step(1); - general.value[5]->align(FL_ALIGN_RIGHT); - general.value[5]->callback(general_options_ok_cb); - - general.input[0] = new Fl_Input - (L + 2 * WB, 2 * WB + 8 * BH, IW, BH, "Default file name"); - general.input[0]->align(FL_ALIGN_RIGHT); - general.input[0]->callback(general_options_ok_cb); - Fl_Button *b2 = new Fl_Button - (L + 2 * WB, 2 * WB + 10 * BH, BW, BH, "Restore all options to default values"); + (L + 2 * WB, 2 * WB + 9 * BH, BW, BH, "Restore all options to default values"); b2->callback(options_restore_defaults_cb); b2->labelcolor(FL_DARK_RED);