Adjust line length to match Code Style Guide (see #103)

This commit is contained in:
coderkun 2024-05-27 12:46:46 +02:00
commit a1f8b73590
11 changed files with 436 additions and 258 deletions

View file

@ -12,7 +12,10 @@ from gi.repository import Gtk, Adw, GObject
class ServerPanel(Adw.Bin):
__gtype_name__ = 'McgServerPanel'
__gsignals__ = {
'change-output-device': (GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,bool,)),
'change-output-device': (GObject.SIGNAL_RUN_FIRST, None, (
GObject.TYPE_PYOBJECT,
bool,
)),
}
# Widgets
@ -57,10 +60,11 @@ class ServerPanel(Adw.Bin):
file = self._none_label
self.status_file.set_markup(file)
# Audio information
if audio:
if audio:
parts = audio.split(":")
if len(parts) == 3:
audio = "{}Hz, {}bit, {}channels".format(parts[0], parts[1], parts[2])
audio = "{}Hz, {}bit, {}channels".format(
parts[0], parts[1], parts[2])
else:
audio = self._none_label
self.status_audio.set_markup(audio)
@ -93,17 +97,21 @@ class ServerPanel(Adw.Bin):
device_ids.append(device.get_id())
if device.get_id() in self._output_buttons.keys():
self._output_buttons[device.get_id()].freeze_notify()
self._output_buttons[device.get_id()].set_active(device.is_enabled())
self._output_buttons[device.get_id()].set_active(
device.is_enabled())
self._output_buttons[device.get_id()].thaw_notify()
else:
button = Gtk.CheckButton.new_with_label(device.get_name())
if device.is_enabled():
button.set_active(True)
handler = button.connect('toggled', self.on_output_device_toggled, device)
handler = button.connect('toggled',
self.on_output_device_toggled, device)
self.output_devices.insert(button, -1)
self._output_buttons[device.get_id()] = button
# Remove devices
for id in self._output_buttons.keys():
if id not in device_ids:
self.output_devices.remove(self._output_buttons[id].get_parent())
self.output_devices.remove(
self._output_buttons[id].get_parent())