28 |
from Thuban import _ |
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 |
from Thuban.Model.postgisdb import PostGISShapeStore |
from Thuban.Model.postgisdb import PostGISShapeStore, has_postgis_support |
32 |
# XXX: replace this by |
# XXX: replace this by |
33 |
# from wxPython.lib.dialogs import wxMultipleChoiceDialog |
# from wxPython.lib.dialogs import wxMultipleChoiceDialog |
34 |
# when Thuban does not support wxPython 2.4.0 any more. |
# when Thuban does not support wxPython 2.4.0 any more. |
972 |
"""Return whether the the session has database connections""" |
"""Return whether the the session has database connections""" |
973 |
return context.session.HasDBConnections() |
return context.session.HasDBConnections() |
974 |
|
|
975 |
|
def _has_postgis_support(context): |
976 |
|
return has_postgis_support() |
977 |
|
|
978 |
|
|
979 |
# File menu |
# File menu |
980 |
_method_command("new_session", _("&New Session"), "NewSession", |
_method_command("new_session", _("&New Session"), "NewSession", |
981 |
helptext = _("Start a new session")) |
helptext = _("Start a new session")) |
992 |
checked = _has_legend_shown, |
checked = _has_legend_shown, |
993 |
helptext = _("Toggle Legend on/off")) |
helptext = _("Toggle Legend on/off")) |
994 |
_method_command("database_management", _("&Database Connections..."), |
_method_command("database_management", _("&Database Connections..."), |
995 |
"DatabaseManagement") |
"DatabaseManagement", |
996 |
|
sensitive = _has_postgis_support) |
997 |
_method_command("exit", _("E&xit"), "Exit", |
_method_command("exit", _("E&xit"), "Exit", |
998 |
helptext = _("Finish working with Thuban")) |
helptext = _("Finish working with Thuban")) |
999 |
|
|