Place title configuration (was Private Records)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Place title configuration (was Private Records)

jerome
It makes me remember bug report #9251
where I tested a conditional patch.

diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py
index 6f2096b..c9e03fd 100644
--- a/gramps/gui/configure.py
+++ b/gramps/gui/configure.py
@@ -1113,31 +1113,34 @@ class GrampsPreferences(ConfigureDialog):
                           row, 'preferences.place-auto', stop=3)
         row += 1
 
-        self.add_checkbox(grid, _("Suppress comma after house number"),
-                          row, 'preferences.place-number', stop=3)
-        row += 1
-
-        self.add_checkbox(grid, _("Reverse display order"),
-                          row, 'preferences.place-reverse', stop=3)
-        row += 1
-
-        # Place restriction
-        obox = Gtk.ComboBoxText()
-        formats = [_("Full place name"),
-                   _("-> Hamlet/VillageTown/City"),
-                   _("Hamlet/VillageTown/City ->")]
-        list(map(obox.append_text, formats))
-        active = config.get('preferences.place-restrict')
-        obox.set_active(active)
-        obox.connect('changed', self.place_restrict_changed)
-        lwidget = BasicLabel("%s: " % _('Restrict'))
-        grid.attach(lwidget, 0, row, 1, 1)
-        grid.attach(obox, 1, row, 2, 1)
-        row += 1
-
-        self.add_entry(grid, _("Language"),
-                          row, 'preferences.place-lang')
-        row += 1
+        HAS_AUTOPLACE = config.get('preferences.place-auto')
+
+        if HAS_AUTOPLACE: # if True
+            self.add_checkbox(grid, _("Suppress comma after house number"),
+                              row, 'preferences.place-number', stop=3)
+            row += 1
+
+            self.add_checkbox(grid, _("Reverse display order"),
+                              row, 'preferences.place-reverse', stop=3)
+            row += 1
+
+            # Place restriction
+            obox = Gtk.ComboBoxText()
+            formats = [_("Full place name"),
+                       _("-> Hamlet/VillageTown/City"),
+                       _("Hamlet/VillageTown/City ->")]
+            list(map(obox.append_text, formats))
+            active = config.get('preferences.place-restrict')
+            obox.set_active(active)
+            obox.connect('changed', self.place_restrict_changed)
+            lwidget = BasicLabel("%s: " % _('Restrict'))
+            grid.attach(lwidget, 0, row, 1, 1)
+            grid.attach(obox, 1, row, 2, 1)
+            row += 1
+
+            self.add_entry(grid, _("Language"),
+                              row, 'preferences.place-lang')
+            row += 1
 
         return _('Places'), grid

In theory, automatic title generation state and Places section
into Preferences dialog might be more clear after the change.

Some options are specific to title generation.
Maybe this could avoid confusion if these options are not
available when automatic title generation is disabled?

An alternate way for sensitive attribute on checkbox.

Just a proposal!
 



--------------------------------------------
En date de : Sam 9.4.16, Douglas Bainbridge <[hidden email]> a écrit :

 
 "wiping out the top line" sounds like you have automatic
 title generation switched on. You can enable or disable this
 in
 Edit=>Preferences=> Places=> Enable automatic place
 title
 generation.
 but it doesn't become effective until after you close gramps
 
 and re-start it.
 If it's disabled you'll see whatever you typed in the place
 
 title; if enabled, whatever the title generator can produce.
 
 Note that the generated title isn't permanently recorded,
 whereas the input title is, so you can switch from input to
 
 generated title and back again as often as you like (closing
 
 and restarting gramps each time of course).
 That may show you what you've actually got recorded.
 
 HTH
 
 Doug
 
 ------------------------------------------------------------------------------
 Find and fix application performance issues faster with
 Applications Manager
 Applications Manager provides deep performance insights into
 multiple tiers of
 your business applications. It resolves application problems
 quickly and
 reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
 gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
 _______________________________________________
 Gramps-users mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-users

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Place title configuration (was Private Records)

Nick Hall
On 09/04/16 17:11, jerome wrote:

> In theory, automatic title generation state and Places section
> into Preferences dialog might be more clear after the change.
>
> Some options are specific to title generation.
> Maybe this could avoid confusion if these options are not
> available when automatic title generation is disabled?
>
> An alternate way for sensitive attribute on checkbox.
>
> Just a proposal!

I would prefer to make the options insensitive (greyed out) when not
available.


Nick.


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Place title configuration (was Private Records)

jerome
In reply to this post by jerome
 On 09/04/16 17:11, jerome
 wrote:
 >> In theory, automatic title
 generation state and Places section
 >>
 into Preferences dialog might be more clear after the
 change.
 >>
 >> Some
 options are specific to title generation.
 >> Maybe this could avoid confusion if these
 options are not
 >> available when
 automatic title generation is disabled?
 >>
 >> An alternate way for
 sensitive attribute on checkbox.
 >>
 >> Just a proposal!
 
 >I would prefer to make the options insensitive
 > (greyed out) when not
 > available.
 
 >Nick.

Yes, this will be more consistent.
During quick tests, the alternate way was just less intrusive.

Anyway, I suppose it should be possible to properly set gtk state attribute
(insensitive) instead of playing with set_sensitive(), right?

And maybe a different indentation for related rows?


Jérôme
 
 
 ------------------------------------------------------------------------------
 Find and fix application performance issues
 faster with Applications Manager
 Applications Manager provides deep performance
 insights into multiple tiers of
 your
 business applications. It resolves application problems
 quickly and
 reduces your MTTR. Get your free
 trial! http://pubads.g.doubleclick.net/
 gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
 _______________________________________________
 Gramps-users mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-users

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Place title configuration (was Private Records)

jerome
In reply to this post by jerome
Hi,

 > I would prefer to make the options insensitive
 > (greyed out) when not
 > available.
 
 A callback signal is maybe missing, but it also works for me:

diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py
index 6f2096b..30f1e46 100644
--- a/gramps/gui/configure.py
+++ b/gramps/gui/configure.py
@@ -1113,12 +1113,22 @@ class GrampsPreferences(ConfigureDialog):
                           row, 'preferences.place-auto', stop=3)
         row += 1
 
-        self.add_checkbox(grid, _("Suppress comma after house number"),
-                          row, 'preferences.place-number', stop=3)
+        HAS_AUTO_PLACE_TITLE = config.get('preferences.place-auto')
+
+        if not HAS_AUTO_PLACE_TITLE:
+            self.add_checkbox(grid, _("Suppress comma after house number"),
+                              row, 'preferences.place-number', stop=3).set_sensitive(False)
+        else:
+            self.add_checkbox(grid, _("Suppress comma after house number"),
+                              row, 'preferences.place-number', stop=3)
         row += 1
 
-        self.add_checkbox(grid, _("Reverse display order"),
-                          row, 'preferences.place-reverse', stop=3)
+        if not HAS_AUTO_PLACE_TITLE:
+            self.add_checkbox(grid, _("Reverse display order"),
+                              row, 'preferences.place-reverse', stop=3).set_sensitive(False)
+        else:
+            self.add_checkbox(grid, _("Reverse display order"),
+                              row, 'preferences.place-reverse', stop=3)
         row += 1
 
         # Place restriction
@@ -1132,11 +1142,17 @@ class GrampsPreferences(ConfigureDialog):
         obox.connect('changed', self.place_restrict_changed)
         lwidget = BasicLabel("%s: " % _('Restrict'))
         grid.attach(lwidget, 0, row, 1, 1)
+        if not HAS_AUTO_PLACE_TITLE:
+            obox.set_sensitive(False)
         grid.attach(obox, 1, row, 2, 1)
         row += 1
 
-        self.add_entry(grid, _("Language"),
-                          row, 'preferences.place-lang')
+        if not HAS_AUTO_PLACE_TITLE:
+            self.add_entry(grid, _("Language"),
+                              row, 'preferences.place-lang').set_sensitive(False)
+        else:
+            self.add_entry(grid, _("Language"),
+                              row, 'preferences.place-lang')
         row += 1
 
         return _('Places'), grid


On the other hand, hide() does not need a signal.

 > Nick.
 
 
 ------------------------------------------------------------------------------
 Find and fix application performance issues
 faster with Applications Manager
 Applications Manager provides deep performance
 insights into multiple tiers of
 your
 business applications. It resolves application problems
 quickly and
 reduces your MTTR. Get your free
 trial! http://pubads.g.doubleclick.net/
 gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
 _______________________________________________
 Gramps-users mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-users
 

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Place title configuration (was Private Records)

Nick Hall
Jérôme,

This isn't quite right yet.  I'll write a patch for you.

Nick.


On 14/04/16 09:06, jerome wrote:

>   > I would prefer to make the options insensitive
>   > (greyed out) when not
>   > available.
>  
>   A callback signal is maybe missing, but it also works for me:
>
> diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py
> index 6f2096b..30f1e46 100644
> --- a/gramps/gui/configure.py
> +++ b/gramps/gui/configure.py
> @@ -1113,12 +1113,22 @@ class GrampsPreferences(ConfigureDialog):
>                             row, 'preferences.place-auto', stop=3)
>           row += 1
>  
> -        self.add_checkbox(grid, _("Suppress comma after house number"),
> -                          row, 'preferences.place-number', stop=3)
> +        HAS_AUTO_PLACE_TITLE = config.get('preferences.place-auto')
> +
> +        if not HAS_AUTO_PLACE_TITLE:
> +            self.add_checkbox(grid, _("Suppress comma after house number"),
> +                              row, 'preferences.place-number', stop=3).set_sensitive(False)
> +        else:
> +            self.add_checkbox(grid, _("Suppress comma after house number"),
> +                              row, 'preferences.place-number', stop=3)
>           row += 1
>  
> -        self.add_checkbox(grid, _("Reverse display order"),
> -                          row, 'preferences.place-reverse', stop=3)
> +        if not HAS_AUTO_PLACE_TITLE:
> +            self.add_checkbox(grid, _("Reverse display order"),
> +                              row, 'preferences.place-reverse', stop=3).set_sensitive(False)
> +        else:
> +            self.add_checkbox(grid, _("Reverse display order"),
> +                              row, 'preferences.place-reverse', stop=3)
>           row += 1
>  
>           # Place restriction
> @@ -1132,11 +1142,17 @@ class GrampsPreferences(ConfigureDialog):
>           obox.connect('changed', self.place_restrict_changed)
>           lwidget = BasicLabel("%s: " % _('Restrict'))
>           grid.attach(lwidget, 0, row, 1, 1)
> +        if not HAS_AUTO_PLACE_TITLE:
> +            obox.set_sensitive(False)
>           grid.attach(obox, 1, row, 2, 1)
>           row += 1
>  
> -        self.add_entry(grid, _("Language"),
> -                          row, 'preferences.place-lang')
> +        if not HAS_AUTO_PLACE_TITLE:
> +            self.add_entry(grid, _("Language"),
> +                              row, 'preferences.place-lang').set_sensitive(False)
> +        else:
> +            self.add_entry(grid, _("Language"),
> +                              row, 'preferences.place-lang')
>           row += 1
>  
>           return _('Places'), grid
>
>
> On the other hand, hide() does not need a signal.


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Place title configuration (was Private Records)

jerome
In reply to this post by jerome
Nick,


Yes, a signal (callback) would be more nice and maybe rather check state than
current configuration value via the key? Anyway, that's also why my first proposal was
only to hide the related sections from dialogue... I do not often set insensitive.

More "lazy", will be to only make an alternate location for "children" options!
Something visually more hierarchical. User can say: "Ah yes, first check place
title state, then the related options".

Tweak improvements to limit possible confusions.

Thank you.
Jérôme


--------------------------------------------
En date de : Dim 17.4.16, Nick Hall <[hidden email]> a écrit :

 Objet: Re: [Gramps-users] Place title configuration (was Private Records)
 À: "jerome" <[hidden email]>, [hidden email]
 Date: Dimanche 17 avril 2016, 18h50
 
 Jérôme,
 
 This isn't quite right
 yet.  I'll write a patch for you.
 
 Nick.
 

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users