Mercurial > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 17676:c060ad097056
add menu entries to the editor for directly accessing the editor's settings
* settings-dialog.ui: tabs with self explaining names
* settings-dialog.cc(constructor): name of desired tab as new parameter,
open the last or desired tab depending on this parameter;
(destructor, write_lexer_settings): update to new tab names
* settings-dialog.h: new parameter in constructor
* main-window.cc(process_settings_dialog_request): name of desired tab as new
parameter, settings-dialog is created with this parameter
* main-window.h: new parameter for process_settings_dialog_request
* file-editor.cc(request_preferences,request_styles_preferences): new slots
emtting a new signal for opening the settings dialog via the main window;
(construct): new actions for opening the editor and editor styles settings
* file-editor.h: new actions, related slots and signal for main window
author | Torsten <ttl@justmail.de> |
---|---|
date | Thu, 17 Oct 2013 20:29:17 +0200 |
parents | e693b2622f72 |
children | 97ed9dd479ab |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc Thu Oct 17 10:44:36 2013 -0700 +++ b/libgui/src/m-editor/file-editor.cc Thu Oct 17 20:29:17 2013 +0200 @@ -751,6 +751,18 @@ } void +file_editor::request_preferences (bool) +{ + emit request_settings_dialog ("editor"); +} + +void +file_editor::request_styles_preferences (bool) +{ + emit request_settings_dialog ("editor_styles"); +} + +void file_editor::construct (void) { QWidget *editor_widget = new QWidget (this); @@ -940,6 +952,13 @@ editMenu->addAction (_remove_bookmark_action); editMenu->addSeparator (); editMenu->addAction (_goto_line_action); + editMenu->addSeparator (); + _preferences_action = + editMenu->addAction (QIcon (":/actions/icons/configure.png"), + tr ("&Preferences"), this, SLOT (request_preferences (bool))); + _styles_preferences_action = + editMenu->addAction (QIcon (":/actions/icons/configure.png"), + tr ("&Styles Preferences"), this, SLOT (request_styles_preferences (bool))); _menu_bar->addMenu (editMenu); _debug_menu = new QMenu (tr ("&Debug"), _menu_bar); @@ -981,6 +1000,9 @@ setWidget (editor_widget); // signals + connect (this, SIGNAL (request_settings_dialog (const QString&)), + main_win (), SLOT (process_settings_dialog_request (const QString&))); + connect (main_win (), SIGNAL (new_file_signal (const QString&)), this, SLOT (request_new_file (const QString&)));