GNOME Bugzilla – Bug 608830
[clock] Location edit dialog doesn't have input vaildation
Last modified: 2010-03-09 05:03:45 UTC
It is possible to enter information in the location edit dialog that is not valid. The OK button is always sensitive and the dialog is closed if clicked. 1. Add a new location. Enter "Test" as the city name and click OK. The dialog closes and no location is added. 2. Add a new location. Enter "Test" as the city name, choose a time zone, and click OK. A new location with the information is created. No weather will be available (seems obvious, but at least one bug report on Ubuntu is about this). A very simple fix would be to add a condition in ./applets/clock/clock.c function locations_changed() to check if the location is valid (i.e. gloc is not NULL) and set the sensitivity of the OK button accordingly. However, this would no longer allow the user to create a location based on an arbitrary name and time zone (case 2). Is the second case really supported? If not, I can produce a clean patch as described. I have already code that I can test based on 2.29.6 and it doesn't seem to break the code allowing to edit the location name.
The second case is definitely something we want. I want to be able to name a location the way I want, and not to be forced to use a city name from the database.
So at the very least, the OK button should be sensitive if there is a name and a time zone. I can submit a patch for that if necessary. From a bug report on Ubuntu [1], it looks like it was possible in the past to enter such locations and still get weather information. I am not sure why it worked, but it seems that it was once possible to enter the weather station code manually. Since libgweather is used, there is no way to get the weather based on this station code only. Would this be considered a regression or are the users encouraged to use the libgweather-based system to get the weather back? [1] https://bugs.launchpad.net/ubuntu/+source/libgweather/+bug/397267
(In reply to comment #2) > So at the very least, the OK button should be sensitive if there is a name and > a time zone. I can submit a patch for that if necessary. Please do. > From a bug report on Ubuntu [1], it looks like it was possible in the past to > enter such locations and still get weather information. I am not sure why it > worked, but it seems that it was once possible to enter the weather station > code manually. Since libgweather is used, there is no way to get the weather > based on this station code only. Would this be considered a regression or are > the users encouraged to use the libgweather-based system to get the weather > back? This was a deliberate choice, since the weather code is something that most people don't understand. We could probably add this back in some way (hidden in a GtkExpander), though.
Created attachment 152901 [details] [review] Patch to validate inputs to the add location dialog
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.