15 #define GETTEXT_DOMAIN "wesnoth-lib"
30 #include <boost/algorithm/string.hpp>
33 #define ERR_LOG_VERSION_MIGRATION LOG_STREAM(err, log_version_migration)
34 #define WRN_LOG_VERSION_MIGRATION LOG_STREAM(warn, log_version_migration)
35 #define LOG_LOG_VERSION_MIGRATION LOG_STREAM(info, log_version_migration)
36 #define DBG_LOG_VERSION_MIGRATION LOG_STREAM(debug, log_version_migration)
57 std::string previous_version_str = std::to_string(current_version.
major_version()) +
"."
59 std::string previous_addons_dir
63 versions_.push_back(previous_version_str);
70 listbox& version_list = find_widget<listbox>(&
window,
"versions_listbox",
false);
76 item_label[
"label"] = version;
77 data[
"version_label"] = item_label;
87 listbox& version_list = find_widget<listbox>(&
window,
"versions_listbox",
false);
91 std::string migrate_addons_dir
93 std::string migrate_prefs_file
95 std::string migrate_credentials_file
101 std::vector<std::string> migrate_addons;
103 if(migrate_addons.size() > 0) {
This shows the dialog to select a previous version of Wesnoth to migrate preferences from and redownl...
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
migrate_version_selection()
std::vector< std::string > versions_
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Abstract base class for all modal dialogs.
bool show(const unsigned auto_close_time=0)
Shows the window.
int get_retval() const
Returns the cached window exit code.
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
int get_selected_row() const
Returns the first selected row.
base class of top level items, the only item which needs to store the final canvases to draw on.
Represents version numbers.
unsigned int minor_version() const
Retrieves the minor version number (x2 in "x1.x2.x3").
unsigned int major_version() const
Retrieves the major version number (x1 in "x1.x2.x3").
Declarations for File-IO.
Interfaces for manipulating version numbers of engine, add-ons, etc.
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 ...
static lg::log_domain log_version_migration
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void get_files_in_dir(const std::string &dir, std::vector< std::string > *files, std::vector< std::string > *dirs, name_mode mode, filter_mode filter, reorder_mode reorder, file_tree_checksum *checksum)
Get a list of all files and/or directories in a given directory.
void copy_file(const std::string &src, const std::string &dest)
Read a file and then writes it back out.
static bool file_exists(const bfs::path &fpath)
std::string get_prefs_file()
std::string get_credentials_file()
std::string get_addons_dir()
const std::string get_version_path_suffix(const version_info &version)
const version_info wesnoth_version(VERSION)
std::map< std::string, widget_item > widget_data
std::map< std::string, t_string > widget_item
@ OK
Dialog was closed with the OK button.