enable book selector dialog to remember its size

This commit is contained in:
Paul Franklin 2016-11-21 13:11:26 -08:00
parent 5932addfb5
commit 0f9c3012be
3 changed files with 7 additions and 2 deletions

View File

@ -187,6 +187,8 @@ register('interface.address-height', 450)
register('interface.address-width', 650) register('interface.address-width', 650)
register('interface.attribute-height', 350) register('interface.attribute-height', 350)
register('interface.attribute-width', 600) register('interface.attribute-width', 600)
register('interface.book-selector-height', 600)
register('interface.book-selector-width', 700)
register('interface.child-ref-height', 450) register('interface.child-ref-height', 450)
register('interface.child-ref-width', 600) register('interface.child-ref-width', 600)
register('interface.citation-height', 450) register('interface.citation-height', 450)

View File

@ -3,8 +3,6 @@
<interface> <interface>
<requires lib="gtk+" version="3.10"/> <requires lib="gtk+" version="3.10"/>
<object class="GtkWindow" id="top"> <object class="GtkWindow" id="top">
<property name="width_request">600</property>
<property name="height_request">600</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">Book</property> <property name="title" translatable="yes">Book</property>
<property name="window_position">center</property> <property name="window_position">center</property>

View File

@ -296,6 +296,8 @@ class BookOptions(ReportOptions):
self.options_dict = { self.options_dict = {
'bookname' : '', 'bookname' : '',
} }
# TODO since the CLI code for the "book" generates its own "help" now,
# the GUI code would be faster if it didn't list all the possible books
self.options_help = { self.options_help = {
'bookname' : ("=name", _("Name of the book. MANDATORY"), 'bookname' : ("=name", _("Name of the book. MANDATORY"),
BookList('books.xml', dbase).get_book_names(), BookList('books.xml', dbase).get_book_names(),
@ -329,6 +331,9 @@ class BookSelector(ManagedWindow):
title_label = self.xml.get_object('title') title_label = self.xml.get_object('title')
self.set_window(window, title_label, self.title) self.set_window(window, title_label, self.title)
self.height_key = 'interface.book-selector-height'
self.width_key = 'interface.book-selector-width'
self._set_size()
window.show() window.show()
self.xml.connect_signals({ self.xml.connect_signals({
"on_add_clicked" : self.on_add_clicked, "on_add_clicked" : self.on_add_clicked,