Changeset View
Changeset View
Standalone View
Standalone View
krusader/ActionMan/actionproperty.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 41 | { | |||
---|---|---|---|---|---|
89 | connect(leDifferentUser, SIGNAL(textChanged(QString)), SLOT(setModified())); | 89 | connect(leDifferentUser, SIGNAL(textChanged(QString)), SLOT(setModified())); | ||
90 | connect(chkDifferentUser, SIGNAL(clicked()), SLOT(setModified())); | 90 | connect(chkDifferentUser, SIGNAL(clicked()), SLOT(setModified())); | ||
91 | connect(chkConfirmExecution, SIGNAL(clicked()), SLOT(setModified())); | 91 | connect(chkConfirmExecution, SIGNAL(clicked()), SLOT(setModified())); | ||
92 | connect(chkSeparateStdError, SIGNAL(clicked()), SLOT(setModified())); | 92 | connect(chkSeparateStdError, SIGNAL(clicked()), SLOT(setModified())); | ||
93 | // The modified-state of the ShowOnly-lists is tracked in the access-functions below | 93 | // The modified-state of the ShowOnly-lists is tracked in the access-functions below | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | ActionProperty::~ActionProperty() | 96 | ActionProperty::~ActionProperty() | ||
97 | { | 97 | = default; | ||
98 | } | | |||
99 | 98 | | |||
100 | void ActionProperty::changedShortcut(const QKeySequence& shortcut) | 99 | void ActionProperty::changedShortcut(const QKeySequence& shortcut) | ||
101 | { | 100 | { | ||
102 | KeyButtonShortcut->setKeySequence(shortcut); | 101 | KeyButtonShortcut->setKeySequence(shortcut); | ||
103 | } | 102 | } | ||
104 | 103 | | |||
105 | 104 | | |||
106 | void ActionProperty::clear() | 105 | void ActionProperty::clear() | ||
107 | { | 106 | { | ||
108 | _action = 0; | 107 | _action = nullptr; | ||
109 | 108 | | |||
110 | // This prevents the changed-signal from being emitted during the GUI-update | 109 | // This prevents the changed-signal from being emitted during the GUI-update | ||
111 | _modified = true; // The real state is set at the end of this function. | 110 | _modified = true; // The real state is set at the end of this function. | ||
112 | 111 | | |||
113 | leDistinctName->clear(); | 112 | leDistinctName->clear(); | ||
114 | cbCategory->clearEditText(); | 113 | cbCategory->clearEditText(); | ||
115 | leTitle->clear(); | 114 | leTitle->clear(); | ||
116 | leTooltip->clear(); | 115 | leTooltip->clear(); | ||
▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Line(s) | 323 | { | |||
333 | if (ok && !text.isEmpty()) { | 332 | if (ok && !text.isEmpty()) { | ||
334 | lbShowonlyProtocol->addItems(text.split(';')); | 333 | lbShowonlyProtocol->addItems(text.split(';')); | ||
335 | setModified(); | 334 | setModified(); | ||
336 | } | 335 | } | ||
337 | } | 336 | } | ||
338 | 337 | | |||
339 | void ActionProperty::editProtocol() | 338 | void ActionProperty::editProtocol() | ||
340 | { | 339 | { | ||
341 | if (lbShowonlyProtocol->currentItem() == 0) | 340 | if (lbShowonlyProtocol->currentItem() == nullptr) | ||
342 | return; | 341 | return; | ||
343 | 342 | | |||
344 | bool ok; | 343 | bool ok; | ||
345 | 344 | | |||
346 | QString currentText = lbShowonlyProtocol->currentItem()->text(); | 345 | QString currentText = lbShowonlyProtocol->currentItem()->text(); | ||
347 | 346 | | |||
348 | QString text = QInputDialog::getText(this, i18n("Edit Protocol"), i18n("Set another protocol:"), | 347 | QString text = QInputDialog::getText(this, i18n("Edit Protocol"), i18n("Set another protocol:"), | ||
349 | QLineEdit::Normal, currentText, &ok); | 348 | QLineEdit::Normal, currentText, &ok); | ||
350 | if (ok && !text.isEmpty()) { | 349 | if (ok && !text.isEmpty()) { | ||
351 | lbShowonlyProtocol->currentItem()->setText(text); | 350 | lbShowonlyProtocol->currentItem()->setText(text); | ||
352 | setModified(); | 351 | setModified(); | ||
353 | } | 352 | } | ||
354 | } | 353 | } | ||
355 | 354 | | |||
356 | void ActionProperty::removeProtocol() | 355 | void ActionProperty::removeProtocol() | ||
357 | { | 356 | { | ||
358 | if (lbShowonlyProtocol->currentItem() != 0) { | 357 | if (lbShowonlyProtocol->currentItem() != nullptr) { | ||
359 | delete lbShowonlyProtocol->currentItem(); | 358 | delete lbShowonlyProtocol->currentItem(); | ||
360 | setModified(); | 359 | setModified(); | ||
361 | } | 360 | } | ||
362 | } | 361 | } | ||
363 | 362 | | |||
364 | void ActionProperty::addPath() | 363 | void ActionProperty::addPath() | ||
365 | { | 364 | { | ||
366 | QString folder = QFileDialog::getExistingDirectory(this); | 365 | QString folder = QFileDialog::getExistingDirectory(this); | ||
367 | if (!folder.isEmpty()) { | 366 | if (!folder.isEmpty()) { | ||
368 | lbShowonlyPath->addItem(folder); | 367 | lbShowonlyPath->addItem(folder); | ||
369 | setModified(); | 368 | setModified(); | ||
370 | } | 369 | } | ||
371 | } | 370 | } | ||
372 | 371 | | |||
373 | void ActionProperty::editPath() | 372 | void ActionProperty::editPath() | ||
374 | { | 373 | { | ||
375 | if (lbShowonlyPath->currentItem() == 0) | 374 | if (lbShowonlyPath->currentItem() == nullptr) | ||
376 | return; | 375 | return; | ||
377 | 376 | | |||
378 | bool ok; | 377 | bool ok; | ||
379 | 378 | | |||
380 | QString currentText = lbShowonlyPath->currentItem()->text(); | 379 | QString currentText = lbShowonlyPath->currentItem()->text(); | ||
381 | 380 | | |||
382 | QString text = QInputDialog::getText(this, i18n("Edit Path"), i18n("Set another path:"), | 381 | QString text = QInputDialog::getText(this, i18n("Edit Path"), i18n("Set another path:"), | ||
383 | QLineEdit::Normal, currentText, &ok); | 382 | QLineEdit::Normal, currentText, &ok); | ||
384 | if (ok && !text.isEmpty()) { | 383 | if (ok && !text.isEmpty()) { | ||
385 | lbShowonlyPath->currentItem()->setText(text); | 384 | lbShowonlyPath->currentItem()->setText(text); | ||
386 | setModified(); | 385 | setModified(); | ||
387 | } | 386 | } | ||
388 | } | 387 | } | ||
389 | 388 | | |||
390 | void ActionProperty::removePath() | 389 | void ActionProperty::removePath() | ||
391 | { | 390 | { | ||
392 | if (lbShowonlyPath->currentItem() != 0) { | 391 | if (lbShowonlyPath->currentItem() != nullptr) { | ||
393 | delete lbShowonlyPath->currentItem(); | 392 | delete lbShowonlyPath->currentItem(); | ||
394 | setModified(); | 393 | setModified(); | ||
395 | } | 394 | } | ||
396 | } | 395 | } | ||
397 | 396 | | |||
398 | void ActionProperty::addMime() | 397 | void ActionProperty::addMime() | ||
399 | { | 398 | { | ||
400 | bool ok; | 399 | bool ok; | ||
401 | 400 | | |||
402 | QString currentText; | 401 | QString currentText; | ||
403 | if (lbShowonlyMime->currentItem()) | 402 | if (lbShowonlyMime->currentItem()) | ||
404 | currentText = lbShowonlyMime->currentItem()->text(); | 403 | currentText = lbShowonlyMime->currentItem()->text(); | ||
405 | 404 | | |||
406 | QString text = QInputDialog::getText(this, i18n("New MIME Type"), i18n("Set a MIME type:"), | 405 | QString text = QInputDialog::getText(this, i18n("New MIME Type"), i18n("Set a MIME type:"), | ||
407 | QLineEdit::Normal, currentText, &ok); | 406 | QLineEdit::Normal, currentText, &ok); | ||
408 | if (ok && !text.isEmpty()) { | 407 | if (ok && !text.isEmpty()) { | ||
409 | lbShowonlyMime->addItems(text.split(';')); | 408 | lbShowonlyMime->addItems(text.split(';')); | ||
410 | setModified(); | 409 | setModified(); | ||
411 | } | 410 | } | ||
412 | } | 411 | } | ||
413 | 412 | | |||
414 | void ActionProperty::editMime() | 413 | void ActionProperty::editMime() | ||
415 | { | 414 | { | ||
416 | if (lbShowonlyMime->currentItem() == 0) | 415 | if (lbShowonlyMime->currentItem() == nullptr) | ||
417 | return; | 416 | return; | ||
418 | 417 | | |||
419 | bool ok; | 418 | bool ok; | ||
420 | 419 | | |||
421 | QString currentText = lbShowonlyMime->currentItem()->text(); | 420 | QString currentText = lbShowonlyMime->currentItem()->text(); | ||
422 | 421 | | |||
423 | QString text = QInputDialog::getText(this, i18n("Edit MIME Type"), i18n("Set another MIME type:"), | 422 | QString text = QInputDialog::getText(this, i18n("Edit MIME Type"), i18n("Set another MIME type:"), | ||
424 | QLineEdit::Normal, currentText, &ok); | 423 | QLineEdit::Normal, currentText, &ok); | ||
425 | if (ok && !text.isEmpty()) { | 424 | if (ok && !text.isEmpty()) { | ||
426 | lbShowonlyMime->currentItem()->setText(text); | 425 | lbShowonlyMime->currentItem()->setText(text); | ||
427 | setModified(); | 426 | setModified(); | ||
428 | } | 427 | } | ||
429 | } | 428 | } | ||
430 | 429 | | |||
431 | void ActionProperty::removeMime() | 430 | void ActionProperty::removeMime() | ||
432 | { | 431 | { | ||
433 | if (lbShowonlyMime->currentItem() != 0) { | 432 | if (lbShowonlyMime->currentItem() != nullptr) { | ||
434 | delete lbShowonlyMime->currentItem(); | 433 | delete lbShowonlyMime->currentItem(); | ||
435 | setModified(); | 434 | setModified(); | ||
436 | } | 435 | } | ||
437 | } | 436 | } | ||
438 | 437 | | |||
439 | void ActionProperty::newFile() | 438 | void ActionProperty::newFile() | ||
440 | { | 439 | { | ||
441 | bool ok; | 440 | bool ok; | ||
442 | 441 | | |||
443 | QString currentText; | 442 | QString currentText; | ||
444 | if (lbShowonlyFile->currentItem()) | 443 | if (lbShowonlyFile->currentItem()) | ||
445 | currentText = lbShowonlyFile->currentItem()->text(); | 444 | currentText = lbShowonlyFile->currentItem()->text(); | ||
446 | 445 | | |||
447 | QString text = QInputDialog::getText(this, i18n("New File Name"), i18n("Set a file name:"), | 446 | QString text = QInputDialog::getText(this, i18n("New File Name"), i18n("Set a file name:"), | ||
448 | QLineEdit::Normal, currentText, &ok); | 447 | QLineEdit::Normal, currentText, &ok); | ||
449 | if (ok && !text.isEmpty()) { | 448 | if (ok && !text.isEmpty()) { | ||
450 | lbShowonlyFile->addItems(text.split(';')); | 449 | lbShowonlyFile->addItems(text.split(';')); | ||
451 | setModified(); | 450 | setModified(); | ||
452 | } | 451 | } | ||
453 | } | 452 | } | ||
454 | 453 | | |||
455 | void ActionProperty::editFile() | 454 | void ActionProperty::editFile() | ||
456 | { | 455 | { | ||
457 | if (lbShowonlyFile->currentItem() == 0) | 456 | if (lbShowonlyFile->currentItem() == nullptr) | ||
458 | return; | 457 | return; | ||
459 | 458 | | |||
460 | bool ok; | 459 | bool ok; | ||
461 | 460 | | |||
462 | QString currentText = lbShowonlyFile->currentItem()->text(); | 461 | QString currentText = lbShowonlyFile->currentItem()->text(); | ||
463 | 462 | | |||
464 | QString text = QInputDialog::getText(this, i18n("Edit File Name"), i18n("Set another file name:"), | 463 | QString text = QInputDialog::getText(this, i18n("Edit File Name"), i18n("Set another file name:"), | ||
465 | QLineEdit::Normal, currentText, &ok); | 464 | QLineEdit::Normal, currentText, &ok); | ||
466 | if (ok && !text.isEmpty()) { | 465 | if (ok && !text.isEmpty()) { | ||
467 | lbShowonlyFile->currentItem()->setText(text); | 466 | lbShowonlyFile->currentItem()->setText(text); | ||
468 | setModified(); | 467 | setModified(); | ||
469 | } | 468 | } | ||
470 | } | 469 | } | ||
471 | 470 | | |||
472 | void ActionProperty::removeFile() | 471 | void ActionProperty::removeFile() | ||
473 | { | 472 | { | ||
474 | if (lbShowonlyFile->currentItem() != 0) { | 473 | if (lbShowonlyFile->currentItem() != nullptr) { | ||
475 | delete lbShowonlyFile->currentItem(); | 474 | delete lbShowonlyFile->currentItem(); | ||
476 | setModified(); | 475 | setModified(); | ||
477 | } | 476 | } | ||
478 | } | 477 | } | ||
479 | 478 | | |||
480 | 479 | | |||
481 | bool ActionProperty::validProperties() | 480 | bool ActionProperty::validProperties() | ||
482 | { | 481 | { | ||
Show All 36 Lines |