From a8e0846a7c111a8d5b5cf8592ecb9b9bbd15ce26 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 22 Sep 2020 22:46:29 +0200 Subject: Initial file manager implementation, with thumbnail caching --- plugins/Dmenu.hpp | 2 +- plugins/FileManager.hpp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 plugins/FileManager.hpp (limited to 'plugins') diff --git a/plugins/Dmenu.hpp b/plugins/Dmenu.hpp index 84614cc..32fdad1 100644 --- a/plugins/Dmenu.hpp +++ b/plugins/Dmenu.hpp @@ -9,7 +9,7 @@ namespace QuickMedia { bool search_is_filter() override { return true; } bool search_suggestions_has_thumbnails() const override { return false; } bool search_results_has_thumbnails() const override { return false; } - int get_search_delay() const override { return 0; } + int get_search_delay() const override { return 50; } bool search_suggestion_is_search() const override { return true; } Page get_page_after_search() const override { return Page::EXIT; } PluginResult get_front_page(BodyItems &result_items) override; diff --git a/plugins/FileManager.hpp b/plugins/FileManager.hpp new file mode 100644 index 0000000..d5d7088 --- /dev/null +++ b/plugins/FileManager.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include "Plugin.hpp" +#include + +namespace QuickMedia { + class FileManager : public Plugin { + public: + FileManager(); + PluginResult get_files_in_directory(BodyItems &result_items); + bool set_current_directory(const std::string &path); + bool set_child_directory(const std::string &filename); + const std::filesystem::path& get_current_dir() const; + + bool search_suggestions_has_thumbnails() const override { return true; } + bool search_results_has_thumbnails() const override { return true; } + int get_search_delay() const override { return 50; } + Page get_page_after_search() const override { return Page::FILE_MANAGER; } + private: + std::filesystem::path current_dir; + }; +} \ No newline at end of file -- cgit v1.2.3