5 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
6 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
7 |
|
|
8 |
|
"""The layer and table join dialog""" |
9 |
|
|
10 |
|
__version__ = "$Revision$" |
11 |
|
# $Source$ |
12 |
|
# $Id$ |
13 |
|
|
14 |
|
|
15 |
import sys |
import sys |
16 |
from wxPython.wx import * |
from wxPython.wx import * |
17 |
|
|
71 |
|
|
72 |
for t in session.Tables(): |
for t in session.Tables(): |
73 |
if self.choice_left_table is not None: |
if self.choice_left_table is not None: |
74 |
self.choice_left_table.Append(t.transient_table().Title(), t) |
self.choice_left_table.Append(t.Title(), t) |
75 |
|
|
76 |
# If there is no choice_left_table then self.left_table will |
# If there is no choice_left_table then self.left_table will |
77 |
# be the keft table so we can simply leave it out on the |
# be the keft table so we can simply leave it out on the |
78 |
# right side. |
# right side. |
79 |
if t is not self.left_table: |
if t is not self.left_table: |
80 |
self.choice_right_table.Append(t.transient_table().Title(), t) |
self.choice_right_table.Append(t.Title(), t) |
81 |
|
|
82 |
if self.choice_left_table is None: |
if self.choice_left_table is None: |
83 |
for col in self.left_table.Columns(): |
for col in self.left_table.Columns(): |
177 |
needed_rows = self.layer.ShapeStore().Table().NumRows() |
needed_rows = self.layer.ShapeStore().Table().NumRows() |
178 |
joined_rows = joined_table.NumRows() |
joined_rows = joined_table.NumRows() |
179 |
if needed_rows != joined_rows: |
if needed_rows != joined_rows: |
180 |
msg = _("The joined table has %(joined)d rows but " |
msg = _("The joined table has %(joined)d rows but" |
181 |
"it must have %(needed)d rows" |
" it must have %(needed)d rows" |
182 |
"to be used with the selected layer") \ |
" to be used with the selected layer") \ |
183 |
% {"joined": joined_rows, |
% {"joined": joined_rows, |
184 |
"needed": needed_rows} |
"needed": needed_rows} |
185 |
dlg = wxMessageDialog(None, msg, _('Join Failed'), |
dlg = wxMessageDialog(None, msg, _('Join Failed'), |