Added ability to use natilus theme icons. Set default path for writing GEDCOM files.
svn: r1185
This commit is contained in:
parent
dea43fb83c
commit
0869dbaa92
@ -1080,3 +1080,4 @@ def save_filter(val):
|
|||||||
|
|
||||||
def get_filter():
|
def get_filter():
|
||||||
return get_bool("/gramps/config/filter")
|
return get_bool("/gramps/config/filter")
|
||||||
|
|
||||||
|
@ -950,4 +950,3 @@ class DeleteMediaQuery:
|
|||||||
if self.update:
|
if self.update:
|
||||||
self.update(0)
|
self.update(0)
|
||||||
|
|
||||||
|
|
||||||
|
38
src/Utils.py
38
src/Utils.py
@ -332,9 +332,43 @@ def get_place_from_list(obj):
|
|||||||
else:
|
else:
|
||||||
return select[0].get_data(LISTOBJ)
|
return select[0].get_data(LISTOBJ)
|
||||||
|
|
||||||
|
def nautilus_icon(icon,type):
|
||||||
|
import GrampsCfg
|
||||||
|
|
||||||
|
theme = GrampsCfg.client.get_string("/desktop/gnome/file_views/icon_theme")
|
||||||
|
|
||||||
|
if icon :
|
||||||
|
newicon = "%s/%s/%s.png" % (const.nautdir,theme,icon)
|
||||||
|
if os.path.isfile(newicon):
|
||||||
|
return newicon
|
||||||
|
else:
|
||||||
|
newicon = "%s/document-icons/%s.png" % (const.pixdir,icon)
|
||||||
|
if os.path.isfile(newicon):
|
||||||
|
return newicon
|
||||||
|
return None
|
||||||
|
elif type == "x-directory/":
|
||||||
|
if theme:
|
||||||
|
newicon = "%s/%s/i-directory.png" % (const.nautdir,theme)
|
||||||
|
else:
|
||||||
|
newicon = "%s/gnome-folder.png" % const.pixdir
|
||||||
|
if os.path.isfile(newicon):
|
||||||
|
return newicon
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
icontmp = type.replace('/','-')
|
||||||
|
if theme:
|
||||||
|
newicon = "%s/%s/gnome-%s.png" % (const.nautdir,theme,icontmp)
|
||||||
|
if os.path.isfile(newicon):
|
||||||
|
return newicon
|
||||||
|
else:
|
||||||
|
newicon = "%s/document-icons/gnome-%s.png" % (const.nautdir,icontmp)
|
||||||
|
if os.path.isfile(newicon):
|
||||||
|
return newicon
|
||||||
|
return None
|
||||||
|
|
||||||
def find_icon(mtype):
|
def find_icon(mtype):
|
||||||
n = "%s/icons/%s.png" % (const.rootDir,string.replace(string.replace(mtype,'/','-'),'.','-'))
|
n = nautilus_icon(None,mtype)
|
||||||
if os.path.isfile(n):
|
if n:
|
||||||
return n
|
return n
|
||||||
else:
|
else:
|
||||||
return const.icon
|
return const.icon
|
||||||
|
@ -42,6 +42,9 @@ editor = "gimp"
|
|||||||
zipcmd = "zip -r -q"
|
zipcmd = "zip -r -q"
|
||||||
convert = "convert"
|
convert = "convert"
|
||||||
|
|
||||||
|
pixdir = "/usr/share/pixmaps"
|
||||||
|
nautdir = "/usr/share/pixmaps/nautilus"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Paths to files - assumes that files reside in the same directory as
|
# Paths to files - assumes that files reside in the same directory as
|
||||||
|
@ -42,6 +42,9 @@ editor = "gimp"
|
|||||||
zipcmd = "zip -r -q"
|
zipcmd = "zip -r -q"
|
||||||
convert = "convert"
|
convert = "convert"
|
||||||
|
|
||||||
|
pixdir = "/usr/share/pixmaps"
|
||||||
|
nautdir = "/usr/share/pixmaps/nautilus"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Paths to files - assumes that files reside in the same directory as
|
# Paths to files - assumes that files reside in the same directory as
|
||||||
|
@ -356,6 +356,11 @@ class GedcomWriter:
|
|||||||
|
|
||||||
target_obj.set_menu(myMenu)
|
target_obj.set_menu(myMenu)
|
||||||
self.target_menu = myMenu
|
self.target_menu = myMenu
|
||||||
|
|
||||||
|
pathname = "%s.ged" % os.path.dirname(db.getSavePath())
|
||||||
|
|
||||||
|
filetgt = self.topDialog.get_widget('fileentry1')
|
||||||
|
filetgt.set_filename(pathname)
|
||||||
|
|
||||||
self.topDialog.get_widget("gedcomExport").show()
|
self.topDialog.get_widget("gedcomExport").show()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user