Fix layout in manage sounds window and add transient

This commit is contained in:
lovetox 2016-10-05 11:30:18 +02:00
parent 6891cc49f4
commit 9c29b32384
3 changed files with 16 additions and 13 deletions

View File

@ -4,9 +4,9 @@
<requires lib="gtk+" version="3.12"/>
<object class="GtkWindow" id="manage_sounds_window">
<property name="width_request">400</property>
<property name="height_request">350</property>
<property name="height_request">370</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">12</property>
<property name="title" translatable="yes">Manage sounds</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
@ -34,7 +34,7 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
@ -123,6 +123,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>

View File

@ -4341,7 +4341,7 @@ class ManageSoundsWindow:
path_to_snd_file = model[iter_][2]
self.dialog = dialogs.SoundChooserDialog(path_to_snd_file, on_ok,
on_cancel)
on_cancel, transient_for=self.window)
def on_sounds_entry_changed(self, widget):
path_to_snd_file = widget.get_text()

View File

@ -4740,7 +4740,7 @@ class ClientCertChooserDialog(FileChooserDialog):
class SoundChooserDialog(FileChooserDialog):
def __init__(self, path_to_snd_file='', on_response_ok=None,
on_response_cancel=None):
on_response_cancel=None, transient_for=None):
"""
Optionally accepts path_to_snd_file so it has that as selected
"""
@ -4752,14 +4752,16 @@ class SoundChooserDialog(FileChooserDialog):
if os.path.exists(path_to_snd_file):
callback(widget, path_to_snd_file)
FileChooserDialog.__init__(self, title_text = _('Choose Sound'),
action = Gtk.FileChooserAction.OPEN,
buttons = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OPEN, Gtk.ResponseType.OK),
default_response = Gtk.ResponseType.OK,
current_folder = gajim.config.get('last_sounds_dir'),
on_response_ok = (on_ok, on_response_ok),
on_response_cancel = on_response_cancel)
FileChooserDialog.__init__(
self, title_text=_('Choose Sound'),
action=Gtk.FileChooserAction.OPEN,
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OPEN, Gtk.ResponseType.OK),
default_response=Gtk.ResponseType.OK,
current_folder=gajim.config.get('last_sounds_dir'),
on_response_ok=(on_ok, on_response_ok),
on_response_cancel=on_response_cancel,
transient_for=transient_for)
filter_ = Gtk.FileFilter()
filter_.set_name(_('All files'))