The Battle for Wesnoth  1.19.5+dev
Macros | Functions | Variables
manager_ui.cpp File Reference
#include "addon/manager_ui.hpp"
#include "addon/client.hpp"
#include "addon/info.hpp"
#include "addon/manager.hpp"
#include "config_cache.hpp"
#include "filesystem.hpp"
#include "formula/string_utils.hpp"
#include "preferences/preferences.hpp"
#include "gettext.hpp"
#include "gui/dialogs/addon/manager.hpp"
#include "gui/dialogs/addon/uninstall_list.hpp"
#include "gui/dialogs/addon/connect.hpp"
#include "gui/dialogs/message.hpp"
#include "gui/dialogs/transient_message.hpp"
#include "gui/widgets/retval.hpp"
#include "log.hpp"
#include "wml_exception.hpp"
Include dependency graph for manager_ui.cpp:

Go to the source code of this file.

Macros

#define ERR_CFG   LOG_STREAM(err, log_config)
 
#define INFO_CFG   LOG_STREAM(info, log_config)
 
#define ERR_NET   LOG_STREAM(err, log_network)
 
#define ERR_FS   LOG_STREAM(err, log_filesystem)
 
#define LOG_AC   LOG_STREAM(info, log_addons_client)
 

Functions

bool manage_addons ()
 Shows the add-ons server connection dialog, for access to the various management front-ends. More...
 
bool ad_hoc_addon_fetch_session (const std::vector< std::string > &addon_ids)
 Conducts an ad-hoc add-ons server connection to download an add-on with a particular id and all it's dependencies. More...
 

Variables

static lg::log_domain log_config ("config")
 
static lg::log_domain log_network ("network")
 
static lg::log_domain log_filesystem ("filesystem")
 
static lg::log_domain log_addons_client ("addons-client")
 

Macro Definition Documentation

◆ ERR_CFG

#define ERR_CFG   LOG_STREAM(err, log_config)

Definition at line 41 of file manager_ui.cpp.

◆ ERR_FS

#define ERR_FS   LOG_STREAM(err, log_filesystem)

Definition at line 46 of file manager_ui.cpp.

◆ ERR_NET

#define ERR_NET   LOG_STREAM(err, log_network)

Definition at line 44 of file manager_ui.cpp.

◆ INFO_CFG

#define INFO_CFG   LOG_STREAM(info, log_config)

Definition at line 42 of file manager_ui.cpp.

◆ LOG_AC

#define LOG_AC   LOG_STREAM(info, log_addons_client)

Definition at line 48 of file manager_ui.cpp.

Function Documentation

◆ ad_hoc_addon_fetch_session()

bool ad_hoc_addon_fetch_session ( const std::vector< std::string > &  addon_ids)

Conducts an ad-hoc add-ons server connection to download an add-on with a particular id and all it's dependencies.

Launches gui dialogs when issues arise.

Parameters
addon_idsThe ids of the target add-on.
Returns
true when we successfully installed the target (possibly the user chose to ignore failures)

Definition at line 255 of file manager_ui.cpp.

References _(), prefs::campaign_server(), addons_client::connect(), addon_info::current_version, e, ERR_CFG, ERR_FS, ERR_NET, filesystem::file_exists(), prefs::get(), filesystem::get_addons_dir(), game_config::config_cache::get_config(), lg::info(), INFO_CFG, addons_client::install_addon_with_checks(), game_config::config_cache::instance(), LOG_AC, addons_client::install_result::outcome, gui2::show_error_message(), addons_client::success, and VGETTEXT.

Referenced by gui2::dialogs::migrate_version_selection::post_show().

◆ manage_addons()

bool manage_addons ( )

Shows the add-ons server connection dialog, for access to the various management front-ends.

Returns
true when one or more add-ons have been successfully installed or removed, thus requiring a local WML cache refresh. false otherwise.

Definition at line 228 of file manager_ui.cpp.

References prefs::campaign_server(), prefs::get(), gui2::dialogs::modal_dialog::get_retval(), installed_addons(), gui2::OK, and gui2::dialogs::modal_dialog::show().

Referenced by gui2::dialogs::title_screen::init_callbacks(), and sp::select_campaign().

Variable Documentation

◆ log_addons_client

lg::log_domain log_addons_client("addons-client") ( "addons-client"  )
static

◆ log_config

lg::log_domain log_config("config") ( "config"  )
static

◆ log_filesystem

lg::log_domain log_filesystem("filesystem") ( "filesystem"  )
static

◆ log_network

lg::log_domain log_network("network") ( "network"  )
static