Changeset - r21358:efdb4bf8ac8a
[Not reviewed]
master
0 2 0
peter1138 - 10 years ago 2014-04-11 18:14:44
peter1138@openttd.org
(svn r26455) -Change: Prompt for confirmation when deleting a vehicle group.
2 files changed with 15 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/group_gui.cpp
Show inline comments
 
@@ -110,6 +110,7 @@ private:
 
	GroupID group_sel;     ///< Selected group (for drag/drop)
 
	GroupID group_rename;  ///< Group being renamed, INVALID_GROUP if none
 
	GroupID group_over;    ///< Group over which a vehicle is dragged, INVALID_GROUP if none
 
	GroupID group_confirm; ///< Group awaiting delete confirmation
 
	GUIGroupList groups;   ///< List of groups
 
	uint tiny_step_height; ///< Step height for the group list
 
	Scrollbar *group_sb;
 
@@ -565,6 +566,15 @@ public:
 
		}
 
	}
 

	
 
	static void DeleteGroupCallback(Window *win, bool confirmed)
 
	{
 
		if (confirmed) {
 
			VehicleGroupWindow *w = (VehicleGroupWindow*)win;
 
			w->vli.index = ALL_GROUP;
 
			DoCommandP(0, w->group_confirm, 0, CMD_DELETE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_DELETE));
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		switch (widget) {
 
@@ -629,10 +639,8 @@ public:
 
			}
 

	
 
			case WID_GL_DELETE_GROUP: { // Delete the selected group
 
				GroupID group = this->vli.index;
 
				this->vli.index = ALL_GROUP;
 

	
 
				DoCommandP(0, group, 0, CMD_DELETE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_DELETE));
 
				this->group_confirm = this->vli.index;
 
				ShowQuery(STR_QUERY_GROUP_DELETE_CAPTION, STR_GROUP_DELETE_QUERY_TEXT, this, DeleteGroupCallback);
 
				break;
 
			}
 

	
src/lang/english.txt
Show inline comments
 
@@ -3303,6 +3303,9 @@ STR_GROUP_DELETE_TOOLTIP                
 
STR_GROUP_RENAME_TOOLTIP                                        :{BLACK}Rename the selected group
 
STR_GROUP_REPLACE_PROTECTION_TOOLTIP                            :{BLACK}Click to protect this group from global autoreplace
 

	
 
STR_QUERY_GROUP_DELETE_CAPTION                                  :{WHITE}Delete Group
 
STR_GROUP_DELETE_QUERY_TEXT                                     :{WHITE}Are you sure you want to delete this group and any descendants?
 

	
 
STR_GROUP_ADD_SHARED_VEHICLE                                    :Add shared vehicles
 
STR_GROUP_REMOVE_ALL_VEHICLES                                   :Remove all vehicles
 

	
0 comments (0 inline, 0 general)