Added shortcut to import chat, moved option to primary menu and moved primary menu to sidebar
This commit is contained in:
parent
39691cc83c
commit
b8c420526c
@ -88,7 +88,6 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
message_text_view = Gtk.Template.Child()
|
||||
send_button = Gtk.Template.Child()
|
||||
stop_button = Gtk.Template.Child()
|
||||
chats_menu_button = Gtk.Template.Child()
|
||||
attachment_container = Gtk.Template.Child()
|
||||
attachment_box = Gtk.Template.Child()
|
||||
file_filter_tar = Gtk.Template.Child()
|
||||
@ -753,7 +752,7 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
self.chats["chats"][self.chats["selected_chat"]]["messages"][id]['content'] += data['message']['content']
|
||||
|
||||
def toggle_ui_sensitive(self, status):
|
||||
for element in [self.chat_list_box, self.add_chat_button, self.chats_menu_button]:
|
||||
for element in [self.chat_list_box, self.add_chat_button]:
|
||||
element.set_sensitive(status)
|
||||
|
||||
def switch_send_stop_button(self):
|
||||
@ -1229,7 +1228,7 @@ 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('import_chat', lambda *_: self.import_chat())
|
||||
self.get_application().create_action('import_chat', lambda *_: self.import_chat(), ['<primary>i'])
|
||||
self.get_application().create_action('create_model_from_existing', lambda *_: dialogs.create_model_from_existing(self))
|
||||
self.get_application().create_action('create_model_from_file', lambda *_: dialogs.create_model_from_file(self))
|
||||
self.get_application().create_action('delete_chat', self.chat_actions)
|
||||
|
@ -46,11 +46,11 @@
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="chats_menu_button">
|
||||
<property name="direction">1</property>
|
||||
<property name="halign">3</property>
|
||||
<property name="menu-model">chats_menu</property>
|
||||
<property name="icon-name">view-more-symbolic</property>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="primary">True</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Menu</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@ -114,12 +114,7 @@
|
||||
</object>
|
||||
</property>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="primary">True</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Menu</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
@ -856,6 +851,10 @@
|
||||
</template>
|
||||
<menu id="primary_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Import chat</attribute>
|
||||
<attribute name="action">app.import_chat</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Clear Chat</attribute>
|
||||
<attribute name="action">app.clear</attribute>
|
||||
@ -874,14 +873,6 @@
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="chats_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Import chat</attribute>
|
||||
<attribute name="action">app.import_chat</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="right_click_menu">
|
||||
<section>
|
||||
<item>
|
||||
@ -953,6 +944,12 @@
|
||||
<property name="title" translatable="yes">Close application</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="accelerator"><ctrl>I</property>
|
||||
<property name="title" translatable="yes">Import chat</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="accelerator"><ctrl>E</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user