1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:37:34 +00:00

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)
This commit is contained in:
Nick Vella 2021-02-15 20:49:37 +11:00 committed by Andreas Kling
parent 05914d2e9a
commit bafb8b0be6
4 changed files with 61 additions and 9 deletions

View file

@ -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;
};