32 struct builder_addon_list;
183 static const std::string&
type();
217 virtual std::unique_ptr<widget>
build()
const override;
A config object defines a single node in a WML file, with access to child nodes.
addon_op_func_t uninstall_function_
void set_uninstall_function(addon_op_func_t function)
Sets the function to call when the player clicks the uninstall button.
virtual const std::string & get_control_type() const override
Inherited from styled_widget, implemented by REGISTER_WIDGET.
virtual bool get_active() const override
See styled_widget::get_active.
std::function< bool(const addon_info &, const addon_info &)> addon_sort_func
void set_publish_function(addon_op_func_t function)
Sets the function to upload an addon to the addons server.
void set_addon_shown(boost::dynamic_bitset<> &shown)
Filters which add-ons are visible.
void add_list_to_keyboard_chain()
Adds the internal listbox to the keyboard event chain.
void set_install_status_visibility(visibility visibility)
Determines if install status of each widget is shown.
void set_install_function(addon_op_func_t function)
Sets the function to call when the player clicks the install button.
void set_delete_function(addon_op_func_t function)
Sets the function to install an addon from the addons server.
void addon_action_wrapper(addon_op_func_t &func, const addon_info &addon, bool &handled, bool &halt)
Helper to wrap the execution of any of the addon operation functions.
void set_install_buttons_visibility(visibility visibility)
Determines if install/uninstall buttons are shown for each widget.
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
const addon_info * get_selected_addon() const
Returns the selected add-on.
virtual void set_active(const bool) override
See styled_widget::set_active.
void set_update_function(addon_op_func_t function)
Sets the function to call when the player clicks the update button.
void set_self_active(const bool) override
See container_base::set_self_active.
visibility install_buttons_visibility_
void set_modified_signal_handler(const std::function< void()> &callback)
Sets up a callback that will be called when the player selects an add-on.
listbox & get_listbox()
Returns the underlying list box.
void set_callback_order_change(std::function< void(unsigned, sort_order::type)> callback)
Sets up a callback that will be called when the player changes the sorting order.
std::string get_remote_addon_id()
Returns the selected add-on id, for use with remote publish/delete ops.
const std::string display_title_full_shift(const addon_info &addon) const
static const int DEFAULT_ACTION_RETVAL
Special retval for the toggle panels in the addons list.
static std::string colorize_addon_state_string(const std::string &str, ADDON_STATUS state, bool verbose=false)
Changes the color of an add-on state string (installed, outdated, etc.) according to the state itself...
static std::string describe_status(const addon_tracking_info &info)
std::vector< const addon_info * > addon_vector_
addon_op_func_t update_function_
void select_first_addon()
Choose the item at the top of the list (taking account of sort order).
addon_op_func_t delete_function_
virtual unsigned get_state() const override
See styled_widget::get_state.
addon_list(const implementation::builder_addon_list &builder)
addon_op_func_t publish_function_
visibility install_status_visibility_
void set_addon_order(const addon_sort_func &func)
void select_addon(const std::string &id)
Selects the add-on with the given ID.
std::function< void(const addon_info &)> addon_op_func_t
void set_addons(const addons_list &addons)
Sets the add-ons to show.
addon_op_func_t install_function_
A generic container base class.
void set_row_shown(const unsigned row, const bool shown)
Makes a row visible or invisible.
void set_callback_order_change(std::function< void(unsigned, sort_order::type)> callback)
Registers a callback to be called when the active sorting option changes.
std::map< std::string, addon_info > addons_list
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
std::shared_ptr< builder_grid > builder_grid_ptr
Contains the implementation details for lexical_cast and shouldn't be used directly.
ADDON_STATUS
Defines various add-on installation statuses.
Stores additional status information about add-ons.
resolution(const config &cfg)
addon_list_definition(const config &cfg)
widget::visibility install_buttons_visibility
virtual std::unique_ptr< widget > build() const override
widget::visibility install_status_visibility
builder_addon_list(const config &cfg)