removing the password box and the remember password checkbox...
...from the mp method selection dialog
This commit is contained in:
parent
0d3e1fd507
commit
803c29f54d
2 changed files with 4 additions and 126 deletions
|
@ -76,6 +76,10 @@
|
|||
history = "mp_user_name_history"
|
||||
|
||||
label = ""
|
||||
tooltip = _ "You may login to the official multiplayer server with your forum username and password.
|
||||
Note that registration is not required to join the server: you need to supply a password only if you wish to use a registered username.
|
||||
|
||||
The Battle for Wesnoth forum can be found at http://www.wesnoth.org/forum/"
|
||||
[/text_box]
|
||||
|
||||
[/column]
|
||||
|
@ -88,113 +92,6 @@
|
|||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
|
||||
horizontal_grow = "true"
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
definition = "default"
|
||||
|
||||
label = _ "Password:"
|
||||
[/label]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[password_box]
|
||||
id = "password"
|
||||
definition = "default"
|
||||
|
||||
label = ""
|
||||
tooltip = _ "You may login to the official multiplayer server with your forum username and password.
|
||||
Note that registration is not required to join the server: you need to supply a password only if you wish to use a registered username.
|
||||
|
||||
The Battle for Wesnoth forum can be found at http://www.wesnoth.org/forum/"
|
||||
[/password_box]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
border = "top"
|
||||
border_size = 10
|
||||
[spacer]
|
||||
definition = "default"
|
||||
[/spacer]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[toggle_button]
|
||||
id = "remember_password"
|
||||
definition = "default"
|
||||
|
||||
label = _ "Save password to preferences (clear text)"
|
||||
[/toggle_button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
border = "top"
|
||||
border_size = 30
|
||||
[spacer]
|
||||
definition = "default"
|
||||
[/spacer]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
vertical_grow = "true"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "gui/dialogs/mp_method_selection.hpp"
|
||||
|
||||
#include "gui/widgets/listbox.hpp"
|
||||
#include "gui/widgets/password_box.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
#include "gui/widgets/text_box.hpp"
|
||||
#include "gui/widgets/toggle_button.hpp"
|
||||
|
@ -55,15 +54,6 @@ void tmp_method_selection::pre_show(CVideo& /*video*/, twindow& window)
|
|||
user_widget->set_maximum_length(mp::max_login_size);
|
||||
window.keyboard_capture(user_widget);
|
||||
|
||||
tpassword_box* password_widget = dynamic_cast<tpassword_box*>(window.find_widget("password", false));
|
||||
VALIDATE(password_widget, missing_widget("password"));
|
||||
|
||||
password_widget->set_value(preferences::password());
|
||||
|
||||
ttoggle_button* remember_password
|
||||
= dynamic_cast<ttoggle_button*>(window.find_widget("remember_password", false));
|
||||
if(remember_password) remember_password->set_value(preferences::remember_password());
|
||||
|
||||
tlistbox* list = dynamic_cast<tlistbox*>(window.find_widget("method_list", false));
|
||||
VALIDATE(list, missing_widget("method_list"));
|
||||
|
||||
|
@ -77,23 +67,14 @@ void tmp_method_selection::post_show(twindow& window)
|
|||
ttext_box* user_widget = dynamic_cast<ttext_box*>(window.find_widget("user_name", false));
|
||||
assert(user_widget);
|
||||
|
||||
tpassword_box* password_widget = dynamic_cast<tpassword_box*>(window.find_widget("password", false));
|
||||
assert(password_widget);
|
||||
|
||||
tlistbox* list = dynamic_cast<tlistbox*>(window.find_widget("method_list", false));
|
||||
assert(list);
|
||||
|
||||
ttoggle_button* remember_password
|
||||
= dynamic_cast<ttoggle_button*>(window.find_widget("remember_password", false));
|
||||
if(remember_password) preferences::set_remember_password(remember_password->get_value());
|
||||
|
||||
choice_ = list->get_selected_row();
|
||||
|
||||
user_widget->save_to_history();
|
||||
user_name_= user_widget->get_value();
|
||||
preferences::set_login(user_name_);
|
||||
|
||||
preferences::set_password(password_widget->get_real_value());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue