Fixed event system logic
This commit is contained in:
parent
a78c7e2261
commit
42f2be0602
|
@ -14,7 +14,10 @@ class Builtins(IPCServerMixin):
|
||||||
"""Docstring for __builtins__ extender"""
|
"""Docstring for __builtins__ extender"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# NOTE: The format used is list of [type, target, data]
|
# NOTE: The format used is list of [type, target, data] Where:
|
||||||
|
# type is useful context for control flow,
|
||||||
|
# target is the method to call,
|
||||||
|
# data is the method parameters to give
|
||||||
# Where data may be any kind of data
|
# Where data may be any kind of data
|
||||||
self._gui_events = []
|
self._gui_events = []
|
||||||
self._fm_events = []
|
self._fm_events = []
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Controller(DummyMixin, Controller_Data):
|
||||||
if event:
|
if event:
|
||||||
try:
|
try:
|
||||||
type, target, data = event
|
type, target, data = event
|
||||||
method = getattr(self.__class__, type)
|
method = getattr(self.__class__, target)
|
||||||
GLib.idle_add(method, (self, data,))
|
GLib.idle_add(method, (self, data,))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(repr(e))
|
print(repr(e))
|
||||||
|
|
|
@ -34,7 +34,7 @@ class IPCServerMixin:
|
||||||
if "FILE|" in msg:
|
if "FILE|" in msg:
|
||||||
file = msg.split("FILE|")[1].strip()
|
file = msg.split("FILE|")[1].strip()
|
||||||
if file:
|
if file:
|
||||||
event_system.push_gui_event(["create_tab_from_ipc", None, file])
|
event_system.push_gui_event([None, "create_tab_from_ipc", file])
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue