/[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 1155 by jan, Thu Jun 12 12:17:11 2003 UTC revision 1293 by jonathan, Mon Jun 23 13:05:58 2003 UTC
# Line 13  The main window Line 13  The main window
13    
14  __version__ = "$Revision$"  __version__ = "$Revision$"
15    
16  __ThubanVersion__ = "0.2" #"$THUBAN_0_2$"  __ThubanVersion__ = "0.8" #"$THUBAN_0_2$"
17  #__BuildDate__ = "$Date$"  #__BuildDate__ = "$Date$"
18    
19  import os  import os
# Line 49  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 108  class MainWindow(DockFrame): Line 107  class MainWindow(DockFrame):
107    
108          self.init_dialogs()          self.init_dialogs()
109    
110            self.ShowLegend()
111    
112          EVT_CLOSE(self, self.OnClose)          EVT_CLOSE(self, self.OnClose)
113    
114      def Subscribe(self, channel, *args):      def Subscribe(self, channel, *args):
# Line 444  class MainWindow(DockFrame): Line 445  class MainWindow(DockFrame):
445    
446      def About(self):      def About(self):
447          self.RunMessageBox(_("About"),          self.RunMessageBox(_("About"),
448                             _("Thuban %s\n"                             _("Thuban %s\n\n"
449                              #"Build Date: %s\n"                              #"Build Date: %s\n"
450                              "using:\n"                              "Currently using:\n"
451                              "  %s\n"                              "  %s\n"
452                              "  %s\n\n"                              "  %s\n\n"
453                              "Thuban is a program for\n"                              "Thuban is a program for\n"
# Line 578  class MainWindow(DockFrame): Line 579  class MainWindow(DockFrame):
579      def LayerShowTable(self):      def LayerShowTable(self):
580          layer = self.current_layer()          layer = self.current_layer()
581          if layer is not None:          if layer is not None:
582              table = layer.table              table = layer.ShapeStore().Table()
583              name = "table_view" + str(id(table))              name = "table_view" + str(id(table))
584              dialog = self.get_open_dialog(name)              dialog = self.get_open_dialog(name)
585              if dialog is None:              if dialog is None:
# Line 939  def _has_legend_shown(context): Line 940  def _has_legend_shown(context):
940      """Return true if the legend window is shown"""      """Return true if the legend window is shown"""
941      return context.mainwindow.LegendShown()      return context.mainwindow.LegendShown()
942    
943    def _has_gdal_support(context):
944        """Return True if the GDAL is available"""
945        return Thuban.Model.resource.has_gdal_support()
946    
947  # File menu  # File menu
948  _method_command("new_session", _("&New Session"), "NewSession",  _method_command("new_session", _("&New Session"), "NewSession",
# Line 1002  _method_command("map_rename", _("&Rename Line 1006  _method_command("map_rename", _("&Rename
1006  _method_command("layer_add", _("&Add Layer..."), "AddLayer",  _method_command("layer_add", _("&Add Layer..."), "AddLayer",
1007                  helptext = _("Add a new layer to the map"))                  helptext = _("Add a new layer to the map"))
1008  _method_command("rasterlayer_add", _("&Add Image Layer..."), "AddRasterLayer",  _method_command("rasterlayer_add", _("&Add Image Layer..."), "AddRasterLayer",
1009                  helptext = _("Add a new image layer to the map"))                  helptext = _("Add a new image layer to the map"),
1010                    sensitive = _has_gdal_support)
1011  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",
1012                  helptext = _("Remove selected layer"),                  helptext = _("Remove selected layer"),
1013                  sensitive = _can_remove_layer)                  sensitive = _can_remove_layer)
# Line 1078  _method_command("table_join", _("&Join.. Line 1083  _method_command("table_join", _("&Join..
1083                  helptext = _("Join two tables creating a new one"))                  helptext = _("Join two tables creating a new one"))
1084    
1085  #  Export only under Windows ...  #  Export only under Windows ...
1086  map_menu = ["layer_add", "rasterlayer_add", "layer_remove", "map_rename",  map_menu = ["layer_add", "rasterlayer_add", "layer_remove",
1087                          None,                          None,
1088                            "map_rename",
1089                          "map_projection",                          "map_projection",
1090                          None,                          None,
1091                          "map_zoom_in_tool", "map_zoom_out_tool",                          "map_zoom_in_tool", "map_zoom_out_tool",
# Line 1136  main_toolbar = Menu("<toolbar>", "<toolb Line 1142  main_toolbar = Menu("<toolbar>", "<toolb
1142                       "selected_full_extent",                       "selected_full_extent",
1143                       None,                       None,
1144                       "map_identify_tool", "map_label_tool"])                       "map_identify_tool", "map_label_tool"])
1145    

Legend:
Removed from v.1155  
changed lines
  Added in v.1293

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26