|
31 | 31 | from .. import utils |
32 | 32 | from ..controller import ctrlcommands |
33 | 33 | from ..publish import PUBLISHER |
34 | | -from ..publish.messages import (RideImportSetting, RideOpenVariableDialog, RideExecuteSpecXmlImport, RideSaving, |
35 | | - RideVariableAdded, RideVariableUpdated, RideVariableRemoved) |
| 34 | +from ..publish.messages import (RideImportSetting, RideOpenVariableDialog, RideExecuteSpecXmlImport, |
| 35 | + RideOpenLibraryDocumentation, RideSaving, RideVariableAdded, |
| 36 | + RideVariableUpdated, RideVariableRemoved, RideExecuteLibraryInstall) |
36 | 37 | from ..utils.highlightmatcher import highlight_matcher |
37 | 38 | from ..widgets import ButtonWithHandler, Label, HtmlWindow, PopupMenu, PopupMenuItems, HtmlDialog |
38 | 39 |
|
@@ -626,16 +627,27 @@ def _create_item_menu(self): |
626 | 627 | menu = self._menu |
627 | 628 | menu_nt = self._menu_nt |
628 | 629 | item = self._controller[self._selection] |
629 | | - if item.has_error() and item.type == 'Library': |
630 | | - menu = menu[:] + [_('Import Library Spec XML')] |
631 | | - menu_nt = menu_nt[:] + ['Import Library Spec XML'] |
| 630 | + if item.type == 'Library': |
| 631 | + menu = menu[:] + [_('Open Library Documentation')] |
| 632 | + menu_nt = menu_nt[:] + ['Open Library Documentation'] |
| 633 | + if item.has_error() and item.name != "Remote": |
| 634 | + menu = menu[:] + [_('Import Library Spec XML'), _('Install Library')] |
| 635 | + menu_nt = menu_nt[:] + ['Import Library Spec XML', 'Install Library'] |
632 | 636 | return menu, menu_nt |
633 | 637 |
|
634 | 638 | @staticmethod |
635 | 639 | def on_import_library_spec_xml(event): |
636 | 640 | __ = event |
637 | 641 | RideExecuteSpecXmlImport().publish() |
638 | 642 |
|
| 643 | + def on_open_library_documentation(self, event): |
| 644 | + item = self._controller[self._selection] |
| 645 | + RideOpenLibraryDocumentation(item=item.name).publish() |
| 646 | + |
| 647 | + def on_install_library(self, event): |
| 648 | + item = self._controller[self._selection] |
| 649 | + RideExecuteLibraryInstall(item=item.name).publish() |
| 650 | + |
639 | 651 | def on_edit(self, event): |
640 | 652 | setting = self._get_setting() |
641 | 653 | self._show_import_editor_dialog( |
|
0 commit comments