Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 18841:74ef7fed8b9a gui-release
simplify some code by using scintilla internal commands
* file-editor-tab.cc (undo, redo, copy, cut, selectall): remove
* file-editor-tab.h: remove undo, redo, copy, cut, selectall
* file-editor.cc (request_undo, request_redo, request_copy, request_cut,
request_paste, reuqest_selectall): replace particular signal by common
signal that sends the scintilla command as paramter;
(add_new_edit_tab): remove the connects of the obsolete signals
* file-editor.h: remove obsolete signals
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 27 Apr 2014 15:13:05 +0200 |
parents | 03edfcd943db |
children | 99e26cb0f87f |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -572,40 +572,45 @@ void file_editor::request_undo (bool) { - emit fetab_undo (_tab_widget->currentWidget ()); + emit fetab_scintilla_command (_tab_widget->currentWidget (), + QsciScintillaBase::SCI_UNDO); } void file_editor::request_redo (bool) { - emit fetab_redo (_tab_widget->currentWidget ()); + emit fetab_scintilla_command (_tab_widget->currentWidget (), + QsciScintillaBase::SCI_REDO); } void file_editor::request_copy (bool) { - emit fetab_copy (_tab_widget->currentWidget ()); + emit fetab_scintilla_command (_tab_widget->currentWidget (), + QsciScintillaBase::SCI_COPY); } void file_editor::request_cut (bool) { - emit fetab_cut (_tab_widget->currentWidget ()); + emit fetab_scintilla_command (_tab_widget->currentWidget (), + QsciScintillaBase::SCI_CUT); } void file_editor::request_paste (bool) { - emit fetab_paste (_tab_widget->currentWidget ()); + emit fetab_scintilla_command (_tab_widget->currentWidget (), + QsciScintillaBase::SCI_PASTE); } void file_editor::request_selectall (bool) { - emit fetab_selectall (_tab_widget->currentWidget ()); + emit fetab_scintilla_command (_tab_widget->currentWidget (), + QsciScintillaBase::SCI_SELECTALL); } - void file_editor::request_context_help (bool) { @@ -1417,24 +1422,6 @@ f, SLOT (save_file (const QWidget*, const QString&, bool))); // Signals from the file_editor trivial operations - connect (this, SIGNAL (fetab_undo (const QWidget*)), - f, SLOT (undo (const QWidget*))); - - connect (this, SIGNAL (fetab_redo (const QWidget*)), - f, SLOT (redo (const QWidget*))); - - connect (this, SIGNAL (fetab_copy (const QWidget*)), - f, SLOT (copy (const QWidget*))); - - connect (this, SIGNAL (fetab_cut (const QWidget*)), - f, SLOT (cut (const QWidget*))); - - connect (this, SIGNAL (fetab_paste (const QWidget*)), - f, SLOT (paste (const QWidget*))); - - connect (this, SIGNAL (fetab_selectall (const QWidget*)), - f, SLOT (select_all (const QWidget*))); - connect (this, SIGNAL (fetab_zoom_in (const QWidget*)), f, SLOT (zoom_in (const QWidget*))); connect (this, SIGNAL (fetab_zoom_out (const QWidget*)),