SolarFM/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/signals/ipc_signals_mixin.py

30 lines
844 B
Python
Raw Normal View History

2022-01-31 00:09:00 +00:00
# Python imports
# Lib imports
# Application imports
class IPCSignalsMixin:
""" IPCSignalsMixin handle messages from another starting solarfm process. """
2022-01-31 00:09:00 +00:00
def print_to_console(self, message=None):
print(self)
print(message)
def handle_file_from_ipc(self, path):
2022-03-13 23:53:43 +00:00
wid, tid = self.fm_controller.get_active_wid_and_tid()
notebook = self.builder.get_object(f"window_{wid}")
2022-01-31 00:09:00 +00:00
if notebook.is_visible():
2022-03-13 23:53:43 +00:00
self.create_tab(wid, None, path)
2022-01-31 00:09:00 +00:00
return
if not self.is_pane4_hidden:
2022-03-13 23:53:43 +00:00
self.create_tab(4, None, path)
2022-01-31 00:09:00 +00:00
elif not self.is_pane3_hidden:
2022-03-13 23:53:43 +00:00
self.create_tab(3, None, path)
2022-01-31 00:09:00 +00:00
elif not self.is_pane2_hidden:
2022-03-13 23:53:43 +00:00
self.create_tab(2, None, path)
2022-01-31 00:09:00 +00:00
elif not self.is_pane1_hidden:
2022-03-13 23:53:43 +00:00
self.create_tab(1, None, path)