15 #define GETTEXT_DOMAIN "wesnoth-lib"
31 #ifdef GUI2_EXPERIMENTAL_LISTBOX
53 const std::string text_feature_on =
"<span color='#0f0'>●</span>";
54 const std::string text_feature_off =
"<span color='#f00'>●</span>";
91 : path_wid_stem_("path_")
92 , copy_wid_stem_("copy_")
93 , browse_wid_stem_("browse_")
124 generate_plain_text_report();
135 tcontrol& version_label = find_widget<tcontrol>(&window,
"version",
false);
139 tcontrol& os_label = find_widget<tcontrol>(&window,
"os",
false);
143 tbutton& copy_all = find_widget<tbutton>(&window,
"copy_all",
false);
159 tbutton& copy_w = find_widget<tbutton>(
161 tbutton& browse_w = find_widget<tbutton>(
185 copy_w.set_active(
false);
186 copy_w.set_tooltip(
_(
"Clipboard support not found, contact your packager"));
191 tgrid& w32_options_grid
192 = find_widget<tgrid>(&window,
"win32_paths",
false);
196 = find_widget<tbutton>(&window,
"open_stderr",
false);
209 std::map<std::string, string_map> list_data;
212 = find_widget<tlistbox>(&window,
"deps_listbox",
false);
214 for(
const auto & dep :
deps_)
216 list_data[
"dep_name"][
"label"] = dep[0];
218 list_data[
"dep_build_version"][
"label"] = dep[1];
223 if(!dep[2].empty()) {
224 list_data[
"dep_rt_version"][
"label"] = dep[2];
226 list_data[
"dep_rt_version"][
"label"] =
_(
"version^N/A");
229 deps_listbox.
add_row(list_data);
240 = find_widget<tlistbox>(&window,
"opts_listbox",
false);
242 for(
const auto & opt :
opts_)
244 list_data[
"opt_name"][
"label"] = opt.name;
247 list_data[
"opt_status"][
"label"] = text_feature_on;
249 list_data[
"opt_status"][
"label"] = text_feature_off;
251 list_data[
"opt_status"][
"use_markup"] =
"true";
253 opts_listbox.
add_row(list_data);
264 = find_widget<tstacked_widget>(&window,
"tabs_container",
false);
268 = find_widget<tlistbox>(&window,
"tab_bar",
false);
270 list_data[
"tab_label"][
"label"] =
_(
"Paths");
273 list_data[
"tab_label"][
"label"] =
_(
"Libraries");
276 list_data[
"tab_label"][
"label"] =
_(
"Features");
280 window.keyboard_capture(&tab_bar);
285 for(
unsigned k = 0; k < tab_count; ++k) {
286 #ifdef GUI2_EXPERIMENTAL_LISTBOX
293 dialog_callback<tgame_version, &tgame_version::tab_switch_callback>);
301 = find_widget<tstacked_widget>(&window,
"tabs_container",
false);
303 = find_widget<tlistbox>(&window,
"tab_bar",
false);
305 pager.
select_layer(std::max<int>(0, tab_bar.get_selected_row()));
325 std::ostringstream o;
333 <<
"Data dir: " <<
path_map_[
"datadir"] <<
'\n'
334 <<
"User config dir: " <<
path_map_[
"config"] <<
'\n'
335 <<
"User data dir: " <<
path_map_[
"userdata"] <<
'\n'
336 <<
"Saves dir: " <<
path_map_[
"saves"] <<
'\n'
337 <<
"Add-ons dir: " <<
path_map_[
"addons"] <<
'\n'
338 <<
"Cache dir: " <<
path_map_[
"cache"] <<
'\n'
void pre_show(twindow &window)
Inherited from tdialog.
std::string log_file_path()
Returns the path to the current log file.
std::string library_versions_report()
Produce a plain-text report of library versions suitable for stdout/stderr.
bool available()
Whether wesnoth was compiled with support for a clipboard.
virtual void set_active(const bool active) override
See tcontrol::set_active.
std::string optional_features_report()
Produce a plain-text report of features suitable for stdout/stderr.
void browse_directory_callback(const std::string &path)
Callback function for browse-directory action buttons.
void connect_signal_notify_modified(tdispatcher &dispatcher, const tsignal_notification_function &signal)
Connects a signal handler for getting a notification upon modification.
bool select_row(const unsigned row, const bool select=true)
Selectes a row.
REGISTER_DIALOG(label_settings)
virtual void set_label(const t_string &label)
void connect_signal_mouse_left_click(tdispatcher &dispatcher, const tsignal_function &signal)
Connects a signal handler for a left mouse button click.
const std::string & library_build_version(LIBRARY_ID lib)
Retrieve the build-time version number of the given library.
std::string get_saves_dir()
virtual void set_value(const std::string &text)
The set_value is virtual for the tpassword_box class.
base class of top level items, the only item which needs to store the final canvases to draw on ...
void copy_to_clipboard_callback(const std::string &path)
Callback function for copy-to-clipboard action buttons.
A class inherited from ttext_box that displays its input as stars.
const std::string copy_wid_stem_
Desktop environment interaction functions.
static UNUSEDNOWARN std::string _(const char *str)
GLsizei const char ** path
const std::string & library_name(LIBRARY_ID lib)
Retrieve the user-visible name for the given library.
#define VALIDATE(cond, message)
The macro to use for the validation of WML.
std::vector< optional_feature > optional_features_table()
Return a localized features table.
unsigned get_item_count() const
Returns the number of items in the listbox.
void add_row(const string_map &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
std::string get_user_data_dir()
const std::string path_wid_stem_
const std::string browse_wid_stem_
std::map< std::string, std::string > path_map_
std::vector< deplist_entry > deps_
Platform identification and version information functions.
std::map< std::string, t_string > string_map
bool open_object(const std::string &path_or_url)
Opens the specified object with the default application configured for its type.
std::string get_cache_dir()
Log file control routines for Windows.
boost::array< std::string, 4 > deplist_entry
const std::string revision
std::string os_version()
Returns a string with the running OS name and version information.
const std::string & library_runtime_version(LIBRARY_ID lib)
Retrieve the runtime version number of the given library.
Declarations for File-IO.
std::vector< game_config::optional_feature > opts_
Base class for all visible items.
std::string get_user_config_dir()
bool open_object_is_supported()
Returns whether open_object() is supported/implemented for the current platform.
void copy_to_clipboard(const std::string &text, const bool)
Copies text to the clipboard.
void report_copy_callback()
Callback function for the dialog-wide copy-to-clipboard button.
std::string get_addons_dir()
void generate_plain_text_report()
void tab_switch_callback(twindow &window)
Callback function called when switching tabs.
void set_callback_value_change(const std::function< void(twidget &)> &callback)
GLsizei const GLcharARB ** string
Abstract base class for text items.