diff --git a/Common/Context.cpp b/Common/Context.cpp index 0f6b52931e997b98d7da1c102a6e0fe0e5a2c2cd..df05afef401b9ac706a56d0fd16c7aab1d277afc 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -71,7 +71,7 @@ CTX::CTX() : gamepad(0) hideUnselected = 0; numWindows = numTiles = 1; deltaFontSize = 0; - recentFiles.resize(5); + recentFiles.resize(10); mesh.optimizeLloyd = 0; gamepad = 0; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 879009d2bf49466e160b817465a1c84cdee982b0..1e49db143344b0435e8e8cbaa2a9e59fc50a0167 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -86,6 +86,16 @@ StringXString GeneralOptions_String[] = { "4th most recent opened file"}, { F|S, "RecentFile4", opt_general_recent_file4 , "untitled.geo" , "5th most recent opened file"}, + { F|S, "RecentFile5", opt_general_recent_file5 , "untitled.geo" , + "6th most recent opened file"}, + { F|S, "RecentFile6", opt_general_recent_file6 , "untitled.geo" , + "7th most recent opened file"}, + { F|S, "RecentFile7", opt_general_recent_file7 , "untitled.geo" , + "8th most recent opened file"}, + { F|S, "RecentFile8", opt_general_recent_file8 , "untitled.geo" , + "9th most recent opened file"}, + { F|S, "RecentFile9", opt_general_recent_file9 , "untitled.geo" , + "10th most recent opened file"}, { 0, "SessionFileName" , opt_general_session_filename , #if defined(WIN32) diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 97fb592a4454cc3c6ed406c8c3e2c482c9a3745a..b93543a6e2091b064c31ee15930e6b77c93cfed9 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -686,11 +686,13 @@ void OpenProject(const std::string &fileName, bool setWindowTitle) // merge the file if(MergeFile(fileName, false, setWindowTitle)) { - if(fileName != CTX::instance()->recentFiles.front()) + if(std::find(CTX::instance()->recentFiles.begin(), + CTX::instance()->recentFiles.end(), fileName) == + CTX::instance()->recentFiles.end()) CTX::instance()->recentFiles.insert (CTX::instance()->recentFiles.begin(), fileName); - if(CTX::instance()->recentFiles.size() > 5) - CTX::instance()->recentFiles.resize(5); + if(CTX::instance()->recentFiles.size() > 10) + CTX::instance()->recentFiles.resize(10); #if defined(HAVE_FLTK) if(FlGui::available()) FlGui::instance()->graph[0]->fillRecentHistoryMenu(); diff --git a/Common/Options.cpp b/Common/Options.cpp index fb09ce8d79b9cb60857c17044999ea0133ef015c..df4c02dfad54955efcdae2d465c08b1f710b073c 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1204,6 +1204,41 @@ std::string opt_general_recent_file4(OPT_ARGS_STR) return CTX::instance()->recentFiles[4]; } +std::string opt_general_recent_file5(OPT_ARGS_STR) +{ + if(action & GMSH_SET) + CTX::instance()->recentFiles[5] = val; + return CTX::instance()->recentFiles[5]; +} + +std::string opt_general_recent_file6(OPT_ARGS_STR) +{ + if(action & GMSH_SET) + CTX::instance()->recentFiles[6] = val; + return CTX::instance()->recentFiles[6]; +} + +std::string opt_general_recent_file7(OPT_ARGS_STR) +{ + if(action & GMSH_SET) + CTX::instance()->recentFiles[7] = val; + return CTX::instance()->recentFiles[7]; +} + +std::string opt_general_recent_file8(OPT_ARGS_STR) +{ + if(action & GMSH_SET) + CTX::instance()->recentFiles[8] = val; + return CTX::instance()->recentFiles[8]; +} + +std::string opt_general_recent_file9(OPT_ARGS_STR) +{ + if(action & GMSH_SET) + CTX::instance()->recentFiles[9] = val; + return CTX::instance()->recentFiles[9]; +} + std::string opt_general_editor(OPT_ARGS_STR) { if(action & GMSH_SET) diff --git a/Common/Options.h b/Common/Options.h index 90d721c1ae5a0d7f4408d1bd643f382edb61b13d..3338b10d3f72e6d1b4c4cccc6a25fba16885c925 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -47,6 +47,11 @@ std::string opt_general_recent_file1(OPT_ARGS_STR); 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_recent_file5(OPT_ARGS_STR); +std::string opt_general_recent_file6(OPT_ARGS_STR); +std::string opt_general_recent_file7(OPT_ARGS_STR); +std::string opt_general_recent_file8(OPT_ARGS_STR); +std::string opt_general_recent_file9(OPT_ARGS_STR); std::string opt_general_editor(OPT_ARGS_STR); std::string opt_general_watch_file_pattern(OPT_ARGS_STR); std::string opt_general_gui_theme(OPT_ARGS_STR); diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 963ef8c86294b3eabdac642cc7cca701eefc6c66..d415f8d965bb74467b6309a6e9f6d87762e127bf 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -1948,6 +1948,11 @@ static Fl_Menu_Item bar_table[] = { {"&New...", FL_CTRL+'n', (Fl_Callback *)file_new_cb, 0}, {"&Open...", FL_CTRL+'o', (Fl_Callback *)file_open_merge_cb, (void*)"open"}, {"Open Recent", 0, 0, 0, FL_SUBMENU}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, @@ -2016,6 +2021,11 @@ static Fl_Menu_Item sysbar_table[] = { {"New...", FL_META+'n', (Fl_Callback *)file_new_cb, 0}, {"Open...", FL_META+'o', (Fl_Callback *)file_open_merge_cb, (void*)"open"}, {"Open Recent", 0, 0, 0, FL_SUBMENU}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, + {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, {"", 0, (Fl_Callback *)file_open_recent_cb, 0}, @@ -3505,7 +3515,7 @@ void graphicWindow::fillRecentHistoryMenu() table = sysbar_table; #endif - for(int i = 0; i < 5; i++){ + for(int i = 0; i < 10; i++){ table[4 + i].text = CTX::instance()->recentFiles[i].c_str(); table[4 + i].user_data_ = (void*)CTX::instance()->recentFiles[i].c_str(); } diff --git a/doc/texinfo/opt_general.texi b/doc/texinfo/opt_general.texi index 1d6249dfdea99e0540859c2a97c0822fbae9c3a0..3711281f131f2bf9da319e7fa4bb42a73b1fae36 100644 --- a/doc/texinfo/opt_general.texi +++ b/doc/texinfo/opt_general.texi @@ -67,7 +67,7 @@ Saved in: @code{-} @item General.FltkTheme FLTK user interface theme (try e.g. plastic or gtk+)@* Default value: @code{""}@* -Saved in: @code{General.OptionsFileName} +Saved in: @code{General.SessionFileName} @item General.GraphicsFont Font used in the graphic window@* @@ -114,6 +114,31 @@ Saved in: @code{General.SessionFileName} Default value: @code{"untitled.geo"}@* Saved in: @code{General.SessionFileName} +@item General.RecentFile5 +6th most recent opened file@* +Default value: @code{"untitled.geo"}@* +Saved in: @code{General.SessionFileName} + +@item General.RecentFile6 +7th most recent opened file@* +Default value: @code{"untitled.geo"}@* +Saved in: @code{General.SessionFileName} + +@item General.RecentFile7 +8th most recent opened file@* +Default value: @code{"untitled.geo"}@* +Saved in: @code{General.SessionFileName} + +@item General.RecentFile8 +9th most recent opened file@* +Default value: @code{"untitled.geo"}@* +Saved in: @code{General.SessionFileName} + +@item General.RecentFile9 +10th most recent opened file@* +Default value: @code{"untitled.geo"}@* +Saved in: @code{General.SessionFileName} + @item General.SessionFileName Option file into which session specific information is saved; automatically read on startup@* Default value: @code{".gmshrc"}@* @@ -465,9 +490,9 @@ Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @item General.ColorScheme -Default color scheme (0=dark, 1=light or 2=grayscale)@* +Default color scheme for graphics (0=dark, 1=light, 2=grayscale, 3=reverse)@* Default value: @code{1}@* -Saved in: @code{General.OptionsFileName} +Saved in: @code{General.SessionFileName} @item General.ConfirmOverwrite Ask confirmation before overwriting files?@* @@ -564,6 +589,11 @@ Vertical position (in pixels) of the upper left corner of the file chooser windo Default value: @code{200}@* Saved in: @code{General.SessionFileName} +@item General.FltkColorScheme +FLTK user interface color theme (0: standard, 1:dark)@* +Default value: @code{0}@* +Saved in: @code{General.SessionFileName} + @item General.FontSize Size of the font in the user interface (-1=automatic)@* Default value: @code{-1}@* diff --git a/doc/texinfo/opt_view.texi b/doc/texinfo/opt_view.texi index d5699766277cb3dfdeac3ffb3d7ac3c6c39c43de..81abcc4408a77b26e83a2f7011665229882f9a46 100644 --- a/doc/texinfo/opt_view.texi +++ b/doc/texinfo/opt_view.texi @@ -216,7 +216,7 @@ Saved in: @code{General.OptionsFileName} @item View.CenterGlyphs Center glyphs (arrows, numbers, etc.)? (0=left, 1=centered, 2=right)@* -Default value: @code{1}@* +Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @item View.Clip