mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
fix: add keypress signal to KeywordEntry
This commit is contained in:
1 parent
59120825dc
commit
decc1f636c
2 files changed
+9
-11
No files matched your search
+4
-11
@@ -149,10 +149,6 @@ class Controller(GObject.GObject):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.critical(f"{attr} is not a valid AppNavigation attribute.")
|
logger.critical(f"{attr} is not a valid AppNavigation attribute.")
|
||||||
|
|
||||||
# def terminate_process(self) -> None:
|
|
||||||
# # TODO: only used by server table multiprocessing queue
|
|
||||||
# self.get_active_treeview().terminate_process()
|
|
||||||
|
|
||||||
def get_prefs(self) -> UserPrefs:
|
def get_prefs(self) -> UserPrefs:
|
||||||
return self.prefs
|
return self.prefs
|
||||||
|
|
||||||
@@ -469,12 +465,10 @@ class Controller(GObject.GObject):
|
|||||||
job = Servers.query_api
|
job = Servers.query_api
|
||||||
params = Servers.params
|
params = Servers.params
|
||||||
serv = []
|
serv = []
|
||||||
# i = 0
|
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
futures = [executor.submit(job, key, APPID_DAYZ, param) for param in params]
|
futures = [executor.submit(job, key, APPID_DAYZ, param) for param in params]
|
||||||
for future in as_completed(futures):
|
for future in as_completed(futures):
|
||||||
try:
|
try:
|
||||||
# i += 1
|
|
||||||
GLib.idle_add(lambda: self.wait_dialog.increment())
|
GLib.idle_add(lambda: self.wait_dialog.increment())
|
||||||
res = future.result(timeout=3)
|
res = future.result(timeout=3)
|
||||||
if res.status != 200 or not res.parsed:
|
if res.status != 200 or not res.parsed:
|
||||||
@@ -488,7 +482,6 @@ class Controller(GObject.GObject):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# NOTE: This step is allowed to fail, since this metadata is incidental
|
# NOTE: This step is allowed to fail, since this metadata is incidental
|
||||||
print("now checking exp servers")
|
|
||||||
res = Servers.query_api(key, APPID_DAYZ_EXP, "")
|
res = Servers.query_api(key, APPID_DAYZ_EXP, "")
|
||||||
if res.status == 200 and res.parsed is True:
|
if res.status == 200 and res.parsed is True:
|
||||||
j = res.json
|
j = res.json
|
||||||
@@ -803,6 +796,8 @@ class Controller(GObject.GObject):
|
|||||||
dialog = ExceptionDialog(self, strings.api_warn_msg)
|
dialog = ExceptionDialog(self, strings.api_warn_msg)
|
||||||
dialog.run()
|
dialog.run()
|
||||||
|
|
||||||
|
# TODO: break into initial dump and refilter modes, can drop filtermode kwarg
|
||||||
|
# and stop pushing empty data
|
||||||
def push_data_success(self, data: tuple, mode: Optional[FilterMode]) -> None:
|
def push_data_success(self, data: tuple, mode: Optional[FilterMode]) -> None:
|
||||||
# FIXME: calls treeview read methods in thread
|
# FIXME: calls treeview read methods in thread
|
||||||
# treeview = self.get_active_treeview()
|
# treeview = self.get_active_treeview()
|
||||||
@@ -925,11 +920,10 @@ class Controller(GObject.GObject):
|
|||||||
def filter_threaded(
|
def filter_threaded(
|
||||||
self, filter_man: "FilteredModelManager", mode: FilterMode, label: str
|
self, filter_man: "FilteredModelManager", mode: FilterMode, label: str
|
||||||
) -> None:
|
) -> None:
|
||||||
# TODO: why pushing empty data?
|
|
||||||
filter_man.filter(mode, label)
|
filter_man.filter(mode, label)
|
||||||
self.push_data_success("", mode)
|
self.to_insert = filter_man.get_model()
|
||||||
|
self.cleanup_func = StoredFunc(self.cleanup_on_success)
|
||||||
|
|
||||||
# TODO: consolidate with method above
|
|
||||||
# TODO: call filter_man methods directly
|
# TODO: call filter_man methods directly
|
||||||
def refilter_model(self, mode: FilterMode, label: Optional[str] = None) -> None:
|
def refilter_model(self, mode: FilterMode, label: Optional[str] = None) -> None:
|
||||||
tv = self.get_active_treeview()
|
tv = self.get_active_treeview()
|
||||||
@@ -960,7 +954,6 @@ class Controller(GObject.GObject):
|
|||||||
# TODO: clear ephemeral model if necessary
|
# TODO: clear ephemeral model if necessary
|
||||||
# manager = treeview.get_filter_man()
|
# manager = treeview.get_filter_man()
|
||||||
# manager.clear_model()
|
# manager.clear_model()
|
||||||
# treeview.fancy_col.set_cell_data_func(treeview.fancy_rend, None)
|
|
||||||
|
|
||||||
self.first_iteration = True
|
self.first_iteration = True
|
||||||
self.pending_jobs = jobs
|
self.pending_jobs = jobs
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ class KeywordEntry(Gtk.Entry):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def restore_focus_to_treeview(self) -> Literal[False]:
|
||||||
|
view = self.controller.get_active_treeview()
|
||||||
|
view.grab_focus()
|
||||||
|
return False
|
||||||
|
|
||||||
def _on_activated(self, entry: Gtk.Entry) -> None:
|
def _on_activated(self, entry: Gtk.Entry) -> None:
|
||||||
# TODO: investigate this method
|
# TODO: investigate this method
|
||||||
self.controller.mediator.window.set_keep_below(False)
|
self.controller.mediator.window.set_keep_below(False)
|
||||||
|
|||||||
Reference in new issue
Block a user