Enabled Quickviews on all list views; enabled References Quickview for all views
svn: r13947
This commit is contained in:
@@ -60,7 +60,7 @@ from gui.editors import EditMedia, DeleteMediaQuery
|
||||
import Errors
|
||||
from Filters.SideBar import MediaSidebarFilter
|
||||
from DdTargets import DdTargets
|
||||
|
||||
from gen.plug import CATEGORY_QR_MEDIA
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -89,6 +89,7 @@ class MediaView(ListView):
|
||||
EDIT_MSG = _("Edit the selected media object")
|
||||
DEL_MSG = _("Delete the selected media object")
|
||||
FILTER_TYPE = 'MediaObject'
|
||||
QR_CATEGORY = CATEGORY_QR_MEDIA
|
||||
|
||||
_DND_TYPE = DdTargets.URI_LIST
|
||||
|
||||
@@ -225,6 +226,9 @@ class MediaView(ListView):
|
||||
_('Open Containing _Folder'),
|
||||
tip=_("Open the folder containing the media file"),
|
||||
callback=self.open_containing_folder)
|
||||
|
||||
self._add_action('QuickReport', None, _("Quick View"), None, None, None)
|
||||
self._add_action('Dummy', None, ' ', None, None, self.dummy_report)
|
||||
|
||||
def view_media(self, obj):
|
||||
"""
|
||||
@@ -372,9 +376,20 @@ class MediaView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
</menu>
|
||||
</popup>
|
||||
</ui>'''
|
||||
|
||||
def dummy_report(self, obj):
|
||||
""" For the xml UI definition of popup to work, the submenu
|
||||
Quick Report must have an entry in the xml
|
||||
As this submenu will be dynamically built, we offer a dummy action
|
||||
"""
|
||||
pass
|
||||
|
||||
def add(self, obj):
|
||||
"""Add a new media object to the media list"""
|
||||
try:
|
||||
|
@@ -55,6 +55,7 @@ from gen.lib import Note
|
||||
from DdTargets import DdTargets
|
||||
from Filters.SideBar import NoteSidebarFilter
|
||||
from gui.editors import EditNote, DeleteNoteQuery
|
||||
from gen.plug import CATEGORY_QR_NOTE
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -74,6 +75,7 @@ class NoteView(ListView):
|
||||
EDIT_MSG = _("Edit the selected note")
|
||||
DEL_MSG = _("Delete the selected note")
|
||||
FILTER_TYPE = "Note"
|
||||
QR_CATEGORY = CATEGORY_QR_NOTE
|
||||
|
||||
def __init__(self, dbstate, uistate):
|
||||
|
||||
@@ -165,15 +167,28 @@ class NoteView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
</menu>
|
||||
</popup>
|
||||
</ui>'''
|
||||
|
||||
def dummy_report(self, obj):
|
||||
""" For the xml UI definition of popup to work, the submenu
|
||||
Quick Report must have an entry in the xml
|
||||
As this submenu will be dynamically built, we offer a dummy action
|
||||
"""
|
||||
pass
|
||||
|
||||
def define_actions(self):
|
||||
ListView.define_actions(self)
|
||||
self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self._column_editor)
|
||||
self._add_action('FilterEdit', None, _('Note Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
self._add_action('QuickReport', None, _("Quick View"), None, None, None)
|
||||
self._add_action('Dummy', None, ' ', None, None, self.dummy_report)
|
||||
|
||||
def get_handle_from_gramps_id(self, gid):
|
||||
obj = self.dbstate.db.get_note_from_gramps_id(gid)
|
||||
|
@@ -47,6 +47,7 @@ from DdTargets import DdTargets
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gui.editors import EditSource, DeleteSrcQuery
|
||||
from Filters.SideBar import SourceSidebarFilter
|
||||
from gen.plug import CATEGORY_QR_SOURCE
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -76,6 +77,7 @@ class SourceView(ListView):
|
||||
EDIT_MSG = _("Edit the selected source")
|
||||
DEL_MSG = _("Delete the selected source")
|
||||
FILTER_TYPE = "Source"
|
||||
QR_CATEGORY = CATEGORY_QR_SOURCE
|
||||
|
||||
def __init__(self, dbstate, uistate):
|
||||
|
||||
@@ -119,6 +121,8 @@ class SourceView(ListView):
|
||||
callback=self.fast_merge)
|
||||
self._add_action('FilterEdit', None, _('Source Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
self._add_action('QuickReport', None, _("Quick View"), None, None, None)
|
||||
self._add_action('Dummy', None, ' ', None, None, self.dummy_report)
|
||||
|
||||
def _column_editor(self, obj):
|
||||
import ColumnOrder
|
||||
@@ -174,9 +178,20 @@ class SourceView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
</menu>
|
||||
</popup>
|
||||
</ui>'''
|
||||
|
||||
def dummy_report(self, obj):
|
||||
""" For the xml UI definition of popup to work, the submenu
|
||||
Quick Report must have an entry in the xml
|
||||
As this submenu will be dynamically built, we offer a dummy action
|
||||
"""
|
||||
pass
|
||||
|
||||
def add(self, obj):
|
||||
EditSource(self.dbstate, self.uistate, [], gen.lib.Source())
|
||||
|
||||
|
Reference in New Issue
Block a user