✨ feat(Editor): add,change settings
add settings for parsing check on save and fontsize change directory for configfile to only the path for the configs
This commit is contained in:
parent
8b6c987640
commit
d4abe1da08
|
@ -135,9 +135,8 @@ class KlipperPlugin(
|
||||||
),
|
),
|
||||||
configuration=dict(
|
configuration=dict(
|
||||||
debug_logging=False,
|
debug_logging=False,
|
||||||
configpath="~/printer.cfg",
|
configpath="~/",
|
||||||
old_config="",
|
old_config="",
|
||||||
temp_config="",
|
|
||||||
logpath="/tmp/klippy.log",
|
logpath="/tmp/klippy.log",
|
||||||
reload_command="RESTART",
|
reload_command="RESTART",
|
||||||
shortStatus_navbar=True,
|
shortStatus_navbar=True,
|
||||||
|
@ -206,7 +205,7 @@ class KlipperPlugin(
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_settings_version(self):
|
def get_settings_version(self):
|
||||||
return 3
|
return 4
|
||||||
|
|
||||||
|
|
||||||
#migrate Settings
|
#migrate Settings
|
||||||
|
|
|
@ -127,15 +127,15 @@ $(function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.loadLastSession = function () {
|
self.loadLastSession = function () {
|
||||||
if (self.settings.settings.plugins.klipper.configuration.temp_config() != "") {
|
if (self.settings.settings.plugins.klipper.configuration.old_config() != "") {
|
||||||
self.klipperViewModel.consoleMessage(
|
self.klipperViewModel.consoleMessage(
|
||||||
"info",
|
"info",
|
||||||
"lastSession:" +
|
"lastSession:" +
|
||||||
self.settings.settings.plugins.klipper.configuration.temp_config()
|
self.settings.settings.plugins.klipper.configuration.old_config()
|
||||||
);
|
);
|
||||||
if (editor.session) {
|
if (editor.session) {
|
||||||
editor.session.setValue(
|
editor.session.setValue(
|
||||||
self.settings.settings.plugins.klipper.configuration.temp_config()
|
self.settings.settings.plugins.klipper.configuration.old_config()
|
||||||
);
|
);
|
||||||
editor.clearSelection();
|
editor.clearSelection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,13 @@ $(function () {
|
||||||
|
|
||||||
self.markedForFileRemove = ko.observableArray([]);
|
self.markedForFileRemove = ko.observableArray([]);
|
||||||
|
|
||||||
|
self.checkFontsize = function () {
|
||||||
|
if (settings.settings.plugins.klipper.configuration.fontsize() > 20) {
|
||||||
|
settings.settings.plugins.klipper.configuration.fontsize(20)
|
||||||
|
} else if (settings.settings.plugins.klipper.configuration.fontsize()< 9) {
|
||||||
|
settings.settings.plugins.klipper.configuration.fontsize(9)
|
||||||
|
}
|
||||||
|
}
|
||||||
// initialize list helper
|
// initialize list helper
|
||||||
self.configs = new ItemListHelper(
|
self.configs = new ItemListHelper(
|
||||||
"klipperCfgFiles",
|
"klipperCfgFiles",
|
||||||
|
|
|
@ -39,7 +39,19 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label">{{ _('Klipper Config File') }}</label>
|
<label class="control-label">Editor</label>
|
||||||
|
<div class="controls">
|
||||||
|
<label class="checkbox" title="{{ _('Check parsing on save') }}"><input type="checkbox"
|
||||||
|
data-bind="checked: settings.settings.plugins.klipper.configuration.parse_check" /> {{ _('Check parsing on save') }}
|
||||||
|
</label>
|
||||||
|
<label title="{{ _('Fontsize') }}"><input type="text"
|
||||||
|
class="input-block-level span1" data-bind="value: settings.settings.plugins.klipper.configuration.fontsize,
|
||||||
|
event: { change: checkFontsize}" /> {{ _('Fontsize') }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label">{{ _('Klipper Config Directory') }}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.configpath" />
|
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.configpath" />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue