diff --git a/docs/framework.rst b/docs/framework.rst index fbf667a8d..a15f1a899 100644 --- a/docs/framework.rst +++ b/docs/framework.rst @@ -26,15 +26,6 @@ The Application will look for services defined as :doc:`gaphor.services The most notable services are: -gui_manager - The GUI manager is one of the major services that have to be loaded. The - GUI manager is responsible for loading the main window and displaying it - on the screen. - - This by itself doesn't do a thing though. The Action manager - (`action_manager`) is required to maintain all actions users can perform. - Actions will be shown as menu entries for example. - file_manager Loading and saving a model is done through this service. diff --git a/gaphor/plugins/diagramlayout/tests/test_diagramlayout.py b/gaphor/plugins/diagramlayout/tests/test_diagramlayout.py index ea69f4bb2..36bc2b9b8 100644 --- a/gaphor/plugins/diagramlayout/tests/test_diagramlayout.py +++ b/gaphor/plugins/diagramlayout/tests/test_diagramlayout.py @@ -9,7 +9,6 @@ class DiagramLayoutTestCase(TestCase): services = TestCase.services + [ "main_window", "properties", - "action_manager", "diagram_layout", "import_menu", "export_menu", diff --git a/gaphor/services/tests/test_copyservice.py b/gaphor/services/tests/test_copyservice.py index c7e29c90c..8680f4f59 100644 --- a/gaphor/services/tests/test_copyservice.py +++ b/gaphor/services/tests/test_copyservice.py @@ -11,7 +11,6 @@ class CopyServiceTestCase(TestCase): services = TestCase.services + [ "main_window", - "action_manager", "properties", "undo_manager", "import_menu", diff --git a/gaphor/ui/mainwindow.py b/gaphor/ui/mainwindow.py index f87cf252e..2e693e57a 100644 --- a/gaphor/ui/mainwindow.py +++ b/gaphor/ui/mainwindow.py @@ -132,7 +132,6 @@ class MainWindow(Service, ActionProvider): event_manager, component_registry, element_factory, - action_manager, properties, import_menu, export_menu, @@ -141,7 +140,6 @@ class MainWindow(Service, ActionProvider): self.event_manager = event_manager self.component_registry = component_registry self.element_factory = element_factory - self.action_manager = action_manager self.properties = properties self.import_menu = import_menu self.export_menu = export_menu @@ -154,7 +152,6 @@ class MainWindow(Service, ActionProvider): self.layout = None self.init_styling() - self.init_action_group() def init_styling(self): with importlib.resources.path("gaphor.ui", "layout.css") as css_file: @@ -177,23 +174,6 @@ class MainWindow(Service, ActionProvider): em.unsubscribe(self._on_undo_manager_state_changed) em.unsubscribe(self._new_model_content) - def init_action_group(self): - self.action_group = build_action_group(self) - for name, label in ( - ("file", "_File"), - ("file-export", "_Export"), - ("file-import", "_Import"), - ("edit", "_Edit"), - ("diagram", "_Diagram"), - ("tools", "_Tools"), - ("help", "_Help"), - ): - a = Gtk.Action.new(name, label, None, None) - a.set_property("hide-if-empty", False) - self.action_group.add_action(a) - - self.action_manager.register_action_provider(self) - def get_ui_component(self, name): return self.component_registry.get(UIComponent, name) @@ -276,7 +256,7 @@ class MainWindow(Service, ActionProvider): action_group = window_action_group(self.component_registry) self.window.insert_action_group("win", action_group) - # self.window.add_accel_group(self.action_manager.get_accel_group()) + # TODO: self.window.add_accel_group(self.action_manager.get_accel_group()) self.window.present() @@ -368,10 +348,9 @@ class Diagrams(UIComponent, ActionProvider): title = _("Diagrams") - def __init__(self, event_manager, element_factory, action_manager, properties): + def __init__(self, event_manager, element_factory, properties): self.event_manager = event_manager self.element_factory = element_factory - self.action_manager = action_manager self.properties = properties self._notebook = None self._page_ui_settings = None @@ -501,16 +480,13 @@ class Diagrams(UIComponent, ActionProvider): self.event_manager.handle(DiagramPageChange(page)) def _add_ui_settings(self, page_num): - action_manager = self.action_manager child_widget = self._notebook.get_nth_page(page_num) - self.action_manager.register_action_provider(child_widget.diagram_page) - # TODO: self.window.insert_action_group("tree-view", child_widget.diagram_page.action_group) + # TODO: self.window.insert_action_group("diagram", child_widget.diagram_page.action_group) self._page_ui_settings = child_widget.diagram_page def _clear_ui_settings(self): - # TODO: notebook.get_current_page()? if self._page_ui_settings: - self.action_manager.unregister_action_provider(self._page_ui_settings) + # TODO: self.action_manager.unregister_action_provider(self._page_ui_settings) self._page_ui_settings = None @event_handler(DiagramShow) diff --git a/gaphor/ui/tests/test_diagrampage.py b/gaphor/ui/tests/test_diagrampage.py index d8f274fda..7078f89d2 100644 --- a/gaphor/ui/tests/test_diagrampage.py +++ b/gaphor/ui/tests/test_diagrampage.py @@ -16,7 +16,6 @@ class DiagramPageTestCase(unittest.TestCase): "component_registry", "element_factory", "main_window", - "action_manager", "properties", "namespace", "diagrams", diff --git a/gaphor/ui/tests/test_diagramtoolbox.py b/gaphor/ui/tests/test_diagramtoolbox.py index 55626520c..b23ae2ace 100644 --- a/gaphor/ui/tests/test_diagramtoolbox.py +++ b/gaphor/ui/tests/test_diagramtoolbox.py @@ -22,7 +22,6 @@ class DiagramToolboxTestCase(TestCase): "component_registry", "element_factory", "properties", - "action_manager", "main_window", "import_menu", "export_menu", diff --git a/gaphor/ui/tests/test_diagramtools.py b/gaphor/ui/tests/test_diagramtools.py index 4e7314184..7a02558dd 100644 --- a/gaphor/ui/tests/test_diagramtools.py +++ b/gaphor/ui/tests/test_diagramtools.py @@ -14,7 +14,6 @@ logging.basicConfig(level=logging.DEBUG) class DiagramItemConnectorTestCase(TestCase): services = TestCase.services + [ "main_window", - "action_manager", "properties", "namespace", "diagrams", diff --git a/gaphor/ui/tests/test_elementeditor.py b/gaphor/ui/tests/test_elementeditor.py index e59a8f2dd..8b8bf3576 100644 --- a/gaphor/ui/tests/test_elementeditor.py +++ b/gaphor/ui/tests/test_elementeditor.py @@ -26,7 +26,6 @@ def main_window(event_manager, element_factory): return Diagrams( event_manager=event_manager, element_factory=element_factory, - action_manager=None, properties=lambda a, b: 0, ) diff --git a/gaphor/ui/tests/test_handletool.py b/gaphor/ui/tests/test_handletool.py index 5e5a70119..ad3d991bc 100644 --- a/gaphor/ui/tests/test_handletool.py +++ b/gaphor/ui/tests/test_handletool.py @@ -28,7 +28,6 @@ def application(): "element_factory", "main_window", "properties_manager", - "action_manager", "properties", "namespace", "diagrams", @@ -110,7 +109,6 @@ class HandleToolTestCase(unittest.TestCase): "element_factory", "main_window", "properties_manager", - "action_manager", "properties", "namespace", "diagrams", diff --git a/gaphor/ui/tests/test_mainwindow.py b/gaphor/ui/tests/test_mainwindow.py index b21fec60d..44260d05a 100644 --- a/gaphor/ui/tests/test_mainwindow.py +++ b/gaphor/ui/tests/test_mainwindow.py @@ -15,7 +15,6 @@ def application(): "element_factory", "properties", "main_window", - "action_manager", "namespace", "diagrams", "toolbox", diff --git a/pyproject.toml b/pyproject.toml index 89ebaef48..0a2075a4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,6 @@ gaphorconvert = 'gaphor.tools.gaphorconvert:main' "file_manager" = "gaphor.ui.filemanager:FileManager" "recent_files" = "gaphor.ui.recentfiles:RecentFiles" "diagram_export_manager" = "gaphor.services.diagramexportmanager:DiagramExportManager" -"action_manager" = "gaphor.services.actionmanager:ActionManager" "main_window" = "gaphor.ui.mainwindow:MainWindow" "preferences" = "gaphor.ui.preferences:Preferences" "export_menu" = "gaphor.ui.menufragment:MenuFragment" diff --git a/setup.py b/setup.py index f49c6f762..ac9a64fef 100644 --- a/setup.py +++ b/setup.py @@ -109,7 +109,6 @@ setup( "element_factory = gaphor.UML.elementfactory:ElementFactory", "file_manager = gaphor.ui.filemanager:FileManager", "recent_files = gaphor.ui.recentfiles:RecentFiles", - "action_manager = gaphor.services.actionmanager:ActionManager", "main_window = gaphor.ui.mainwindow:MainWindow", "preferences = gaphor.ui.preferences:Preferences", "export_menu = gaphor.ui.menufragment:MenuFragment",