2006-07-20 Alex Roitman <shura@gramps-project.org>

* src/GrampsCfg.py (add_name_panel): Minor UI improvements;
	(_build_custom_name_ui): Minor UI improvements;
	(cb_edit_fmt_str): Make correct transient_for call.
	* src/gramps.glade (namefmt_edit): Add expander with the help on
	format definitions; minor UI improvements.



svn: r7050
This commit is contained in:
Alex Roitman 2006-07-20 19:12:22 +00:00
parent 334e331030
commit 3a20c1bf4f
3 changed files with 122 additions and 53 deletions

View File

@ -1,3 +1,10 @@
2006-07-20 Alex Roitman <shura@gramps-project.org>
* src/GrampsCfg.py (add_name_panel): Minor UI improvements;
(_build_custom_name_ui): Minor UI improvements;
(cb_edit_fmt_str): Make correct transient_for call.
* src/gramps.glade (namefmt_edit): Add expander with the help on
format definitions; minor UI improvements.
2006-07-19 Alex Roitman <shura@gramps-project.org>
* src/plugins/Checkpoint.py (Checkpoint.init_gui): Detect whether
rcs program is present and modify UI accordingly.

View File

@ -227,20 +227,14 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
self.examplename.set_surname_prefix('Rev.')
self.examplename.set_surname('Smith')
self.examplename.set_suffix('Sr')
self.examplename.set_patronymic('patr')
self.examplename.set_call_name('call')
self.examplename.set_patronymic('Patronymic')
self.examplename.set_call_name('Ed')
table = gtk.Table(2,2)
table.set_border_width(12)
table.set_col_spacings(6)
table.set_row_spacings(6)
##format_list = []
##format_list += [(name,number) for (number,name,fmt_str)
##in Name.STANDARD_FORMATS]
##format_list += [(name,number) for (number,name,fmt_str)
##in NameDisplay.CUSTOM_FORMATS]
# get the model for the combo and the treeview
# index is used to set the active format in the combo quickly
# and to find an unused index number when a new format is created
@ -260,7 +254,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
self.fmt_obox.set_active(self.fmt_index[active])
self.fmt_obox.connect('changed', self.cb_name_changed)
# label for the combo
lwidget = BasicLabel("%s: " % _('Preset format'))
lwidget = BasicLabel("%s: " % _('_Display format'))
lwidget.set_use_underline(True)
lwidget.set_mnemonic_widget(self.fmt_obox)
# build the format manager ui
custom_ui = self._build_custom_name_ui()
@ -271,7 +267,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
# put all these together
table.attach(lwidget, 0, 1, 0, 1, yoptions=0)
table.attach(self.fmt_obox, 1, 2, 0, 1, yoptions=0)
table.attach(name_exp, 0, 2, 1, 2, yoptions=0)
table.attach(name_exp, 0, 2, 1, 2, yoptions=gtk.FILL|gtk.EXPAND)
return table
@ -316,26 +312,25 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
# make a treeview for listing all the name formats
format_tree = gtk.TreeView(self.fmt_model)
name_renderer = gtk.CellRendererText()
name_column = gtk.TreeViewColumn(_('Title'),
name_column = gtk.TreeViewColumn(_('Format Name'),
name_renderer,
text=COL_NAME)
format_tree.append_column(name_column)
example_renderer = gtk.CellRendererText()
example_column = gtk.TreeViewColumn(_('Example name'),
example_column = gtk.TreeViewColumn(_('Example'),
example_renderer,
text=COL_EXPL)
format_tree.append_column(example_column)
format_tree.get_selection().connect('changed',
self.cb_format_tree_select)
format_tree.set_rules_hint(True)
(r,x,y,w,h) = name_column.cell_get_size()
# ... and put it into a scrolled win
format_sw = gtk.ScrolledWindow()
format_sw.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
format_sw.add(format_tree)
format_sw.set_shadow_type(gtk.SHADOW_IN)
format_sw.set_size_request(-1, h*6)
table.attach(format_sw, 0, 3, 0, 1)
table.attach(format_sw, 0, 3, 0, 1, yoptions=gtk.FILL|gtk.EXPAND)
# to hold the values of the selected row of the tree and the iter
self.selected_fmt = ()
@ -354,9 +349,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
self.remove_button.connect('clicked',self.cb_del_fmt_str)
self.remove_button.set_sensitive(False)
table.attach(insert_button, 0, 1, 1, 2,)
table.attach(self.remove_button, 1, 2, 1, 2,)
table.attach(self.edit_button, 2, 3, 1, 2,)
table.attach(insert_button, 0, 1, 1, 2,yoptions=0)
table.attach(self.remove_button, 1, 2, 1, 2,yoptions=0)
table.attach(self.edit_button, 2, 3, 1, 2,yoptions=0)
return table
@ -366,9 +361,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
Saves the new default to gconf and NameDisplay's fn_array
"""
list = obj.get_model()
iter = list.get_iter(obj.get_active())
new_idx = list.get_value(iter,COL_NUM)
the_list = obj.get_model()
the_iter = the_list.get_iter(obj.get_active())
new_idx = the_list.get_value(the_iter,COL_NUM)
Config.set(Config.NAME_FORMAT,new_idx)
_nd.set_format_default(new_idx)
@ -398,6 +393,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
n = self.selected_fmt[COL_NAME]
f = self.selected_fmt[COL_FMT]
dlg = NameFormatEditDlg(n,f,self.examplename)
dlg.dlg.set_transient_for(self.window)
(res,n,f) = dlg.run()
if res == gtk.RESPONSE_OK:

View File

@ -14819,7 +14819,7 @@ You should select parents before adding any new information. If you select paren
<widget class="GtkTable" id="table76">
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@ -14828,7 +14828,7 @@ You should select parents before adding any new information. If you select paren
<child>
<widget class="GtkLabel" id="name_label">
<property name="visible">True</property>
<property name="label" translatable="yes">_Name:</property>
<property name="label" translatable="yes">Format _name:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
@ -14857,7 +14857,7 @@ You should select parents before adding any new information. If you select paren
<child>
<widget class="GtkLabel" id="format_label">
<property name="visible">True</property>
<property name="label" translatable="yes">_Format:</property>
<property name="label" translatable="yes">Format _definition:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
@ -14883,34 +14883,6 @@ You should select parents before adding any new information. If you select paren
</packing>
</child>
<child>
<widget class="GtkLabel" id="example_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Example:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="name_entry">
<property name="visible">True</property>
@ -14953,6 +14925,34 @@ You should select parents before adding any new information. If you select paren
</packing>
</child>
<child>
<widget class="GtkLabel" id="example_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Example:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="example_label">
<property name="visible">True</property>
@ -14974,10 +14974,76 @@ You should select parents before adding any new information. If you select paren
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="expander2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label662">
<property name="visible">True</property>
<property name="label" translatable="yes">The following conventions are used:
%f - Given Name (First name)
%l - Surname (Last name, Family Name)
%t - Title
%p - Prefix
%s - Suffix
%c - Call name
%y - Patronymic</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">12</property>
<property name="ypad">6</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label661">
<property name="visible">True</property>
<property name="label" translatable="yes">Format definition d_etails</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>