summaryrefslogtreecommitdiff
path: root/Userland/Applications/Run/RunWindow.h
diff options
context:
space:
mode:
authorNick Vella <nick@nxk.io>2021-02-15 20:49:37 +1100
committerAndreas Kling <kling@serenityos.org>2021-02-17 23:06:19 +0100
commitbafb8b0be69c0452b7974aa4616976d572db0f21 (patch)
treeca74a9fbabfb8e92dbd166940876db43357dd5c1 /Userland/Applications/Run/RunWindow.h
parent05914d2e9a81243a82369862e28c8ae59d6a38cd (diff)
downloadserenity-bafb8b0be69c0452b7974aa4616976d572db0f21.zip
Run: Store and present recent Run command history in a ComboBox.
We now store the last 25 inputs ran in Run in a simple text file under .config (~/.config/RunHistory.txt)
Diffstat (limited to 'Userland/Applications/Run/RunWindow.h')
-rw-r--r--Userland/Applications/Run/RunWindow.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/Userland/Applications/Run/RunWindow.h b/Userland/Applications/Run/RunWindow.h
index f8cd19ea61..5a99a7731b 100644
--- a/Userland/Applications/Run/RunWindow.h
+++ b/Userland/Applications/Run/RunWindow.h
@@ -27,8 +27,9 @@
#pragma once
#include <LibGUI/Button.h>
+#include <LibGUI/ComboBox.h>
#include <LibGUI/ImageWidget.h>
-#include <LibGUI/TextBox.h>
+#include <LibGUI/ItemListModel.h>
#include <LibGUI/Window.h>
class RunWindow final : public GUI::Window {
@@ -45,9 +46,16 @@ private:
bool run_as_command(const String& run_input);
bool run_via_launch(const String& run_input);
+ String history_file_path();
+ void load_history();
+ void save_history();
+
+ Vector<String> m_path_history;
+ NonnullRefPtr<GUI::ItemListModel<String>> m_path_history_model;
+
RefPtr<GUI::ImageWidget> m_icon_image_widget;
RefPtr<GUI::Button> m_ok_button;
RefPtr<GUI::Button> m_cancel_button;
RefPtr<GUI::Button> m_browse_button;
- RefPtr<GUI::TextBox> m_path_text_box;
+ RefPtr<GUI::ComboBox> m_path_combo_box;
};