Added ability to use natilus theme icons. Set default path for writing GEDCOM files.
svn: r1185
This commit is contained in:
parent
d28ba99928
commit
868f09af4f
@ -1080,3 +1080,4 @@ def save_filter(val):
|
||||
|
||||
def get_filter():
|
||||
return get_bool("/gramps/config/filter")
|
||||
|
||||
|
@ -950,4 +950,3 @@ class DeleteMediaQuery:
|
||||
if self.update:
|
||||
self.update(0)
|
||||
|
||||
|
||||
|
@ -332,9 +332,43 @@ def get_place_from_list(obj):
|
||||
else:
|
||||
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):
|
||||
n = "%s/icons/%s.png" % (const.rootDir,string.replace(string.replace(mtype,'/','-'),'.','-'))
|
||||
if os.path.isfile(n):
|
||||
n = nautilus_icon(None,mtype)
|
||||
if n:
|
||||
return n
|
||||
else:
|
||||
return const.icon
|
||||
|
@ -42,6 +42,9 @@ editor = "gimp"
|
||||
zipcmd = "zip -r -q"
|
||||
convert = "convert"
|
||||
|
||||
pixdir = "/usr/share/pixmaps"
|
||||
nautdir = "/usr/share/pixmaps/nautilus"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Paths to files - assumes that files reside in the same directory as
|
||||
|
@ -42,6 +42,9 @@ editor = "gimp"
|
||||
zipcmd = "zip -r -q"
|
||||
convert = "convert"
|
||||
|
||||
pixdir = "/usr/share/pixmaps"
|
||||
nautdir = "/usr/share/pixmaps/nautilus"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Paths to files - assumes that files reside in the same directory as
|
||||
|
@ -357,6 +357,11 @@ class GedcomWriter:
|
||||
target_obj.set_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()
|
||||
|
||||
def on_ok_clicked(self,obj):
|
||||
|
Loading…
Reference in New Issue
Block a user