/[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 1142 by bh, Tue Jun 10 09:41:57 2003 UTC revision 1219 by bh, Mon Jun 16 17:42:54 2003 UTC
# Line 22  import copy Line 22  import copy
22  from wxPython.wx import *  from wxPython.wx import *
23  from wxPython.wx import __version__ as wxPython_version  from wxPython.wx import __version__ as wxPython_version
24    
 from wxPython.lib.dialogs import wxMultipleChoiceDialog  
   
25  import Thuban  import Thuban
26  import Thuban.version  import Thuban.version
27    
# Line 31  from Thuban import _ Line 29  from Thuban import _
29  from Thuban.Model.session import create_empty_session  from Thuban.Model.session import create_empty_session
30  from Thuban.Model.layer import Layer, RasterLayer  from Thuban.Model.layer import Layer, RasterLayer
31    
32    # XXX: replace this by
33    # from wxPython.lib.dialogs import wxMultipleChoiceDialog
34    # when Thuban does not support wxPython 2.4.0 any more.
35    from Thuban.UI.multiplechoicedialog import wxMultipleChoiceDialog
36    
37  import view  import view
38  import tree  import tree
39  import tableview, identifyview  import tableview, identifyview
# Line 46  from Thuban.UI.dock import DockFrame Line 49  from Thuban.UI.dock import DockFrame
49  from Thuban.UI.join import JoinDialog  from Thuban.UI.join import JoinDialog
50    
51  import resource  import resource
52    import Thuban.Model.resource
53    
54  import projdialog  import projdialog
55    
   
   
56  class MainWindow(DockFrame):  class MainWindow(DockFrame):
57    
58      # Some messages that can be subscribed/unsubscribed directly through      # Some messages that can be subscribed/unsubscribed directly through
# Line 575  class MainWindow(DockFrame): Line 577  class MainWindow(DockFrame):
577      def LayerShowTable(self):      def LayerShowTable(self):
578          layer = self.current_layer()          layer = self.current_layer()
579          if layer is not None:          if layer is not None:
580              table = layer.table              table = layer.ShapeStore().Table()
581              name = "table_view" + str(id(table))              name = "table_view" + str(id(table))
582              dialog = self.get_open_dialog(name)              dialog = self.get_open_dialog(name)
583              if dialog is None:              if dialog is None:
# Line 936  def _has_legend_shown(context): Line 938  def _has_legend_shown(context):
938      """Return true if the legend window is shown"""      """Return true if the legend window is shown"""
939      return context.mainwindow.LegendShown()      return context.mainwindow.LegendShown()
940    
941    def _has_gdal_support(context):
942        """Return True if the GDAL is available"""
943        return Thuban.Model.resource.has_gdal_support()
944    
945  # File menu  # File menu
946  _method_command("new_session", _("&New Session"), "NewSession",  _method_command("new_session", _("&New Session"), "NewSession",
# Line 999  _method_command("map_rename", _("&Rename Line 1004  _method_command("map_rename", _("&Rename
1004  _method_command("layer_add", _("&Add Layer..."), "AddLayer",  _method_command("layer_add", _("&Add Layer..."), "AddLayer",
1005                  helptext = _("Add a new layer to the map"))                  helptext = _("Add a new layer to the map"))
1006  _method_command("rasterlayer_add", _("&Add Image Layer..."), "AddRasterLayer",  _method_command("rasterlayer_add", _("&Add Image Layer..."), "AddRasterLayer",
1007                  helptext = _("Add a new image layer to the map"))                  helptext = _("Add a new image layer to the map"),
1008                    sensitive = _has_gdal_support)
1009  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",
1010                  helptext = _("Remove selected layer"),                  helptext = _("Remove selected layer"),
1011                  sensitive = _can_remove_layer)                  sensitive = _can_remove_layer)
# Line 1075  _method_command("table_join", _("&Join.. Line 1081  _method_command("table_join", _("&Join..
1081                  helptext = _("Join two tables creating a new one"))                  helptext = _("Join two tables creating a new one"))
1082    
1083  #  Export only under Windows ...  #  Export only under Windows ...
1084  map_menu = ["layer_add", "rasterlayer_add", "layer_remove", "map_rename",  map_menu = ["layer_add", "rasterlayer_add", "layer_remove",
1085                          None,                          None,
1086                            "map_rename",
1087                          "map_projection",                          "map_projection",
1088                          None,                          None,
1089                          "map_zoom_in_tool", "map_zoom_out_tool",                          "map_zoom_in_tool", "map_zoom_out_tool",

Legend:
Removed from v.1142  
changed lines
  Added in v.1219

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26