summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorShannon Booth <shannon.ml.booth@gmail.com>2020-01-07 22:29:21 +1300
committerAndreas Kling <awesomekling@gmail.com>2020-01-07 11:06:27 +0100
commit6192467de93c45bc54b1fcd34e11100233d1b721 (patch)
treef96ae9e3f29c168cb884b231cdeff6ed7a43388b /Applications/FileManager
parent7cf15bcb75735db6b13160d1756e6ef19068a9ad (diff)
downloadserenity-6192467de93c45bc54b1fcd34e11100233d1b721.zip
Filemanager: Add Ctrl+A select all action
Unfortunately this means that current_view() needed to be made non-const as changing the selection is a non-const operation.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/DirectoryView.h2
-rw-r--r--Applications/FileManager/main.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/Applications/FileManager/DirectoryView.h b/Applications/FileManager/DirectoryView.h
index 6d5dcde8cd..e9feeca8ba 100644
--- a/Applications/FileManager/DirectoryView.h
+++ b/Applications/FileManager/DirectoryView.h
@@ -36,7 +36,7 @@ public:
void set_view_mode(ViewMode);
ViewMode view_mode() const { return m_view_mode; }
- const GAbstractView& current_view() const
+ GAbstractView& current_view()
{
switch (m_view_mode) {
case ViewMode::List:
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp
index eab0307aef..16abecf67e 100644
--- a/Applications/FileManager/main.cpp
+++ b/Applications/FileManager/main.cpp
@@ -191,6 +191,10 @@ int main(int argc, char** argv)
return paths;
};
+ auto select_all_action = GAction::create("Select all", { Mod_Ctrl, KeyCode::Key_A }, [&](const GAction&) {
+ directory_view->current_view.select_all();
+ });
+
auto copy_action = GCommonActions::make_copy_action([&](const GAction& action) {
Vector<String> paths;
if (action.activator() == directory_context_menu || directory_view->active_widget()->is_focused()) {