Author: mordante
Date: Sat Jun 2 10:59:48 2007
New Revision: 18013
URL: http://svn.gna.org/viewcvs/wesnoth?rev=18013&view=rev
Log:
removed the deprecated and unused dialog_action code
Modified:
trunk/src/construct_dialog.cpp
trunk/src/construct_dialog.hpp
trunk/src/dialogs.cpp
trunk/src/editor/editor.cpp
trunk/src/hotkeys.cpp
trunk/src/menu_events.cpp
trunk/src/mouse_events.cpp
trunk/src/show_dialog.cpp
trunk/src/show_dialog.hpp
trunk/src/widgets/combo.cpp
Modified: trunk/src/construct_dialog.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/construct_dialog.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/construct_dialog.cpp (original)
+++ trunk/src/construct_dialog.cpp Sat Jun 2 10:59:48 2007
@@ -113,7 +113,7 @@
title_(title), style_(dialog_style),
title_widget_(NULL), message_(NULL),
type_(type), menu_(NULL),
help_button_(disp, help_topic),
text_widget_(NULL),
- action_(NULL), frame_(NULL), bg_restore_(NULL),
result_(CONTINUE_DIALOG)
+ frame_(NULL), bg_restore_(NULL),
result_(CONTINUE_DIALOG)
{
CVideo& screen = disp_.video();
@@ -162,7 +162,6 @@
delete message_;
delete text_widget_;
delete image_;
-// delete action_;
delete frame_;
button_pool_iterator b;
@@ -779,11 +778,6 @@
info.first_time = true;
}
}
-
- //support for old-style dialog actions
- if(!done() && action_ != NULL) {
- set_result(action_->do_action());
- }
}
int standard_dialog_button::action(dialog_process_info &/*info*/) {
Modified: trunk/src/construct_dialog.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/construct_dialog.hpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/construct_dialog.hpp (original)
+++ trunk/src/construct_dialog.hpp Sat Jun 2 10:59:48 2007
@@ -205,10 +205,6 @@
dialog_textbox& get_textbox() const { return *text_widget_; }
const bool option_checked(unsigned int option_index=0);
display& get_display() { return disp_; }
-
- //Backwards compatibility
- //set_action - deprecated, subclass dialog instead and override action()
- void set_action(dialog_action *const da) {action_ = da;}
protected:
void set_result(const int result) { result_ = result; }
@@ -253,7 +249,6 @@
std::vector<button*> frame_buttons_;
help_button help_button_;
dialog_textbox *text_widget_;
- dialog_action *action_;
dialog_frame *frame_;
surface_restorer *bg_restore_;
dimension_measurements dim_;
Modified: trunk/src/dialogs.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/dialogs.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/dialogs.cpp (original)
+++ trunk/src/dialogs.cpp Sat Jun 2 10:59:48 2007
@@ -291,7 +291,7 @@
options.push_back(gui::check_item(_("Don't ask me
again!"),false));
const int res = gui::show_dialog(disp_,NULL,"",_("Do
you really want to delete this game?"),gui::YES_NO,
-
NULL,NULL,"",NULL,-1,NULL,&options);
+
NULL,NULL,"",NULL,-1,&options);
//see if the user doesn't want to be asked this again
wassert(options.empty() == false);
@@ -599,7 +599,7 @@
const int res = gui::show_dialog2(disp,NULL,
_("Load Game"),
_("Choose the game to load"),
-
gui::OK_CANCEL,&items,&preview_panes,"",NULL,-1,NULL,&options,-1,-1,NULL,&buttons,"",&sorter);
+
gui::OK_CANCEL,&items,&preview_panes,"",NULL,-1,&options,-1,-1,NULL,&buttons,"",&sorter);
write_save_index();
Modified: trunk/src/editor/editor.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor/editor.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/editor/editor.cpp (original)
+++ trunk/src/editor/editor.cpp Sat Jun 2 10:59:48 2007
@@ -1345,7 +1345,7 @@
}
static const std::string style = "menu2";
const int res = gui::show_dialog(gui_, NULL, "", "", gui::MESSAGE,
&menu, NULL, "",
- NULL, 256, NULL, NULL, xloc, yloc,
&style);
+ NULL, 256, NULL, xloc, yloc, &style);
if(res < 0 || (unsigned)res >= items.size())
return;
const hotkey::HOTKEY_COMMAND cmd =
hotkey::get_hotkey(items[res]).get_id();
Modified: trunk/src/hotkeys.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/hotkeys.cpp (original)
+++ trunk/src/hotkeys.cpp Sat Jun 2 10:59:48 2007
@@ -806,7 +806,7 @@
static const std::string style = "menu2";
const int res = gui::show_dialog(gui,NULL,"","",
-
gui::MESSAGE,&menu,NULL,"",NULL,-1,NULL,NULL,xloc,yloc,&style);
+
gui::MESSAGE,&menu,NULL,"",NULL,-1,NULL,xloc,yloc,&style);
if (size_t(res) >= items.size())
return;
Modified: trunk/src/menu_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Sat Jun 2 10:59:48 2007
@@ -346,7 +346,7 @@
selected = gui::show_dialog2(*gui_,NULL,_("Unit
List"),"",
gui::OK_ONLY,&items,&preview_panes,
-
"",NULL,0,NULL,NULL,-1,-1,NULL,NULL,"",&sorter);
+
"",NULL,0,NULL,-1,-1,NULL,NULL,"",&sorter);
}
if(selected > 0 && selected < int(locations_list.size())) {
@@ -434,7 +434,7 @@
}
gui::show_dialog2(*gui_,NULL,"","",gui::CLOSE_ONLY,&items,
-
NULL,"",NULL,0,NULL,NULL,-1,-1,NULL,NULL,"",&sorter);
+
NULL,"",NULL,0,NULL,-1,-1,NULL,NULL,"",&sorter);
}
void menu_handler::save_game(const std::string& message,
gui::DIALOG_TYPE dialog_type,
@@ -724,7 +724,7 @@
recruit_res = gui::show_dialog2(*gui_,NULL,_("Recruit"),
_("Select unit:") + std::string("\n"),
-
gui::OK_CANCEL,&items,&preview_panes,"",NULL,-1,NULL,NULL,-1,-1,
+
gui::OK_CANCEL,&items,&preview_panes,"",NULL,-1,NULL,-1,-1,
NULL,NULL,"recruit_and_recall");
}
@@ -876,7 +876,7 @@
_("Select unit:") +
std::string("\n"),
gui::OK_CANCEL,&options,
&preview_panes,"",NULL,-1,
-
NULL,NULL,-1,-1,NULL,&buttons,"",&sorter);
+
NULL,-1,-1,NULL,&buttons,"",&sorter);
}
if(res >= 0) {
Modified: trunk/src/mouse_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Sat Jun 2 10:59:48 2007
@@ -1345,7 +1345,7 @@
res = gui::show_dialog2(*gui_,NULL,_("Attack Enemy"),
_("Choose weapon:")+std::string("\n"),
-
gui::OK_CANCEL,&items,&preview_panes,"",NULL,-1,NULL,NULL,-1,-1,
+
gui::OK_CANCEL,&items,&preview_panes,"",NULL,-1,NULL,-1,-1,
NULL,&buttons);
}
Modified: trunk/src/show_dialog.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/show_dialog.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/show_dialog.cpp (original)
+++ trunk/src/show_dialog.cpp Sat Jun 2 10:59:48 2007
@@ -350,7 +350,7 @@
const std::string& text_widget_label,
std::string* text_widget_text,
int text_widget_max_chars,
- dialog_action* action, std::vector<check_item>*
options, int xloc, int yloc,
+ std::vector<check_item>* options, int xloc, int
yloc,
const std::string* dialog_style,
std::vector<dialog_button_info>* action_buttons,
const std::string& help_topic, const
menu::sorter* sorter, menu::style* menu_style)
{
@@ -374,9 +374,6 @@
}
if(text_widget_text) {
d.set_textbox(text_widget_label,*text_widget_text,
text_widget_max_chars);
- }
- if(action) {
- d.set_action(action);
}
if(options) {
for(unsigned int i=0; i < options->size(); ++i) {
Modified: trunk/src/show_dialog.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/show_dialog.hpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/show_dialog.hpp (original)
+++ trunk/src/show_dialog.hpp Sat Jun 2 10:59:48 2007
@@ -121,14 +121,6 @@
// const std::string* dialog_style=NULL, std::vector<button*>*
buttons=NULL,
// surface_restorer* restorer=NULL, button* help_button=NULL,
label** label_widget);
-class dialog_action
-{
-public:
- virtual ~dialog_action() {}
-
- virtual int do_action() = 0;
-};
-
class dialog_button_action
{
public:
@@ -180,7 +172,6 @@
const std::string& text_widget_label="",
std::string* text_widget_text=NULL,
const int text_widget_max_chars = 256,
- dialog_action* action=NULL,
std::vector<check_item>* options=NULL, int
xloc=-1, int yloc=-1,
const std::string* dialog_style=NULL,
std::vector<dialog_button_info>* buttons=NULL,
Modified: trunk/src/widgets/combo.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/widgets/combo.cpp?rev=18013&r1=18012&r2=18013&view=diff
==============================================================================
--- trunk/src/widgets/combo.cpp (original)
+++ trunk/src/widgets/combo.cpp Sat Jun 2 10:59:48 2007
@@ -87,7 +87,7 @@
return;
SDL_Rect const &loc = location();
set_selected_internal(gui::show_dialog2(*disp_, NULL, "", "",
gui::MESSAGE, &items_,
- NULL, "", NULL, -1, NULL, NULL,
loc.x, loc.y + loc.h));
+ NULL, "", NULL, -1, NULL, loc.x,
loc.y + loc.h));
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits