/usr/share/pyshared/quodlibet/qltk/ccb.py is in exfalso 3.0.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # Copyright 2005 Joe Wreschnig, Michael Urman
# 2012 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
from gi.repository import Gtk
from quodlibet import config
class ConfigCheckButton(Gtk.CheckButton):
"""A CheckButton that connects to QL's config module, and toggles
a boolean configuration value when it is toggled.
It is initialised to the current config value if `populate` is set True."""
def __init__(self, label, section, option, populate=False):
super(ConfigCheckButton, self).__init__(
label=label, use_underline=True)
if populate:
self.set_active(config.getboolean(section, option))
self.connect('toggled', ConfigCheckButton.__toggled, section, option)
def __toggled(self, section, option):
config.set(section, option, str(bool(self.get_active())).lower())
class ConfigCheckMenuItem(Gtk.CheckMenuItem):
"""A CheckMenuItem that connects to QL's config module, and toggles
a boolean configuration value when it is toggled.
It is initialised to the current config value if `populate` is set True."""
def __init__(self, label, section, option, populate=False):
super(ConfigCheckMenuItem, self).__init__(
label=label, use_underline=True)
if populate:
self.set_active(config.getboolean(section, option))
self.connect('toggled', ConfigCheckMenuItem.__toggled, section, option)
def __toggled(self, section, option):
config.set(section, option, str(bool(self.get_active())).lower())
|