summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-15 19:02:50 +0000
committersmatz <smatz@openttd.org>2008-09-15 19:02:50 +0000
commit1266b1a73f4197e3bf4d2cc0e09e9e667d7c640e (patch)
tree9ea3e279046e9a622321db881df0c37605fde380 /src/vehicle_gui.cpp
parent42f33890aa4612a821c20783778bb086ee2028b6 (diff)
downloadopenttd-1266b1a73f4197e3bf4d2cc0e09e9e667d7c640e.tar.xz
(svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies)
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index ec162382e..e5a57da66 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1470,7 +1470,7 @@ struct VehicleDetailsWindow : Window {
case VLD_WIDGET_RENAME_VEHICLE: {// rename
const Vehicle *v = GetVehicle(this->window_number);
SetDParam(0, v->index);
- ShowQueryString(STR_VEHICLE_NAME, _name_vehicle_title[v->type], MAX_LENGTH_VEHICLE_NAME_BYTES, MAX_LENGTH_VEHICLE_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_NONE);
+ ShowQueryString(STR_VEHICLE_NAME, _name_vehicle_title[v->type], MAX_LENGTH_VEHICLE_NAME_BYTES, MAX_LENGTH_VEHICLE_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT);
} break;
case VLD_WIDGET_INCREASE_SERVICING_INTERVAL: // increase int
@@ -1513,10 +1513,10 @@ struct VehicleDetailsWindow : Window {
STR_A031_CAN_T_NAME_AIRCRAFT
};
- if (!StrEmpty(str)) {
- _cmd_text = str;
- DoCommandP(0, this->window_number, 0, NULL, CMD_NAME_VEHICLE | CMD_MSG(_name_vehicle_error[GetVehicle(this->window_number)->type]));
- }
+ if (str == NULL) return;
+
+ _cmd_text = str;
+ DoCommandP(0, this->window_number, 0, NULL, CMD_NAME_VEHICLE | CMD_MSG(_name_vehicle_error[GetVehicle(this->window_number)->type]));
}
virtual void OnResize(Point new_size, Point delta)