return False on Glib functions
This commit is contained in:
parent
2241b54153
commit
4920720c99
@ -130,6 +130,7 @@ class KlippyFiles:
|
||||
self.add_file(data['item'], False)
|
||||
self.remove_file(data['source_item']['path'], False)
|
||||
self.run_callbacks(newfiles=[data['item']['path']], deletedfiles=[data['source_item']['path']])
|
||||
return False
|
||||
|
||||
def remove_file_callback(self, callback):
|
||||
if callback in self.callbacks:
|
||||
@ -165,6 +166,7 @@ class KlippyFiles:
|
||||
|
||||
def refresh_files(self):
|
||||
self._screen._ws.klippy.get_file_list(self._callback)
|
||||
return False
|
||||
|
||||
def remove_file(self, filename, notify=True):
|
||||
if filename not in self.filelist:
|
||||
|
@ -132,6 +132,7 @@ class Printer:
|
||||
GLib.idle_add(self.busy_cb, False)
|
||||
if state != self.state:
|
||||
self.change_state(state)
|
||||
return False
|
||||
|
||||
def process_power_update(self, data):
|
||||
if data['device'] in self.power_devices:
|
||||
|
@ -250,6 +250,8 @@ class BasePanel(ScreenPanel):
|
||||
self.control['temp_box'].reorder_child(self.labels[f"{self.current_extruder}_box"], 0)
|
||||
self.control['temp_box'].show_all()
|
||||
|
||||
return False
|
||||
|
||||
def remove(self, widget):
|
||||
self.content.remove(widget)
|
||||
|
||||
|
@ -136,6 +136,7 @@ class MacroPanel(ScreenPanel):
|
||||
self.options = {}
|
||||
self.labels['options'].remove_column(0)
|
||||
self.load_gcode_macros()
|
||||
return False
|
||||
|
||||
def load_gcode_macros(self):
|
||||
for macro in self._printer.get_gcode_macros():
|
||||
|
@ -257,6 +257,7 @@ class MainPanel(MenuPanel):
|
||||
self._printer.get_dev_stat(x, "target"),
|
||||
self._printer.get_dev_stat(x, "power"),
|
||||
)
|
||||
return False
|
||||
|
||||
def show_numpad(self, widget, device):
|
||||
|
||||
|
@ -115,6 +115,7 @@ class NetworkPanel(ScreenPanel):
|
||||
self.add_network(net, False)
|
||||
self.update_all_networks()
|
||||
self.content.show_all()
|
||||
return False
|
||||
|
||||
def add_network(self, ssid, show=True):
|
||||
|
||||
@ -428,6 +429,7 @@ class NetworkPanel(ScreenPanel):
|
||||
|
||||
self.labels['networkinfo'].set_markup(connected)
|
||||
self.labels['networkinfo'].show_all()
|
||||
return True
|
||||
|
||||
def reload_networks(self, widget=None):
|
||||
self.networks = {}
|
||||
|
@ -153,6 +153,7 @@ class PrintPanel(ScreenPanel):
|
||||
self.dir_panels[directory].attach(self.files[filepath], 0, pos, 1, 1)
|
||||
if show is True:
|
||||
self.dir_panels[directory].show_all()
|
||||
return False
|
||||
|
||||
def _create_row(self, fullpath, filename=None):
|
||||
name = Gtk.Label()
|
||||
@ -232,6 +233,7 @@ class PrintPanel(ScreenPanel):
|
||||
self.labels['files'][filepath]['icon'].set_image(Gtk.Image.new_from_pixbuf(pixbuf))
|
||||
else:
|
||||
self.labels['files'][filepath]['icon'].set_image(self._gtk.Image("file"))
|
||||
return False
|
||||
|
||||
def confirm_delete_file(self, widget, filepath):
|
||||
logging.debug(f"Sending delete_file {filepath}")
|
||||
@ -390,6 +392,7 @@ class PrintPanel(ScreenPanel):
|
||||
flist = sorted(self._screen.files.get_file_list(), key=lambda item: '/' in item)
|
||||
for file in flist:
|
||||
GLib.idle_add(self.add_file, file)
|
||||
return False
|
||||
|
||||
def update_file(self, filename):
|
||||
if filename not in self.labels['files']:
|
||||
@ -413,9 +416,11 @@ class PrintPanel(ScreenPanel):
|
||||
logging.debug(f"updatefiles: {updatedfiles}")
|
||||
for file in updatedfiles:
|
||||
self.update_file(file)
|
||||
return False
|
||||
|
||||
def _refresh_files(self, widget=None):
|
||||
self._files.refresh_files()
|
||||
return False
|
||||
|
||||
def show_rename(self, widget, fullpath):
|
||||
self.source = fullpath
|
||||
|
@ -68,6 +68,7 @@ def set_text_direction(lang=None):
|
||||
|
||||
def state_execute(callback):
|
||||
callback()
|
||||
return False
|
||||
|
||||
|
||||
class KlipperScreen(Gtk.Window):
|
||||
@ -352,6 +353,7 @@ class KlipperScreen(Gtk.Window):
|
||||
if self.popup_timeout is not None:
|
||||
GLib.source_remove(self.popup_timeout)
|
||||
self.popup_message = self.popup_timeout = None
|
||||
return False
|
||||
|
||||
def show_error_modal(self, err, e=""):
|
||||
logging.error(f"Showing error modal: {err} {e}")
|
||||
@ -483,6 +485,7 @@ class KlipperScreen(Gtk.Window):
|
||||
self.gtk.remove_dialog(dialog)
|
||||
self.close_screensaver()
|
||||
|
||||
|
||||
def _remove_current_panel(self, pop=True):
|
||||
if len(self._cur_panels) < 1:
|
||||
self.reload_panels()
|
||||
@ -545,6 +548,7 @@ class KlipperScreen(Gtk.Window):
|
||||
if self.screensaver_timeout is not None:
|
||||
GLib.source_remove(self.screensaver_timeout)
|
||||
self.screensaver_timeout = None
|
||||
return False
|
||||
|
||||
def close_screensaver(self, widget=None):
|
||||
if self.screensaver is None:
|
||||
@ -626,6 +630,7 @@ class KlipperScreen(Gtk.Window):
|
||||
|
||||
def process_busy_state(self, busy):
|
||||
self.process_update("notify_busy", busy)
|
||||
return False
|
||||
|
||||
def websocket_disconnected(self, msg):
|
||||
self.printer_initializing(msg, remove=True)
|
||||
@ -886,6 +891,7 @@ class KlipperScreen(Gtk.Window):
|
||||
logging.info(f"Temperature store size: {self.printer.tempstore_size}")
|
||||
except KeyError:
|
||||
logging.error("Couldn't get the temperature store size")
|
||||
return False
|
||||
|
||||
def base_panel_show_all(self):
|
||||
self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True))
|
||||
|
Loading…
x
Reference in New Issue
Block a user