After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608830 - [clock] Location edit dialog doesn't have input vaildation
[clock] Location edit dialog doesn't have input vaildation
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: clock
2.29.x
Other Linux
: Normal minor
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-02 19:04 UTC by Philippe Gauthier
Modified: 2010-03-09 05:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to validate inputs to the add location dialog (2.56 KB, patch)
2010-02-03 03:17 UTC, Philippe Gauthier
committed Details | Review

Description Philippe Gauthier 2010-02-02 19:04:32 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.
Comment 1 Vincent Untz 2010-02-03 00:51:31 UTC
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.
Comment 2 Philippe Gauthier 2010-02-03 01:37:49 UTC
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
Comment 3 Vincent Untz 2010-02-03 01:48:10 UTC
(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.
Comment 4 Philippe Gauthier 2010-02-03 03:17:46 UTC
Created attachment 152901 [details] [review]
Patch to validate inputs to the add location dialog
Comment 5 Vincent Untz 2010-03-09 05:03:40 UTC
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.