Skip to content

Commit

Permalink
Implement executor config throuh GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
mildred committed Mar 9, 2023
1 parent 260dbec commit 606f072
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
9 changes: 9 additions & 0 deletions nwg_panel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2665,6 +2665,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)
Expand Down Expand Up @@ -2694,6 +2697,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"])

Expand Down Expand Up @@ -2741,6 +2748,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())

Expand All @@ -2751,6 +2759,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:
Expand Down
41 changes: 39 additions & 2 deletions nwg_panel/glade/config_executor.glade
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,20 @@
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="continuous">
<property name="label" translatable="yes">continuous</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
<property name="tooltip-text" translatable="yes">Updates the executor each time the script puts two lines of text (icon or empty line and text)</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl-script">
<property name="visible">True</property>
Expand Down Expand Up @@ -347,6 +361,29 @@ executor will create a new one.</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl-icon">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Icon:</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">16</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="icon">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="width-chars">22</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">16</property>
</packing>
</child>
<child>
<object class="GtkButton" id="save-to-database">
<property name="label" translatable="yes">Save to database</property>
Expand All @@ -356,7 +393,7 @@ executor will create a new one.</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">16</property>
<property name="top-attach">17</property>
</packing>
</child>
<child>
Expand All @@ -369,7 +406,7 @@ executor will create a new one.</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">16</property>
<property name="top-attach">17</property>
</packing>
</child>
<child>
Expand Down
2 changes: 2 additions & 0 deletions nwg_panel/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 606f072

Please sign in to comment.