added scrolling area and remembers window width/height for filter rule editor (see #4336 for more details)

svn: r16226
This commit is contained in:
Doug Blank 2010-11-23 00:48:36 +00:00
parent 1891e8e710
commit 9f629ad6f9
2 changed files with 12 additions and 3 deletions

View File

@ -181,6 +181,8 @@ register('interface.view-categories',
["Gramplets", "People", "Relationships", "Families",
"Ancestry", "Events", "Places", "Geography", "Sources",
"Repositories", "Media", "Notes"])
register('interface.edit-rule-width', 600)
register('interface.edit-rule-height', 450)
register('interface.event-height', 450)
register('interface.event-ref-height', 450)
register('interface.event-ref-width', 600)

View File

@ -394,9 +394,9 @@ class MyEntry(gtk.Entry):
class EditRule(ManagedWindow.ManagedWindow):
def __init__(self, namespace, dbstate, uistate, track, filterdb, val,
label, update, filter_name):
ManagedWindow.ManagedWindow.__init__(self, uistate, track, EditRule)
self.width_key = "interface.edit-rule-width"
self.height_key = "interface.edit-rule-height"
self.namespace = namespace
self.dbstate = dbstate
self.db = dbstate.db
@ -511,7 +511,12 @@ class EditRule(ManagedWindow.ManagedWindow):
table.attach(l, 1, 2, pos, pos+1, gtk.FILL, 0, 5, 5)
table.attach(t, 2, 3, pos, pos+1, gtk.EXPAND|gtk.FILL, 0, 5, 5)
pos += 1
self.notebook.append_page(table, gtk.Label(class_obj.name))
# put the table into a scrollable area:
scrolled_win = gtk.ScrolledWindow()
scrolled_win.add_with_viewport(table)
scrolled_win.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
scrolled_win.show()
self.notebook.append_page(scrolled_win, gtk.Label(class_obj.name))
self.class2page[class_obj] = self.page_num
self.page_num = self.page_num + 1
self.page_num = 0
@ -573,6 +578,7 @@ class EditRule(ManagedWindow.ManagedWindow):
self.get_widget('rule_editor_cancel').connect('clicked', self.close_window)
self.get_widget('rule_editor_help').connect('clicked', self.on_help_clicked)
self._set_size()
self.show()
def select_iter(self, data):
@ -653,6 +659,7 @@ class EditRule(ManagedWindow.ManagedWindow):
new_rule = class_obj(value_list)
self.update_rule(self.active_rule, new_rule)
self._save_size()
self.close()
except KeyError:
pass