2006-04-25 Alex Roitman <shura@gramps-project.org>
* src/plugins/EventCmp.py (DisplayChart.on_write_table): Use FileChooser dialog. * src/plugins/eventcmp.glade: remove unused dialog. svn: r6447
This commit is contained in:
parent
8a8ef76233
commit
f1c3795edf
@ -1,3 +1,8 @@
|
||||
2006-04-25 Alex Roitman <shura@gramps-project.org>
|
||||
* src/plugins/EventCmp.py (DisplayChart.on_write_table): Use
|
||||
FileChooser dialog.
|
||||
* src/plugins/eventcmp.glade: remove unused dialog.
|
||||
|
||||
2006-04-25 Don Allingham <don@gramps-project.org>
|
||||
* src/Bookmarks.py: Don't use goto submenu
|
||||
* src/GrampsCfg/py: move and rename tabs, change Prefixes for Formats
|
||||
|
@ -371,34 +371,35 @@ class DisplayChart(ManagedWindow.ManagedWindow):
|
||||
return [_("Person"),_("Birth"),_("Death")] + sort_list
|
||||
|
||||
def on_write_table(self,obj):
|
||||
self.form = gtk.glade.XML(self.glade_file,"dialog1","gramps")
|
||||
self.form.signal_autoconnect({
|
||||
"on_save_clicked" : self.on_save_clicked,
|
||||
"destroy_passed_object" : self.close,
|
||||
})
|
||||
self.save_form = self.form.get_widget("dialog1")
|
||||
self.save_form.show_all()
|
||||
f = gtk.FileChooserDialog(_("Select filename"),
|
||||
action=gtk.FILE_CHOOSER_ACTION_SAVE,
|
||||
buttons=(gtk.STOCK_CANCEL,
|
||||
gtk.RESPONSE_CANCEL,
|
||||
gtk.STOCK_OPEN,
|
||||
gtk.RESPONSE_OK))
|
||||
|
||||
def on_save_clicked(self,obj):
|
||||
|
||||
name = unicode(self.form.get_widget("filename").get_text())
|
||||
f.set_current_folder(os.getcwd())
|
||||
status = f.run()
|
||||
name = unicode(f.get_filename())
|
||||
f.destroy()
|
||||
|
||||
pstyle = BaseDoc.PaperStyle("junk",10,10)
|
||||
doc = OpenSpreadSheet.OpenSpreadSheet(pstyle,BaseDoc.PAPER_PORTRAIT)
|
||||
doc.creator(self.db.get_researcher().get_name())
|
||||
spreadsheet = TableReport(name,doc)
|
||||
spreadsheet.initialize(len(self.event_titles))
|
||||
if status == gtk.RESPONSE_OK:
|
||||
pstyle = BaseDoc.PaperStyle("junk",10,10)
|
||||
doc = OpenSpreadSheet.OpenSpreadSheet(pstyle,
|
||||
BaseDoc.PAPER_PORTRAIT)
|
||||
doc.creator(self.db.get_researcher().get_name())
|
||||
spreadsheet = TableReport(name,doc)
|
||||
spreadsheet.initialize(len(self.event_titles))
|
||||
|
||||
spreadsheet.write_table_head(self.event_titles)
|
||||
spreadsheet.write_table_head(self.event_titles)
|
||||
|
||||
index = 0
|
||||
for top in self.row_data:
|
||||
spreadsheet.set_row(index%2)
|
||||
index = index + 1
|
||||
spreadsheet.write_table_data(top)
|
||||
index = 0
|
||||
for top in self.row_data:
|
||||
spreadsheet.set_row(index%2)
|
||||
index = index + 1
|
||||
spreadsheet.write_table_data(top)
|
||||
|
||||
spreadsheet.finalize()
|
||||
Utils.destroy_passed_object(obj)
|
||||
spreadsheet.finalize()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -4,149 +4,6 @@
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="dialog1">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">Save as a Spreadsheet - GRAMPS</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="has_separator">False</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">8</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area2">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button16">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="destroy_passed_object" object="dialog1"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button14">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_save_clicked" object="dialog1"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTable" id="table2">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="labelTitle">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>_File name</b></property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">True</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="mnemonic_widget">filename</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_padding">6</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GnomeFileEntry" id="fileentry1">
|
||||
<property name="visible">True</property>
|
||||
<property name="history_id">table_data</property>
|
||||
<property name="max_saved">10</property>
|
||||
<property name="browse_dialog_title" translatable="yes">Save Data</property>
|
||||
<property name="directory_entry">False</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="use_filechooser">False</property>
|
||||
<property name="filechooser_action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
|
||||
|
||||
<child internal-child="entry">
|
||||
<widget class="GtkEntry" id="filename">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Select file to save OpenOffice.org spreadsheet</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_padding">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkDialog" id="view">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes"></property>
|
||||
@ -162,6 +19,8 @@
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">False</property>
|
||||
<signal name="delete_event" handler="on_view_delete_event" last_modification_time="Mon, 10 May 2004 22:57:39 GMT"/>
|
||||
|
||||
@ -248,6 +107,10 @@
|
||||
<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>
|
||||
@ -276,6 +139,9 @@
|
||||
<property name="rules_hint">True</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="fixed_height_mode">False</property>
|
||||
<property name="hover_selection">False</property>
|
||||
<property name="hover_expand">False</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@ -311,6 +177,8 @@
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">False</property>
|
||||
<signal name="delete_event" handler="on_filters_delete_event" last_modification_time="Mon, 10 May 2004 00:54:23 GMT"/>
|
||||
|
||||
@ -399,6 +267,10 @@
|
||||
<property name="xpad">5</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">filter_list</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>
|
||||
@ -423,6 +295,10 @@
|
||||
<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">1</property>
|
||||
@ -489,6 +365,10 @@
|
||||
<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>
|
||||
|
Loading…
Reference in New Issue
Block a user