Image fixes
svn: r1286
This commit is contained in:
parent
3cd92882fd
commit
4d69982b87
Binary file not shown.
@ -211,6 +211,7 @@ def loadConfig(call):
|
||||
global mediaref
|
||||
global globalprop
|
||||
global localprop
|
||||
global capitalize
|
||||
|
||||
_callback = call
|
||||
lastfile = get_string("/apps/gramps/last-file")
|
||||
@ -459,7 +460,7 @@ class ConfigCheckbox(ConfigWidget):
|
||||
class ConfigFile(ConfigWidget):
|
||||
|
||||
def get_widgets(self):
|
||||
self.w = gnome.ui.GnomeFileEntry(self.tag)
|
||||
self.w = gnome.ui.FileEntry(self.tag)
|
||||
lbl = gtk.Label(self.l)
|
||||
self.w.show()
|
||||
lbl.show()
|
||||
|
@ -328,12 +328,22 @@ class Gallery(ImageSelect):
|
||||
if x != self.cx or y != self.cy:
|
||||
grp.move(self.cx-x,self.cy-y)
|
||||
else:
|
||||
import gobject
|
||||
|
||||
name = Utils.thumb_path(self.db.getSavePath(),object)
|
||||
description = object.getDescription()
|
||||
if len(description) > 20:
|
||||
description = "%s..." % description[0:20]
|
||||
|
||||
image = gtk.gdk.pixbuf_new_from_file(name)
|
||||
try:
|
||||
image = gtk.gdk.pixbuf_new_from_file(name)
|
||||
except gobject.GError,msg:
|
||||
ErrorDialog(str(msg))
|
||||
image = gtk.gdk.pixbuf_new_from_file(const.icon)
|
||||
except:
|
||||
ErrorDialog(_("Thumbnail %s could not be found") % name)
|
||||
image = gtk.gdk.pixbuf_new_from_file(const.icon)
|
||||
|
||||
x = image.get_width()
|
||||
y = image.get_height()
|
||||
|
||||
|
@ -136,7 +136,8 @@ class MediaView:
|
||||
if pexists and os.path.exists(thumb_path):
|
||||
self.preview.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file(thumb_path))
|
||||
else:
|
||||
self.preview.set_from_pixbuf(Utils.find_icon(type))
|
||||
icon_image = gtk.gdk.pixbuf_new_from_file(Utils.find_icon(type))
|
||||
self.preview.set_from_pixbuf(icon_image)
|
||||
if not pexists:
|
||||
fexists = 0
|
||||
|
||||
|
@ -278,6 +278,7 @@ _utoa = {
|
||||
def ansel_to_utf8(s):
|
||||
"""Converts an ANSEL encoded string to UTF8"""
|
||||
|
||||
print s
|
||||
buff = cStringIO.StringIO()
|
||||
while s:
|
||||
c0 = ord(s[0])
|
||||
@ -285,18 +286,25 @@ def ansel_to_utf8(s):
|
||||
head = u' '
|
||||
s = s[1:]
|
||||
elif c0 > 127:
|
||||
if _twobyte.has_key(s[0:2]):
|
||||
head = _twobyte[s[0:2]]
|
||||
l2 = s[0:2]
|
||||
l1 = s[0]
|
||||
print "----------------------"
|
||||
if _twobyte.has_key(l2):
|
||||
head = _twobyte[l2]
|
||||
s = s[2:]
|
||||
elif _onebyte.has_key(s[0]):
|
||||
head = _onebyte[s[0]]
|
||||
print "two"
|
||||
elif _onebyte.has_key(l1):
|
||||
head = _onebyte[l1]
|
||||
s = s[1:]
|
||||
print "**8 one",l1,ord(l1),"*",_onebyte[l1],
|
||||
else:
|
||||
head = u'\xff\xfd'
|
||||
s = s[1:]
|
||||
print "barf"
|
||||
else:
|
||||
head = s[0]
|
||||
s = s[1:]
|
||||
print head,c0
|
||||
buff.write(head)
|
||||
ans = buff.getvalue()
|
||||
buff.close()
|
||||
|
@ -100,7 +100,7 @@ startup = 1
|
||||
#-------------------------------------------------------------------------
|
||||
progName = "GRAMPS"
|
||||
version = "0.9.0-rc5"
|
||||
copyright = "© 2001-2003 Donald N. Allingham"
|
||||
copyright = unicode("© 2001-2003 Donald N. Allingham","iso-8859-1")
|
||||
authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
|
||||
comments = _("GRAMPS (Genealogical Research and Analysis "
|
||||
"Management Programming System) is a personal "
|
||||
@ -130,8 +130,8 @@ childRelations = {
|
||||
_("Birth") : "Birth",
|
||||
_("Adopted") : "Adopted",
|
||||
_("Stepchild") : "Stepchild",
|
||||
_("Foster") : "Foster",
|
||||
_("Sponsored") : "Sponsored",
|
||||
_("Foster") : "Foster",
|
||||
_("None") : "None",
|
||||
_("Unknown") : "Unknown",
|
||||
_("Other") : "Other",
|
||||
|
@ -100,7 +100,7 @@ startup = 1
|
||||
#-------------------------------------------------------------------------
|
||||
progName = "GRAMPS"
|
||||
version = "@VERSIONSTRING@"
|
||||
copyright = "© 2001-2003 Donald N. Allingham"
|
||||
copyright = unicode("© 2001-2003 Donald N. Allingham","iso-8859-1")
|
||||
authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
|
||||
comments = _("GRAMPS (Genealogical Research and Analysis "
|
||||
"Management Programming System) is a personal "
|
||||
|
@ -26,6 +26,8 @@ from intl import gettext as _
|
||||
import TextDoc
|
||||
import DrawDoc
|
||||
|
||||
def pt2cm(val):
|
||||
return (float(val)/72.0)*2.54
|
||||
|
||||
class PSDrawDoc(DrawDoc.DrawDoc):
|
||||
|
||||
@ -111,18 +113,45 @@ class PSDrawDoc(DrawDoc.DrawDoc):
|
||||
self.f.write('%%PageTrailer\n')
|
||||
|
||||
def draw_text(self,style,text,x1,y1):
|
||||
x1 = x1 + self.lmargin
|
||||
y1 = y1 + self.tmargin
|
||||
|
||||
stype = self.draw_styles[style]
|
||||
para_name = stype.get_paragraph_style()
|
||||
p = self.style_list[para_name]
|
||||
|
||||
x1 = x1 + self.lmargin
|
||||
y1 = y1 + self.tmargin + pt2cm(p.get_font().get_size())
|
||||
|
||||
self.f.write('gsave\n')
|
||||
self.f.write('%f cm %f cm moveto\n' % self.translate(x1,y1))
|
||||
self.f.write(self.fontdef(p))
|
||||
self.f.write('(%s) show\n' % text)
|
||||
self.f.write('grestore\n')
|
||||
|
||||
def draw_path(self,style,path,fill):
|
||||
stype = self.draw_styles[style]
|
||||
self.f.write('gsave\n')
|
||||
self.f.write('newpath\n')
|
||||
self.f.write('%d setlinewidth\n' % stype.get_line_width())
|
||||
if stype.get_line_style() == DrawDoc.SOLID:
|
||||
self.f.write('[] 0 setdash\n')
|
||||
else:
|
||||
self.f.write('[2 4] 0 setdash\n')
|
||||
|
||||
point = path[0]
|
||||
x1 = point[0]+self.lmargin
|
||||
y1 = point[1]+self.tmargin
|
||||
self.f.write('%f cm %f cm moveto\n' % self.translate(x1,y1))
|
||||
|
||||
for point in path[1:]:
|
||||
x1 = point[0]+self.lmargin
|
||||
y1 = point[1]+self.tmargin
|
||||
self.f.write('%f cm %f cm lineto\n' % self.translate(x1,y1))
|
||||
self.f.write('closepath\n')
|
||||
if fill:
|
||||
self.f.write('fill\n')
|
||||
else:
|
||||
self.f.write('stroke\n')
|
||||
self.f.write('grestore\n')
|
||||
|
||||
def draw_line(self,style,x1,y1,x2,y2):
|
||||
x1 = x1 + self.lmargin
|
||||
x2 = x2 + self.lmargin
|
||||
|
@ -1461,7 +1461,7 @@
|
||||
<child>
|
||||
<widget class="GtkTable" id="table10">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_rows">7</property>
|
||||
<property name="n_columns">6</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">0</property>
|
||||
@ -1532,8 +1532,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1604,8 +1604,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1628,8 +1628,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1652,8 +1652,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1676,8 +1676,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1700,8 +1700,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1724,8 +1724,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1748,8 +1748,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1761,7 +1761,7 @@
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
@ -1786,7 +1786,7 @@
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
@ -1812,33 +1812,7 @@
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">6</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_padding">3</property>
|
||||
<property name="y_padding">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="alt_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
@ -1859,12 +1833,12 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="name_type">
|
||||
<widget class="GtkLabel" id="alt_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
@ -1884,6 +1858,32 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="name_type">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">6</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_padding">3</property>
|
||||
<property name="y_padding">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label279">
|
||||
<property name="visible">True</property>
|
||||
@ -1901,8 +1901,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1925,8 +1925,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="right_attach">5</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="x_options"></property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -1938,7 +1938,7 @@
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
@ -1949,8 +1949,8 @@
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="x_padding">3</property>
|
||||
<property name="y_padding">3</property>
|
||||
<property name="y_options"></property>
|
||||
@ -1963,7 +1963,7 @@
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
@ -1974,8 +1974,82 @@
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="right_attach">6</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label294">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Surname Prefix</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">5</property>
|
||||
<property name="ypad">3</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label295">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">:</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">3</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="alt_prefix">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">6</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_padding">3</property>
|
||||
<property name="y_padding">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -176,7 +176,7 @@ class DescendantReportDialog(Report.TextReportDialog):
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def report(database,person):
|
||||
DescendantReportDialog(person,database)
|
||||
DescendantReportDialog(database,person)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -47,9 +47,12 @@ class ReadNative:
|
||||
self.top = gtk.FileSelection("%s - GRAMPS" % _("Import from GRAMPS"))
|
||||
self.top.hide_fileop_buttons()
|
||||
self.top.ok_button.connect('clicked', self.on_ok_clicked)
|
||||
self.top.cancel_button.connect_object('clicked', Utils.destroy_passed_object,self.top)
|
||||
self.top.cancel_button.connect('clicked', self.close_window)
|
||||
self.top.show()
|
||||
|
||||
def close_window(self,obj):
|
||||
self.top.destroy()
|
||||
|
||||
def show_display(self):
|
||||
self.window = gtk.Window()
|
||||
self.window.set_title(_("Import from GRAMPS"))
|
||||
|
Loading…
Reference in New Issue
Block a user