Added missing has_data interface for QuickViews
svn: r17125
This commit is contained in:
parent
33bc447f88
commit
cc52aa660e
@ -104,6 +104,7 @@ class TextBufDoc(BaseDoc, TextDoc):
|
||||
#--------------------------------------------------------------------
|
||||
def open(self, filename, container=None):
|
||||
self.type = "gtk"
|
||||
self.has_data = True
|
||||
self.tag_table = gtk.TextTagTable()
|
||||
|
||||
sheet = self.get_style_sheet()
|
||||
|
@ -77,11 +77,20 @@ class QuickViewGramplet(Gramplet):
|
||||
except:
|
||||
active_handle = None
|
||||
if active_handle:
|
||||
run_quick_report_by_name(self.gui.dbstate,
|
||||
self.gui.uistate,
|
||||
quick_view,
|
||||
active_handle,
|
||||
container=self.gui.textview)
|
||||
docman = run_quick_report_by_name(self.gui.dbstate,
|
||||
self.gui.uistate,
|
||||
quick_view,
|
||||
active_handle,
|
||||
container=self.gui.textview)
|
||||
self.set_has_data(docman.document.has_data)
|
||||
else:
|
||||
self.set_has_data(False)
|
||||
|
||||
def update_has_data(self):
|
||||
"""
|
||||
Update the has_data indicator when gramplet is not visible.
|
||||
"""
|
||||
self.main()
|
||||
|
||||
def build_options(self):
|
||||
from gen.plug.menu import EnumeratedListOption
|
||||
|
@ -66,8 +66,10 @@ def run(database, document, obj):
|
||||
|
||||
if stab.get_row_count() > 0:
|
||||
stab.write(sdoc)
|
||||
document.has_data = True
|
||||
else:
|
||||
sdoc.paragraph(_("No link references for this note"))
|
||||
sdoc.paragraph("")
|
||||
document.has_data = False
|
||||
sdoc.paragraph("")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user