Feature: Showing units along with labels

Lakshman acrlakshman at gmail.com
Sun Mar 9 10:37:44 PDT 2014


Hi Dirk,

Thank you for the reply and suggestion. Attached are the revised patch and
snaps. Please let me know, regarding any issues in this patch.

Thank you,

Lakshman


On Sun, Mar 9, 2014 at 10:26 AM, Dirk Hohndel <dirk at hohndel.org> wrote:

>
> Hi Lakshman,
>
> On Sun, 2014-03-09 at 03:13 -0500, Lakshman wrote:
>
> > In an attempt to slightly enhance user experience, I tried to show
> > units along with labels. This feature can be enabled or disabled as
> > shown in the attached snapshots. Patch is also attached. Would be
> > grateful for any sort of feedback on this.
>
> I like the idea. I am not excited about the implementation.
>
> +               if (prefs.text_label_with_units) {
> +
> ui.airTempLabel->setText(QApplication::translate("MainTab",
> +                                               &(*(std::string("Air
> temp") +
> +                                                               " [" +
> +
> *(get_temp_unit().toStdString().rbegin()) +
> +
> "]").begin()),
> +                                               0,
> QApplication::UnicodeUTF8));
> +
>
> this breaks translation - the strings are parsed by a tool in order to
> be collected for translation - nowhere here is the final string
> accessible to the tool, so when at run time the string is assembled, it
> won't be found in the translation database. It's a much better idea to
> concatenate two translated strings:
>
> Also, that whole painful conversion to std::string seems rather awkward
> and unnecessary. Simply use QString.
>
> There are quite a few spots in the application where we assemble strings
> that are to be presented to the user. Can you look at those and create a
> revised patch that doesn't use std::string and doesn't break
> translation?
>
> Thanks
>
> /D
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140309/37895c74/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snap1.png
Type: image/png
Size: 156823 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140309/37895c74/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: option_checked_dive_saved.png
Type: image/png
Size: 153198 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140309/37895c74/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: option_off.png
Type: image/png
Size: 153173 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140309/37895c74/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Feature-to-show-units-with-labels.patch
Type: text/x-patch
Size: 4800 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140309/37895c74/attachment-0001.bin>


More information about the subsurface mailing list