|
@@ -67,12 +67,20 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ auto clear_action = GUI::Action::create("Clear history", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/trash-can.png"sv)), [&](const GUI::Action&) {
|
|
|
+ model->clear();
|
|
|
+ GUI::Clipboard::the().clear();
|
|
|
+ });
|
|
|
+
|
|
|
auto entry_context_menu = TRY(GUI::Menu::try_create());
|
|
|
TRY(entry_context_menu->try_add_action(delete_action));
|
|
|
TRY(entry_context_menu->try_add_action(debug_dump_action));
|
|
|
+ entry_context_menu->add_separator();
|
|
|
+ TRY(entry_context_menu->try_add_action(clear_action));
|
|
|
table_view->on_context_menu_request = [&](GUI::ModelIndex const&, GUI::ContextMenuEvent const& event) {
|
|
|
delete_action->set_enabled(!table_view->selection().is_empty());
|
|
|
debug_dump_action->set_enabled(!table_view->selection().is_empty());
|
|
|
+ clear_action->set_enabled(!model->is_empty());
|
|
|
entry_context_menu->popup(event.screen_position());
|
|
|
};
|
|
|
|