mirror of
https://github.com/Steve-Tech/YAFI.git
synced 2026-04-19 16:50:36 +00:00
Fix stutter when opening About dialogue
This commit is contained in:
@@ -18,9 +18,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from gi.repository import Adw
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk, Adw, GLib
|
||||
|
||||
import cros_ec_python.commands as ec_commands
|
||||
import cros_ec_python.exceptions as ec_exceptions
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from gi.repository import Adw
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk, Adw, GLib
|
||||
|
||||
import cros_ec_python.commands as ec_commands
|
||||
import cros_ec_python.exceptions as ec_exceptions
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from gi.repository import Adw
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk, Adw, GLib
|
||||
|
||||
import cros_ec_python.commands as ec_commands
|
||||
import cros_ec_python.exceptions as ec_exceptions
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from gi.repository import Adw
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gtk, Adw, GLib
|
||||
|
||||
import cros_ec_python.commands as ec_commands
|
||||
import cros_ec_python.exceptions as ec_exceptions
|
||||
|
||||
12
yafi/main.py
12
yafi/main.py
@@ -20,13 +20,13 @@
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
import threading
|
||||
import gi
|
||||
from gi.repository import Gio
|
||||
|
||||
gi.require_version('Gtk', '4.0')
|
||||
gi.require_version('Adw', '1')
|
||||
|
||||
from gi.repository import Gtk, Gio, Adw
|
||||
from gi.repository import Gtk, Gio, Adw, GLib
|
||||
from .window import YafiWindow
|
||||
from .thermals import ThermalsPage
|
||||
from .leds import LedsPage
|
||||
@@ -136,9 +136,8 @@ class YafiApplication(Adw.Application):
|
||||
comments="YAFI is another GUI for the Framework Laptop Embedded Controller.\n"
|
||||
+ "It is written in Python with a GTK3 theme, and uses the `CrOS_EC_Python` library to communicate with the EC.",
|
||||
copyright="© 2025 Stephen Horvath",
|
||||
debug_info=self.generate_debug_info(),
|
||||
developer_name="Stephen Horvath",
|
||||
developers=["Stephen Horvath"],
|
||||
developers=["Stephen Horvath https://github.com/Steve-Tech"],
|
||||
issue_url="https://github.com/Steve-Tech/YAFI/issues",
|
||||
license_type=Gtk.License.GPL_2_0,
|
||||
version="0.5",
|
||||
@@ -147,6 +146,11 @@ class YafiApplication(Adw.Application):
|
||||
about.add_acknowledgement_section(None, ["Framework Computer Inc. https://frame.work/"])
|
||||
about.present(self.props.active_window)
|
||||
|
||||
if hasattr(self, 'debug_info'):
|
||||
about.set_debug_info(self.debug_info)
|
||||
else:
|
||||
threading.Thread(target=lambda: GLib.idle_add(about.set_debug_info, self.generate_debug_info())).start()
|
||||
|
||||
def show_error(self, heading, message):
|
||||
dialog = Adw.AlertDialog(heading=heading, body=message)
|
||||
dialog.add_response("exit", "Exit")
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from gi.repository import Adw
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk, Adw, GLib
|
||||
|
||||
import cros_ec_python.commands as ec_commands
|
||||
import cros_ec_python.exceptions as ec_exceptions
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from gi.repository import Adw
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gtk, Adw
|
||||
|
||||
@Gtk.Template(resource_path='/au/stevetech/yafi/ui/yafi.ui')
|
||||
class YafiWindow(Adw.ApplicationWindow):
|
||||
|
||||
Reference in New Issue
Block a user