Updated Launcher, made ShellFM Settings more generic

This commit is contained in:
2023-02-21 13:16:53 -06:00
parent 3ad9e1c7bb
commit f5dd0e9ff0
8 changed files with 122 additions and 58 deletions

View File

@@ -35,11 +35,36 @@ def daemon_threaded(fn):
class GrepSearchMixin:
def _run_grep_query(self, widget=None, eve=None):
self._handle_grep_query(query=widget)
self._queue_grep = True
if not self._grep_watcher_running:
self._grep_watcher_running = True
self._stop_grep_query()
self.reset_grep_box()
self.run_grep_watcher(query=widget)
# TODO: Merge this logic with nearly the exact same thing in file_search_mixin
@daemon_threaded
def _handle_grep_query(self, widget=None, eve=None, query=None):
def run_grep_watcher(self, query):
while True:
if self._queue_grep:
self._queue_grep = False
time.sleep(1)
# NOTE: Hold call to translate if we're still typing/updating...
if self._queue_grep:
continue
# NOTE: If query create new process and do all new loop.
if query:
self.pause_fifo_update = False
GLib.idle_add(self._exec_grep_query, query)
self._grep_watcher_running = False
break
def _stop_grep_query(self, widget=None, eve=None):
# NOTE: Freeze IPC consumption
self.pause_fifo_update = True
self.grep_query = ""
@@ -55,13 +80,6 @@ class GrepSearchMixin:
self._grep_proc = None
# NOTE: Clear children from ui and make sure ui thread redraws
GLib.idle_add(self.reset_grep_box)
# NOTE: If query create new process and do all new loop.
if query:
self.pause_fifo_update = False
GLib.idle_add(self._exec_grep_query, query)
def _exec_grep_query(self, widget=None, eve=None):
query = widget.get_text()