Re-enable attachments context menu.
Since we're using the Icon View, we have some more options in terms of user selction and the actions applicable to that. So make the attachment signals and their handlers all apply to collections of attachments and use the GAppInfo class for determining which app to open an attachment with. * src/client/application/geary-controller.vala: Chase signal changes. (GearyController::on_attachments_activated): Handle multiple attachments being activated at once. Use its GAppInfo for launching each attachment, prompt the user with an GtkAppChooserDialog if the info is unknown. * src/client/conversation-viewer/conversation-email.vala Use the new AttachmentInfo class to manage lists of all displayed and currently selected attachments and their associated GAppInfo objects. Add actions for attachment context menu items. Move attachment signals from ConversationViewer here, make all attachment signals have a collection of them as their param. Hook up appropriate GtkIconView callbacks to manage selection, activation, etc. Construct AttachmentInfo instances when loading attachments and use them in the icon view's model. * ui/conversation-email.ui: Define needed callbacks for the icon view. Update its model to accept a GObject for the attachment info class. * ui/conversation-message-menu.ui: Fix action name for save attachments menu item.
This commit is contained in:
parent
19456bd58e
commit
be31b33731
5 changed files with 176 additions and 81 deletions
|
|
@ -112,8 +112,8 @@
|
|||
<column type="GdkPixbuf"/>
|
||||
<!-- column-name label -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name attachment_id -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name attachment_info -->
|
||||
<column type="GObject"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkBox" id="attachments_box">
|
||||
|
|
@ -140,7 +140,9 @@
|
|||
<property name="item_orientation">horizontal</property>
|
||||
<property name="model">attachments_model</property>
|
||||
<property name="spacing">6</property>
|
||||
<signal name="button-press-event" handler="on_attachments_view_button_press_event" swapped="no"/>
|
||||
<signal name="item-activated" handler="on_attachments_view_activated" swapped="no"/>
|
||||
<signal name="selection-changed" handler="on_attachments_view_selection_changed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="icon"/>
|
||||
<attributes>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Save Attachments</attribute>
|
||||
<attribute name="action">msg.selected</attribute>
|
||||
<attribute name="action">msg.save_all_attachments</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
|
|
@ -47,4 +47,22 @@
|
|||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="attachments_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Open</attribute>
|
||||
<attribute name="action">msg.open_attachments</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Save</attribute>
|
||||
<attribute name="action">msg.save_attachments</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Save All</attribute>
|
||||
<attribute name="action">msg.save_all_attachments</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
</interface>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue