Skip to content

Commit

Permalink
Merge pull request #354 from livMatS/24_remove_gbulb
Browse files Browse the repository at this point in the history
24 remove gbulb
  • Loading branch information
jotelha authored Nov 4, 2024
2 parents 336ec00 + 3086a21 commit 5f7f30f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 175 deletions.
15 changes: 9 additions & 6 deletions dtool_lookup_gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@
gi.require_version('Gtk', '3.0')
gi.require_version('GtkSource', '4')
from gi.repository import GLib, GObject, Gio, Gtk, GtkSource, GdkPixbuf
from gi.events import GLibEventLoopPolicy

import gbulb
gbulb.install(gtk=True)
asyncio.set_event_loop_policy(GLibEventLoopPolicy())

from .models.settings import settings


from .views.main_window import MainWindow
from .views.login_window import LoginWindow

Expand Down Expand Up @@ -88,6 +87,10 @@ def __init__(self, *args, loop=None, **kwargs):
self.loop = loop
self.args = None

def on_window_delete(self, window, event):
self.quit()
return False

def do_activate(self):
logger.debug("do_activate")

Expand All @@ -114,7 +117,7 @@ def do_activate(self):
logger.debug("{}", icon_file_list)
else:
logger.warning("Could not load app icons.")
win.connect('destroy', lambda _: self.loop.stop())
win.connect("delete-event", self.on_window_delete)
self.loop.call_soon(win.refresh) # Populate widgets after event loop starts

logger.debug("Present main window.")
Expand Down Expand Up @@ -344,7 +347,7 @@ def run_gui():

loop = asyncio.get_event_loop()
app = Application(loop=loop)

logger.debug("do_startup")
# see https://github.com/beeware/gbulb#gapplicationgtkapplication-event-loop
loop.run_forever(application=app, argv=sys.argv)
app.run(sys.argv)

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ dependencies = [
'dtool-info>=0.16.2',
'dtool-lookup-api>=0.9.1',
'aiohttp>=3.6',
'gbulb>=0.6',
'pyyaml>=5.3',
'ruamel.yaml',
'PyGObject>=3.36',
'PyGObject>=3.50',
'scipy>=1.5',
'numpy',
'jwt',
Expand Down
2 changes: 0 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ dtool-lookup-api
dtool-s3
dtool-smb
aiohttp
gbulb
pyyaml
ruamel.yaml
PyGObject
numpy>=1.26.0
scipy>=1.11
jwt
yamllint
markupsafe==2.0.1
161 changes: 0 additions & 161 deletions requirements.txt

This file was deleted.

8 changes: 4 additions & 4 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
gi.require_version('Gtk', '3.0')
gi.require_version('GtkSource', '4')
from gi.repository import GLib, GObject, Gio, Gtk, GtkSource, GdkPixbuf
from gi.events import GLibEventLoopPolicy

import gbulb
gbulb.install(gtk=True)
asyncio.set_event_loop_policy(GlibEventLoopPolicy())

from dtool_lookup_gui.main import Application

Expand Down Expand Up @@ -139,15 +139,15 @@ def check_loop_failures(loop): # pragma: no cover

@pytest.fixture(scope="function")
def glib_policy():
from gbulb.glib_events import GLibEventLoopPolicy
from gi.events import GLibEventLoopPolicy

logger.debug("Apply GLibEventLoopPolicy")
return GLibEventLoopPolicy()


@pytest.fixture(scope="function")
def gtk_policy():
from gbulb.gtk import GtkEventLoopPolicy
from gi.events import GtkEventLoopPolicy
logger.debug("Apply GtkEventLoopPolicy")
return GtkEventLoopPolicy()

Expand Down

0 comments on commit 5f7f30f

Please sign in to comment.