@@ -62,6 +62,12 @@ void MainWindow::setupEditMenu()
6262
6363 editMenu->addSeparator ();
6464
65+ editMenu->addAction (QIcon (" :/icons/edit-cut.png" ), tr (" &Cut" ), this , SLOT (cut ()), QKeySequence::Cut);
66+ editMenu->addAction (QIcon (" :/icons/edit-copy.png" ), tr (" &Copy" ), this , SLOT (copy ()), QKeySequence::Copy);
67+ editMenu->addAction (QIcon (" :/icons/edit-paste.png" ), tr (" &Paste" ), this , SLOT (paste ()), QKeySequence::Paste);
68+
69+ editMenu->addSeparator ();
70+
6571 editMenu->addAction (QIcon (" :/icons/edit-find.png" ), tr (" Find" ), this , SLOT (showFindFrame ()), QKeySequence::Find);
6672 editMenu->addAction (QIcon (" :/icons/go-next.png" ), tr (" Find Next" ), this , SLOT (findNextClicked ()), QKeySequence::FindNext);
6773 editMenu->addAction (QIcon (" :/icons/go-previous.png" ), tr (" Find Previous" ), this , SLOT (findPrevClicked ()), QKeySequence::FindPrevious);
@@ -72,18 +78,30 @@ void MainWindow::setupEditMenu()
7278}
7379
7480
81+ void MainWindow::cut ()
82+ {
83+ getEditor (editorTabs->currentIndex ())->cut ();
84+ }
85+
86+ void MainWindow::copy ()
87+ {
88+ getEditor (editorTabs->currentIndex ())->copy ();
89+ }
90+
91+ void MainWindow::paste ()
92+ {
93+ getEditor (editorTabs->currentIndex ())->paste ();
94+ }
95+
96+
7597void MainWindow::undo ()
7698{
77- int index = editorTabs->currentIndex ();
78- Editor * editor = getEditor (index);
79- editor->undo ();
99+ getEditor (editorTabs->currentIndex ())->undo ();
80100}
81101
82102void MainWindow::redo ()
83103{
84- int index = editorTabs->currentIndex ();
85- Editor * editor = getEditor (index);
86- editor->redo ();
104+ getEditor (editorTabs->currentIndex ())->redo ();
87105}
88106
89107
0 commit comments