9736: Export options 'Preview' buttons create hidden quickreport.

This commit is contained in:
SNoiraud 2016-10-11 13:40:25 +02:00
parent 44b0837d4d
commit 433a7d73cb

View File

@ -53,7 +53,7 @@ LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER'
_WIDTH_IN_CHARS = 72 _WIDTH_IN_CHARS = 72
class DisplayBuf(ManagedWindow): class DisplayBuf(ManagedWindow):
def __init__(self, title, document): def __init__(self, title, document, modal=False):
self.title = title self.title = title
ManagedWindow.__init__(self, document.uistate, [], ManagedWindow.__init__(self, document.uistate, [],
document) document)
@ -70,6 +70,7 @@ class DisplayBuf(ManagedWindow):
scrolled_window.add(document.text_view) scrolled_window.add(document.text_view)
self.window.vbox.pack_start(scrolled_window, True, True, 0) self.window.vbox.pack_start(scrolled_window, True, True, 0)
self.window.show_all() self.window.show_all()
self.window.set_modal(modal)
def build_menu_names(self, obj): def build_menu_names(self, obj):
return ('View', _('Quick View')) return ('View', _('Quick View'))
@ -154,7 +155,7 @@ class TextBufDoc(BaseDoc, TextDoc):
if container: if container:
return DocumentManager(_('Quick View'), self, container) return DocumentManager(_('Quick View'), self, container)
else: else:
DisplayBuf(_('Quick View'), self) DisplayBuf(_('Quick View'), self, modal=True)
return return
#-------------------------------------------------------------------- #--------------------------------------------------------------------