Changed export/import buttons for a secundary menu button
This commit is contained in:
parent
a180f7a46c
commit
3a5dc568c5
@ -87,8 +87,6 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
|
||||
chat_list_box = Gtk.Template.Child()
|
||||
add_chat_button = Gtk.Template.Child()
|
||||
export_chat_button = Gtk.Template.Child()
|
||||
import_chat_button = Gtk.Template.Child()
|
||||
|
||||
loading_spinner = None
|
||||
|
||||
@ -542,7 +540,7 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
self.chats["chats"][self.chats["selected_chat"]]["messages"][-1]['content'] += data['message']['content']
|
||||
|
||||
def toggle_ui_sensitive(self, status):
|
||||
for element in [self.chat_list_box, self.export_chat_button, self.import_chat_button, self.add_chat_button]:
|
||||
for element in [self.chat_list_box, self.add_chat_button]:
|
||||
element.set_sensitive(status)
|
||||
|
||||
def switch_send_stop_button(self):
|
||||
@ -882,11 +880,10 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
self.get_application().create_action('new_chat', lambda *_: self.new_chat(), ['<primary>n'])
|
||||
self.get_application().create_action('clear', lambda *_: dialogs.clear_chat(self), ['<primary>e'])
|
||||
self.get_application().create_action('send', lambda *_: self.send_message(self), ['Return'])
|
||||
self.get_application().create_action('export_current_chat', lambda *_: self.export_current_chat())
|
||||
self.get_application().create_action('import_chat', lambda *_: self.import_chat())
|
||||
self.add_chat_button.connect("clicked", lambda button : self.new_chat())
|
||||
|
||||
self.export_chat_button.connect("clicked", lambda button : self.export_current_chat())
|
||||
self.import_chat_button.connect("clicked", lambda button : self.import_chat())
|
||||
|
||||
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.background_switch.connect("notify", lambda pspec, user_data : self.switch_run_on_background())
|
||||
|
@ -44,21 +44,11 @@
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkButton" id="import_chat_button">
|
||||
<property name="tooltip-text" translatable="yes">Import chat</property>
|
||||
<property name="icon-name">document-open-symbolic</property>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkButton" id="export_chat_button">
|
||||
<property name="tooltip-text" translatable="yes">Export chat</property>
|
||||
<property name="icon-name">folder-download-symbolic</property>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
<object class="GtkMenuButton" id="chats_menu_button">
|
||||
<property name="direction">1</property>
|
||||
<property name="halign">3</property>
|
||||
<property name="menu-model">chats_button_menu</property>
|
||||
<property name="icon-name">view-more-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@ -113,7 +103,7 @@
|
||||
<property name="tooltip-text" translatable="yes">Manage models</property>
|
||||
<child>
|
||||
<object class="AdwButtonContent">
|
||||
<property name="icon-name">package-x-generic-symbolic</property>
|
||||
<property name="icon-name">view-more-horizontal-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@ -632,10 +622,15 @@
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="chat_context_menu">
|
||||
<menu id="chats_button_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Remove</attribute>
|
||||
<attribute name="label" translatable="yes">Export current chat</attribute>
|
||||
<attribute name="action">app.export_current_chat</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Import chat</attribute>
|
||||
<attribute name="action">app.import_chat</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
Loading…
x
Reference in New Issue
Block a user