vm-manager: add empty list screen

This commit is contained in:
Johannes Kirschbauer
2024-04-23 16:17:09 +02:00
parent 5f5155023c
commit 1da6a0c5a2
4 changed files with 7 additions and 6 deletions

View File

@@ -4,5 +4,5 @@ from typing import Union
loc: Path = Path(__file__).parent loc: Path = Path(__file__).parent
def get_asset(name: Union[str, Path]) -> Path: def get_asset(name: str | Path) -> Path:
return loc / name return loc / name

View File

@@ -1,6 +1,6 @@
import logging import logging
from collections.abc import Callable from collections.abc import Callable
from typing import Any, Generic, TypeVar, ClassVar from typing import Any, ClassVar, Generic, TypeVar
import gi import gi

View File

@@ -1,12 +1,13 @@
import logging import logging
from typing import Callable, Optional, TypeVar from collections.abc import Callable
from typing import TypeVar
import gi import gi
from clan_vm_manager import assets from clan_vm_manager import assets
gi.require_version("Adw", "1") gi.require_version("Adw", "1")
from gi.repository import Adw, Gio, GObject, Gtk, GdkPixbuf from gi.repository import Adw, GdkPixbuf, Gio, GObject, Gtk
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@@ -53,7 +54,7 @@ class EmptySplash(Gtk.Box):
self.append(clamp) self.append(clamp)
def load_image(self, file_path: str) -> Optional[GdkPixbuf.Pixbuf]: def load_image(self, file_path: str) -> GdkPixbuf.Pixbuf | None:
try: try:
pixbuf = GdkPixbuf.Pixbuf.new_from_file(file_path) pixbuf = GdkPixbuf.Pixbuf.new_from_file(file_path)
return pixbuf return pixbuf

View File

@@ -1,6 +1,6 @@
import logging import logging
import threading import threading
from typing import Callable from collections.abc import Callable
import gi import gi
from clan_cli.history.list import list_history from clan_cli.history.list import list_history