Changeset View
Changeset View
Standalone View
Standalone View
mainWindow/kpMainWindow_Edit.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 77 | { | |||
---|---|---|---|---|---|
89 | } | 89 | } | ||
90 | 90 | | |||
91 | 91 | | |||
92 | d->actionCut = KStandardAction::cut (this, SLOT (slotCut()), ac); | 92 | d->actionCut = KStandardAction::cut (this, SLOT (slotCut()), ac); | ||
93 | d->actionCopy = KStandardAction::copy (this, SLOT (slotCopy()), ac); | 93 | d->actionCopy = KStandardAction::copy (this, SLOT (slotCopy()), ac); | ||
94 | d->actionPaste = KStandardAction::paste (this, SLOT (slotPaste()), ac); | 94 | d->actionPaste = KStandardAction::paste (this, SLOT (slotPaste()), ac); | ||
95 | d->actionPasteInNewWindow = ac->addAction ("edit_paste_in_new_window"); | 95 | d->actionPasteInNewWindow = ac->addAction ("edit_paste_in_new_window"); | ||
96 | d->actionPasteInNewWindow->setText (i18n ("Paste in &New Window")); | 96 | d->actionPasteInNewWindow->setText (i18n ("Paste in &New Window")); | ||
97 | connect (d->actionPasteInNewWindow, SIGNAL (triggered(bool)), | 97 | connect (d->actionPasteInNewWindow, &QAction::triggered, | ||
98 | SLOT (slotPasteInNewWindow())); | 98 | this, &kpMainWindow::slotPasteInNewWindow); | ||
99 | ac->setDefaultShortcut (d->actionPasteInNewWindow, Qt::CTRL + Qt::SHIFT + Qt::Key_V); | 99 | ac->setDefaultShortcut (d->actionPasteInNewWindow, Qt::CTRL + Qt::SHIFT + Qt::Key_V); | ||
100 | 100 | | |||
101 | //d->actionDelete = KStandardAction::clear (this, SLOT (slotDelete()), ac); | 101 | //d->actionDelete = KStandardAction::clear (this, SLOT (slotDelete()), ac); | ||
102 | d->actionDelete = ac->addAction ("edit_clear"); | 102 | d->actionDelete = ac->addAction ("edit_clear"); | ||
103 | d->actionDelete->setText (i18n ("&Delete Selection")); | 103 | d->actionDelete->setText (i18n ("&Delete Selection")); | ||
104 | connect (d->actionDelete, SIGNAL (triggered(bool)), SLOT (slotDelete())); | 104 | connect (d->actionDelete, &QAction::triggered, this, &kpMainWindow::slotDelete); | ||
105 | 105 | | |||
106 | d->actionSelectAll = KStandardAction::selectAll (this, SLOT (slotSelectAll()), ac); | 106 | d->actionSelectAll = KStandardAction::selectAll (this, SLOT (slotSelectAll()), ac); | ||
107 | d->actionDeselect = KStandardAction::deselect (this, SLOT (slotDeselect()), ac); | 107 | d->actionDeselect = KStandardAction::deselect (this, SLOT (slotDeselect()), ac); | ||
108 | 108 | | |||
109 | 109 | | |||
110 | d->actionCopyToFile = ac->addAction ("edit_copy_to_file"); | 110 | d->actionCopyToFile = ac->addAction ("edit_copy_to_file"); | ||
111 | d->actionCopyToFile->setText (i18n ("C&opy to File...")); | 111 | d->actionCopyToFile->setText (i18n ("C&opy to File...")); | ||
112 | connect (d->actionCopyToFile, SIGNAL (triggered(bool)), | 112 | connect (d->actionCopyToFile, &QAction::triggered, this, &kpMainWindow::slotCopyToFile); | ||
113 | SLOT (slotCopyToFile())); | 113 | | ||
114 | d->actionPasteFromFile = ac->addAction ("edit_paste_from_file"); | 114 | d->actionPasteFromFile = ac->addAction ("edit_paste_from_file"); | ||
115 | d->actionPasteFromFile->setText (i18n ("Paste &From File...")); | 115 | d->actionPasteFromFile->setText (i18n ("Paste &From File...")); | ||
116 | connect (d->actionPasteFromFile, SIGNAL (triggered(bool)), | 116 | connect (d->actionPasteFromFile, &QAction::triggered, this, &kpMainWindow::slotPasteFromFile); | ||
117 | SLOT (slotPasteFromFile())); | | |||
118 | 117 | | |||
119 | 118 | | |||
120 | d->editMenuDocumentActionsEnabled = false; | 119 | d->editMenuDocumentActionsEnabled = false; | ||
121 | enableEditMenuDocumentActions (false); | 120 | enableEditMenuDocumentActions (false); | ||
122 | 121 | | |||
123 | // Paste should always be enabled, as long as there is something to paste | 122 | // Paste should always be enabled, as long as there is something to paste | ||
124 | // (independent of whether we have a document or not) | 123 | // (independent of whether we have a document or not) | ||
125 | connect (QApplication::clipboard (), SIGNAL (dataChanged()), | 124 | connect (QApplication::clipboard(), &QClipboard::dataChanged, | ||
126 | this, SLOT (slotEnablePaste())); | 125 | this, &kpMainWindow::slotEnablePaste); | ||
126 | | ||||
127 | slotEnablePaste (); | 127 | slotEnablePaste (); | ||
128 | } | 128 | } | ||
129 | 129 | | |||
130 | //--------------------------------------------------------------------- | 130 | //--------------------------------------------------------------------- | ||
131 | 131 | | |||
132 | // private | 132 | // private | ||
133 | void kpMainWindow::enableEditMenuDocumentActions (bool enable) | 133 | void kpMainWindow::enableEditMenuDocumentActions (bool enable) | ||
134 | { | 134 | { | ||
▲ Show 20 Lines • Show All 785 Lines • Show Last 20 Lines |