/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/join.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/join.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1010 by frank, Fri May 23 08:27:20 2003 UTC revision 1022 by jan, Fri May 23 14:17:50 2003 UTC
# Line 11  from wxPython.wx import * Line 11  from wxPython.wx import *
11  from Thuban import _  from Thuban import _
12    
13  from Thuban.Model.transientdb import TransientJoinedTable  from Thuban.Model.transientdb import TransientJoinedTable
14  from Thuban.UI.tableview import TableFrame, LayerTableFrame  from Thuban.UI.tableview import QueryTableFrame, LayerTableFrame
15                                                                                                                                                                    
16  ID_LEFT_TABLE = 4001  ID_LEFT_TABLE = 4001
17  ID_RIGHT_TABLE = 4002  ID_RIGHT_TABLE = 4002
# Line 23  class JoinDialog(wxDialog): Line 23  class JoinDialog(wxDialog):
23      """Table join dialog.      """Table join dialog.
24    
25      Join two tables (left/right) based on the user selected fields.      Join two tables (left/right) based on the user selected fields.
26      Opens a TableFrame and registers the new table with the session.      Opens a QueryTableFrame and registers the new table with the session.
27      """      """
28    
29      def __init__(self, parent, title, session, layer = None):      def __init__(self, parent, title, session, layer = None):
# Line 132  class JoinDialog(wxDialog): Line 132  class JoinDialog(wxDialog):
132                                              right_table, right_field,                                              right_table, right_field,
133                                              outer_join)                                              outer_join)
134          except:          except:
135              dlg = wxMessageDialog(None, 'Join failed:\n  %s'%sys.exc_info()[1],              dlg = wxMessageDialog(None,
136                                          'Info',wxOK|wxICON_ERROR)                                    _('Join failed:\n  %s') % sys.exc_info()[1],
137                                      _('Info'), wxOK|wxICON_ERROR)
138              dlg.ShowModal()              dlg.ShowModal()
139              dlg.Destroy()              dlg.Destroy()
140              result = False              result = False
# Line 141  class JoinDialog(wxDialog): Line 142  class JoinDialog(wxDialog):
142          if result:          if result:
143              self.session.AddTable(joined_table)              self.session.AddTable(joined_table)
144              name = joined_table.tablename              name = joined_table.tablename
145              dialog = TableFrame(self.parent, name,              dialog = QueryTableFrame(self.parent, name,
146                                        _("Table: %s") % name, joined_table)                                  _('Table: %s') % joined_table.Title(),
147                                    joined_table)
148              self.parent.add_dialog(name, dialog)              self.parent.add_dialog(name, dialog)
149              dialog.Show(true)              dialog.Show(true)
150    

Legend:
Removed from v.1010  
changed lines
  Added in v.1022

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26