Set parent window for ProfileWindow. See #7184.

This commit is contained in:
Denis Fomin 2012-07-05 23:53:51 +04:00
parent 5872658167
commit f92b8e46d4
3 changed files with 10 additions and 3 deletions

View file

@ -4,6 +4,7 @@
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkWindow" id="profile_window">
<property name="title" translatable="yes">Personal Information</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
<signal name="destroy" handler="on_profile_window_destroy"/>
<signal name="key_press_event" handler="on_profile_window_key_press_event"/>

View file

@ -45,6 +45,7 @@ import cell_renderer_image
import message_control
import chat_control
import dataforms_widget
import profile_window
try:
import gtkspell
@ -2454,7 +2455,11 @@ class AccountsWindow:
_("Your server can't save your personal information."))
return
gajim.interface.edit_own_details(self.current_account)
jid = gajim.get_jid_from_account(self.current_account)
if 'profile' not in gajim.interface.instances[self.current_account]:
gajim.interface.instances[self.current_account]['profile'] = \
profile_window.ProfileWindow(self.current_account, self.window)
gajim.connections[self.current_account].request_vcard(jid)
def on_checkbutton_toggled(self, widget, config_name,
change_sensitivity_widgets = None, account = None):

View file

@ -42,10 +42,11 @@ class ProfileWindow:
Class for our information window
"""
def __init__(self, account):
def __init__(self, account, transient_for=None):
self.xml = gtkgui_helpers.get_gtk_builder('profile_window.ui')
self.window = self.xml.get_object('profile_window')
self.window.set_transient_for(gajim.interface.roster.window)
if not transient_for:
self.window.set_transient_for(gajim.interface.roster.window)
self.progressbar = self.xml.get_object('progressbar')
self.statusbar = self.xml.get_object('statusbar')
self.context_id = self.statusbar.get_context_id('profile')