* src/DataViews/_MediaView.py: add view option

* src/images/Makefile.am: add stock_zoom
	* src/images/stock_zoom.png: added
	* src/gramps_main.py: register stock_zoom as a stock icon


svn: r7965
This commit is contained in:
Don Allingham 2007-01-24 00:23:39 +00:00
parent 7c92fb10a6
commit 79e9f3e9b5
5 changed files with 18 additions and 3 deletions

View File

@ -1,4 +1,8 @@
2007-01-23 Don Allingham <don@gramps-project.org>
* src/DataViews/_MediaView.py: add view option
* src/images/Makefile.am: add stock_zoom
* src/images/stock_zoom.png: added
* src/gramps_main.py: register stock_zoom as a stock icon
* src/GrampsDb/_GrampsBSDDB.py: initialize the next gramps_id
indexes to the length of the tables to prevent a walk of the db
entries.

View File

@ -60,7 +60,7 @@ import RelLib
from Editors import EditMedia, DeleteMediaQuery
import Errors
from QuestionDialog import QuestionDialog
from QuestionDialog import QuestionDialog, ErrorDialog
from Filters.SideBar import MediaSidebarFilter
from DdTargets import DdTargets
@ -184,11 +184,12 @@ class MediaView(PageView.ListView):
def define_actions(self):
PageView.ListView.define_actions(self)
self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
_('_Column Editor'), callback=self.column_editor)
self.add_action('FilterEdit', None, _('Media Filter Editor'),
callback=self.filter_editor)
self.add_action('OpenMedia', None, _('View in an external viewer'),
self.add_action('OpenMedia', 'gramps-viewmedia', _('View'),
callback=self.view_media)
def view_media(self, obj):
@ -201,6 +202,10 @@ class MediaView(PageView.ListView):
app = Mime.get_application(mime_type)
if app:
Utils.launch(app[0], ref_obj.get_path())
else:
ErrorDialog(_("Cannot view %s") % ref_obj.get_path(),
_("GRAMPS cannot find an application that can view "
"a file type of %s.") % mime_type)
def column_editor(self, obj):
import ColumnOrder
@ -238,7 +243,8 @@ class MediaView(PageView.ListView):
vbox.pack_start(base, True)
self.tt = gtk.Tooltips()
self.tt.set_tip(ebox, _('Double click image to view in an external viewer'))
self.tt.set_tip(ebox,
_('Double click image to view in an external viewer'))
self.selection.connect('changed', self.row_change)
self._set_dnd()
@ -290,6 +296,8 @@ class MediaView(PageView.ListView):
<toolitem action="Edit"/>
<toolitem action="Remove"/>
</placeholder>
<separator/>
<toolitem action="OpenMedia"/>
</toolbar>
<popup name="Popup">
<menuitem action="Add"/>

View File

@ -133,6 +133,8 @@ def register_stock_icons ():
('gramps-url',_('URL'),gtk.gdk.CONTROL_MASK,0,'')),
(os.path.join(const.image_dir,'share-fam.png'),
('gramps-sharefamily',_('Share Family'),gtk.gdk.CONTROL_MASK,0,'')),
(os.path.join(const.image_dir,'stock_zoom.png'),
('gramps-viewmedia',_('View'),gtk.gdk.CONTROL_MASK,0,'')),
]
# Register our stock items

View File

@ -95,6 +95,7 @@ dist_pkgdata_DATA = \
stock_lock-open.png\
stock_lock.png\
stock_notes.png\
stock_zoom.png\
somerights20.gif \
document.png #\ $(map_tile_images)

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B