| 178 | } |
| 179 | |
| 180 | bool TextDocumentEditorView::onMsg(const char* msg) |
| 181 | { |
| 182 | // don't allow any actions if the editor is being closed |
| 183 | if (aboutToClose) { |
| 184 | return false; |
| 185 | } |
| 186 | |
| 187 | if (strcmp(msg, "Save") == 0) { |
| 188 | saveToObject(); |
| 189 | getGuiDocument()->save(); |
| 190 | return true; |
| 191 | } |
| 192 | if (strcmp(msg, "Cut") == 0) { |
| 193 | getEditor()->cut(); |
| 194 | return true; |
| 195 | } |
| 196 | if (strcmp(msg, "Copy") == 0) { |
| 197 | getEditor()->copy(); |
| 198 | return true; |
| 199 | } |
| 200 | if (strcmp(msg, "Paste") == 0) { |
| 201 | getEditor()->paste(); |
| 202 | return true; |
| 203 | } |
| 204 | if (strcmp(msg, "Undo") == 0) { |
| 205 | getEditor()->undo(); |
| 206 | return true; |
| 207 | } |
| 208 | if (strcmp(msg, "Redo") == 0) { |
| 209 | getEditor()->redo(); |
| 210 | return true; |
| 211 | } |
| 212 | return false; |
| 213 | } |
| 214 | |
| 215 | #include "moc_TextDocumentEditorView.cpp" |