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
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
from gi.repository import Adw
|
from gi.repository import Gtk, Adw, GLib
|
||||||
from gi.repository import Gtk
|
|
||||||
from gi.repository import GLib
|
|
||||||
|
|
||||||
import cros_ec_python.commands as ec_commands
|
import cros_ec_python.commands as ec_commands
|
||||||
import cros_ec_python.exceptions as ec_exceptions
|
import cros_ec_python.exceptions as ec_exceptions
|
||||||
|
|||||||
@@ -18,9 +18,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
from gi.repository import Adw
|
from gi.repository import Gtk, Adw, GLib
|
||||||
from gi.repository import Gtk
|
|
||||||
from gi.repository import GLib
|
|
||||||
|
|
||||||
import cros_ec_python.commands as ec_commands
|
import cros_ec_python.commands as ec_commands
|
||||||
import cros_ec_python.exceptions as ec_exceptions
|
import cros_ec_python.exceptions as ec_exceptions
|
||||||
|
|||||||
@@ -18,9 +18,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
from gi.repository import Adw
|
from gi.repository import Gtk, Adw, GLib
|
||||||
from gi.repository import Gtk
|
|
||||||
from gi.repository import GLib
|
|
||||||
|
|
||||||
import cros_ec_python.commands as ec_commands
|
import cros_ec_python.commands as ec_commands
|
||||||
import cros_ec_python.exceptions as ec_exceptions
|
import cros_ec_python.exceptions as ec_exceptions
|
||||||
|
|||||||
@@ -18,8 +18,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
from gi.repository import Adw
|
from gi.repository import Gtk, Adw, GLib
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
import cros_ec_python.commands as ec_commands
|
import cros_ec_python.commands as ec_commands
|
||||||
import cros_ec_python.exceptions as ec_exceptions
|
import cros_ec_python.exceptions as ec_exceptions
|
||||||
|
|||||||
12
yafi/main.py
12
yafi/main.py
@@ -20,13 +20,13 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
import threading
|
||||||
import gi
|
import gi
|
||||||
from gi.repository import Gio
|
|
||||||
|
|
||||||
gi.require_version('Gtk', '4.0')
|
gi.require_version('Gtk', '4.0')
|
||||||
gi.require_version('Adw', '1')
|
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 .window import YafiWindow
|
||||||
from .thermals import ThermalsPage
|
from .thermals import ThermalsPage
|
||||||
from .leds import LedsPage
|
from .leds import LedsPage
|
||||||
@@ -136,9 +136,8 @@ class YafiApplication(Adw.Application):
|
|||||||
comments="YAFI is another GUI for the Framework Laptop Embedded Controller.\n"
|
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.",
|
+ "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",
|
copyright="© 2025 Stephen Horvath",
|
||||||
debug_info=self.generate_debug_info(),
|
|
||||||
developer_name="Stephen Horvath",
|
developer_name="Stephen Horvath",
|
||||||
developers=["Stephen Horvath"],
|
developers=["Stephen Horvath https://github.com/Steve-Tech"],
|
||||||
issue_url="https://github.com/Steve-Tech/YAFI/issues",
|
issue_url="https://github.com/Steve-Tech/YAFI/issues",
|
||||||
license_type=Gtk.License.GPL_2_0,
|
license_type=Gtk.License.GPL_2_0,
|
||||||
version="0.5",
|
version="0.5",
|
||||||
@@ -147,6 +146,11 @@ class YafiApplication(Adw.Application):
|
|||||||
about.add_acknowledgement_section(None, ["Framework Computer Inc. https://frame.work/"])
|
about.add_acknowledgement_section(None, ["Framework Computer Inc. https://frame.work/"])
|
||||||
about.present(self.props.active_window)
|
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):
|
def show_error(self, heading, message):
|
||||||
dialog = Adw.AlertDialog(heading=heading, body=message)
|
dialog = Adw.AlertDialog(heading=heading, body=message)
|
||||||
dialog.add_response("exit", "Exit")
|
dialog.add_response("exit", "Exit")
|
||||||
|
|||||||
@@ -18,9 +18,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
from gi.repository import Adw
|
from gi.repository import Gtk, Adw, GLib
|
||||||
from gi.repository import Gtk
|
|
||||||
from gi.repository import GLib
|
|
||||||
|
|
||||||
import cros_ec_python.commands as ec_commands
|
import cros_ec_python.commands as ec_commands
|
||||||
import cros_ec_python.exceptions as ec_exceptions
|
import cros_ec_python.exceptions as ec_exceptions
|
||||||
|
|||||||
@@ -18,8 +18,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
from gi.repository import Adw
|
from gi.repository import Gtk, Adw
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
@Gtk.Template(resource_path='/au/stevetech/yafi/ui/yafi.ui')
|
@Gtk.Template(resource_path='/au/stevetech/yafi/ui/yafi.ui')
|
||||||
class YafiWindow(Adw.ApplicationWindow):
|
class YafiWindow(Adw.ApplicationWindow):
|
||||||
|
|||||||
Reference in New Issue
Block a user