bug 9872: fix Windows issue; Book dialogs don't stay on top

They are pushed to background if background window tooltip appears.
Also, The book list display was not popping up above the dialog
(no transient parent).
This commit is contained in:
prculley 2016-12-31 14:31:13 -06:00
parent dde84ed8bc
commit 7406c6ecf4
2 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.10"/> <requires lib="gtk+" version="3.10"/>
<object class="GtkWindow" id="top"> <object class="GtkWindow" id="top">
@ -507,8 +507,6 @@
<property name="height_request">300</property> <property name="height_request">300</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="type_hint">normal</property> <property name="type_hint">normal</property>
<property name="transient_for">top</property>
<property name="window_position">center</property>>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -147,7 +147,7 @@ class BookListDisplay:
Allows the user to select and/or delete a book from the list. Allows the user to select and/or delete a book from the list.
""" """
def __init__(self, booklist, nodelete=False, dosave=False): def __init__(self, booklist, nodelete=False, dosave=False, parent=None):
""" """
Create a BookListDisplay object that displays the books in BookList. Create a BookListDisplay object that displays the books in BookList.
@ -191,6 +191,7 @@ class BookListDisplay:
self.redraw() self.redraw()
self.selection = None self.selection = None
self.top.set_transient_for(parent)
self.top.run() self.top.run()
def redraw(self): def redraw(self):
@ -330,7 +331,7 @@ class BookSelector(ManagedWindow):
title_label = self.xml.get_object('title') title_label = self.xml.get_object('title')
self.set_window(window, title_label, self.title) self.set_window(window, title_label, self.title)
self.setup_configs('interface.bookselector', 700, 600) self.setup_configs('interface.bookselector', 700, 600)
window.show() self.show()
self.xml.connect_signals({ self.xml.connect_signals({
"on_add_clicked" : self.on_add_clicked, "on_add_clicked" : self.on_add_clicked,
"on_remove_clicked" : self.on_remove_clicked, "on_remove_clicked" : self.on_remove_clicked,
@ -764,8 +765,8 @@ class BookSelector(ManagedWindow):
""" """
Run the BookListDisplay dialog to present the choice of books to open. Run the BookListDisplay dialog to present the choice of books to open.
""" """
booklistdisplay = BookListDisplay(self.book_list, booklistdisplay = BookListDisplay(self.book_list, nodelete=True,
nodelete=True, dosave=False) dosave=False, parent=self.window)
booklistdisplay.top.destroy() booklistdisplay.top.destroy()
book = booklistdisplay.selection book = booklistdisplay.selection
if book: if book:
@ -777,8 +778,8 @@ class BookSelector(ManagedWindow):
""" """
Run the BookListDisplay dialog to present the choice of books to delete. Run the BookListDisplay dialog to present the choice of books to delete.
""" """
booklistdisplay = BookListDisplay(self.book_list, booklistdisplay = BookListDisplay(self.book_list, nodelete=False,
nodelete=False, dosave=True) dosave=True, parent=self.window)
booklistdisplay.top.destroy() booklistdisplay.top.destroy()
book = booklistdisplay.selection book = booklistdisplay.selection
if book: if book: