From 7406c6ecf4570efd466a7ae307d0715d2067cf0c Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 31 Dec 2016 14:31:13 -0600 Subject: [PATCH] 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). --- gramps/gui/glade/book.glade | 4 +--- gramps/gui/plug/report/_bookdialog.py | 13 +++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gramps/gui/glade/book.glade b/gramps/gui/glade/book.glade index e476b26ab..c4a6cd766 100644 --- a/gramps/gui/glade/book.glade +++ b/gramps/gui/glade/book.glade @@ -1,5 +1,5 @@ - + @@ -507,8 +507,6 @@ 300 False normal - top - center> True diff --git a/gramps/gui/plug/report/_bookdialog.py b/gramps/gui/plug/report/_bookdialog.py index 308daaa8b..03fcda839 100644 --- a/gramps/gui/plug/report/_bookdialog.py +++ b/gramps/gui/plug/report/_bookdialog.py @@ -147,7 +147,7 @@ class BookListDisplay: 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. @@ -191,6 +191,7 @@ class BookListDisplay: self.redraw() self.selection = None + self.top.set_transient_for(parent) self.top.run() def redraw(self): @@ -330,7 +331,7 @@ class BookSelector(ManagedWindow): title_label = self.xml.get_object('title') self.set_window(window, title_label, self.title) self.setup_configs('interface.bookselector', 700, 600) - window.show() + self.show() self.xml.connect_signals({ "on_add_clicked" : self.on_add_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. """ - booklistdisplay = BookListDisplay(self.book_list, - nodelete=True, dosave=False) + booklistdisplay = BookListDisplay(self.book_list, nodelete=True, + dosave=False, parent=self.window) booklistdisplay.top.destroy() book = booklistdisplay.selection if book: @@ -777,8 +778,8 @@ class BookSelector(ManagedWindow): """ Run the BookListDisplay dialog to present the choice of books to delete. """ - booklistdisplay = BookListDisplay(self.book_list, - nodelete=False, dosave=True) + booklistdisplay = BookListDisplay(self.book_list, nodelete=False, + dosave=True, parent=self.window) booklistdisplay.top.destroy() book = booklistdisplay.selection if book: