Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeanon committed Nov 23, 2024
1 parent c724854 commit 7955b3b
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ks_includes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ def validate_config(self, config, string="", remove=False):
'invert_x', 'invert_y', 'invert_z', '24htime', 'only_heaters', 'show_cursor', 'confirm_estop',
'autoclose_popups', 'use_dpms', 'use_default_menu', 'use_default_move_menu', 'side_macro_shortcut',
'use-matchbox-keyboard', 'show_heater_power', "show_scroll_steppers", "auto_open_extrude",
"auto_scale_temp_chart", "auto_adjust_temp_chart_indices"
"auto_scale_temp_chart", "auto_adjust_temp_chart_indices", "enable_lock",
)
strs = (
'default_printer', 'language', 'print_sort_dir', 'theme', 'screen_blanking_printing', 'font_size',
'print_estimate_method', 'screen_blanking', "screen_on_devices", "screen_off_devices", 'print_view',
"lock_password"
"lock_password",
)
numbers = (
'job_complete_timeout', 'job_error_timeout', 'move_speed_xy', 'move_speed_z',
Expand Down
25 changes: 17 additions & 8 deletions panels/shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,25 @@ def __init__(self, screen, title):
restart_ks = self._gtk.Button("refresh", _("Restart") + " KlipperScreen", "color3")
restart_ks.connect("clicked", self._screen.restart_ks)

lock_screen = self._gtk.Button("lock", _("Lock"), "color3")
lock_screen.connect("clicked", self._screen.lock_screen.lock)

self.main = Gtk.Grid(row_homogeneous=True, column_homogeneous=True)
if self._printer and self._printer.state not in {'disconnected', 'startup', 'shutdown', 'error'}:
self.main.attach(estop, 0, 0, 1, 2)
self.main.attach(restart_ks, 1, 0, 1, 1)
self.main.attach(lock_screen, 2, 0, 1, 1)
self.main.attach(poweroff, 1, 1, 1, 1)
self.main.attach(restart, 2, 1, 1, 1)

if screen._config.get_main_config().getboolean("enable_lock", True):
lock_screen = self._gtk.Button("lock", _("Lock"), "color3")
lock_screen.connect("clicked", self._screen.lock_screen.lock)

if self._printer and self._printer.state not in {'disconnected', 'startup', 'shutdown', 'error'}:
self.main.attach(estop, 0, 0, 1, 2)
self.main.attach(lock_screen, 2, 0, 1, 1)
self.main.attach(poweroff, 1, 1, 1, 1)
self.main.attach(restart, 2, 1, 1, 1)

else:
if self._printer and self._printer.state not in {'disconnected', 'startup', 'shutdown', 'error'}:
self.main.attach(estop, 0, 0, 1, 1)
self.main.attach(poweroff, 0, 1, 1, 1)
self.main.attach(restart, 1, 1, 1, 1)

self.content.add(self.main)

def reboot_poweroff(self, widget, method):
Expand Down
41 changes: 41 additions & 0 deletions styles/LynxBot-Darker/images/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions styles/LynxBot-Darker/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Material-darker theme created by Alfredo Monclus 2021 */
/* Modified by Zeanon */

* {
color: #e2e2e2;
Expand Down
41 changes: 41 additions & 0 deletions styles/LynxCrew-Darker/images/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions styles/LynxCrew-Darker/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Material-darker theme created by Alfredo Monclus 2021 */
/* Modified by Zeanon */

* {
color: #e2e2e2;
Expand Down
97 changes: 97 additions & 0 deletions styles/z-bolt_lynxcrew/images/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7955b3b

Please sign in to comment.