mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
sculpt_manager: Popup_dialog::_scan_rom -> main
This change allows the consumption of the list of depot users by the forthcoming system-update functionality. Issue #4744
This commit is contained in:
parent
46eb175b17
commit
1f11e4b8db
@ -303,7 +303,11 @@ struct Sculpt::Main : Input_event_handler,
|
||||
xml.attribute("arch", _deploy._arch);
|
||||
xml.attribute("version", _query_version.value);
|
||||
|
||||
_popup_dialog.gen_depot_query(xml);
|
||||
if (_popup_dialog.depot_query_needs_users())
|
||||
xml.node("scan", [&] () {
|
||||
xml.attribute("users", "yes"); });
|
||||
|
||||
_popup_dialog.gen_depot_query(xml, _scan_rom.xml());
|
||||
|
||||
/* update query for blueprints of all unconfigured start nodes */
|
||||
_deploy.gen_depot_query(xml);
|
||||
@ -365,6 +369,16 @@ struct Sculpt::Main : Input_event_handler,
|
||||
|
||||
Deploy::Prio_levels const _prio_levels { 4 };
|
||||
|
||||
Attached_rom_dataspace _scan_rom { _env, "report -> runtime/depot_query/scan" };
|
||||
|
||||
Signal_handler<Main> _scan_handler { _env.ep(), *this, &Main::_handle_scan };
|
||||
|
||||
void _handle_scan()
|
||||
{
|
||||
_scan_rom.update();
|
||||
_popup_dialog.depot_users_scan_updated();
|
||||
}
|
||||
|
||||
Attached_rom_dataspace _launcher_listing_rom {
|
||||
_env, "report -> /runtime/launcher_query/listing" };
|
||||
|
||||
@ -1167,7 +1181,7 @@ struct Sculpt::Main : Input_event_handler,
|
||||
Popup_dialog _popup_dialog { _env, *this, _launchers,
|
||||
_network._nic_state, _network._nic_target,
|
||||
_runtime_state, _cached_runtime_config,
|
||||
_download_queue, *this, *this };
|
||||
_download_queue, _scan_rom, *this, *this };
|
||||
|
||||
Menu_view _popup_menu_view { _env, _child_states, _popup_dialog, "popup_view",
|
||||
Ram_quota{4*1024*1024}, Cap_quota{150},
|
||||
@ -1245,6 +1259,7 @@ struct Sculpt::Main : Input_event_handler,
|
||||
_pci_devices .sigh(_pci_devices_handler);
|
||||
_window_list .sigh(_window_list_handler);
|
||||
_decorator_margins .sigh(_decorator_margins_handler);
|
||||
_scan_rom .sigh(_scan_handler);
|
||||
_launcher_listing_rom.sigh(_launcher_and_preset_listing_handler);
|
||||
_blueprint_rom .sigh(_blueprint_handler);
|
||||
_editor_saved_rom .sigh(_editor_saved_handler);
|
||||
|
@ -121,7 +121,7 @@ void Popup_dialog::_gen_pkg_elements(Xml_generator &xml,
|
||||
}
|
||||
|
||||
|
||||
void Popup_dialog::_gen_menu_elements(Xml_generator &xml) const
|
||||
void Popup_dialog::_gen_menu_elements(Xml_generator &xml, Xml_node const &depot_users) const
|
||||
{
|
||||
/*
|
||||
* Lauchers
|
||||
@ -145,7 +145,7 @@ void Popup_dialog::_gen_menu_elements(Xml_generator &xml) const
|
||||
if (_state == DEPOT_SHOWN || _state == INDEX_REQUESTED) {
|
||||
_gen_sub_menu_title(xml, "back", "Depot");
|
||||
|
||||
_scan_rom.xml().for_each_sub_node("user", [&] (Xml_node user) {
|
||||
depot_users.for_each_sub_node("user", [&] (Xml_node user) {
|
||||
|
||||
User const name = user.attribute_value("name", User());
|
||||
bool const selected = (_selected_user == name);
|
||||
@ -170,7 +170,7 @@ void Popup_dialog::_gen_menu_elements(Xml_generator &xml) const
|
||||
if (_state == DEPOT_SELECTION) {
|
||||
_gen_sub_menu_title(xml, "back", "Selection");
|
||||
|
||||
_scan_rom.xml().for_each_sub_node("user", [&] (Xml_node user) {
|
||||
depot_users.for_each_sub_node("user", [&] (Xml_node user) {
|
||||
|
||||
User const name = user.attribute_value("name", User());
|
||||
bool const selected = _index_avail(name);
|
||||
|
@ -38,6 +38,8 @@ namespace Sculpt { struct Popup_dialog; }
|
||||
|
||||
struct Sculpt::Popup_dialog : Dialog
|
||||
{
|
||||
using Depot_users = Attached_rom_dataspace;
|
||||
|
||||
Env &_env;
|
||||
|
||||
Sculpt_version const _sculpt_version { _env };
|
||||
@ -51,6 +53,7 @@ struct Sculpt::Popup_dialog : Dialog
|
||||
Runtime_info const &_runtime_info;
|
||||
Runtime_config const &_runtime_config;
|
||||
Download_queue const &_download_queue;
|
||||
Depot_users const &_depot_users;
|
||||
|
||||
Depot_query &_depot_query;
|
||||
|
||||
@ -214,15 +217,8 @@ struct Sculpt::Popup_dialog : Dialog
|
||||
return hover_result;
|
||||
}
|
||||
|
||||
Attached_rom_dataspace _scan_rom { _env, "report -> runtime/depot_query/scan" };
|
||||
|
||||
Signal_handler<Popup_dialog> _scan_handler {
|
||||
_env.ep(), *this, &Popup_dialog::_handle_scan };
|
||||
|
||||
void _handle_scan()
|
||||
void depot_users_scan_updated()
|
||||
{
|
||||
_scan_rom.update();
|
||||
|
||||
if (_state == DEPOT_REQUESTED)
|
||||
_state = DEPOT_SHOWN;
|
||||
|
||||
@ -375,13 +371,13 @@ struct Sculpt::Popup_dialog : Dialog
|
||||
|
||||
void _gen_pkg_info (Xml_generator &, Component const &) const;
|
||||
void _gen_pkg_elements (Xml_generator &, Component const &) const;
|
||||
void _gen_menu_elements(Xml_generator &) const;
|
||||
void _gen_menu_elements(Xml_generator &, Xml_node const &depot_users) const;
|
||||
|
||||
void generate(Xml_generator &xml) const override
|
||||
{
|
||||
xml.node("frame", [&] () {
|
||||
xml.node("vbox", [&] () {
|
||||
_gen_menu_elements(xml); }); });
|
||||
_gen_menu_elements(xml, _depot_users.xml()); }); });
|
||||
}
|
||||
|
||||
void click(Action &action);
|
||||
@ -426,27 +422,26 @@ struct Sculpt::Popup_dialog : Dialog
|
||||
Runtime_info const &runtime_info,
|
||||
Runtime_config const &runtime_config,
|
||||
Download_queue const &download_queue,
|
||||
Depot_users const &depot_users,
|
||||
Depot_query &depot_query,
|
||||
Construction_info const &construction_info)
|
||||
:
|
||||
_env(env), _launchers(launchers),
|
||||
_nic_state(nic_state), _nic_target(nic_target),
|
||||
_runtime_info(runtime_info), _runtime_config(runtime_config),
|
||||
_download_queue(download_queue), _depot_query(depot_query),
|
||||
_download_queue(download_queue), _depot_users(depot_users),
|
||||
_depot_query(depot_query),
|
||||
_refresh(refresh), _construction_info(construction_info)
|
||||
{
|
||||
_scan_rom.sigh(_scan_handler);
|
||||
_index_rom.sigh(_index_handler);
|
||||
}
|
||||
|
||||
void gen_depot_query(Xml_generator &xml) const
|
||||
bool depot_query_needs_users() const { return _state >= TOP_LEVEL; }
|
||||
|
||||
void gen_depot_query(Xml_generator &xml, Xml_node const &depot_users) const
|
||||
{
|
||||
if (_state >= TOP_LEVEL)
|
||||
xml.node("scan", [&] () {
|
||||
xml.attribute("users", "yes"); });
|
||||
|
||||
if (_state >= TOP_LEVEL)
|
||||
_scan_rom.xml().for_each_sub_node("user", [&] (Xml_node user) {
|
||||
depot_users.for_each_sub_node("user", [&] (Xml_node user) {
|
||||
xml.node("index", [&] () {
|
||||
User const name = user.attribute_value("name", User());
|
||||
xml.attribute("user", name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user