| 242 | } |
| 243 | |
| 244 | QList<QAction *> OutputPane::actionFactory() |
| 245 | { |
| 246 | QList<QAction *> list; |
| 247 | |
| 248 | { |
| 249 | auto action = new QAction(this); |
| 250 | action->setText(tr("Copy")); |
| 251 | action->setEnabled(false); |
| 252 | connect(action, &QAction::triggered, [this]() { |
| 253 | if (!d->outputEdit->document()->toPlainText().isEmpty()) |
| 254 | d->outputEdit->copy(); |
| 255 | }); |
| 256 | connect(d->outputEdit, &QPlainTextEdit::copyAvailable, action, &QAction::setEnabled); |
| 257 | list.append(action); |
| 258 | } |
| 259 | |
| 260 | { |
| 261 | auto action = new QAction(this); |
| 262 | action->setText(tr("Clear")); |
| 263 | connect(action, &QAction::triggered, [this]() { |
| 264 | if (!d->outputEdit->document()->toPlainText().isEmpty()) |
| 265 | d->outputEdit->clear(); |
| 266 | }); |
| 267 | list.append(action); |
| 268 | } |
| 269 | |
| 270 | { |
| 271 | auto action = new QAction(this); |
| 272 | action->setText(tr("Select All")); |
| 273 | connect(action, &QAction::triggered, [this]() { |
| 274 | if (!d->outputEdit->document()->toPlainText().isEmpty()) |
| 275 | d->outputEdit->selectAll(); |
| 276 | }); |
| 277 | list.append(action); |
| 278 | } |
| 279 | |
| 280 | return list; |
| 281 | } |
| 282 | |
| 283 | void OutputPane::updateFilter(const QString &filterText, bool caseSensitive, bool isRegexp) |
| 284 | { |