@@ -55,6 +55,14 @@ Application::Application(int& argc, char** argv)
5555 splash->finish (_mainWindow);
5656 delete splash;
5757 }
58+
59+ // Perform a startup action
60+ const auto action = _settings->getEntryValue (" global/app/startup_action" ).toInt ();
61+ switch (action)
62+ {
63+ case 1 : _mainWindow->openMostRecentProject (); break ;
64+ default : break ; // 0: empty environment
65+ }
5866}
5967
6068Application::~Application ()
@@ -154,17 +162,26 @@ void Application::createSettingsEntries()
154162 // General settings
155163
156164 auto catGlobal = _settings->createCategory (" global" , " Global" );
157- auto secUndoRedo = catGlobal->createSection (" undo" , " Undo and Redo" );
165+ auto secApp = catGlobal->createSection (" app" , " Application" );
166+
167+ SettingsEntryPtr entry (new SettingsEntry (*secApp, " startup_action" , 1 , " On startup, load" ,
168+ " What to show when an application started" ,
169+ " combobox" , false , 1 , { {0 , " Empty environment" }, {1 , " Most recent project" } }));
170+ secApp->addEntry (std::move (entry));
158171
159172 // By default we limit the undo stack to 500 undo commands, should be enough and should
160- // avoid memory drainage. keep in mind that every tabbed editor has it's own undo stack,
173+ // avoid memory drainage. Keep in mind that every tabbed editor has it's own undo stack,
161174 // so the overall command limit is number_of_tabs * 500!
162- SettingsEntryPtr entry (new SettingsEntry (*secUndoRedo, " limit" , 500 , " Limit (number of steps)" ,
163- " Puts a limit on every tabbed editor's undo stack. You can undo at most the number of times specified here." ,
164- " int" , true , 1 ));
165- secUndoRedo->addEntry (std::move (entry));
175+ entry.reset (new SettingsEntry (*secApp, " undo_limit" , 500 , " Undo history size" ,
176+ " Puts a limit on every tabbed editor's undo stack. You can undo at most the number of times specified here." ,
177+ " int" , true , 1 ));
178+ secApp->addEntry (std::move (entry));
179+
180+ entry.reset (new SettingsEntry (*secApp, " copy_path_os_separators" , true , " Copy path with OS-specific separators" ,
181+ " When copy a file path to clipboard, will convert forward slashes (/) to OS-specific separators" ,
182+ " checkbox" , false , 1 ));
183+ secApp->addEntry (std::move (entry));
166184
167- auto secApp = catGlobal->createSection (" app" , " Application" );
168185 entry.reset (new SettingsEntry (*secApp, " show_splash" , true , " Show splash screen" ,
169186 " Show the splash screen on startup" ,
170187 " checkbox" , false , 1 ));
0 commit comments