From 02cba90a71c411f64654884b90e0fa6b9452890f Mon Sep 17 00:00:00 2001 From: Trigg Date: Wed, 9 Mar 2022 10:40:33 +0000 Subject: [PATCH] - --debug option saves output to output.txt in config - Bump minor version - Re-add font chooser for voice overlay --- discover_overlay/discover_overlay.py | 8 ++++++-- discover_overlay/voice_settings.py | 26 ++++++++++++++------------ setup.py | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/discover_overlay/discover_overlay.py b/discover_overlay/discover_overlay.py index 28d308b..44f5dfe 100755 --- a/discover_overlay/discover_overlay.py +++ b/discover_overlay/discover_overlay.py @@ -33,13 +33,15 @@ except ModuleNotFoundError: class Discover: """Main application class""" - def __init__(self, rpc_file, args): + def __init__(self, rpc_file, debug_file, args): self.ind = None self.tray = None self.steamos = False self.show_settings_delay=False self.settings = None + self.debug_file = debug_file + self.do_args(args, True) self.create_gui() @@ -103,6 +105,7 @@ class Discover: self.text_overlay.set_hidden(False) if "--debug" in data or "-v" in data: logging.getLogger().setLevel(0) + logging.basicConfig(filename=self.debug_file, encoding="UTF-8", level=logging.DEBUG) def rpc_changed(self, _a=None, _b=None, _c=None, _d=None): """ @@ -221,10 +224,11 @@ def entrypoint(): line = "%s %s" % (line, arg) pid_file = os.path.join(config_dir, "discover_overlay.pid") rpc_file = os.path.join(config_dir, "discover_overlay.rpc") + debug_file = os.path.join(config_dir, "output.txt") try: with pidfile.PIDFile(pid_file): logging.getLogger().setLevel(logging.INFO) - Discover(rpc_file, line) + Discover(rpc_file, debug_file, line) except pidfile.AlreadyRunningError: logging.warning("Discover overlay is currently running") diff --git a/discover_overlay/voice_settings.py b/discover_overlay/voice_settings.py index 0af139f..f96883d 100644 --- a/discover_overlay/voice_settings.py +++ b/discover_overlay/voice_settings.py @@ -251,6 +251,8 @@ class VoiceSettingsWindow(SettingsWindow): if self.font: font.set_font(self.font) font.connect("font-set", self.change_font) + alignment_box.attach(font_label, 0,0,1,1) + alignment_box.attach(font, 1,0,1,1) # Colours bg_col = Gtk.ColorButton.new_with_rgba( @@ -448,8 +450,8 @@ class VoiceSettingsWindow(SettingsWindow): icon_spacing = Gtk.SpinButton.new(icon_spacing_adjustment, 0, 0) icon_spacing.connect("value-changed", self.change_icon_spacing) - alignment_box.attach(icon_spacing_label,0,0,1,1) - alignment_box.attach(icon_spacing,1,0,1,1) + alignment_box.attach(icon_spacing_label,0,1,1,1) + alignment_box.attach(icon_spacing,1,1,1,1) # Text padding text_padding_label = Gtk.Label.new("Text Padding") @@ -459,8 +461,8 @@ class VoiceSettingsWindow(SettingsWindow): text_padding = Gtk.SpinButton.new(text_padding_adjustment, 0, 0) text_padding.connect("value-changed", self.change_text_padding) - alignment_box.attach(text_padding_label,0,1,1,1) - alignment_box.attach(text_padding,1,1,1,1) + alignment_box.attach(text_padding_label,0,2,1,1) + alignment_box.attach(text_padding,1,2,1,1) # Text Baseline Adjustment text_baseline_label = Gtk.Label.new("Text Vertical Offset") @@ -470,8 +472,8 @@ class VoiceSettingsWindow(SettingsWindow): text_baseline = Gtk.SpinButton.new(text_baseline_adjustment, 0, 0) text_baseline.connect("value-changed", self.change_text_baseline) - alignment_box.attach(text_baseline_label, 0, 2,1,1) - alignment_box.attach(text_baseline,1,2,1,1) + alignment_box.attach(text_baseline_label, 0, 3,1,1) + alignment_box.attach(text_baseline,1,3,1,1) # Edge padding vert_edge_padding_label = Gtk.Label.new("Vertical Edge Padding") @@ -483,8 +485,8 @@ class VoiceSettingsWindow(SettingsWindow): vert_edge_padding.connect( "value-changed", self.change_vert_edge_padding) - alignment_box.attach(vert_edge_padding_label, 0,3,1,1) - alignment_box.attach(vert_edge_padding,1,3,1,1) + alignment_box.attach(vert_edge_padding_label, 0,4,1,1) + alignment_box.attach(vert_edge_padding,1,4,1,1) horz_edge_padding_label = Gtk.Label.new("Horizontal Edge Padding") horz_edge_padding_adjustment = Gtk.Adjustment.new( @@ -494,8 +496,8 @@ class VoiceSettingsWindow(SettingsWindow): horz_edge_padding.connect( "value-changed", self.change_horz_edge_padding) - alignment_box.attach(horz_edge_padding_label,0,4,1,1) - alignment_box.attach(horz_edge_padding,1,4,1,1) + alignment_box.attach(horz_edge_padding_label,0,5,1,1) + alignment_box.attach(horz_edge_padding,1,5,1,1) # Display icon horizontally horizontal_label = Gtk.Label.new("Display Horizontally") @@ -504,8 +506,8 @@ class VoiceSettingsWindow(SettingsWindow): horizontal.set_active(self.horizontal) horizontal.connect("toggled", self.change_horizontal) - alignment_box.attach(horizontal_label, 0, 5, 1,1) - alignment_box.attach(horizontal, 1,5,1,1) + alignment_box.attach(horizontal_label, 0, 6, 1,1) + alignment_box.attach(horizontal, 1,6,1,1) # Guild ids to load: guild_ids_label = Gtk.Label.new("Search Servers for User") diff --git a/setup.py b/setup.py index 73c76d3..01c745b 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='discover-overlay', author='trigg', author_email='', - version='0.4.1', + version='0.4.2', description='Voice chat overlay', long_description=readme(), long_description_content_type='text/markdown',