Commit 1886f641 authored by Alexandru Băluț's avatar Alexandru Băluț

medialibrary: Use a standard close button for the errors infobar

Differential Revision: https://phabricator.freedesktop.org/D756
parent a21c92d5
......@@ -149,6 +149,7 @@
<property name="app_paintable">True</property>
<property name="can_focus">False</property>
<property name="message_type">warning</property>
<property name="show_close_button">True</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="infobar-action_area3">
<property name="can_focus">False</property>
......@@ -160,7 +161,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="_viewErrorsButtonClickedCb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
......@@ -168,21 +168,6 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="warnings_dismiss_button">
<property name="label"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Close this message</property>
<signal name="clicked" handler="_warningInfoBarDismissedCb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -191,8 +176,7 @@
</packing>
</child>
<action-widgets>
<action-widget response="0">view_error_button</action-widget>
<action-widget response="0">warnings_dismiss_button</action-widget>
<action-widget response="-5">view_error_button</action-widget>
</action-widgets>
<child internal-child="content_area">
<object class="GtkBox" id="infobar-content_area3">
......@@ -219,10 +203,6 @@
<property name="position">0</property>
</packing>
</child>
<action-widgets>
<action-widget response="0">view_error_button</action-widget>
<action-widget response="0">warnings_dismiss_button</action-widget>
</action-widgets>
</object>
<object class="GtkInfoBar" id="welcome_infobar">
<property name="visible">True</property>
......
......@@ -271,6 +271,7 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
self._project_settings_set_infobar.connect("response", self.__projectSettingsSetInfobarCb)
self._import_warning_infobar = builder.get_object("warning_infobar")
self._import_warning_infobar.hide()
self._import_warning_infobar.connect("response", self.__warningInfobarCb)
self._warning_label = builder.get_object("warning_label")
self._view_error_button = builder.get_object("view_error_button")
toolbar = builder.get_object("medialibrary_toolbar")
......@@ -1108,14 +1109,17 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
dialog.dialog.set_transient_for(self.app.gui)
dialog.run()
def _warningInfoBarDismissedCb(self, unused_button):
def __warningInfobarCb(self, infobar, response_id):
if response_id == Gtk.ResponseType.OK:
self.__showErrors()
self._resetErrorList()
infobar.hide()
def _resetErrorList(self):
self._errors = []
self._import_warning_infobar.hide()
def _viewErrorsButtonClickedCb(self, unused_button):
def __showErrors(self):
"""
Show a FileListErrorDialog to display import _errors.
"""
......@@ -1133,8 +1137,6 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
error_dialogbox.addFailedFile(uri, reason, extra)
error_dialogbox.window.set_transient_for(self.app.gui)
error_dialogbox.window.show()
# Reset the error list, since the user has read them.
self._resetErrorList()
def _toggleViewTypeCb(self, widget):
if widget.get_active():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment