code cleanup

main
mirkobrombin 2 years ago
parent 060a5e4e36
commit 9a3bd446cd

@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ubuntu_smoother.window import UbuntuSmootherWindow
from gi.repository import Gtk, Gio, Adw
import sys
import gi
import logging
@ -21,10 +23,6 @@ import logging
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
from gi.repository import Gtk, Gio, Adw
from ubuntu_smoother.window import UbuntuSmootherWindow
logging.basicConfig(level=logging.INFO)

@ -4,4 +4,3 @@ class Config:
self.snap = snap
self.flatpak = flatpak
self.apport = apport

@ -3,4 +3,3 @@ class Preset:
snap: bool = True
flatpak: bool = True
apport: bool = True

@ -1,10 +1,13 @@
import shutil
def is_snap_installed():
return shutil.which('snap') is not None
def is_flatpak_installed():
return shutil.which('flatpak') is not None
def is_apport_installed():
return shutil.which('apport') is not None

@ -8,6 +8,7 @@ from ubuntu_smoother.utils.snap import Snap
logger = logging.getLogger("UbuntuSmoother::Configurator")
class Configurator:
def __init__(self, config: 'Config', fake: bool = False):

@ -51,8 +51,10 @@ class UbuntuSmootherWindow(Adw.ApplicationWindow):
self.btn_start.connect('clicked', self.__on_btn_start_clicked)
self.btn_save.connect('clicked', self.on_btn_save_clicked)
self.switch_snap.connect('state-set', self.__on_switch_snap_state_set)
self.switch_flatpak.connect('state-set', self.__on_switch_flatpak_state_set)
self.switch_apport.connect('state-set', self.__on_switch_apport_state_set)
self.switch_flatpak.connect(
'state-set', self.__on_switch_flatpak_state_set)
self.switch_apport.connect(
'state-set', self.__on_switch_apport_state_set)
def __on_btn_start_clicked(self, widget):
index = int(self.carousel.get_position())

Loading…
Cancel
Save