2008-03-08 Douglas S. Blank <dblank@saliva.brynmawr.edu>
* src/DataViews/GrampletView.py (GrampletWindow.close): fixed issue with reattaching detached window after a col change svn: r10227
This commit is contained in:
parent
123b1d7a9a
commit
f761e01f52
@ -1,3 +1,6 @@
|
|||||||
|
2008-03-08 Douglas S. Blank <dblank@saliva.brynmawr.edu>
|
||||||
|
* src/DataViews/GrampletView.py (GrampletWindow.close):
|
||||||
|
|
||||||
2008-03-08 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
2008-03-08 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||||
* src/DataViews/GrampletView.py (GrampletWindow.close):
|
* src/DataViews/GrampletView.py (GrampletWindow.close):
|
||||||
Fixed issue exhibited on Windows with buttons becoming dead
|
Fixed issue exhibited on Windows with buttons becoming dead
|
||||||
|
@ -179,13 +179,14 @@ class GrampletWindow(ManagedWindow.ManagedWindow):
|
|||||||
self.gramplet.gvoptions.hide()
|
self.gramplet.gvoptions.hide()
|
||||||
self.gramplet.viewpage.detached_gramplets.remove(self.gramplet)
|
self.gramplet.viewpage.detached_gramplets.remove(self.gramplet)
|
||||||
self.gramplet.state = "maximized"
|
self.gramplet.state = "maximized"
|
||||||
self.gramplet.mainframe.reparent(self.gramplet.parent)
|
parent = self.gramplet.viewpage.get_column_frame(self.gramplet.column)
|
||||||
expand,fill,padding,pack = self.gramplet.parent.query_child_packing(self.gramplet.mainframe)
|
self.gramplet.mainframe.reparent(parent)
|
||||||
self.gramplet.parent.set_child_packing(self.gramplet.mainframe,
|
expand,fill,padding,pack = parent.query_child_packing(self.gramplet.mainframe)
|
||||||
self.gramplet.expand,
|
parent.set_child_packing(self.gramplet.mainframe,
|
||||||
fill,
|
self.gramplet.expand,
|
||||||
padding,
|
fill,
|
||||||
pack)
|
padding,
|
||||||
|
pack)
|
||||||
self.gramplet.gvclose.show()
|
self.gramplet.gvclose.show()
|
||||||
self.gramplet.gvstate.show()
|
self.gramplet.gvstate.show()
|
||||||
self.gramplet.gvproperties.show()
|
self.gramplet.gvproperties.show()
|
||||||
@ -525,8 +526,6 @@ class GuiGramplet:
|
|||||||
self.gvproperties.hide()
|
self.gvproperties.hide()
|
||||||
if self.pui and len(self.pui.option_dict) > 0:
|
if self.pui and len(self.pui.option_dict) > 0:
|
||||||
self.gvoptions.show()
|
self.gvoptions.show()
|
||||||
# keep a pointer to old parent frame:
|
|
||||||
self.parent = self.mainframe.get_parent()
|
|
||||||
self.viewpage.detached_gramplets.append(self)
|
self.viewpage.detached_gramplets.append(self)
|
||||||
# make a window, and attach it there
|
# make a window, and attach it there
|
||||||
self.detached_window = GrampletWindow(self)
|
self.detached_window = GrampletWindow(self)
|
||||||
@ -764,17 +763,25 @@ class GrampletView(PageView.PersonNavView):
|
|||||||
self.place_gramplets()
|
self.place_gramplets()
|
||||||
return frame
|
return frame
|
||||||
|
|
||||||
|
def get_column_frame(self, column_num):
|
||||||
|
if column_num < len(self.columns):
|
||||||
|
return self.columns[column_num]
|
||||||
|
else:
|
||||||
|
return self.columns[-1] # it was too big, so select largest
|
||||||
|
|
||||||
def clear_gramplets(self):
|
def clear_gramplets(self):
|
||||||
"""
|
"""
|
||||||
Detach all of the mainframe gramplets from the columns.
|
Detach all of the mainframe gramplets from the columns.
|
||||||
"""
|
"""
|
||||||
gramplets = [g for g in self.gramplet_map.values() if g != None]
|
gramplets = [g for g in self.gramplet_map.values() if g != None]
|
||||||
for gramplet in gramplets:
|
for gramplet in gramplets:
|
||||||
|
if (gramplet.state == "windowed" or gramplet.state == "closed"):
|
||||||
|
continue
|
||||||
column = gramplet.mainframe.get_parent()
|
column = gramplet.mainframe.get_parent()
|
||||||
if column:
|
if column:
|
||||||
column.remove(gramplet.mainframe)
|
column.remove(gramplet.mainframe)
|
||||||
|
|
||||||
def place_gramplets(self):
|
def place_gramplets(self, recolumn=False):
|
||||||
"""
|
"""
|
||||||
Place the gramplet mainframes in the columns.
|
Place the gramplet mainframes in the columns.
|
||||||
"""
|
"""
|
||||||
@ -791,8 +798,10 @@ class GrampletView(PageView.PersonNavView):
|
|||||||
else:
|
else:
|
||||||
# else, spread them out:
|
# else, spread them out:
|
||||||
pos = cnt % self.column_count
|
pos = cnt % self.column_count
|
||||||
self.columns[pos].pack_start(gramplet.mainframe, expand=gramplet.expand)
|
|
||||||
gramplet.column = pos
|
gramplet.column = pos
|
||||||
|
if recolumn and (gramplet.state == "windowed" or gramplet.state == "closed"):
|
||||||
|
continue
|
||||||
|
self.columns[pos].pack_start(gramplet.mainframe, expand=gramplet.expand)
|
||||||
# set height on gramplet.scrolledwindow here:
|
# set height on gramplet.scrolledwindow here:
|
||||||
gramplet.scrolledwindow.set_size_request(-1, gramplet.height)
|
gramplet.scrolledwindow.set_size_request(-1, gramplet.height)
|
||||||
# Can't minimize here, because GRAMPS calls show_all later:
|
# Can't minimize here, because GRAMPS calls show_all later:
|
||||||
@ -1027,7 +1036,7 @@ class GrampletView(PageView.PersonNavView):
|
|||||||
self.columns[-1].show()
|
self.columns[-1].show()
|
||||||
self.hbox.pack_start(self.columns[-1],expand=True)
|
self.hbox.pack_start(self.columns[-1],expand=True)
|
||||||
# place the gramplets back in the new columns
|
# place the gramplets back in the new columns
|
||||||
self.place_gramplets()
|
self.place_gramplets(recolumn=True)
|
||||||
self.widget.show()
|
self.widget.show()
|
||||||
|
|
||||||
def restore_gramplet(self, obj):
|
def restore_gramplet(self, obj):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user