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

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

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

revision 1074 by bh, Tue May 27 17:39:43 2003 UTC revision 1080 by bh, Wed May 28 09:12:21 2003 UTC
# Line 698  class MainWindow(DockFrame): Line 698  class MainWindow(DockFrame):
698          dlg = wxMultipleChoiceDialog(self, _("Pick the table to show:"),          dlg = wxMultipleChoiceDialog(self, _("Pick the table to show:"),
699                                       _("Show Table"),                                       _("Show Table"),
700                                       [t.Title() for t in tables],                                       [t.Title() for t in tables],
701                                       size = (400,300), style = wxRESIZE_BORDER)                                       size = (400,300),
702                                         style = wxDEFAULT_DIALOG_STYLE |
703                                                 wxRESIZE_BORDER)
704          if (dlg.ShowModal() == wxID_OK):          if (dlg.ShowModal() == wxID_OK):
705              for i in dlg.GetValue():              for i in dlg.GetValue():
706                  # XXX: if the table belongs to a layer, open a                  # XXX: if the table belongs to a layer, open a
# Line 938  _method_command("layer_jointable", _("&J Line 940  _method_command("layer_jointable", _("&J
940                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
941    
942  def _can_unjoin(context):  def _can_unjoin(context):
943        """Return whether the Layer/Unjoin command can be executed.
944    
945        This is the case if a layer is selected and that layer has a
946        shapestore that has an original shapestore.
947        """
948      layer = context.mainwindow.SelectedLayer()      layer = context.mainwindow.SelectedLayer()
949      return bool(layer and layer.ShapeStore().OrigShapeStore() is not None)      if layer is None:
950            return 0
951        getstore = getattr(layer, "ShapeStore", None)
952        if getstore is not None:
953            return getstore().OrigShapeStore() is not None
954        else:
955            return 0
956  _method_command("layer_unjointable", _("&Unjoin Table..."), "LayerUnjoinTable",  _method_command("layer_unjointable", _("&Unjoin Table..."), "LayerUnjoinTable",
957                  sensitive = _can_unjoin)                  sensitive = _can_unjoin)
958    

Legend:
Removed from v.1074  
changed lines
  Added in v.1080

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26