Remove the "tables" parameter for text and book document generators. All generators support tables, and if one didn't, it doesn't look like the code would work.

svn: r10745
This commit is contained in:
Brian Matherly
2008-05-20 03:19:58 +00:00
parent 1d306345bd
commit 92d5ba8dfd
12 changed files with 36 additions and 56 deletions

View File

@@ -50,24 +50,22 @@ class BookFormatComboBox(gtk.ComboBox):
self.__book_doc_list.sort()
gtk.ComboBox.__init__(self)
def set(self,tables,callback, obj=None,active=None):
def set(self, callback, obj=None, active=None):
self.store = gtk.ListStore(gobject.TYPE_STRING)
self.set_model(self.store)
cell = gtk.CellRendererText()
self.pack_start(cell,True)
self.add_attribute(cell,'text',0)
self.pack_start(cell, True)
self.add_attribute(cell, 'text', 0)
out_pref = Config.get(Config.OUTPUT_PREFERENCE)
index = 0
active_index = 0
self.data = []
for item in self.__book_doc_list:
if tables and item[2] == 0:
continue
self.data.append(item)
name = item[0]
self.store.append(row=[name])
if item[7] == active:
if item[6] == active:
active_index = index
elif not active and name == out_pref:
active_index = index
@@ -81,13 +79,13 @@ class BookFormatComboBox(gtk.ComboBox):
return self.data[self.get_active()][0]
def get_paper(self):
return self.data[self.get_active()][3]
return self.data[self.get_active()][2]
def get_ext(self):
return self.data[self.get_active()][5]
return self.data[self.get_active()][4]
def get_printable(self):
return self.data[self.get_active()][6]
return self.data[self.get_active()][5]
def get_clname(self):
return self.data[self.get_active()][7]
return self.data[self.get_active()][6]

View File

@@ -39,22 +39,20 @@ class TextFormatComboBox(gtk.ComboBox):
self.__text_doc_list.sort()
gtk.ComboBox.__init__(self)
def set(self,tables,callback, obj=None,active=None):
def set(self, callback, obj=None, active=None):
self.store = gtk.ListStore(gobject.TYPE_STRING)
self.set_model(self.store)
cell = gtk.CellRendererText()
self.pack_start(cell,True)
self.add_attribute(cell,'text',0)
self.pack_start(cell, True)
self.add_attribute(cell, 'text', 0)
out_pref = Config.get(Config.OUTPUT_PREFERENCE)
index = 0
active_index = 0
for item in self.__text_doc_list:
if tables and item[2] == 0:
continue
name = item[0]
self.store.append(row=[name])
if item[7] == active:
if item[6] == active:
active_index = index
elif not active and name == out_pref:
active_index = index
@@ -68,16 +66,16 @@ class TextFormatComboBox(gtk.ComboBox):
return self.__text_doc_list[self.get_active()][1]
def get_paper(self):
return self.__text_doc_list[self.get_active()][3]
return self.__text_doc_list[self.get_active()][2]
def get_styles(self):
return self.__text_doc_list[self.get_active()][4]
return self.__text_doc_list[self.get_active()][3]
def get_ext(self):
return self.__text_doc_list[self.get_active()][5]
return self.__text_doc_list[self.get_active()][4]
def get_printable(self):
return self.__text_doc_list[self.get_active()][6]
return self.__text_doc_list[self.get_active()][5]
def get_clname(self):
return self.__text_doc_list[self.get_active()][7]
return self.__text_doc_list[self.get_active()][6]

View File

@@ -40,17 +40,6 @@ class TextReportDialog(DocReportDialog):
DocReportDialog.__init__(self, dbstate, uistate, options,
name, translated_name)
#------------------------------------------------------------------------
#
# Customization hooks for subclasses
#
#------------------------------------------------------------------------
def doc_uses_tables(self):
"""Does this report require the ability to generate tables in
the file format. Override this for documents that do need
table support."""
return 0
#------------------------------------------------------------------------
#
# Functions related to selecting/changing the current file format.
@@ -61,5 +50,4 @@ class TextReportDialog(DocReportDialog):
this text report. This menu will be generated based upon
whether the document requires table support, etc."""
self.format_menu = TextFormatComboBox()
self.format_menu.set(self.doc_uses_tables(),
self.doc_type_changed, None, active)
self.format_menu.set(self.doc_type_changed, None, active)