Mercurial > octave-nkf
comparison gui/src/octave-gui.cc @ 14804:a565c560e654 gui
Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
* default-settings: New file containing the default settings.
* file-editor-tab: Subclassed event observer and added code to send a run event.
* main-window: Sending workspace events instead of using the terminal.
* octave-event: Added new event types.
* octave-link: Added getter for the current working directory.
* octave-gui: Adjusted code, so the default settings can be loaded.
* resource-manager: Added code to handle the logic with a default settings file.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Tue, 26 Jun 2012 15:27:10 +0200 |
parents | 5cb54cca8a06 |
children | a6c44c28dabe |
comparison
equal
deleted
inserted
replaced
14803:625be3eb27c5 | 14804:a565c560e654 |
---|---|
29 while (true) | 29 while (true) |
30 { | 30 { |
31 if (resource_manager::instance ()->is_first_run ()) | 31 if (resource_manager::instance ()->is_first_run ()) |
32 { | 32 { |
33 welcome_wizard welcomeWizard; | 33 welcome_wizard welcomeWizard; |
34 int returnCode = welcomeWizard.exec (); | 34 welcomeWizard.exec (); |
35 | |
36 QSettings *settings = resource_manager::instance ()->get_settings (); | |
37 settings->setValue ("connectOnStartup", true); | |
38 settings->setValue ("showMessageOfTheDay", true); | |
39 settings->setValue ("showTopic", true); | |
40 settings->setValue ("autoIdentification", false); | |
41 settings->setValue ("nickServPassword", ""); | |
42 settings->setValue ("useCustomFileEditor", false); | |
43 settings->setValue ("customFileEditor", "emacs"); | |
44 settings->setValue ("editor/showLineNumbers", true); | |
45 settings->setValue ("editor/highlightCurrentLine", true); | |
46 settings->setValue ("editor/codeCompletion", true); | |
47 settings->setValue ("editor/fontName", "Monospace"); | |
48 settings->setValue ("editor/fontSize", 10); | |
49 settings->setValue ("editor/shortWindowTitle", true); | |
50 settings->setValue ("showFilenames", true); | |
51 settings->setValue ("showFileSize", false); | |
52 settings->setValue ("showFileType", false); | |
53 settings->setValue ("showLastModified", false); | |
54 settings->setValue ("showHiddenFiles", false); | |
55 settings->setValue ("useAlternatingRowColors", true); | |
56 settings->setValue ("useProxyServer", false); | |
57 settings->setValue ("proxyType", "Sock5Proxy"); | |
58 settings->setValue ("proxyHostName", "none"); | |
59 settings->setValue ("proxyPort", 8080); | |
60 settings->setValue ("proxyUserName", ""); | |
61 settings->setValue ("proxyPassword", ""); | |
62 settings->sync (); | |
63 resource_manager::instance ()->reload_settings (); | 35 resource_manager::instance ()->reload_settings (); |
64 | |
65 application.quit (); | |
66 // We are in an infinite loop, so everything else than a return | |
67 // will cause the application to restart from the very beginning. | |
68 if (returnCode == QDialog::Rejected) | |
69 return 0; | |
70 } | 36 } |
71 else | 37 else |
72 { | 38 { |
73 QSettings *settings = resource_manager::instance ()->get_settings (); | 39 QSettings *settings = resource_manager::instance ()->get_settings (); |
74 QString language = settings->value ("language").toString (); | 40 QString language = settings->value ("language").toString (); |
81 resource_manager::instance ()->update_network_settings (); | 47 resource_manager::instance ()->update_network_settings (); |
82 resource_manager::instance ()->load_icons (); | 48 resource_manager::instance ()->load_icons (); |
83 | 49 |
84 main_window w; | 50 main_window w; |
85 w.show (); | 51 w.show (); |
86 //w.activateWindow(); | |
87 return application.exec (); | 52 return application.exec (); |
88 } | 53 } |
89 } | 54 } |
90 } | 55 } |