mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +00:00
ClipboardHistory: Add debug dump action
This allows for easy dumping of clipboard data to the debug console.
This commit is contained in:
parent
298a6b9937
commit
2565f458d1
2 changed files with 11 additions and 1 deletions
|
@ -62,10 +62,18 @@ int main(int argc, char* argv[])
|
|||
model->remove_item(table_view.selection().first().row());
|
||||
});
|
||||
|
||||
auto debug_dump_action = GUI::Action::create("Dump to debug console", [&](const GUI::Action&) {
|
||||
table_view.selection().for_each_index([&](GUI::ModelIndex& index) {
|
||||
dbgln("{}", model->data(index, GUI::ModelRole::Display).as_string());
|
||||
});
|
||||
});
|
||||
|
||||
auto entry_context_menu = GUI::Menu::construct();
|
||||
entry_context_menu->add_action(delete_action);
|
||||
entry_context_menu->add_action(debug_dump_action);
|
||||
table_view.on_context_menu_request = [&](const GUI::ModelIndex&, const GUI::ContextMenuEvent& event) {
|
||||
delete_action->set_enabled(!table_view.selection().is_empty());
|
||||
debug_dump_action->set_enabled(!table_view.selection().is_empty());
|
||||
entry_context_menu->popup(event.screen_position());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue