Remove a deprecated function.

This commit is contained in:
Mark de Wever 2011-08-30 19:41:22 +00:00
parent e5beaf5753
commit 010a38ebbf
8 changed files with 8 additions and 52 deletions

View file

@ -53,7 +53,7 @@ taddon_connect::taddon_connect(std::string& host_name
: allow_updates_(allow_updates) : allow_updates_(allow_updates)
, allow_remove_(allow_remove) , allow_remove_(allow_remove)
{ {
register_text2("host_name", false, host_name, true); register_text("host_name", false, host_name, true);
} }
void taddon_connect::pre_show(CVideo& /*video*/, twindow& window) void taddon_connect::pre_show(CVideo& /*video*/, twindow& window)

View file

@ -171,20 +171,6 @@ tfield_text* tdialog::register_text(const std::string& id
return field; return field;
} }
tfield_text* tdialog::register_text2(const std::string& id
, const bool mandatory
, std::string& linked_variable
, const bool capture_focus)
{
assert(!capture_focus || focus_.empty());
if(capture_focus) {
focus_ = id;
}
return tdialog::register_text(id, mandatory, linked_variable);
}
tfield_label* tdialog::register_label(const std::string& id tfield_label* tdialog::register_label(const std::string& id
, const bool mandatory , const bool mandatory
, const std::string& text , const std::string& text

View file

@ -254,36 +254,6 @@ protected:
, std::string& linked_variable , std::string& linked_variable
, const bool capture_focus = false); , const bool capture_focus = false);
/**
* Creates a new text field.
*
* The field created is owned by tdialog, the returned pointer can be used
* in the child classes as access to a field.
*
* @note This function uses @p mandatory instead of @p optional as in other
* functions, the other functions need to be converted to use @p mandatory
* as well.
*
* @todo Convert more functions to this new style once done drop the 2 from
* the function name.
*
* @deprecated Use @ref register_text instead.
*
* @param id Id of the widget, same value as in WML.
* @param mandatory Is the widget mandatory or optional.
* @param linked_variable The variable the widget is linked to. See
* @ref tfield::tfield for more information.
* @param capture_focus Does this widget need to capture the focus
* when created? @warning Only one widget may
* capture the focus.
*
* @returns Pointer to the created widget.
*/
tfield_text* register_text2(const std::string& id
, const bool mandatory
, std::string& linked_variable
, const bool capture_focus = false);
/** /**
* Registers a new control as a label. * Registers a new control as a label.
* *

View file

@ -48,7 +48,7 @@ REGISTER_DIALOG(edit_label)
tedit_label::tedit_label(std::string& label, bool& team_only) tedit_label::tedit_label(std::string& label, bool& team_only)
{ {
register_text2("label", true, label, true); register_text("label", true, label, true);
register_bool("team_only_toggle", true, team_only); register_bool("team_only_toggle", true, team_only);
} }

View file

@ -42,7 +42,7 @@ REGISTER_DIALOG(folder_create)
tfolder_create::tfolder_create(std::string& folder_name) tfolder_create::tfolder_create(std::string& folder_name)
{ {
register_text2("name", true, folder_name, true); register_text("name", true, folder_name, true);
} }
} }

View file

@ -49,7 +49,7 @@ REGISTER_DIALOG(game_save)
tgame_save::tgame_save(std::string& filename, const std::string& title) tgame_save::tgame_save(std::string& filename, const std::string& title)
{ {
register_text2("txtFilename", false, filename, true); register_text("txtFilename", false, filename, true);
register_label("lblTitle", true, title); register_label("lblTitle", true, title);
} }

View file

@ -80,9 +80,9 @@ tmp_cmd_wrapper::tmp_cmd_wrapper(const t_string& user)
, reason_() , reason_()
, time_() , time_()
{ {
register_text2("message", false, message_, true); register_text("message", false, message_, true);
register_text2("reason", false, reason_); register_text("reason", false, reason_);
register_text2("time", false, time_); register_text("time", false, time_);
register_label("user_label", false, user); register_label("user_label", false, user);
set_always_save_fields(true); set_always_save_fields(true);

View file

@ -43,7 +43,7 @@ REGISTER_DIALOG(mp_create_game_set_password)
tmp_create_game_set_password::tmp_create_game_set_password( tmp_create_game_set_password::tmp_create_game_set_password(
std::string& password) std::string& password)
{ {
register_text2("password", true, password, true); register_text("password", true, password, true);
} }
} // namespace gui2 } // namespace gui2