Load files from IPC to code view; fixed tabs close all; corrected app.py logging
This commit is contained in:
@@ -43,7 +43,7 @@ class Application:
|
|||||||
if ipc_server.is_ipc_alive:
|
if ipc_server.is_ipc_alive:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
logger.warning(f"{app_name} IPC Server Exists: Have sent path(s) to it and closing...")
|
logger.warning(f"{APP_NAME} IPC Server Exists: Have sent path(s) to it and closing...")
|
||||||
for arg in unknownargs + [args.new_tab,]:
|
for arg in unknownargs + [args.new_tab,]:
|
||||||
if os.path.isfile(arg):
|
if os.path.isfile(arg):
|
||||||
message = f"FILE|{arg}"
|
message = f"FILE|{arg}"
|
||||||
|
|||||||
@@ -24,9 +24,13 @@ class CodeBase:
|
|||||||
self.controller_manager: ControllerManager = ControllerManager()
|
self.controller_manager: ControllerManager = ControllerManager()
|
||||||
self.miniview_widget: MiniViewWidget = MiniViewWidget()
|
self.miniview_widget: MiniViewWidget = MiniViewWidget()
|
||||||
|
|
||||||
|
self._subscribe_to_events()
|
||||||
self._load_controllers()
|
self._load_controllers()
|
||||||
|
|
||||||
|
|
||||||
|
def _subscribe_to_events(self):
|
||||||
|
event_system.subscribe("handle-file", self._load_ipc_file)
|
||||||
|
|
||||||
def _load_controllers(self):
|
def _load_controllers(self):
|
||||||
files_controller = FilesController()
|
files_controller = FilesController()
|
||||||
tabs_controller = TabsController()
|
tabs_controller = TabsController()
|
||||||
@@ -59,3 +63,8 @@ class CodeBase:
|
|||||||
|
|
||||||
def first_map_load(self):
|
def first_map_load(self):
|
||||||
self.controller_manager["source_views"].first_map_load()
|
self.controller_manager["source_views"].first_map_load()
|
||||||
|
|
||||||
|
def _load_ipc_file(self, fpath: str):
|
||||||
|
active_view = self.controller_manager["source_views"].signal_mapper.active_view
|
||||||
|
uris = [ f"file://{fpath}" ]
|
||||||
|
active_view._on_uri_data_received(uris)
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ class TabsWidget(Gtk.Notebook):
|
|||||||
self.close_right_items(menu_item, page_widget)
|
self.close_right_items(menu_item, page_widget)
|
||||||
|
|
||||||
def close_all_items(self, menu_item, page_widget):
|
def close_all_items(self, menu_item, page_widget):
|
||||||
|
children = self.get_children()
|
||||||
|
|
||||||
for widget in children[ : ]:
|
for widget in children[ : ]:
|
||||||
tab = self.get_tab_label(widget)
|
tab = self.get_tab_label(widget)
|
||||||
tab.close_bttn.clicked()
|
tab.close_bttn.clicked()
|
||||||
|
|||||||
Reference in New Issue
Block a user