Added ability to use natilus theme icons. Set default path for writing GEDCOM files.

svn: r1185
This commit is contained in:
Don Allingham 2002-11-12 04:12:18 +00:00
parent d28ba99928
commit 868f09af4f
6 changed files with 48 additions and 3 deletions

View File

@ -1080,3 +1080,4 @@ def save_filter(val):
def get_filter():
return get_bool("/gramps/config/filter")

View File

@ -950,4 +950,3 @@ class DeleteMediaQuery:
if self.update:
self.update(0)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -356,6 +356,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()