524 |
"""Return true if a layer is selected in the context""" |
"""Return true if a layer is selected in the context""" |
525 |
return context.mainwindow.has_selected_layer() |
return context.mainwindow.has_selected_layer() |
526 |
|
|
527 |
|
def _has_tree_window_shown(context): |
528 |
|
"""Return true if the tree window is shown""" |
529 |
|
return context.mainwindow.get_open_dialog("session_tree") is None |
530 |
|
|
531 |
# File menu |
# File menu |
532 |
_method_command("new_session", "&New Session", "NewSession") |
_method_command("new_session", "&New Session", "NewSession") |
533 |
_method_command("open_session", "&Open Session", "OpenSession") |
_method_command("open_session", "&Open Session", "OpenSession") |
534 |
_method_command("save_session", "&Save Session", "SaveSession") |
_method_command("save_session", "&Save Session", "SaveSession") |
535 |
_method_command("save_session_as", "Save Session &As", "SaveSessionAs") |
_method_command("save_session_as", "Save Session &As", "SaveSessionAs") |
536 |
_method_command("show_session_tree", "Show Session &Tree", "ShowSessionTree") |
_method_command("show_session_tree", "Show Session &Tree", "ShowSessionTree", |
537 |
|
sensitive = _has_tree_window_shown) |
538 |
_method_command("exit", "&Exit", "Exit") |
_method_command("exit", "&Exit", "Exit") |
539 |
|
|
540 |
# Help menu |
# Help menu |