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