User can now leave chat name empty when creating a new one, it will at a placeholder text

This commit is contained in:
jeffser
2024-05-19 21:13:30 -06:00
parent 47faa4581e
commit f333f50016
5 changed files with 613 additions and 34 deletions

View File

@@ -754,7 +754,14 @@ class AlpacaWindow(Adw.ApplicationWindow):
def chat_new(self, dialog=None, task=None, entry=None):
if not entry: return
chat_name = entry.get_text()
if chat_name and (not task or dialog.choose_finish(task) == "create"):
if not chat_name:
chat_name=_("New Chat")
if chat_name in self.chats["chats"]:
for i in range(len(list(self.chats["chats"].keys()))):
if chat_name + f" {i+1}" not in self.chats["chats"]:
chat_name += f" {i+1}"
break
if not task or dialog.choose_finish(task) == "create":
dialog.force_close()
if chat_name in self.chats["chats"]: self.chat_new_dialog(_("The name '{}' is already in use").format(chat_name), True)
else:

View File

@@ -256,7 +256,7 @@
<object class="AdwHeaderBar">
<property name="title-widget">
<object class="AdwWindowTitle">
<property name="title">Manage models</property>
<property name="title" translatable="yes">Manage models</property>
</object>
</property>
</object>