Fixed pull by name feature
This commit is contained in:
parent
476138ef53
commit
3c553e37d8
@ -271,7 +271,7 @@ def create_model_from_name_response(self, dialog, task, entry):
|
|||||||
|
|
||||||
def create_model_from_name(self):
|
def create_model_from_name(self):
|
||||||
entry = Gtk.Entry()
|
entry = Gtk.Entry()
|
||||||
entry.get_delegate().connect("insert-text", self.check_alphanumeric)
|
entry.get_delegate().connect("insert-text", lambda *_ : self.check_alphanumeric(*_, ['-', '.', ':', '_', '/']))
|
||||||
dialog = Adw.AlertDialog(
|
dialog = Adw.AlertDialog(
|
||||||
heading=_("Pull Model"),
|
heading=_("Pull Model"),
|
||||||
body=_("Input the name of the model in this format\nname:tag"),
|
body=_("Input the name of the model in this format\nname:tag"),
|
||||||
|
@ -481,8 +481,8 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
|||||||
if mode == 1:
|
if mode == 1:
|
||||||
return self.model_list_box.get_selected_row().get_name()
|
return self.model_list_box.get_selected_row().get_name()
|
||||||
|
|
||||||
def check_alphanumeric(self, editable, text, length, position):
|
def check_alphanumeric(self, editable, text, length, position, allowed_chars):
|
||||||
new_text = ''.join([char for char in text if char.isalnum() or char in ['-', '.', ':', '_']])
|
new_text = ''.join([char for char in text if char.isalnum() or char in allowed_chars])
|
||||||
if new_text != text:
|
if new_text != text:
|
||||||
editable.stop_emission_by_name("insert-text")
|
editable.stop_emission_by_name("insert-text")
|
||||||
|
|
||||||
@ -1736,7 +1736,7 @@ Generate a title following these rules:
|
|||||||
self.file_preview_remove_button.connect('clicked', lambda button : dialogs.remove_attached_file(self, button.get_name()))
|
self.file_preview_remove_button.connect('clicked', lambda button : dialogs.remove_attached_file(self, button.get_name()))
|
||||||
self.add_chat_button.connect("clicked", lambda button : self.new_chat())
|
self.add_chat_button.connect("clicked", lambda button : self.new_chat())
|
||||||
self.attachment_button.connect("clicked", lambda button, file_filter=self.file_filter_attachments: dialogs.attach_file(self, file_filter))
|
self.attachment_button.connect("clicked", lambda button, file_filter=self.file_filter_attachments: dialogs.attach_file(self, file_filter))
|
||||||
self.create_model_name.get_delegate().connect("insert-text", self.check_alphanumeric)
|
self.create_model_name.get_delegate().connect("insert-text", lambda *_ : self.check_alphanumeric(*_, ['-', '.', '_']))
|
||||||
self.remote_connection_entry.connect("entry-activated", lambda entry : entry.set_css_classes([]))
|
self.remote_connection_entry.connect("entry-activated", lambda entry : entry.set_css_classes([]))
|
||||||
self.remote_connection_switch.connect("notify", lambda pspec, user_data : self.connection_switched())
|
self.remote_connection_switch.connect("notify", lambda pspec, user_data : self.connection_switched())
|
||||||
self.background_switch.connect("notify", lambda pspec, user_data : self.switch_run_on_background())
|
self.background_switch.connect("notify", lambda pspec, user_data : self.switch_run_on_background())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user