Adjust blank lines to match Code Style Guide (see #103)
This commit is contained in:
parent
75b99e5820
commit
d2e1f6f5d8
14 changed files with 14 additions and 413 deletions
|
|
@ -1,25 +1,19 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
import logging
|
||||
import urllib
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version('Gtk', '4.0')
|
||||
gi.require_version('Adw', '1')
|
||||
from gi.repository import Gio, Gtk, Gdk, GLib, Adw
|
||||
|
||||
from .window import Window
|
||||
|
||||
|
||||
|
||||
|
||||
class Application(Gtk.Application):
|
||||
TITLE = "CoverGrid"
|
||||
ID = 'xyz.suruatoel.mcg'
|
||||
DOMAIN = 'mcg'
|
||||
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(application_id=Application.ID, flags=Gio.ApplicationFlags.FLAGS_NONE)
|
||||
self._window = None
|
||||
|
|
@ -38,7 +32,6 @@ class Application(Gtk.Application):
|
|||
self.set_accels_for_action('win.panel("2")', ['<primary>KP_3'])
|
||||
self.set_accels_for_action('win.panel("3")', ['<primary>KP_4'])
|
||||
|
||||
|
||||
def do_startup(self):
|
||||
Gtk.Application.do_startup(self)
|
||||
self._setup_logging()
|
||||
|
|
@ -48,14 +41,12 @@ class Application(Gtk.Application):
|
|||
self._setup_actions()
|
||||
self._setup_adw()
|
||||
|
||||
|
||||
def do_activate(self):
|
||||
Gtk.Application.do_activate(self)
|
||||
if not self._window:
|
||||
self._window = Window(self, Application.TITLE, self._settings)
|
||||
self._window.present()
|
||||
|
||||
|
||||
def on_menu_info(self, action, value):
|
||||
self._info_dialog = Adw.AboutDialog()
|
||||
self._info_dialog.set_application_icon("xyz.suruatoel.mcg")
|
||||
|
|
@ -67,27 +58,22 @@ class Application(Gtk.Application):
|
|||
self._info_dialog.set_issue_url("https://git.suruatoel.xyz/coderkun/mcg")
|
||||
self._info_dialog.present()
|
||||
|
||||
|
||||
def on_menu_quit(self, action, value):
|
||||
self.quit()
|
||||
|
||||
|
||||
def _setup_logging(self):
|
||||
logging.basicConfig(
|
||||
level=self._verbosity,
|
||||
format="%(asctime)s %(levelname)s: %(message)s"
|
||||
)
|
||||
|
||||
|
||||
def _load_settings(self):
|
||||
self._settings = Gio.Settings.new(Application.ID)
|
||||
|
||||
|
||||
def _set_default_settings(self):
|
||||
style_manager = Adw.StyleManager.get_default()
|
||||
style_manager.set_color_scheme(Adw.ColorScheme.PREFER_DARK)
|
||||
|
||||
|
||||
def _load_css(self):
|
||||
styleProvider = Gtk.CssProvider()
|
||||
styleProvider.load_from_resource(self._get_resource_path('gtk.css'))
|
||||
|
|
@ -97,7 +83,6 @@ class Application(Gtk.Application):
|
|||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
|
||||
)
|
||||
|
||||
|
||||
def _setup_actions(self):
|
||||
action = Gio.SimpleAction.new("info", None)
|
||||
action.connect('activate', self.on_menu_info)
|
||||
|
|
@ -106,11 +91,9 @@ class Application(Gtk.Application):
|
|||
action.connect('activate', self.on_menu_quit)
|
||||
self.add_action(action)
|
||||
|
||||
|
||||
def _get_resource_path(self, path):
|
||||
return "/{}/{}".format(Application.ID.replace('.', '/'), path)
|
||||
|
||||
|
||||
def _setup_adw(self):
|
||||
Adw.HeaderBar()
|
||||
Adw.ToolbarView()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue