context improvements
This commit is contained in:
20
gui.py
20
gui.py
@@ -467,6 +467,8 @@ class App:
|
||||
dpg.set_value("project_git_dir", proj.get("project", {}).get("git_dir", ""))
|
||||
if dpg.does_item_exist("project_system_prompt"):
|
||||
dpg.set_value("project_system_prompt", proj.get("project", {}).get("system_prompt", ""))
|
||||
if dpg.does_item_exist("project_main_context"):
|
||||
dpg.set_value("project_main_context", proj.get("project", {}).get("main_context", ""))
|
||||
|
||||
def _save_active_project(self):
|
||||
"""Write self.project to the active project .toml file."""
|
||||
@@ -692,6 +694,8 @@ class App:
|
||||
proj["project"]["git_dir"] = dpg.get_value("project_git_dir")
|
||||
if dpg.does_item_exist("project_system_prompt"):
|
||||
proj["project"]["system_prompt"] = dpg.get_value("project_system_prompt")
|
||||
if dpg.does_item_exist("project_main_context"):
|
||||
proj["project"]["main_context"] = dpg.get_value("project_main_context")
|
||||
|
||||
# Discussion
|
||||
self._flush_disc_entries_to_project()
|
||||
@@ -1064,6 +1068,13 @@ class App:
|
||||
if d and dpg.does_item_exist("project_git_dir"):
|
||||
dpg.set_value("project_git_dir", d)
|
||||
|
||||
def cb_browse_main_context(self):
|
||||
root = hide_tk_root()
|
||||
p = filedialog.askopenfilename(title="Select Main Context File")
|
||||
root.destroy()
|
||||
if p and dpg.does_item_exist("project_main_context"):
|
||||
dpg.set_value("project_main_context", p)
|
||||
|
||||
# ---- discussion callbacks ----
|
||||
|
||||
def cb_disc_switch(self, sender, app_data):
|
||||
@@ -1390,6 +1401,15 @@ class App:
|
||||
)
|
||||
dpg.add_button(label="Browse##git", callback=self.cb_browse_git_dir)
|
||||
dpg.add_separator()
|
||||
dpg.add_text("Main Context File")
|
||||
with dpg.group(horizontal=True):
|
||||
dpg.add_input_text(
|
||||
tag="project_main_context",
|
||||
default_value=proj_meta.get("main_context", ""),
|
||||
width=-100,
|
||||
)
|
||||
dpg.add_button(label="Browse##ctx", callback=self.cb_browse_main_context)
|
||||
dpg.add_separator()
|
||||
dpg.add_text("Project Files")
|
||||
with dpg.child_window(tag="projects_scroll", height=-40, border=True):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user