Mercurial > octave-dspies
comparison libgui/src/m-editor/file-editor.cc @ 18686: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 |
comparison
equal
deleted
inserted
replaced
18685:03edfcd943db | 18686:74ef7fed8b9a |
---|---|
570 } | 570 } |
571 | 571 |
572 void | 572 void |
573 file_editor::request_undo (bool) | 573 file_editor::request_undo (bool) |
574 { | 574 { |
575 emit fetab_undo (_tab_widget->currentWidget ()); | 575 emit fetab_scintilla_command (_tab_widget->currentWidget (), |
576 QsciScintillaBase::SCI_UNDO); | |
576 } | 577 } |
577 | 578 |
578 void | 579 void |
579 file_editor::request_redo (bool) | 580 file_editor::request_redo (bool) |
580 { | 581 { |
581 emit fetab_redo (_tab_widget->currentWidget ()); | 582 emit fetab_scintilla_command (_tab_widget->currentWidget (), |
583 QsciScintillaBase::SCI_REDO); | |
582 } | 584 } |
583 | 585 |
584 void | 586 void |
585 file_editor::request_copy (bool) | 587 file_editor::request_copy (bool) |
586 { | 588 { |
587 emit fetab_copy (_tab_widget->currentWidget ()); | 589 emit fetab_scintilla_command (_tab_widget->currentWidget (), |
590 QsciScintillaBase::SCI_COPY); | |
588 } | 591 } |
589 | 592 |
590 void | 593 void |
591 file_editor::request_cut (bool) | 594 file_editor::request_cut (bool) |
592 { | 595 { |
593 emit fetab_cut (_tab_widget->currentWidget ()); | 596 emit fetab_scintilla_command (_tab_widget->currentWidget (), |
597 QsciScintillaBase::SCI_CUT); | |
594 } | 598 } |
595 | 599 |
596 void | 600 void |
597 file_editor::request_paste (bool) | 601 file_editor::request_paste (bool) |
598 { | 602 { |
599 emit fetab_paste (_tab_widget->currentWidget ()); | 603 emit fetab_scintilla_command (_tab_widget->currentWidget (), |
604 QsciScintillaBase::SCI_PASTE); | |
600 } | 605 } |
601 | 606 |
602 void | 607 void |
603 file_editor::request_selectall (bool) | 608 file_editor::request_selectall (bool) |
604 { | 609 { |
605 emit fetab_selectall (_tab_widget->currentWidget ()); | 610 emit fetab_scintilla_command (_tab_widget->currentWidget (), |
606 } | 611 QsciScintillaBase::SCI_SELECTALL); |
607 | 612 } |
608 | 613 |
609 void | 614 void |
610 file_editor::request_context_help (bool) | 615 file_editor::request_context_help (bool) |
611 { | 616 { |
612 emit fetab_context_help (_tab_widget->currentWidget (), false); | 617 emit fetab_context_help (_tab_widget->currentWidget (), false); |
1415 connect (this, SIGNAL (fetab_save_file (const QWidget*, const QString&, | 1420 connect (this, SIGNAL (fetab_save_file (const QWidget*, const QString&, |
1416 bool)), | 1421 bool)), |
1417 f, SLOT (save_file (const QWidget*, const QString&, bool))); | 1422 f, SLOT (save_file (const QWidget*, const QString&, bool))); |
1418 | 1423 |
1419 // Signals from the file_editor trivial operations | 1424 // Signals from the file_editor trivial operations |
1420 connect (this, SIGNAL (fetab_undo (const QWidget*)), | |
1421 f, SLOT (undo (const QWidget*))); | |
1422 | |
1423 connect (this, SIGNAL (fetab_redo (const QWidget*)), | |
1424 f, SLOT (redo (const QWidget*))); | |
1425 | |
1426 connect (this, SIGNAL (fetab_copy (const QWidget*)), | |
1427 f, SLOT (copy (const QWidget*))); | |
1428 | |
1429 connect (this, SIGNAL (fetab_cut (const QWidget*)), | |
1430 f, SLOT (cut (const QWidget*))); | |
1431 | |
1432 connect (this, SIGNAL (fetab_paste (const QWidget*)), | |
1433 f, SLOT (paste (const QWidget*))); | |
1434 | |
1435 connect (this, SIGNAL (fetab_selectall (const QWidget*)), | |
1436 f, SLOT (select_all (const QWidget*))); | |
1437 | |
1438 connect (this, SIGNAL (fetab_zoom_in (const QWidget*)), | 1425 connect (this, SIGNAL (fetab_zoom_in (const QWidget*)), |
1439 f, SLOT (zoom_in (const QWidget*))); | 1426 f, SLOT (zoom_in (const QWidget*))); |
1440 connect (this, SIGNAL (fetab_zoom_out (const QWidget*)), | 1427 connect (this, SIGNAL (fetab_zoom_out (const QWidget*)), |
1441 f, SLOT (zoom_out (const QWidget*))); | 1428 f, SLOT (zoom_out (const QWidget*))); |
1442 connect (this, SIGNAL (fetab_zoom_normal (const QWidget*)), | 1429 connect (this, SIGNAL (fetab_zoom_normal (const QWidget*)), |