all: Update to enable language files
This commit is contained in:
parent
2341642cc2
commit
7db6a541f2
30
KlipperScreen.pot
Normal file
30
KlipperScreen.pot
Normal file
@ -0,0 +1,30 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-11-18 11:40+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: panels/system.py:43
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:62
|
||||
msgid "Load Average"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:31
|
||||
msgid "System Information"
|
||||
msgstr ""
|
288
ks_includes/locales/KlipperScreen.pot
Normal file
288
ks_includes/locales/KlipperScreen.pot
Normal file
@ -0,0 +1,288 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-11-18 12:37+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: panels/print.py:229
|
||||
msgid "?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:65
|
||||
msgid "Abort"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:61
|
||||
msgid "Accept"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:229
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:108
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:89 panels/fan.py:52 panels/fine_tune.py:119
|
||||
#: panels/menu.py:18 panels/move.py:96 panels/network.py:34
|
||||
#: panels/preheat.py:54 panels/temperature.py:78
|
||||
msgid "Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:79 panels/print.py:225
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Cancel Change"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:111
|
||||
msgid "Cancel Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:146
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:85
|
||||
msgid "Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/preheat.py:51
|
||||
msgid "Cooldown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:49
|
||||
msgid "Decrease"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:79
|
||||
msgid "Disable XY"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:57
|
||||
msgid "Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:85 panels/job_status.py:82
|
||||
msgid "Emergency Stop"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:32
|
||||
msgid "Extrude"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:66 panels/fine_tune.py:134
|
||||
msgid "Extrusion"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:64
|
||||
msgid "Extrusion +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:68
|
||||
msgid "Extrusion -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:46 panels/fine_tune.py:141
|
||||
msgid "Fan"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:44
|
||||
msgid "Fan +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:48
|
||||
msgid "Fan -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:32
|
||||
msgid "Fan Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan On"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:25
|
||||
msgid "Fast"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22 panels/splash_screen.py:59
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:115
|
||||
msgid "Go Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:76 panels/move.py:38
|
||||
msgid "Home All"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:25
|
||||
msgid "Homing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:47
|
||||
msgid "Increase"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:20
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:43 panels/system.py:42
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:62
|
||||
msgid "Load Average"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:34
|
||||
msgid "Lower Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:20 panels/extrude.py:21 panels/extrude.py:24
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:87
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:28
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:70
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:224
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:154
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:32
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:57
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:68
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:34
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:39
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:152
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:23
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:56 panels/fine_tune.py:137
|
||||
msgid "Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:54
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:58
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:31 panels/system.py:30
|
||||
msgid "System Information"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:36
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:33 panels/job_status.py:34
|
||||
msgid "Time Elapsed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:35 panels/job_status.py:36
|
||||
msgid "Time Left"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Tool 1"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:150
|
||||
msgid "Uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:23
|
||||
msgid "X+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:28
|
||||
msgid "Y+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35 panels/fine_tune.py:131 panels/zcalibrate.py:23
|
||||
msgid "Z Offset"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:33 panels/move.py:33
|
||||
msgid "Z+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:37 panels/move.py:35
|
||||
msgid "Z-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35
|
||||
msgid "mm"
|
||||
msgstr ""
|
BIN
ks_includes/locales/en/LC_MESSAGES/KlipperScreen.mo
Normal file
BIN
ks_includes/locales/en/LC_MESSAGES/KlipperScreen.mo
Normal file
Binary file not shown.
269
ks_includes/locales/en/LC_MESSAGES/KlipperScreen.po
Normal file
269
ks_includes/locales/en/LC_MESSAGES/KlipperScreen.po
Normal file
@ -0,0 +1,269 @@
|
||||
#: panels/print.py:229
|
||||
msgid "?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:65
|
||||
msgid "Abort"
|
||||
msgstr "Abort"
|
||||
|
||||
#: panels/zcalibrate.py:61
|
||||
msgid "Accept"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:229
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:108
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:89 panels/fan.py:52 panels/fine_tune.py:119
|
||||
#: panels/menu.py:18 panels/move.py:96 panels/network.py:34
|
||||
#: panels/preheat.py:54 panels/temperature.py:78
|
||||
msgid "Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:79 panels/print.py:225
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Cancel Change"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:111
|
||||
msgid "Cancel Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:146
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:85
|
||||
msgid "Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/preheat.py:51
|
||||
msgid "Cooldown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:49
|
||||
msgid "Decrease"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:79
|
||||
msgid "Disable XY"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:57
|
||||
msgid "Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:85 panels/job_status.py:82
|
||||
msgid "Emergency Stop"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:32
|
||||
msgid "Extrude"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:66 panels/fine_tune.py:134
|
||||
msgid "Extrusion"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:64
|
||||
msgid "Extrusion +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:68
|
||||
msgid "Extrusion -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:46 panels/fine_tune.py:141
|
||||
msgid "Fan"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:44
|
||||
msgid "Fan +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:48
|
||||
msgid "Fan -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:32
|
||||
msgid "Fan Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan On"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:25
|
||||
msgid "Fast"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22 panels/splash_screen.py:59
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:115
|
||||
msgid "Go Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:76 panels/move.py:38
|
||||
msgid "Home All"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:25
|
||||
msgid "Homing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:47
|
||||
msgid "Increase"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:20
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:43 panels/system.py:42
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:62
|
||||
msgid "Load Average"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:34
|
||||
msgid "Lower Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:20 panels/extrude.py:21 panels/extrude.py:24
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:87
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:28
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:70
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:224
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:154
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:32
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:57
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:68
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:34
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:39
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:152
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:23
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:56 panels/fine_tune.py:137
|
||||
msgid "Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:54
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:58
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:31 panels/system.py:30
|
||||
msgid "System Information"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:36
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:33 panels/job_status.py:34
|
||||
msgid "Time Elapsed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:35 panels/job_status.py:36
|
||||
msgid "Time Left"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Tool 1"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:150
|
||||
msgid "Uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:23
|
||||
msgid "X+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:28
|
||||
msgid "Y+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35 panels/fine_tune.py:131 panels/zcalibrate.py:23
|
||||
msgid "Z Offset"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:33 panels/move.py:33
|
||||
msgid "Z+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:37 panels/move.py:35
|
||||
msgid "Z-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35
|
||||
msgid "mm"
|
||||
msgstr ""
|
@ -13,6 +13,7 @@ logger = logging.getLogger("KlipperScreen.BedLevelPanel")
|
||||
|
||||
class BedLevelPanel(ScreenPanel):
|
||||
def initialize(self, menu):
|
||||
_ = self.lang.gettext
|
||||
self.screws = None
|
||||
self.panel = KlippyGtk.HomogeneousGrid()
|
||||
self.disabled_motors = False
|
||||
@ -72,20 +73,20 @@ class BedLevelPanel(ScreenPanel):
|
||||
self.panel.attach(self.labels['bl'], 1, 1, 1, 1)
|
||||
self.panel.attach(self.labels['br'], 2, 1, 1, 1)
|
||||
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home","Home All","color2")
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home",_("Home All"),"color2")
|
||||
self.labels['home'].connect("clicked", self.home)
|
||||
|
||||
self.labels['dm'] = KlippyGtk.ButtonImage("motor-off", "Disable XY", "color3")
|
||||
self.labels['dm'] = KlippyGtk.ButtonImage("motor-off", _("Disable XY"), "color3")
|
||||
self.labels['dm'].connect("clicked", self.disable_motors)
|
||||
|
||||
self.panel.attach(self.labels['home'], 0, 0, 1, 1)
|
||||
self.panel.attach(self.labels['dm'], 0, 1, 1, 1)
|
||||
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease","Emergency Stop","color4")
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease",_("Emergency Stop"),"color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
self.panel.attach(self.labels['estop'], 3, 0, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.panel.attach(b, 3, 1, 1, 1)
|
||||
|
||||
|
@ -9,5 +9,6 @@ from panels.screen_panel import ScreenPanel
|
||||
|
||||
class ExamplePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
# Create gtk items here
|
||||
return
|
||||
|
@ -13,29 +13,27 @@ logger = logging.getLogger("KlipperScreen.ExtrudePanel")
|
||||
class ExtrudePanel(ScreenPanel):
|
||||
distance = 1
|
||||
distances = ['1','5','10','25']
|
||||
speed = "Medium"
|
||||
speeds = ["Slow", "Medium", "Fast"]
|
||||
speed_trans = {
|
||||
"Slow": "300",
|
||||
"Medium": "800",
|
||||
"Fast": "1400"
|
||||
}
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
self.speed = _("Medium")
|
||||
self.speeds = [_("Slow"), _("Medium"), _("Fast")]
|
||||
self.speed_trans = {
|
||||
_("Slow"): "300",
|
||||
_("Medium"): "800",
|
||||
_("Fast"): "1400"
|
||||
}
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
|
||||
|
||||
|
||||
self.labels['tool0'] = KlippyGtk.ButtonImage("extruder-1","Tool 1","color1")
|
||||
self.labels['tool0'] = KlippyGtk.ButtonImage("extruder-1",_("Tool 1"),"color1")
|
||||
self.labels['tool0'].get_style_context().add_class("button_active")
|
||||
self.labels['extrude'] = KlippyGtk.ButtonImage("extrude","Extrude","color3")
|
||||
self.labels['extrude'] = KlippyGtk.ButtonImage("extrude",_("Extrude"),"color3")
|
||||
self.labels['extrude'].connect("clicked", self.extrude, "+")
|
||||
self.labels['retract'] = KlippyGtk.ButtonImage("retract","Retract","color2")
|
||||
self.labels['retract'] = KlippyGtk.ButtonImage("retract",_("Retract"),"color2")
|
||||
self.labels['retract'].connect("clicked", self.extrude, "-")
|
||||
self.labels['temperature'] = KlippyGtk.ButtonImage("heat-up","Temperature","color4")
|
||||
self.labels['temperature'] = KlippyGtk.ButtonImage("heat-up",_("Temperature"),"color4")
|
||||
self.labels['temperature'].connect("clicked", self.menu_item_clicked, "temperature", {
|
||||
"name": "Temperature",
|
||||
"panel": "temperature"
|
||||
|
@ -14,7 +14,8 @@ class FanPanel(ScreenPanel):
|
||||
user_selecting = False
|
||||
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
@ -28,17 +29,17 @@ class FanPanel(ScreenPanel):
|
||||
self.labels["scale"].get_style_context().add_class("fan_slider")
|
||||
box.add(self.labels["scale"])
|
||||
|
||||
self.labels["fanoff"] = KlippyGtk.ButtonImage("fan-off", "Fan Off")
|
||||
self.labels["fanoff"] = KlippyGtk.ButtonImage("fan-off", _("Fan Off"))
|
||||
self.labels["fanoff"].get_style_context().add_class("color1")
|
||||
self.labels["fanoff"].connect("clicked", self.set_fan_on, False)
|
||||
self.labels["fanon"] = KlippyGtk.ButtonImage("fan", "Fan On")
|
||||
self.labels["fanon"] = KlippyGtk.ButtonImage("fan", _("Fan On"))
|
||||
self.labels["fanon"].get_style_context().add_class("color3")
|
||||
self.labels["fanon"].connect("clicked", self.set_fan_on, True)
|
||||
|
||||
self.labels["apply"] = KlippyGtk.ButtonImage("resume", "Set Speed")
|
||||
self.labels["apply"] = KlippyGtk.ButtonImage("resume", _("Set Speed"))
|
||||
self.labels["apply"].get_style_context().add_class("color2")
|
||||
self.labels["apply"].connect("clicked", self.set_fan_speed)
|
||||
self.labels["cancel"] = KlippyGtk.ButtonImage("stop", "Cancel Change")
|
||||
self.labels["cancel"] = KlippyGtk.ButtonImage("stop", _("Cancel Change"))
|
||||
self.labels["cancel"].get_style_context().add_class("color4")
|
||||
self.labels["cancel"].connect("clicked", self.cancel_select_fan_speed)
|
||||
self.labels["cancel"].hide()
|
||||
@ -48,7 +49,7 @@ class FanPanel(ScreenPanel):
|
||||
grid.attach(self.labels["fanoff"], 0, 2, 1, 1)
|
||||
grid.attach(self.labels["fanon"], 1, 2, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b,3,2,1,1)
|
||||
|
||||
|
@ -24,47 +24,48 @@ class FineTune(ScreenPanel):
|
||||
speed = 0
|
||||
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
logger.debug("FineTunePanel")
|
||||
|
||||
|
||||
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", "Z+", "color1")
|
||||
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", _("Z+"), "color1")
|
||||
self.labels['z+'].connect("clicked", self.change_babystepping, "+")
|
||||
self.labels['zoffset'] = Gtk.Label("Z Offset: 0.00mm")
|
||||
self.labels['zoffset'] = Gtk.Label(_("Z Offset") + ": 0.00" + _("mm"))
|
||||
self.labels['zoffset'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", "Z-", "color1")
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", _("Z-"), "color1")
|
||||
self.labels['z-'].connect("clicked", self.change_babystepping, "-")
|
||||
|
||||
grid.attach(self.labels['z+'], 0, 0, 1, 1)
|
||||
grid.attach(self.labels['zoffset'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['z-'], 0, 2, 1, 1)
|
||||
|
||||
self.labels['fan+'] = KlippyGtk.ButtonImage("fan-on", "Fan +", "color2")
|
||||
self.labels['fan+'] = KlippyGtk.ButtonImage("fan-on", _("Fan +"), "color2")
|
||||
self.labels['fan+'].connect("clicked", self.change_fan, "+")
|
||||
self.labels['fanspeed'] = Gtk.Label("Fan: 100%")
|
||||
self.labels['fanspeed'] = Gtk.Label(_("Fan") + ": 100%")
|
||||
self.labels['fanspeed'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['fan-'] = KlippyGtk.ButtonImage("fan-off", "Fan -", "color2")
|
||||
self.labels['fan-'] = KlippyGtk.ButtonImage("fan-off", _("Fan -"), "color2")
|
||||
self.labels['fan-'].connect("clicked", self.change_fan, "-")
|
||||
grid.attach(self.labels['fan+'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['fanspeed'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['fan-'], 1, 2, 1, 1)
|
||||
|
||||
self.labels['speed+'] = KlippyGtk.ButtonImage("speed-step", "Speed +", "color3")
|
||||
self.labels['speed+'] = KlippyGtk.ButtonImage("speed-step", _("Speed +"), "color3")
|
||||
self.labels['speed+'].connect("clicked", self.change_speed, "+")
|
||||
self.labels['speedfactor'] = Gtk.Label("Speed: 100%")
|
||||
self.labels['speedfactor'] = Gtk.Label(_("Speed") + ": 100%")
|
||||
self.labels['speedfactor'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['speed-'] = KlippyGtk.ButtonImage("speed-step", "Speed -", "color3")
|
||||
self.labels['speed-'] = KlippyGtk.ButtonImage("speed-step", _("Speed -"), "color3")
|
||||
self.labels['speed-'].connect("clicked", self.change_speed, "-")
|
||||
grid.attach(self.labels['speed+'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['speedfactor'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['speed-'], 2, 2, 1, 1)
|
||||
|
||||
self.labels['extrude+'] = KlippyGtk.ButtonImage("extrude", "Extrusion +", "color4")
|
||||
self.labels['extrude+'] = KlippyGtk.ButtonImage("extrude", _("Extrusion +"), "color4")
|
||||
self.labels['extrude+'].connect("clicked", self.change_extrusion, "+")
|
||||
self.labels['extrudefactor'] = Gtk.Label("Extrusion: 100%")
|
||||
self.labels['extrudefactor'] = Gtk.Label(_("Extrusion") + ": 100%")
|
||||
self.labels['extrudefactor'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['extrude-'] = KlippyGtk.ButtonImage("retract", "Extrusion -", "color4")
|
||||
self.labels['extrude-'] = KlippyGtk.ButtonImage("retract", _("Extrusion -"), "color4")
|
||||
self.labels['extrude-'].connect("clicked", self.change_extrusion, "-")
|
||||
grid.attach(self.labels['extrude+'], 3, 0, 1, 1)
|
||||
grid.attach(self.labels['extrudefactor'], 3, 1, 1, 1)
|
||||
@ -115,7 +116,7 @@ class FineTune(ScreenPanel):
|
||||
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b,3,3,1,1)
|
||||
|
||||
@ -123,19 +124,21 @@ class FineTune(ScreenPanel):
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, data):
|
||||
_ = self.lang.gettext
|
||||
|
||||
if "gcode_move" in data:
|
||||
if "homing_origin" in data["gcode_move"]:
|
||||
self.labels['zoffset'].set_text("Z Offset: %.2fmm" % data["gcode_move"]["homing_origin"][2])
|
||||
self.labels['zoffset'].set_text(_("Z Offset") + ": %.2fmm" % data["gcode_move"]["homing_origin"][2])
|
||||
if "extrude_factor" in data["gcode_move"]:
|
||||
self.extrusion = int(data["gcode_move"]["extrude_factor"]*100)
|
||||
self.labels['extrudefactor'].set_text("Extrusion: %3d%%" % self.extrusion)
|
||||
self.labels['extrudefactor'].set_text(_("Extrusion") + ": %3d%%" % self.extrusion)
|
||||
if "speed_factor" in data["gcode_move"]:
|
||||
self.speed = int(data["gcode_move"]["speed_factor"]*100)
|
||||
self.labels['speedfactor'].set_text("Speed: %3d%%" % self.speed)
|
||||
self.labels['speedfactor'].set_text(_("Speed") + ": %3d%%" % self.speed)
|
||||
|
||||
if "fan" in data and "speed" in data['fan']:
|
||||
self.fan = int(round(data['fan']['speed'],2)*100)
|
||||
self.labels['fanspeed'].set_text("Fan: %3d%%" % self.fan)
|
||||
self.labels['fanspeed'].set_text(_("Fan") + ": %3d%%" % self.fan)
|
||||
|
||||
def change_babystepping(self, widget, dir):
|
||||
if dir == "+":
|
||||
|
@ -14,6 +14,7 @@ class JobStatusPanel(ScreenPanel):
|
||||
filename = None
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
self.labels['progress'] = KlippyGtk.ProgressBar("printing-progress-bar")
|
||||
@ -29,10 +30,10 @@ class JobStatusPanel(ScreenPanel):
|
||||
overlay.add_overlay(self.labels['progress_text'])
|
||||
|
||||
self.labels['file'] = KlippyGtk.ImageLabel("file","",20,"printing-status-label")
|
||||
self.labels['time_label'] = KlippyGtk.ImageLabel("speed-step","Time Elapsed",20,"printing-status-label")
|
||||
self.labels['time'] = KlippyGtk.Label("Time Elapsed","printing-status-label")
|
||||
self.labels['time_left_label'] = KlippyGtk.ImageLabel("speed-step","Time Left",20,"printing-status-label")
|
||||
self.labels['time_left'] = KlippyGtk.Label("Time Left","printing-status-label")
|
||||
self.labels['time_label'] = KlippyGtk.ImageLabel("speed-step",_("Time Elapsed"),20,"printing-status-label")
|
||||
self.labels['time'] = KlippyGtk.Label(_("Time Elapsed"),"printing-status-label")
|
||||
self.labels['time_left_label'] = KlippyGtk.ImageLabel("speed-step",_("Time Left"),20,"printing-status-label")
|
||||
self.labels['time_left'] = KlippyGtk.Label(_("Time Left"),"printing-status-label")
|
||||
timegrid = Gtk.Grid()
|
||||
timegrid.attach(self.labels['time_label']['b'], 0, 0, 1, 1)
|
||||
timegrid.attach(self.labels['time'], 0, 1, 1, 1)
|
||||
@ -64,9 +65,9 @@ class JobStatusPanel(ScreenPanel):
|
||||
self.labels['heater_bed'].set_sensitive(False)
|
||||
grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
|
||||
|
||||
self.labels['resume'] = KlippyGtk.ButtonImage("resume","Resume","color1")
|
||||
self.labels['resume'] = KlippyGtk.ButtonImage("resume",_("Resume"),"color1")
|
||||
self.labels['resume'].connect("clicked",self.resume)
|
||||
self.labels['pause'] = KlippyGtk.ButtonImage("pause","Pause","color1" )
|
||||
self.labels['pause'] = KlippyGtk.ButtonImage("pause",_("Pause"),"color1" )
|
||||
self.labels['pause'].connect("clicked",self.pause)
|
||||
|
||||
if self._printer.get_stat('pause_resume','is_paused') == True:
|
||||
@ -75,13 +76,13 @@ class JobStatusPanel(ScreenPanel):
|
||||
else:
|
||||
grid.attach(self.labels['pause'], 0, 2, 1, 1)
|
||||
|
||||
self.labels['cancel'] = KlippyGtk.ButtonImage("stop","Cancel","color2")
|
||||
self.labels['cancel'] = KlippyGtk.ButtonImage("stop",_("Cancel"),"color2")
|
||||
self.labels['cancel'].connect("clicked", self.cancel)
|
||||
grid.attach(self.labels['cancel'], 1, 2, 1, 1)
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease","Emergency Stop","color4")
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease",_("Emergency Stop"),"color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
grid.attach(self.labels['estop'], 2, 2, 1, 1)
|
||||
self.labels['control'] = KlippyGtk.ButtonImage("control","Control","color3")
|
||||
self.labels['control'] = KlippyGtk.ButtonImage("control",_("Control"),"color3")
|
||||
self.labels['control'].connect("clicked", self._screen._go_to_submenu, "")
|
||||
grid.attach(self.labels['control'], 3, 2, 1, 1)
|
||||
|
||||
@ -100,16 +101,18 @@ class JobStatusPanel(ScreenPanel):
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel(self, widget):
|
||||
_ = self.lang.gettext
|
||||
|
||||
dialog = KlippyGtk.ConfirmDialog(
|
||||
self._screen,
|
||||
"Are you sure you wish to cancel this print?",
|
||||
_("Are you sure you wish to cancel this print?"),
|
||||
[
|
||||
{
|
||||
"name": "Cancel Print",
|
||||
"name": _("Cancel Print"),
|
||||
"response": Gtk.ResponseType.OK
|
||||
},
|
||||
{
|
||||
"name": "Go Back",
|
||||
"name": _("Go Back"),
|
||||
"response": Gtk.ResponseType.CANCEL
|
||||
}
|
||||
],
|
||||
|
@ -11,11 +11,11 @@ logger = logging.getLogger("KlipperScreen.MenuPanel")
|
||||
|
||||
class MenuPanel(ScreenPanel):
|
||||
def initialize(self, panel_name, items):
|
||||
print("### Making a new menu")
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = self.arrangeMenuItems(items, 4)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 1, 1, 1)
|
||||
|
||||
|
@ -16,25 +16,26 @@ class MovePanel(ScreenPanel):
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
self.labels['x+'] = KlippyGtk.ButtonImage("move-x+", "X+", "color1")
|
||||
self.labels['x+'] = KlippyGtk.ButtonImage("move-x+", _("X+"), "color1")
|
||||
self.labels['x+'].connect("clicked", self.move, "X", "+")
|
||||
self.labels['x-'] = KlippyGtk.ButtonImage("move-x-", "X-", "color1")
|
||||
self.labels['x-'] = KlippyGtk.ButtonImage("move-x-", _("X-"), "color1")
|
||||
self.labels['x-'].connect("clicked", self.move, "X", "-")
|
||||
|
||||
self.labels['y+'] = KlippyGtk.ButtonImage("move-y+", "Y+", "color2")
|
||||
self.labels['y+'] = KlippyGtk.ButtonImage("move-y+", _("Y+"), "color2")
|
||||
self.labels['y+'].connect("clicked", self.move, "Y", "+")
|
||||
self.labels['y-'] = KlippyGtk.ButtonImage("move-y-", "Y-", "color2")
|
||||
self.labels['y-'] = KlippyGtk.ButtonImage("move-y-", _("Y-"), "color2")
|
||||
self.labels['y-'].connect("clicked", self.move, "Y", "-")
|
||||
|
||||
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", "Z+", "color3")
|
||||
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", _("Z+"), "color3")
|
||||
self.labels['z+'].connect("clicked", self.move, "Z", "+")
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", "Z-", "color3")
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", _("Z-"), "color3")
|
||||
self.labels['z-'].connect("clicked", self.move, "Z", "-")
|
||||
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home", "Home All")
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home", _("Home All"))
|
||||
self.labels['home'].connect("clicked", self.home)
|
||||
|
||||
|
||||
@ -83,7 +84,7 @@ class MovePanel(ScreenPanel):
|
||||
bottomgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
|
||||
bottomgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
|
||||
box.pack_start(bottomgrid, True, True, 0)
|
||||
self.labels['move_dist'] = Gtk.Label("Move Distance (mm)")
|
||||
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
|
||||
self.labels['move_dist'].get_style_context().add_class("text")
|
||||
box.pack_start(self.labels['move_dist'], True, True, 0)
|
||||
box.pack_start(distgrid, True, True, 0)
|
||||
@ -92,7 +93,7 @@ class MovePanel(ScreenPanel):
|
||||
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 2, 1, 1)
|
||||
|
||||
|
@ -12,7 +12,7 @@ logger = logging.getLogger("KlipperScreen.NetworkPanel")
|
||||
|
||||
class NetworkPanel(ScreenPanel):
|
||||
def initialize(self, menu):
|
||||
# Create gtk items here
|
||||
_ = self.lang.gettext
|
||||
self.panel = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
# Get Hostname
|
||||
@ -25,12 +25,12 @@ class NetworkPanel(ScreenPanel):
|
||||
|
||||
|
||||
self.labels['networkinfo'] = Gtk.Label(
|
||||
"Network Info\n\n%s%s" % (hostname, ip)
|
||||
_("Network Info") + "\n\n%s%s" % (hostname, ip)
|
||||
)
|
||||
self.labels['networkinfo'].get_style_context().add_class('temperature_entry')
|
||||
self.panel.attach(self.labels['networkinfo'], 1, 0, 1, 1)
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.panel.attach(b, 1, 1, 1, 1)
|
||||
|
@ -13,6 +13,7 @@ class PreheatPanel(ScreenPanel):
|
||||
active_heaters = []
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.preheat_options = self._screen._config.get_preheat_options()
|
||||
logger.debug("Preheat options: %s" % self.preheat_options)
|
||||
|
||||
@ -47,10 +48,10 @@ class PreheatPanel(ScreenPanel):
|
||||
i += 1
|
||||
|
||||
|
||||
cooldown = KlippyGtk.ButtonImage('cool-down', 'Cooldown')
|
||||
cooldown = KlippyGtk.ButtonImage('cool-down', _('Cooldown'))
|
||||
cooldown.connect("clicked", self.set_temperature, "cooldown")
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
|
||||
row = int(i/2) if i%2 == 0 else int(i/2)+1
|
||||
|
@ -140,13 +140,18 @@ class PrintPanel(ScreenPanel):
|
||||
|
||||
|
||||
def get_file_info_str(self, filename):
|
||||
_ = self.lang.gettext
|
||||
|
||||
fileinfo = self._screen.files.get_file_info(filename)
|
||||
if fileinfo == None:
|
||||
return
|
||||
|
||||
return "<small>Uploaded: <b>%s</b> - Size: <b>%s</b>\nPrint Time: <b>%s</b></small>" % (
|
||||
return "<small>%s: <b>%s</b> - %s: <b>%s</b>\n%s: <b>%s</b></small>" % (
|
||||
_("Uploaded"),
|
||||
datetime.fromtimestamp(fileinfo['modified']).strftime("%Y-%m-%d %H:%M"),
|
||||
_("Size"),
|
||||
humanize.naturalsize(fileinfo['size']),
|
||||
_("Print Time"),
|
||||
self.get_print_time(filename)
|
||||
)
|
||||
|
||||
@ -214,27 +219,14 @@ class PrintPanel(ScreenPanel):
|
||||
self.update_file(file)
|
||||
|
||||
def confirm_print(self, widget, filename):
|
||||
dialog = Gtk.Dialog()
|
||||
#TODO: Factor other resolutions in
|
||||
dialog.set_default_size(self._screen.width - 15, self._screen.height - 15)
|
||||
dialog.set_resizable(False)
|
||||
dialog.set_transient_for(self._screen)
|
||||
dialog.set_modal(True)
|
||||
|
||||
dialog.add_button(button_text="Print", response_id=Gtk.ResponseType.OK)
|
||||
dialog.add_button(button_text="Cancel", response_id=Gtk.ResponseType.CANCEL)
|
||||
|
||||
dialog.connect("response", self.confirm_print_response, filename)
|
||||
dialog.get_style_context().add_class("dialog")
|
||||
|
||||
content_area = dialog.get_content_area()
|
||||
content_area.set_margin_start(15)
|
||||
content_area.set_margin_end(15)
|
||||
content_area.set_margin_top(15)
|
||||
content_area.set_margin_bottom(15)
|
||||
_ = self.lang.gettext
|
||||
buttons = [
|
||||
{"name":_("Print"), "response": Gtk.ResponseType.OK},
|
||||
{"name":_("Cancel"),"response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup("Are you sure you want to print <b>%s</b>?" % (filename))
|
||||
label.set_markup("%s <b>%s</b>%s" % (_("Are you sure you want to print"), filename, _("?")))
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
@ -255,9 +247,8 @@ class PrintPanel(ScreenPanel):
|
||||
grid.set_vexpand(True)
|
||||
grid.set_halign(Gtk.Align.CENTER)
|
||||
grid.set_valign(Gtk.Align.CENTER)
|
||||
content_area.add(grid)
|
||||
dialog.resize(self._screen.width - 15, self._screen.height - 15)
|
||||
dialog.show_all()
|
||||
|
||||
dialog = KlippyGtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
|
||||
|
||||
def confirm_print_response(self, widget, response_id, filename):
|
||||
widget.destroy()
|
||||
|
@ -9,6 +9,7 @@ from KlippyGcodes import KlippyGcodes
|
||||
class ScreenPanel:
|
||||
def __init__(self, screen):
|
||||
self._screen = screen
|
||||
self.lang = self._screen.lang
|
||||
self._printer = screen.printer
|
||||
self.labels = {}
|
||||
|
||||
|
@ -14,11 +14,13 @@ class SplashScreenPanel(ScreenPanel):
|
||||
box = None
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
image = Gtk.Image()
|
||||
#TODO: update file reference
|
||||
image.set_from_file(os.getcwd() + "/styles/z-bolt/images/klipper.png")
|
||||
|
||||
self.labels['text'] = Gtk.Label("Initializing printer...")
|
||||
self.labels['text'] = Gtk.Label(_("Initializing printer..."))
|
||||
self.labels['text'].get_style_context().add_class("text")
|
||||
|
||||
|
||||
@ -49,10 +51,12 @@ class SplashScreenPanel(ScreenPanel):
|
||||
self.labels['actions'].remove(child)
|
||||
|
||||
def show_restart_buttons(self):
|
||||
_ = self.lang.gettext
|
||||
|
||||
if "firmware_restart" not in self.labels:
|
||||
self.labels['restart'] = KlippyGtk.ButtonImage("reboot","Restart","color1")
|
||||
self.labels['restart'] = KlippyGtk.ButtonImage("reboot",_("Restart"),"color1")
|
||||
self.labels['restart'].connect("clicked", self.restart)
|
||||
self.labels['firmware_restart'] = KlippyGtk.ButtonImage("restart","Firmware Restart","color2")
|
||||
self.labels['firmware_restart'] = KlippyGtk.ButtonImage("restart",_("Firmware Restart"),"color2")
|
||||
self.labels['firmware_restart'].connect("clicked", self.firmware_restart)
|
||||
|
||||
self.clear_action_bar()
|
||||
|
@ -13,13 +13,13 @@ logger = logging.getLogger("KlipperScreen.SystemPanel")
|
||||
|
||||
class SystemPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
restart = KlippyGtk.ButtonImage('reboot','Klipper Restart','color1')
|
||||
restart = KlippyGtk.ButtonImage('reboot',_('Klipper Restart'),'color1')
|
||||
restart.connect("clicked", self.restart_klippy)
|
||||
firmrestart = KlippyGtk.ButtonImage('restart','Firmware Restart','color2')
|
||||
firmrestart = KlippyGtk.ButtonImage('restart',_('Firmware Restart'),'color2')
|
||||
firmrestart.connect("clicked", self.restart_klippy, "firmware")
|
||||
back = KlippyGtk.ButtonImage('back', 'Back')
|
||||
back.connect("clicked", self._screen._menu_go_back)
|
||||
@ -27,7 +27,7 @@ class SystemPanel(ScreenPanel):
|
||||
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
info.set_vexpand(True)
|
||||
|
||||
title = Gtk.Label("System Information")
|
||||
title = Gtk.Label(_("System Information"))
|
||||
title.set_margin_bottom(5)
|
||||
title.set_margin_top(15)
|
||||
|
||||
@ -39,7 +39,7 @@ class SystemPanel(ScreenPanel):
|
||||
title.get_style_context().add_class('temperature_entry')
|
||||
self.labels['loadavg'].get_style_context().add_class('temperature_entry')
|
||||
|
||||
self.labels['version'] = Gtk.Label("KlipperScreen Version: %s" % self._screen.version)
|
||||
self.labels['version'] = Gtk.Label(_("KlipperScreen Version") + (": %s" % self._screen.version))
|
||||
self.labels['version'].set_margin_top(15)
|
||||
self.labels['version'].get_style_context().add_class('temperature_entry')
|
||||
|
||||
@ -56,9 +56,10 @@ class SystemPanel(ScreenPanel):
|
||||
self.panel = grid
|
||||
|
||||
def update_system_load(self):
|
||||
_ = self.lang.gettext
|
||||
lavg = os.getloadavg()
|
||||
self.labels['loadavg'].set_text(
|
||||
"Load Average: %.2f %.2f %.2f" % (lavg[0], lavg[1], lavg[2])
|
||||
_("Load Average") + (": %.2f %.2f %.2f" % (lavg[0], lavg[1], lavg[2]))
|
||||
)
|
||||
|
||||
#TODO: Shouldn't need this
|
||||
|
@ -16,6 +16,8 @@ class TemperaturePanel(ScreenPanel):
|
||||
tempdelta = "10"
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
eq_grid = KlippyGtk.HomogeneousGrid()
|
||||
@ -42,11 +44,11 @@ class TemperaturePanel(ScreenPanel):
|
||||
|
||||
self.labels["control_grid"] = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
self.labels["increase"] = KlippyGtk.ButtonImage("increase", "Increase", "color1")
|
||||
self.labels["increase"] = KlippyGtk.ButtonImage("increase", _("Increase"), "color1")
|
||||
self.labels["increase"].connect("clicked",self.change_target_temp, "+")
|
||||
self.labels["decrease"] = KlippyGtk.ButtonImage("decrease", "Decrease", "color3")
|
||||
self.labels["decrease"] = KlippyGtk.ButtonImage("decrease", _("Decrease"), "color3")
|
||||
self.labels["decrease"].connect("clicked",self.change_target_temp, "-")
|
||||
self.labels["npad"] = KlippyGtk.ButtonImage("settings", "Number Pad", "color2")
|
||||
self.labels["npad"] = KlippyGtk.ButtonImage("settings", _("Number Pad"), "color2")
|
||||
self.labels["npad"].connect("clicked", self.show_numpad)
|
||||
|
||||
tempgrid = Gtk.Grid()
|
||||
@ -73,7 +75,7 @@ class TemperaturePanel(ScreenPanel):
|
||||
self.labels["control_grid"].attach(self.labels["decrease"], 3, 1, 1, 1)
|
||||
self.labels["control_grid"].attach(self.labels["npad"], 2, 2, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.labels["control_grid"].attach(b, 3, 2, 1, 1)
|
||||
|
||||
@ -104,6 +106,8 @@ class TemperaturePanel(ScreenPanel):
|
||||
self.labels["deg" + str(i)].set_active(False)
|
||||
|
||||
def show_numpad(self, widget):
|
||||
_ = self.lang.gettext
|
||||
|
||||
numpad = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
keys = [
|
||||
@ -139,7 +143,7 @@ class TemperaturePanel(ScreenPanel):
|
||||
ctx = self.labels['entry'].get_style_context()
|
||||
ctx.add_class('temperature_entry')
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Close')
|
||||
b = KlippyGtk.ButtonImage('back', _('Close'))
|
||||
b.connect("clicked", self.hide_numpad)
|
||||
|
||||
#numpad.attach(b, 0, 5, 3, 1)
|
||||
|
@ -16,24 +16,22 @@ class ZCalibratePanel(ScreenPanel):
|
||||
distance = 1
|
||||
distances = ['.01','.05','.1','.5','1','5']
|
||||
|
||||
def __init__(self, screen):
|
||||
self._screen = screen
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
label = Gtk.Label("Z Offset: ")
|
||||
label = Gtk.Label(_("Z Offset") + ": ")
|
||||
label.get_style_context().add_class('temperature_entry')
|
||||
self.labels['zpos'] = Gtk.Label("Homing")
|
||||
self.labels['zpos'] = Gtk.Label(_("Homing"))
|
||||
self.labels['zpos'].get_style_context().add_class('temperature_entry')
|
||||
box = Gtk.Box()
|
||||
|
||||
box.add(label)
|
||||
box.add(self.labels['zpos'])
|
||||
|
||||
zpos = KlippyGtk.ButtonImage('z-offset-decrease',"Raise Nozzle")
|
||||
zpos = KlippyGtk.ButtonImage('z-offset-decrease',_("Raise Nozzle"))
|
||||
zpos.connect("clicked", self.move, "+")
|
||||
zneg = KlippyGtk.ButtonImage('z-offset-increase',"Lower Nozzle")
|
||||
zneg = KlippyGtk.ButtonImage('z-offset-increase',_("Lower Nozzle"))
|
||||
zneg.connect("clicked", self.move, "-")
|
||||
|
||||
distgrid = Gtk.Grid()
|
||||
@ -56,15 +54,15 @@ class ZCalibratePanel(ScreenPanel):
|
||||
self.labels["1"].set_active(True)
|
||||
|
||||
space_grid = KlippyGtk.HomogeneousGrid()
|
||||
space_grid.attach(Gtk.Label("Distance (mm):"),0,0,1,1)
|
||||
space_grid.attach(Gtk.Label(_("Distance (mm)") + ":"),0,0,1,1)
|
||||
space_grid.attach(distgrid,0,1,1,1)
|
||||
space_grid.attach(Gtk.Label(" "),0,2,1,1)
|
||||
|
||||
complete = KlippyGtk.ButtonImage('complete','Accept','color2')
|
||||
complete = KlippyGtk.ButtonImage('complete',_('Accept'),'color2')
|
||||
complete.connect("clicked", self.accept)
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Abort')
|
||||
b = KlippyGtk.ButtonImage('back', _('Abort'))
|
||||
b.connect("clicked", self.abort)
|
||||
|
||||
|
||||
@ -94,7 +92,6 @@ class ZCalibratePanel(ScreenPanel):
|
||||
def change_distance(self, widget, distance):
|
||||
if self.distance == distance:
|
||||
return
|
||||
print("### Distance " + str(distance))
|
||||
|
||||
ctx = self.labels[str(self.distance)].get_style_context()
|
||||
ctx.remove_class("distbutton_active")
|
||||
|
33
screen.py
33
screen.py
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import gi
|
||||
import gettext
|
||||
import time
|
||||
import threading
|
||||
|
||||
@ -91,6 +92,8 @@ class KlipperScreen(Gtk.Window):
|
||||
'is_active': False
|
||||
}
|
||||
})
|
||||
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales')
|
||||
_ = self.lang.gettext
|
||||
|
||||
self.apiclient = KlippyRest("127.0.0.1",7125)
|
||||
Gtk.Window.__init__(self)
|
||||
@ -103,7 +106,7 @@ class KlipperScreen(Gtk.Window):
|
||||
logger.info("KlipperScreen version: %s" % self.version)
|
||||
logger.info("Screen resolution: %sx%s" % (self.width, self.height))
|
||||
|
||||
self.printer_initializing("Initializing")
|
||||
self.printer_initializing(_("Initializing"))
|
||||
|
||||
self._ws = KlippyWebsocket(self, {
|
||||
"on_connect": self.init_printer,
|
||||
@ -182,6 +185,7 @@ class KlipperScreen(Gtk.Window):
|
||||
else:
|
||||
self.panels[panel_name].initialize(panel_name)
|
||||
except:
|
||||
del self.panels[panel_name]
|
||||
self.show_error_modal("Unable to load panel %s" % panel_name)
|
||||
return
|
||||
|
||||
@ -202,15 +206,16 @@ class KlipperScreen(Gtk.Window):
|
||||
logger.debug("Current panel hierarchy: %s", str(self._cur_panels))
|
||||
|
||||
def show_error_modal(self, err):
|
||||
_ = self.lang.gettext
|
||||
logger.exception("Showing error modal: %s", err)
|
||||
|
||||
buttons = [
|
||||
{"name":"Go Back","response": Gtk.ResponseType.CANCEL}
|
||||
{"name":_("Go Back"),"response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup(("%s \n\nCheck /tmp/KlipperScreen.log for more information.\nPlease submit an issue "
|
||||
+ "on GitHub for help.") % err)
|
||||
label.set_markup(("%s \n\n" % err) +
|
||||
_("Check /tmp/KlipperScreen.log for more information.\nPlease submit an issue on GitHub for help."))
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
@ -305,11 +310,12 @@ class KlipperScreen(Gtk.Window):
|
||||
return
|
||||
|
||||
def _websocket_callback(self, action, data):
|
||||
_ = self.lang.gettext
|
||||
#print(json.dumps([action, data], indent=2))
|
||||
|
||||
if action == "notify_klippy_disconnected":
|
||||
logger.info("### Going to disconnected state")
|
||||
self.printer_initializing("Klipper has shutdown")
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
return
|
||||
elif action == "notify_klippy_ready":
|
||||
logger.info("### Going to ready state")
|
||||
@ -324,7 +330,7 @@ class KlipperScreen(Gtk.Window):
|
||||
self.printer_ready()
|
||||
elif data['webhooks']['state'] == "shutdown":
|
||||
self.shutdown == True
|
||||
self.printer_initializing("Klipper shutdown")
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
else:
|
||||
active = self.printer.get_stat('virtual_sdcard','is_active')
|
||||
paused = self.printer.get_stat('pause_resume','is_paused')
|
||||
@ -347,9 +353,11 @@ class KlipperScreen(Gtk.Window):
|
||||
self.panels[sub].process_update(data)
|
||||
|
||||
def _confirm_send_action(self, widget, text, method, params):
|
||||
_ = self.lang.gettext
|
||||
|
||||
buttons = [
|
||||
{"name":"Continue", "response": Gtk.ResponseType.OK},
|
||||
{"name":"Cancel","response": Gtk.ResponseType.CANCEL}
|
||||
{"name":_("Continue"), "response": Gtk.ResponseType.OK},
|
||||
{"name":_("Cancel"),"response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
label = Gtk.Label()
|
||||
@ -360,7 +368,7 @@ class KlipperScreen(Gtk.Window):
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
label.get_style_context().add_class("text")
|
||||
|
||||
dialog = KlippyGtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
|
||||
dialog = KlippyGtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
|
||||
|
||||
def _confirm_send_action_response(self, widget, response_id, method, params):
|
||||
if response_id == Gtk.ResponseType.OK:
|
||||
@ -379,6 +387,7 @@ class KlipperScreen(Gtk.Window):
|
||||
self.panels['splash_screen'].show_restart_buttons()
|
||||
|
||||
def init_printer(self):
|
||||
_ = self.lang.gettext
|
||||
self.shutdown = False
|
||||
|
||||
status_objects = [
|
||||
@ -396,7 +405,7 @@ class KlipperScreen(Gtk.Window):
|
||||
info = self.apiclient.get_printer_info()
|
||||
data = self.apiclient.send_request("printer/objects/query?" + "&".join(status_objects))
|
||||
if info == False or data == False:
|
||||
self.printer_initializing("Moonraker error")
|
||||
self.printer_initializing(_("Moonraker error"))
|
||||
return
|
||||
data = data['result']['status']
|
||||
|
||||
@ -412,10 +421,10 @@ class KlipperScreen(Gtk.Window):
|
||||
if info['result']['state'] == "shutdown":
|
||||
if "FIRMWARE_RESTART" in info['result']['state_message']:
|
||||
self.printer_initializing(
|
||||
"Klipper has encountered an error. Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
_("Klipper has encountered an error. Issue a FIRMWARE_RESTART to attempt fixing the issue.")
|
||||
)
|
||||
else:
|
||||
self.printer_initializing("Klippy is shutdown")
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
return
|
||||
if (data['print_stats']['state'] == "printing" or data['print_stats']['state'] == "paused"):
|
||||
self.printer_printing()
|
||||
|
Loading…
x
Reference in New Issue
Block a user