Fix layout in manage sounds window and add transient
This commit is contained in:
		
							parent
							
								
									6891cc49f4
								
							
						
					
					
						commit
						9c29b32384
					
				
					 3 changed files with 16 additions and 13 deletions
				
			
		| 
						 | 
					@ -4,9 +4,9 @@
 | 
				
			||||||
  <requires lib="gtk+" version="3.12"/>
 | 
					  <requires lib="gtk+" version="3.12"/>
 | 
				
			||||||
  <object class="GtkWindow" id="manage_sounds_window">
 | 
					  <object class="GtkWindow" id="manage_sounds_window">
 | 
				
			||||||
    <property name="width_request">400</property>
 | 
					    <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="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="title" translatable="yes">Manage sounds</property>
 | 
				
			||||||
    <property name="window_position">center-on-parent</property>
 | 
					    <property name="window_position">center-on-parent</property>
 | 
				
			||||||
    <property name="type_hint">dialog</property>
 | 
					    <property name="type_hint">dialog</property>
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@
 | 
				
			||||||
            </child>
 | 
					            </child>
 | 
				
			||||||
          </object>
 | 
					          </object>
 | 
				
			||||||
          <packing>
 | 
					          <packing>
 | 
				
			||||||
            <property name="expand">False</property>
 | 
					            <property name="expand">True</property>
 | 
				
			||||||
            <property name="fill">True</property>
 | 
					            <property name="fill">True</property>
 | 
				
			||||||
            <property name="position">0</property>
 | 
					            <property name="position">0</property>
 | 
				
			||||||
          </packing>
 | 
					          </packing>
 | 
				
			||||||
| 
						 | 
					@ -123,6 +123,7 @@
 | 
				
			||||||
          <packing>
 | 
					          <packing>
 | 
				
			||||||
            <property name="expand">False</property>
 | 
					            <property name="expand">False</property>
 | 
				
			||||||
            <property name="fill">True</property>
 | 
					            <property name="fill">True</property>
 | 
				
			||||||
 | 
					            <property name="pack_type">end</property>
 | 
				
			||||||
            <property name="position">2</property>
 | 
					            <property name="position">2</property>
 | 
				
			||||||
          </packing>
 | 
					          </packing>
 | 
				
			||||||
        </child>
 | 
					        </child>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4341,7 +4341,7 @@ class ManageSoundsWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        path_to_snd_file = model[iter_][2]
 | 
					        path_to_snd_file = model[iter_][2]
 | 
				
			||||||
        self.dialog = dialogs.SoundChooserDialog(path_to_snd_file, on_ok,
 | 
					        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):
 | 
					    def on_sounds_entry_changed(self, widget):
 | 
				
			||||||
        path_to_snd_file = widget.get_text()
 | 
					        path_to_snd_file = widget.get_text()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4740,7 +4740,7 @@ class ClientCertChooserDialog(FileChooserDialog):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SoundChooserDialog(FileChooserDialog):
 | 
					class SoundChooserDialog(FileChooserDialog):
 | 
				
			||||||
    def __init__(self, path_to_snd_file='', on_response_ok=None,
 | 
					    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
 | 
					        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):
 | 
					            if os.path.exists(path_to_snd_file):
 | 
				
			||||||
                callback(widget, path_to_snd_file)
 | 
					                callback(widget, path_to_snd_file)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        FileChooserDialog.__init__(self, title_text = _('Choose Sound'),
 | 
					        FileChooserDialog.__init__(
 | 
				
			||||||
           action = Gtk.FileChooserAction.OPEN,
 | 
					            self, title_text=_('Choose Sound'),
 | 
				
			||||||
           buttons = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
 | 
					            action=Gtk.FileChooserAction.OPEN,
 | 
				
			||||||
                                  Gtk.STOCK_OPEN, Gtk.ResponseType.OK),
 | 
					            buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
 | 
				
			||||||
           default_response = Gtk.ResponseType.OK,
 | 
					                     Gtk.STOCK_OPEN, Gtk.ResponseType.OK),
 | 
				
			||||||
           current_folder = gajim.config.get('last_sounds_dir'),
 | 
					            default_response=Gtk.ResponseType.OK,
 | 
				
			||||||
           on_response_ok = (on_ok, on_response_ok),
 | 
					            current_folder=gajim.config.get('last_sounds_dir'),
 | 
				
			||||||
           on_response_cancel = on_response_cancel)
 | 
					            on_response_ok=(on_ok, on_response_ok),
 | 
				
			||||||
 | 
					            on_response_cancel=on_response_cancel,
 | 
				
			||||||
 | 
					            transient_for=transient_for)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        filter_ = Gtk.FileFilter()
 | 
					        filter_ = Gtk.FileFilter()
 | 
				
			||||||
        filter_.set_name(_('All files'))
 | 
					        filter_.set_name(_('All files'))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue