From c7f67b8fc016540589df5dea3d5a4e589bdc6d70 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 4 Jun 2015 18:41:39 +0200 Subject: [PATCH] Updated for EditorCollectionPlugin --- octoprint_customControl/__init__.py | 10 ++++ ...a2 => customControl_hookedsettings.jinja2} | 56 +++++++++---------- 2 files changed, 38 insertions(+), 28 deletions(-) rename octoprint_customControl/templates/{customControl_settings.jinja2 => customControl_hookedsettings.jinja2} (97%) diff --git a/octoprint_customControl/__init__.py b/octoprint_customControl/__init__.py index 779f060..fd31657 100644 --- a/octoprint_customControl/__init__.py +++ b/octoprint_customControl/__init__.py @@ -18,6 +18,16 @@ class CustomControlPlugin(octoprint.plugin.SettingsPlugin, controls = [] ) + def get_template_configs(self): + if "editorcollection" in self._plugin_manager.enabled_plugins: + return [ + dict(type="plugin_editorcollection_EditorCollection", template="customControl_hookedsettings.jinja2", custom_bindings=True) + ] + else: + return [ + dict(type="settings", template="customControl_hookedsettings.jinja2", custom_bindings=True) + ] + def on_settings_save(self, data): s = settings() s.set(["controls"], data["controls"]) diff --git a/octoprint_customControl/templates/customControl_settings.jinja2 b/octoprint_customControl/templates/customControl_hookedsettings.jinja2 similarity index 97% rename from octoprint_customControl/templates/customControl_settings.jinja2 rename to octoprint_customControl/templates/customControl_hookedsettings.jinja2 index d59e31b..404325b 100644 --- a/octoprint_customControl/templates/customControl_settings.jinja2 +++ b/octoprint_customControl/templates/customControl_hookedsettings.jinja2 @@ -1,6 +1,6 @@

{{ _('Control') }}

-
+
@@ -46,33 +46,33 @@ - - - + +