Partial revert of event sys calls

This commit is contained in:
itdominator 2024-09-08 21:53:23 -05:00
parent 08a3623c9b
commit 2cdb7e7321
3 changed files with 18 additions and 13 deletions

View File

@ -40,10 +40,16 @@ class TopButtonBox(Gtk.ButtonBox):
self.folder_choser_lbl = Gtk.Label(label = "Workspace Folder: ")
self.workspace_choser_btn = WorkspaceFolderChoserButton()
self.add(self.message_id_lbl)
box.add(self.folder_choser_lbl)
box.add(self.workspace_choser_btn)
self.add(self.message_id_lbl)
self.add(box)
def update_message_id_lbl(self, id: int):
self.message_id_lbl.set_label(f"Message ID: {id}")
def get_workspace_path(self):
return self.workspace_choser_btn.get_workspace_path()
def get_workspace_uri(self):
return self.workspace_choser_btn.get_workspace_uri()

View File

@ -42,7 +42,6 @@ class LogList(Gtk.ListBox):
def scroll_down(self, widget):
GLib.idle_add(self.scroll_down)
self.connect("row-activated", tggl_row_view)
self.connect("size-allocate", scroll_down)

View File

@ -53,7 +53,7 @@ class LSPMessageBox(Gtk.Box):
ctx = self.get_style_context()
ctx.add_class("lsp-message-box")
self.set_orientation(Gtk.Orientation.VERTICAL)
self.set_orientation( Gtk.Orientation.VERTICAL )
self.set_hexpand(True)
self.set_vexpand(True)
@ -66,24 +66,24 @@ class LSPMessageBox(Gtk.Box):
def _load_widgets(self):
scrolled_win = Gtk.ScrolledWindow()
self.lsp_msg_src_vw = LspMessageSourceView()
top_buttons = TopButtonBox()
self.top_buttons = TopButtonBox()
bottom_buttons = BottomButtonBox()
scrolled_win.show_all()
scrolled_win.add(self.lsp_msg_src_vw)
self.add(top_buttons)
self.add(self.top_buttons)
self.add(scrolled_win)
self.add(bottom_buttons)
def update_message_id_label(self):
event_system.emit("update-message-id-lbl", (self._message_id,))
self.top_buttons.update_message_id_lbl(self._message_id)
def send_initialize_message(self):
parent = self.get_parent()
init_ops = parent.init_ops_src_vw.get_text_str()
workspace_file = event_system.emit_and_await("get-workspace-path")
workspace_uri = event_system.emit_and_await("get-workspace-uri")
workspace_file = self.top_buttons.get_workspace_path()
workspace_uri = self.top_buttons.get_workspace_uri()
folder_name = os.path.basename(workspace_file)
self._lsp_init_ops["processId"] = settings_manager.get_app_pid()