Reenable and update code for inline message image display.

Use a GtkInfoBar to display to the user the message and related buttons
instead of the message-inline HTML approach. Still needs some additional
work to save per-message loading and displaying images from same sender
in convo when "Always Show" is chosen.

* src/client/conversation-viewer/conversation-message.vala: Reenable
  remote image related code, remove HTML-based UI management code.

* src/client/components/main-window.vala (MainWindow::set_styling):
  Add some theme CSS to style the remote images infobar.

* ui/conversation-message.ui: Add the remote images infobar.
This commit is contained in:
Michael James Gratton 2016-04-13 00:08:14 +10:00
parent a6acfe97d4
commit 22e67655ac
3 changed files with 198 additions and 109 deletions

View file

@ -412,6 +412,105 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkInfoBar" id="remote_images_infobar">
<property name="app_paintable">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="message_type">warning</property>
<property name="show_close_button">True</property>
<signal name="response" handler="on_remote_images_response" swapped="no"/>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">Show Images</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label" translatable="yes">Always Show From Sender</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="non_homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child internal-child="content_area">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Remote images not shown</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Only show remote images from senders you trust.</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<action-widgets>
<action-widget response="1">button1</action-widget>
<action-widget response="2">button2</action-widget>
</action-widgets>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>