Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/panelfunc.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | #include <KService/KMimeTypeTrader> | 51 | #include <KService/KMimeTypeTrader> | ||
52 | #include <KWidgetsAddons/KCursor> | 52 | #include <KWidgetsAddons/KCursor> | ||
53 | #include <KWidgetsAddons/KMessageBox> | 53 | #include <KWidgetsAddons/KMessageBox> | ||
54 | #include <KWidgetsAddons/KToggleAction> | 54 | #include <KWidgetsAddons/KToggleAction> | ||
55 | 55 | | |||
56 | #include "dirhistoryqueue.h" | 56 | #include "dirhistoryqueue.h" | ||
57 | #include "krcalcspacedialog.h" | 57 | #include "krcalcspacedialog.h" | ||
58 | #include "krerrordisplay.h" | 58 | #include "krerrordisplay.h" | ||
59 | #include "krsearchbar.h" | ||||
59 | #include "listpanel.h" | 60 | #include "listpanel.h" | ||
60 | #include "listpanelactions.h" | 61 | #include "listpanelactions.h" | ||
61 | #include "PanelView/krview.h" | 62 | #include "PanelView/krview.h" | ||
62 | #include "PanelView/krviewitem.h" | 63 | #include "PanelView/krviewitem.h" | ||
63 | #include "../krglobal.h" | 64 | #include "../krglobal.h" | ||
64 | #include "../krslots.h" | 65 | #include "../krslots.h" | ||
65 | #include "../kractions.h" | 66 | #include "../kractions.h" | ||
66 | #include "../defaults.h" | 67 | #include "../defaults.h" | ||
▲ Show 20 Lines • Show All 363 Lines • ▼ Show 20 Line(s) | 398 | { | |||
430 | } else { | 431 | } else { | ||
431 | if (link(name.toLocal8Bit(), linkName.toLocal8Bit()) == -1) | 432 | if (link(name.toLocal8Bit(), linkName.toLocal8Bit()) == -1) | ||
432 | KMessageBox::sorry(krMainWindow, | 433 | KMessageBox::sorry(krMainWindow, | ||
433 | i18n("Failed to create a new link '%1' to '%2'", linkName, name)); | 434 | i18n("Failed to create a new link '%1' to '%2'", linkName, name)); | ||
434 | } | 435 | } | ||
435 | } | 436 | } | ||
436 | 437 | | |||
437 | void ListPanelFunc::view() | 438 | void ListPanelFunc::view() | ||
438 | { | 439 | { | ||
nmel: As I [[ https://bugs.kde.org/show_bug.cgi?id=394939#c4 |mentioned in another discussion ]]… | |||||
Mmm... in that discussion there were two persons (https://bugs.kde.org/show_bug.cgi?id=394939#c2 , https://bugs.kde.org/show_bug.cgi?id=394939#c3) that agreed that it's better that users don't have to press Esc every time after those quicksearchs. Total Commander, Double Commander (and Krusader 2.4.0-beta3) also work this way. asensi: Mmm... in that discussion there were two persons (https://bugs.kde.org/show_bug.cgi? | |||||
440 | panel->searchBar->hideBarIfSearching(); | ||||
441 | | ||||
439 | QString fileName = panel->getCurrentName(); | 442 | QString fileName = panel->getCurrentName(); | ||
440 | if (fileName.isNull()) | 443 | if (fileName.isNull()) | ||
441 | return; | 444 | return; | ||
442 | 445 | | |||
443 | // if we're trying to view a directory, just exit | 446 | // if we're trying to view a directory, just exit | ||
444 | FileItem *fileitem = files()->getFileItem(fileName); | 447 | FileItem *fileitem = files()->getFileItem(fileName); | ||
445 | if (!fileitem || fileitem->isDir()) | 448 | if (!fileitem || fileitem->isDir()) | ||
446 | return; | 449 | return; | ||
Show All 18 Lines | |||||
465 | 468 | | |||
466 | void ListPanelFunc::terminal() | 469 | void ListPanelFunc::terminal() | ||
467 | { | 470 | { | ||
468 | SLOTS->runTerminal(panel->lastLocalPath()); | 471 | SLOTS->runTerminal(panel->lastLocalPath()); | ||
469 | } | 472 | } | ||
470 | 473 | | |||
471 | void ListPanelFunc::edit() | 474 | void ListPanelFunc::edit() | ||
472 | { | 475 | { | ||
476 | panel->searchBar->hideBarIfSearching(); | ||||
473 | KFileItem tmp; | 477 | KFileItem tmp; | ||
474 | 478 | | |||
475 | if (fileToCreate.isEmpty()) { | 479 | if (fileToCreate.isEmpty()) { | ||
476 | QString name = panel->getCurrentName(); | 480 | QString name = panel->getCurrentName(); | ||
477 | if (name.isNull()) | 481 | if (name.isNull()) | ||
478 | return; | 482 | return; | ||
479 | fileToCreate = files()->getUrl(name); | 483 | fileToCreate = files()->getUrl(name); | ||
480 | } | 484 | } | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 532 | { | |||
537 | else | 541 | else | ||
538 | KMessageBox::sorry(krMainWindow, job->errorString()); | 542 | KMessageBox::sorry(krMainWindow, job->errorString()); | ||
539 | 543 | | |||
540 | fileToCreate = QUrl(); | 544 | fileToCreate = QUrl(); | ||
541 | } | 545 | } | ||
542 | 546 | | |||
543 | void ListPanelFunc::copyFiles(bool enqueue, bool move) | 547 | void ListPanelFunc::copyFiles(bool enqueue, bool move) | ||
544 | { | 548 | { | ||
549 | panel->searchBar->hideBarIfSearching(); | ||||
550 | | ||||
545 | const QStringList fileNames = panel->getSelectedNames(); | 551 | const QStringList fileNames = panel->getSelectedNames(); | ||
546 | if (fileNames.isEmpty()) | 552 | if (fileNames.isEmpty()) | ||
547 | return ; // safety | 553 | return ; // safety | ||
548 | 554 | | |||
549 | QUrl destination = panel->otherPanel()->virtualPath(); | 555 | QUrl destination = panel->otherPanel()->virtualPath(); | ||
550 | 556 | | |||
551 | bool fullDestPath = false; | 557 | bool fullDestPath = false; | ||
552 | if (fileNames.count() == 1 && otherFunc()->files()->type() != FileSystem::FS_VIRTUAL) { | 558 | if (fileNames.count() == 1 && otherFunc()->files()->type() != FileSystem::FS_VIRTUAL) { | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 615 | if(KConfigGroup(krConfig, "Look&Feel").readEntry("UnselectBeforeOperation", _UnselectBeforeOperation)) { | |||
610 | panel->view->saveSelection(); | 616 | panel->view->saveSelection(); | ||
611 | panel->view->unselectAll(); | 617 | panel->view->unselectAll(); | ||
612 | } | 618 | } | ||
613 | } | 619 | } | ||
614 | 620 | | |||
615 | // called from SLOTS to begin the renaming process | 621 | // called from SLOTS to begin the renaming process | ||
616 | void ListPanelFunc::rename() | 622 | void ListPanelFunc::rename() | ||
617 | { | 623 | { | ||
624 | panel->searchBar->hideBarIfSearching(); | ||||
618 | panel->view->renameCurrentItem(); | 625 | panel->view->renameCurrentItem(); | ||
619 | } | 626 | } | ||
620 | 627 | | |||
621 | // called by signal itemRenamed() from the view to complete the renaming process | 628 | // called by signal itemRenamed() from the view to complete the renaming process | ||
622 | void ListPanelFunc::rename(const QString &oldname, const QString &newname) | 629 | void ListPanelFunc::rename(const QString &oldname, const QString &newname) | ||
623 | { | 630 | { | ||
624 | if (oldname == newname) | 631 | if (oldname == newname) | ||
625 | return ; // do nothing | 632 | return ; // do nothing | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
668 | void ListPanelFunc::defaultOrAlternativeDeleteFiles(bool invert) | 675 | void ListPanelFunc::defaultOrAlternativeDeleteFiles(bool invert) | ||
669 | { | 676 | { | ||
670 | const bool trash = KConfigGroup(krConfig, "General").readEntry("Move To Trash", _MoveToTrash); | 677 | const bool trash = KConfigGroup(krConfig, "General").readEntry("Move To Trash", _MoveToTrash); | ||
671 | deleteFiles(trash != invert); | 678 | deleteFiles(trash != invert); | ||
672 | } | 679 | } | ||
673 | 680 | | |||
674 | void ListPanelFunc::deleteFiles(bool moveToTrash) | 681 | void ListPanelFunc::deleteFiles(bool moveToTrash) | ||
675 | { | 682 | { | ||
683 | panel->searchBar->hideBarIfSearching(); | ||||
684 | | ||||
676 | const bool isVFS = files()->type() == FileSystem::FS_VIRTUAL; | 685 | const bool isVFS = files()->type() == FileSystem::FS_VIRTUAL; | ||
677 | if (isVFS && files()->isRoot()) { | 686 | if (isVFS && files()->isRoot()) { | ||
678 | // only virtual deletion possible | 687 | // only virtual deletion possible | ||
679 | removeVirtualFiles(); | 688 | removeVirtualFiles(); | ||
680 | return; | 689 | return; | ||
681 | } | 690 | } | ||
682 | 691 | | |||
683 | // first get the selected file names list | 692 | // first get the selected file names list | ||
▲ Show 20 Lines • Show All 600 Lines • Show Last 20 Lines |
As I mentioned in another discussion, it's a useful feature to not close the bar in this and a few other cases.