mirror of
https://github.com/aclist/dztui.git
synced 2026-08-28 10:47:15 +02:00
chore: clear typehinting errors
This commit is contained in:
parent
0c0f280d15
commit
4b9687a84d
@ -37,6 +37,7 @@ from gi.repository import Gtk, Gdk, GLib, GObject # noqa E402
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
from dzgui.api.servers import Record
|
||||
from dzgui.const.enum import ServerTab
|
||||
from dzgui.managers.connection import Prerequisites
|
||||
@ -290,7 +291,7 @@ class Controller(GObject.GObject):
|
||||
dialog = ExceptionDialog(self, str(e))
|
||||
dialog.run()
|
||||
|
||||
def set_custom_folder(self) -> None:
|
||||
def set_custom_folder(self) -> "Path" | None:
|
||||
picker = FolderPicker(self.mediator.window)
|
||||
return picker.pick_folder()
|
||||
|
||||
@ -540,6 +541,6 @@ class Controller(GObject.GObject):
|
||||
return True
|
||||
return False
|
||||
|
||||
def open_offline(self, mods) -> None:
|
||||
def open_offline(self, mods: Gtk.TreeModel | None) -> None:
|
||||
self.open_page(NotebookPage.OFFLINE)
|
||||
self.mediator.offline_loader.populate(mods)
|
||||
|
||||
@ -265,9 +265,9 @@ class ConnectionManager:
|
||||
playername = self.controller.query_config(Preferences.NAME)
|
||||
client = self.controller.query_config(Preferences.CLIENT)
|
||||
if menu_only:
|
||||
rc = load_to_menu(client, addr, self.appid, playername, self.remote_mod_ids)
|
||||
rc = load_to_menu(client, self.appid, playername, self.remote_mod_ids)
|
||||
else:
|
||||
rc = connect(client, self.appid, playername, self.remote_mod_ids)
|
||||
rc = connect(client, addr, self.appid, playername, self.remote_mod_ids)
|
||||
if rc != 0:
|
||||
# TODO: log/pop the error
|
||||
func = StoredFunc(self.controller.update_status)
|
||||
|
||||
@ -120,12 +120,12 @@ class OfflineLoader(Gtk.Box):
|
||||
if event.keyval == Gdk.KEY_Escape:
|
||||
self.back.emit("clicked")
|
||||
|
||||
def _on_selection_changed(self, sel) -> None:
|
||||
def _on_selection_changed(self, sel: Gtk.TreeSelection) -> None:
|
||||
model, rows = sel.get_selected_rows()
|
||||
# TODO: update sub-statusbar with selected mods
|
||||
print(len(rows))
|
||||
|
||||
def populate(self, mods: Gtk.TreeModel) -> None:
|
||||
def populate(self, mods: Gtk.TreeModel | None) -> None:
|
||||
self.local_mods.set_model(mods)
|
||||
# TODO: push existing model
|
||||
# TODO: set sensitivity of radio buttons
|
||||
|
||||
Loading…
Reference in New Issue
Block a user