roundabout,
created on Friday, 15 August 2025, 17:03:28 (1755277408),
received on Friday, 15 August 2025, 17:03:32 (1755277412)
Author identity: Vlad <vlad.muntoiu@gmail.com>
3998325e1530941787626fc2156d70e14de5747b
applets/clock/__init__.py
@@ -119,6 +119,7 @@ class ClockApplet(panorama_panel.Applet):
GLib.source_remove(self.next_update)
self.next_update = None
self.set_time()
self.emit("config-changed")
def show_options(self, _0=None, _1=None):
if self.options_window is None:
applets/wf-window-list/__init__.py
@@ -625,6 +625,8 @@ class WFWindowList(panorama_panel.Applet):
child.queue_draw()
child = child.get_next_sibling()
self.emit("config-changed")
def get_config(self):
return {"max_button_width": self.window_button_options.max_width}
main.py
@@ -119,12 +119,16 @@ class PanelConfigurator(Gtk.Frame):
return
self.panel.set_size(int(adjustment.get_value()))
self.panel.get_application().save_config()
@Gtk.Template.Callback()
def toggle_autohide(self, switch: Gtk.Switch, value: bool):
if not self.get_root():
return
self.panel.set_autohide(value, self.panel.hide_time)
self.panel.get_application().save_config()
@Gtk.Template.Callback()
def move_panel(self, button: Gtk.CheckButton):
if not self.get_root():
@@ -144,6 +148,8 @@ class PanelConfigurator(Gtk.Frame):
applet.queue_resize()
applet = applet.get_next_sibling()
self.panel.get_application().save_config()
@Gtk.Template.Callback()
def move_to_monitor(self, adjustment: Gtk.Adjustment):
if not self.get_root():
@@ -161,6 +167,8 @@ class PanelConfigurator(Gtk.Frame):
applet.output_changed()
applet = applet.get_next_sibling()
self.panel.get_application().save_config()
PANEL_POSITIONS_HUMAN = {
Gtk.PositionType.TOP: "top",
@@ -263,6 +271,7 @@ class AppletArea(Gtk.Box):
self.drop_target.connect("drop", self.drop_applet)
def drop_applet(self, drop_target: Gtk.DropTarget, value: int, x: float, y: float):
applet = self.get_root().get_application().drags[value]
old_area: AppletArea = applet.get_parent()
old_area.remove(applet)
# Find the position where to insert the applet
@@ -284,6 +293,10 @@ class AppletArea(Gtk.Box):
else:
self.append(applet)
applet.show()
self.get_root().get_application().drags.pop(value)
self.get_root().get_application().save_config()
return True
def set_edit_mode(self, value):
@@ -619,6 +632,7 @@ class PanoramaPanel(Gtk.Application):
AppletClass = self.applets_by_name[item[0]]
options = item[1]
applet_widget = AppletClass(orientation=panel.get_orientation(), config=options)
applet_widget.connect("config-changed", self.save_config)
applet_widget.set_panel_position(panel.position)
area.append(applet_widget)
@@ -629,7 +643,8 @@ class PanoramaPanel(Gtk.Application):
def do_activate(self):
Gio.Application.do_activate(self)
def save_config(self):
def save_config(self, *args):
print("Saving configuration file")
with open(get_config_file(), "w") as config_file:
yaml_writer = yaml.YAML(typ="rt")
data = {"panels": []}
@@ -668,7 +683,6 @@ class PanoramaPanel(Gtk.Application):
applet = applet.get_next_sibling()
Gtk.Application.do_shutdown(self)
self.save_config()
def do_command_line(self, command_line: Gio.ApplicationCommandLine):
options = command_line.get_options_dict()
shared/panorama_panel.py
@@ -8,6 +8,10 @@ class Applet(Gtk.Box):
name = "Generic applet"
description = ""
__gsignals__ = {
"config-changed": (GObject.SIGNAL_RUN_FIRST, None, ())
}
def __init__(self, orientation=Gtk.Orientation.HORIZONTAL, config=None):
super().__init__(orientation=orientation)
if orientation == Gtk.Orientation.VERTICAL: