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 |
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", |
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) |
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", |