bug 8128; fix progress meters for transient parent
This commit is contained in:
parent
813361179f
commit
f46350d595
@ -152,6 +152,12 @@ class ProgressMeter:
|
||||
self.__dialog.vbox.set_spacing(10)
|
||||
self.__dialog.vbox.set_border_width(24)
|
||||
self.__dialog.set_size_request(400, 125)
|
||||
if not parent: # if we don't have an explicit parent, try to find one
|
||||
for win in Gtk.Window.list_toplevels():
|
||||
if win.is_active():
|
||||
parent = win
|
||||
break
|
||||
# if we still don't have a parent, give up
|
||||
if parent:
|
||||
self.__dialog.set_transient_for(parent)
|
||||
self.__dialog.set_modal(True)
|
||||
|
@ -494,13 +494,17 @@ class GtkProgressDialog(Gtk.Dialog):
|
||||
:type title: string
|
||||
"""
|
||||
Gtk.Dialog.__init__(self)
|
||||
parent = None
|
||||
if len(window_params) >= 2:
|
||||
self.set_transient_for(window_params[1])
|
||||
else:
|
||||
parent = window_params[1] # we got an explicit parent
|
||||
else: # try to find an active window
|
||||
for win in Gtk.Window.list_toplevels():
|
||||
if win.is_active():
|
||||
self.set_transient_for(win)
|
||||
parent = win
|
||||
break
|
||||
# if we still don't have a parent, give up
|
||||
if parent:
|
||||
self.set_transient_for(parent)
|
||||
if len(window_params) >= 3:
|
||||
flags = window_params[2]
|
||||
if Gtk.DialogFlags.MODAL & flags:
|
||||
|
Loading…
Reference in New Issue
Block a user