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 748732 - Switch conversation units (the overview) does not work for same currencies
Switch conversation units (the overview) does not work for same currencies
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Robert Roth
gcalctool maintainers
: 711587 768778 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-05-01 03:32 UTC by Matthias Clasen
Modified: 2016-11-04 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixed conversion unit switch, fixes #748732. (1.43 KB, patch)
2016-09-18 23:26 UTC, Robert Roth
committed Details | Review
Fixed conversion user interface for LTR (bgo#711587) (4.77 KB, patch)
2016-10-21 17:02 UTC, Robert Roth
committed Details | Review
Fixed conversion unit switch, fixes #748732. (1.43 KB, patch)
2016-10-21 17:02 UTC, Robert Roth
committed Details | Review

Description Matthias Clasen 2015-05-01 03:32:53 UTC
This was filed downstream (against 3.8 in RHEL7), but it still applies:

The overview (Fr50 = $9.42)of the conversion stays unchanged with some currency combinations

Version-Release number of selected component (if applicable):
gcalctool-6.4.2.1-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Be in Financial mode, choose "Botswana Pula" on the left side and "Algerian Dinar" on the right side
2. Type 1
3. Click Switch conversation units
  
Actual results:
The displayed number changed correctly, the currencies switched but the overview on the right side (P1 = 10.12 something) stays unchanged.

Expected results:
Everything should switch, like if you choose e.g. "CFA Franc" and "Australian Dollar" in this order
Comment 1 Patrick Welche 2016-04-21 22:40:40 UTC
Just tried "Pound Sterling" "US Dollar".
Click Switch conversion units
It now says "US Dollar" "US Dollar"
AND "Pound Sterling" no longer appears in the right hand menu anywhere.
(version 3.20.0)
Comment 2 Robert Roth 2016-09-18 23:26:50 UTC
Created attachment 335822 [details] [review]
Fixed conversion unit switch, fixes #748732.

https://bugzilla.gnome.org/show_bug.cgi?id=748732
On populating the target combobox, the current value of the from combo
was removed intentionally. This way, setting the old from value as new
target value failed, as it did not exist in the target combo. Note that
this has only happened with the initially selected from currency, so
removing that from target currencies also led to inconsistencies between
the two comboboxes. We better have the same list in both combos, in the
worst case a user can use the same unit as both from and to unit to get
a valid 1 conversion result.
Comment 3 Alberto Ruiz 2016-09-19 19:44:50 UTC
I just tested your patch Robert and it doesn't fix the problem described by Matthias
Comment 4 Robert Roth 2016-09-20 20:35:10 UTC
(In reply to Alberto Ruiz from comment #3)
> I just tested your patch Robert and it doesn't fix the problem described by
> Matthias

Indeed, my fix is a fix for the problem in comment 1, I will look into extending it for the result label update (looks like a gtk bug somehow, with the content starting with some UTF8 characters, the label is not correctly updated, if another word is prepended, like "Hello" then clicking the switch button result in the units being switched in the result label too)
Comment 5 Robert Roth 2016-10-21 17:02:20 UTC
This has been fixed by separating the conversion label into a set of labels.
This way they are ordered correctly based on user interface LTR order, and switch direction switches the result label too.

The following fixes have been pushed:
ac3d162 Fixed conversion user interface for LTR (bgo#711587)
4b2613f Fixed conversion unit switch, fixes #748732.
Comment 6 Robert Roth 2016-10-21 17:02:33 UTC
Created attachment 338203 [details] [review]
Fixed conversion user interface for LTR (bgo#711587)
Comment 7 Robert Roth 2016-10-21 17:02:40 UTC
Created attachment 338204 [details] [review]
Fixed conversion unit switch, fixes #748732.

https://bugzilla.gnome.org/show_bug.cgi?id=748732
On populating the target combobox, the current value of the from combo
was removed intentionally. This way, setting the old from value as new
target value failed, as it did not exist in the target combo. Note that
this has only happened with the initially selected from currency, so
removing that from target currencies also led to inconsistencies between
the two comboboxes. We better have the same list in both combos, in the
worst case a user can use the same unit as both from and to unit to get
a valid 1 conversion result.
Comment 8 Robert Roth 2016-10-21 17:03:37 UTC
*** Bug 711587 has been marked as a duplicate of this bug. ***
Comment 9 Robert Roth 2016-11-04 12:22:59 UTC
*** Bug 768778 has been marked as a duplicate of this bug. ***