From 5b0da88fa66a7e5d97f2b508c28ed49490cd92ae Mon Sep 17 00:00:00 2001 From: Mildred Ki'Lya Date: Thu, 9 Mar 2023 16:13:55 +0100 Subject: [PATCH] Implement executor config throuh GUI --- nwg_panel/config.py | 18 ++++++++---- nwg_panel/glade/config_executor.glade | 41 +++++++++++++++++++++++++-- nwg_panel/langs/en_US.json | 2 ++ 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/nwg_panel/config.py b/nwg_panel/config.py index 7c31e52b..14eca9f6 100644 --- a/nwg_panel/config.py +++ b/nwg_panel/config.py @@ -1230,10 +1230,6 @@ def edit_sway_taskbar(self, *args): self.ckb_show_layout.set_label(voc["show-layout"]) self.ckb_show_layout.set_active(settings["show-layout"]) - self.ckb_hide_empty = builder.get_object("hide-empty") - self.ckb_hide_empty.set_label(voc["hide-empty"]) - self.ckb_hide_empty.set_active(settings["hide-empty"]) - self.workspace_buttons = builder.get_object("workspace-buttons") self.workspace_buttons.set_label(voc["workspaces-as-buttons"]) self.workspace_buttons.set_active(settings["workspace-buttons"]) @@ -1288,7 +1284,6 @@ def update_sway_taskbar(self): settings["show-app-icon"] = self.ckb_show_app_icon.get_active() settings["show-app-name"] = self.ckb_show_app_name.get_active() settings["show-layout"] = self.ckb_show_layout.get_active() - settings["hide-empty"] = self.ckb_hide_empty.get_active() settings["workspace-buttons"] = self.workspace_buttons.get_active() settings["all-workspaces"] = self.ckb_all_workspaces.get_active() settings["mark-autotiling"] = self.ckb_mark_autotiling.get_active() @@ -2603,7 +2598,9 @@ def edit_executor(self, item, name, new=False): "interval": 1, "angle": 0.0, "sigrt": signal.SIGRTMIN, - "use-sigrt": False + "use-sigrt": False, + "icon": "view-refresh-symbolic", + "continuous": False } for key in defaults: check_key(settings, key, defaults[key]) @@ -2665,6 +2662,9 @@ def edit_executor(self, item, name, new=False): self.executor_icon_placement = builder.get_object("icon-placement") self.executor_icon_placement.set_active_id(settings["icon-placement"]) + self.executor_icon = builder.get_object("icon") + self.executor_icon.set_text(settings["icon"]) + self.executor_icon_size = builder.get_object("icon-size") self.executor_icon_size.set_numeric(True) adj = Gtk.Adjustment(value=0, lower=8, upper=128, step_increment=1, page_increment=10, page_size=1) @@ -2694,6 +2694,10 @@ def edit_executor(self, item, name, new=False): self.executor_use_sigrt.set_label(voc["use-signal"]) self.executor_use_sigrt.set_active(settings["use-sigrt"]) + self.executor_continuous = builder.get_object("continuous") + self.executor_continuous.set_label(voc["continuous"]) + self.executor_continuous.set_active(settings["continuous"]) + self.executor_remove = builder.get_object("remove") self.executor_remove.set_label(voc["remove-executor"]) @@ -2741,6 +2745,7 @@ def update_executor(self): val = self.executor_icon_placement.get_active_id() if val: settings["icon-placement"] = val + settings["icon"] = self.executor_icon.get_text() settings["icon-size"] = int(self.executor_icon_size.get_value()) settings["interval"] = int(self.executor_interval.get_value()) @@ -2751,6 +2756,7 @@ def update_executor(self): settings["sigrt"] = int(self.executor_sigrt.get_value()) settings["use-sigrt"] = self.executor_use_sigrt.get_active() + settings["continuous"] = self.executor_continuous.get_active() self.panel[config_key] = settings else: diff --git a/nwg_panel/glade/config_executor.glade b/nwg_panel/glade/config_executor.glade index 0c16187c..b3818718 100644 --- a/nwg_panel/glade/config_executor.glade +++ b/nwg_panel/glade/config_executor.glade @@ -205,6 +205,20 @@ 2 + + + continuous + True + True + False + True + Updates the executor each time the script puts two lines of text (icon or empty line and text) + + + 2 + 2 + + True @@ -347,6 +361,29 @@ executor will create a new one. 11 + + + True + False + end + Icon: + + + 0 + 16 + + + + + True + True + 22 + + + 1 + 16 + + Save to database @@ -356,7 +393,7 @@ executor will create a new one. 1 - 16 + 17 @@ -369,7 +406,7 @@ executor will create a new one. 0 - 16 + 17 diff --git a/nwg_panel/langs/en_US.json b/nwg_panel/langs/en_US.json index e3ac33b3..eeb59d50 100644 --- a/nwg_panel/langs/en_US.json +++ b/nwg_panel/langs/en_US.json @@ -49,6 +49,7 @@ "command": "Command", "common": "Common", "common-panel-settings": "Common nwg-panel settings", + "continuous": "Continuous", "controls": "Controls", "controls-window-width-tooltip": "Controls window width in pixels; leave 0 for auto.", "cover-size": "Cover size", @@ -80,6 +81,7 @@ "gust": "gust", "header-icon-size": "Header icon size", "height": "Height", + "hide-empty": "Hide empty workspaces", "homogeneous": "Homogeneous", "homogeneous-tooltip": "Sets equal columns width be default if 'Modules center' not empty.", "horizontal-padding": "Horizontal padding",