Commit c33f2197 authored by Alexandru Băluț's avatar Alexandru Băluț

dialogs: Fix clip media props cannot be closed

It can actually be closed using the x button in the top-right but only
if it's clicked twice. The first click was not doing anything.

Removed some handles for the two buttons at the bottom and used the
"response" signal instead.

Differential Revision: https://phabricator.freedesktop.org/D1141
parent 2a2b6171
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.1 -->
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkDialog" id="Import Settings">
......@@ -19,13 +19,12 @@
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button1">
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="_cancelButtonCb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
......@@ -34,13 +33,12 @@
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<object class="GtkButton" id="apply_button">
<property name="label" translatable="yes">_Apply to project</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="_applyButtonCb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
......@@ -374,8 +372,11 @@
</object>
</child>
<action-widgets>
<action-widget response="0">button1</action-widget>
<action-widget response="0">button2</action-widget>
<action-widget response="2">cancel_button</action-widget>
<action-widget response="1">apply_button</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</interface>
......@@ -135,9 +135,10 @@ class ClipMediaPropsDialog(object):
self.video_header_label.set_markup("<b>" + _("Image:") + "</b>")
self.dialog.connect("key-press-event", self._keyPressCb)
self.dialog.connect("response", self.__response_cb)
self.dialog.run()
def _applyButtonCb(self, unused_button):
def _apply(self):
"""Applies the widgets values to the project."""
project = self.project
if self.has_video:
......@@ -158,10 +159,10 @@ class ClipMediaPropsDialog(object):
project.audiochannels = audio.get_channels()
if self.samplerate_checkbutton.get_active():
project.audiorate = audio.get_sample_rate()
self.dialog.destroy()
def _cancelButtonCb(self, unused_button):
"""Destroys the dialog."""
def __response_cb(self, unused_dialog, response_id):
if response_id == 1:
self._apply()
self.dialog.destroy()
def _keyPressCb(self, unused_widget, event):
......
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