# HG changeset patch # User Torsten # Date 1398604385 -7200 # Node ID 74ef7fed8b9a5369e2d3f7eae1e3f2808909d440 # Parent 03edfcd943dbe4de8cb2b937331eb1b3cf8a801b 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 diff -r 03edfcd943db -r 74ef7fed8b9a libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Sun Apr 27 13:45:24 2014 +0200 +++ b/libgui/src/m-editor/file-editor-tab.cc Sun Apr 27 15:13:05 2014 +0200 @@ -409,61 +409,6 @@ } void -file_editor_tab::undo (const QWidget *ID) -{ - if (ID != this) - return; - - _edit_area->undo (); -} - -void -file_editor_tab::redo (const QWidget *ID) -{ - if (ID != this) - return; - - _edit_area->redo (); -} - -void -file_editor_tab::copy (const QWidget *ID) -{ - if (ID != this) - return; - - _edit_area->copy (); -} - -void -file_editor_tab::cut (const QWidget *ID) -{ - if (ID != this) - return; - - _edit_area->cut (); -} - -void -file_editor_tab::paste (const QWidget *ID) -{ - if (ID != this) - return; - - _edit_area->paste (); -} - -void -file_editor_tab::select_all (const QWidget *ID) -{ - if (ID != this) - return; - - _edit_area->selectAll (); -} - - -void file_editor_tab::context_help (const QWidget *ID, bool doc) { if (ID != this) diff -r 03edfcd943db -r 74ef7fed8b9a libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Sun Apr 27 13:45:24 2014 +0200 +++ b/libgui/src/m-editor/file-editor-tab.h Sun Apr 27 15:13:05 2014 +0200 @@ -67,12 +67,6 @@ void file_name_query (const QWidget *ID); void set_focus (const QWidget *ID); - void undo (const QWidget *ID); - void redo (const QWidget *ID); - void copy (const QWidget *ID); - void cut (const QWidget *ID); - void paste (const QWidget *ID); - void select_all (const QWidget *ID); void context_help (const QWidget *ID, bool); void context_edit (const QWidget *ID); void save_file (const QWidget *ID); diff -r 03edfcd943db -r 74ef7fed8b9a libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Sun Apr 27 13:45:24 2014 +0200 +++ b/libgui/src/m-editor/file-editor.cc Sun Apr 27 15:13:05 2014 +0200 @@ -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*)), diff -r 03edfcd943db -r 74ef7fed8b9a libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Sun Apr 27 13:45:24 2014 +0200 +++ b/libgui/src/m-editor/file-editor.h Sun Apr 27 15:13:05 2014 +0200 @@ -76,12 +76,6 @@ bool remove_on_success); // No fetab_open, functionality in editor // No fetab_new, functionality in editor - void fetab_undo (const QWidget* ID); - void fetab_redo (const QWidget* ID); - void fetab_copy (const QWidget* ID); - void fetab_cut (const QWidget* ID); - void fetab_paste (const QWidget* ID); - void fetab_selectall (const QWidget* ID); void fetab_context_help (const QWidget* ID, bool); void fetab_context_edit (const QWidget* ID); void fetab_save_file (const QWidget* ID);