mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 12:01:20 +00:00
formatting
it's a pet peeve of mine, but the name of a type is ie "toggle_button*" aka toggle_button pointer. the asterisk or ampersand is part of the type and should be separated.
This commit is contained in:
parent
962e0c35ac
commit
80d09b47c1
@ -34,9 +34,9 @@
|
||||
namespace gui2::dialogs
|
||||
{
|
||||
|
||||
static toggle_button * setup_pref_toggle_button(const std::string & id, bool def, window & window)
|
||||
static toggle_button* setup_pref_toggle_button(const std::string& id, bool def, window& window)
|
||||
{
|
||||
toggle_button * b = find_widget<toggle_button>(&window, id, false, true);
|
||||
toggle_button* b = find_widget<toggle_button>(&window, id, false, true);
|
||||
b->set_value(preferences::get(id, def));
|
||||
|
||||
//ensure we have yes / no for the toggle button, so that the preference matches the toggle button for sure.
|
||||
@ -49,13 +49,13 @@ static toggle_button * setup_pref_toggle_button(const std::string & id, bool def
|
||||
return b;
|
||||
}
|
||||
|
||||
static void setup_item(const std::string & item, window & window)
|
||||
static void setup_item(const std::string& item, window& window)
|
||||
{
|
||||
// Set up the sound checkbox
|
||||
setup_pref_toggle_button(item+"_sound", mp::ui_alerts::get_def_pref_sound(item), window);
|
||||
|
||||
// Set up the notification checkbox
|
||||
toggle_button * notif = setup_pref_toggle_button(item+"_notif", mp::ui_alerts::get_def_pref_notif(item), window);
|
||||
toggle_button* notif = setup_pref_toggle_button(item+"_notif", mp::ui_alerts::get_def_pref_notif(item), window);
|
||||
|
||||
// Check if desktop notifications are available
|
||||
if (!desktop::notifications::available()) {
|
||||
@ -70,16 +70,16 @@ static void setup_item(const std::string & item, window & window)
|
||||
setup_pref_toggle_button(item+"_lobby", mp::ui_alerts::get_def_pref_lobby(item), window);
|
||||
}
|
||||
|
||||
static void set_pref_and_button(const std::string & id, bool value, window & window)
|
||||
static void set_pref_and_button(const std::string& id, bool value, window& window)
|
||||
{
|
||||
preferences::set(id,value);
|
||||
toggle_button * button = find_widget<toggle_button>(&window, id, false, true);
|
||||
toggle_button* button = find_widget<toggle_button>(&window, id, false, true);
|
||||
button->set_value(value);
|
||||
}
|
||||
|
||||
static void revert_to_default_pref_values(window & window)
|
||||
static void revert_to_default_pref_values(window& window)
|
||||
{
|
||||
for (const std::string & i : mp::ui_alerts::items) {
|
||||
for (const std::string& i : mp::ui_alerts::items) {
|
||||
set_pref_and_button(i+"_sound", mp::ui_alerts::get_def_pref_sound(i), window);
|
||||
set_pref_and_button(i+"_notif", mp::ui_alerts::get_def_pref_notif(i), window);
|
||||
set_pref_and_button(i+"_lobby", mp::ui_alerts::get_def_pref_lobby(i), window);
|
||||
@ -95,16 +95,16 @@ mp_alerts_options::mp_alerts_options()
|
||||
|
||||
void mp_alerts_options::pre_show(window& window)
|
||||
{
|
||||
for (const std::string & i : mp::ui_alerts::items) {
|
||||
for (const std::string& i : mp::ui_alerts::items) {
|
||||
setup_item(i, window);
|
||||
}
|
||||
|
||||
if (!desktop::notifications::available()) {
|
||||
label * nlabel = find_widget<label>(&window, "notification_label", false, true);
|
||||
label* nlabel = find_widget<label>(&window, "notification_label", false, true);
|
||||
nlabel->set_tooltip(_("This build of wesnoth does not include support for desktop notifications, contact your package manager"));
|
||||
}
|
||||
|
||||
toggle_button * in_lobby;
|
||||
toggle_button* in_lobby;
|
||||
in_lobby = find_widget<toggle_button>(&window,"ready_for_start_lobby", false, true);
|
||||
in_lobby->set_visible(widget::visibility::invisible);
|
||||
|
||||
@ -117,7 +117,7 @@ void mp_alerts_options::pre_show(window& window)
|
||||
in_lobby = find_widget<toggle_button>(&window,"turn_changed_lobby", false, true);
|
||||
in_lobby->set_visible(widget::visibility::invisible);
|
||||
|
||||
button * defaults;
|
||||
button* defaults;
|
||||
defaults = find_widget<button>(&window,"revert_to_defaults", false, true);
|
||||
connect_signal_mouse_left_click(*defaults, std::bind(&revert_to_default_pref_values, std::ref(window)));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user