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) {
window(const builder_window::window_resolution &definition)
< Needs to be initialized in show.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
Interfaces for manipulating version numbers of engine, add-ons, etc.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
static bool file_exists(const bfs::path &fpath)
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.
std::vector< std::string > versions_
bool show(const unsigned auto_close_time=0)
Shows the window.
This shows the dialog to select a previous version of Wesnoth to migrate preferences from and redownl...
std::map< std::string, t_string > widget_item
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
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 ...
unsigned int major_version() const
Retrieves the major version number (x1 in "x1.x2.x3").
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.
unsigned int minor_version() const
Retrieves the minor version number (x2 in "x1.x2.x3").
migrate_version_selection()
void copy_file(const std::string &src, const std::string &dest)
Read a file and then writes it back out.
Declarations for File-IO.
const version_info wesnoth_version(VERSION)
Represents version numbers.
const std::string get_version_path_suffix(const version_info &version)
int get_retval() const
Returns the cached window exit code.
std::string get_addons_dir()
std::string get_credentials_file()
Abstract base class for all modal dialogs.
std::map< std::string, widget_item > widget_data
Dialog was closed with the OK button.
std::string get_prefs_file()
static lg::log_domain log_version_migration
base class of top level items, the only item which needs to store the final canvases to draw on...