Merged trunk r17888 through r18397 into geps023.
Conflicts resolved in:
/data/grampsxml.dtd
/data/grampsxml.rng
/src/Filters/Rules/Repository/_MatchesNameSubstringOf.py
/src/plugins/import/ImportXml.py
(Various property conflicts also resolved)
svn: r18405
This commit is contained in:
@@ -7,6 +7,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/gui/widgets
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
__init__.py \
|
||||
basicentry.py \
|
||||
buttons.py \
|
||||
expandcollapsearrow.py \
|
||||
grampletpane.py \
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
"""Custom widgets."""
|
||||
|
||||
from basicentry import *
|
||||
from buttons import *
|
||||
from expandcollapsearrow import *
|
||||
from labels import *
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2011 Nick Hall
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id: basicentry.py 17965 2011-07-25 22:47:57Z nick-h $
|
||||
|
||||
__all__ = ["BasicEntry"]
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Standard python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import logging
|
||||
_LOG = logging.getLogger(".widgets.basicentry")
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# BasicEntry class
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class BasicEntry(gtk.Entry):
|
||||
|
||||
def __init__(self):
|
||||
gtk.Entry.__init__(self)
|
||||
self.set_width_chars(5)
|
||||
self.show()
|
||||
@@ -18,7 +18,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id: $
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
An override to allow easy multiselections.
|
||||
|
||||
@@ -44,7 +44,7 @@ class Photo(gtk.EventBox):
|
||||
"""
|
||||
Displays an image and allows it to be viewed in an external image viewer.
|
||||
"""
|
||||
def __init__(self):
|
||||
def __init__(self, use_small_size=False):
|
||||
gtk.EventBox.__init__(self)
|
||||
self.full_path = None
|
||||
self.photo = gtk.Image()
|
||||
@@ -53,6 +53,9 @@ class Photo(gtk.EventBox):
|
||||
tip = _('Double-click on the picture to view it in the default image '
|
||||
'viewer application.')
|
||||
self.set_tooltip_text(tip)
|
||||
self.__size = ThumbNails.SIZE_LARGE
|
||||
if use_small_size:
|
||||
self.__size = ThumbNails.SIZE_NORMAL
|
||||
|
||||
def set_image(self, full_path, mime_type=None, rectangle=None):
|
||||
"""
|
||||
@@ -63,7 +66,7 @@ class Photo(gtk.EventBox):
|
||||
pixbuf = ThumbNails.get_thumbnail_image(full_path,
|
||||
mime_type,
|
||||
rectangle,
|
||||
ThumbNails.SIZE_LARGE)
|
||||
self.__size)
|
||||
self.photo.set_from_pixbuf(pixbuf)
|
||||
self.photo.show()
|
||||
else:
|
||||
|
||||
@@ -71,22 +71,14 @@ class Statusbar(gtk.HBox):
|
||||
gobject.PARAM_READWRITE),
|
||||
}
|
||||
|
||||
def __init__(self, min_width=30):
|
||||
def __init__(self):
|
||||
gtk.HBox.__init__(self)
|
||||
|
||||
# initialize pixel/character scale
|
||||
pl = pango.Layout(self.get_pango_context())
|
||||
pl.set_text("M")
|
||||
(self._char_width, h) = pl.get_pixel_size()
|
||||
|
||||
# initialize property values
|
||||
self.__has_resize_grip = True
|
||||
|
||||
# create the main statusbar with id #0
|
||||
main_bar = gtk.Statusbar()
|
||||
main_bar.set_size_request(min_width*self._char_width, -1)
|
||||
main_bar.show()
|
||||
self.pack_start(main_bar)
|
||||
self.pack_start(main_bar, fill=True, expand=True)
|
||||
self._bars = {0: main_bar}
|
||||
self._set_resize_grip()
|
||||
|
||||
@@ -123,18 +115,6 @@ class Statusbar(gtk.HBox):
|
||||
|
||||
bar.set_has_resize_grip(self.get_property('has-resize-grip'))
|
||||
|
||||
def _set_packing(self):
|
||||
"""Set packing style of the statusbars.
|
||||
|
||||
All bars are packed with "expand"=True, "fill"=True parameters,
|
||||
except the last one, which is packed with "expand"=False, "fill"=False.
|
||||
|
||||
"""
|
||||
for bar in self.get_children():
|
||||
self.set_child_packing(bar, True, True, 0, gtk.PACK_START)
|
||||
|
||||
self.set_child_packing(bar, False, False, 0, gtk.PACK_START)
|
||||
|
||||
def _get_next_id(self):
|
||||
"""Get next unused statusbar id.
|
||||
"""
|
||||
@@ -146,7 +126,7 @@ class Statusbar(gtk.HBox):
|
||||
|
||||
# Public API
|
||||
|
||||
def insert(self, index=-1, min_width=30, ralign=False):
|
||||
def insert(self, index=-1, min_width=None, ralign=False):
|
||||
"""Insert a new statusbar.
|
||||
|
||||
Create a new statusbar and insert it at the given index. Index starts
|
||||
@@ -155,12 +135,10 @@ class Statusbar(gtk.HBox):
|
||||
|
||||
"""
|
||||
new_bar = gtk.Statusbar()
|
||||
new_bar.set_size_request(min_width*self._char_width, -1)
|
||||
new_bar.show()
|
||||
self.pack_start(new_bar)
|
||||
self.pack_start(new_bar, fill=True, expand=True)
|
||||
self.reorder_child(new_bar, index)
|
||||
self._set_resize_grip()
|
||||
self._set_packing()
|
||||
|
||||
if ralign:
|
||||
frame = new_bar.get_children()[0]
|
||||
@@ -196,7 +174,8 @@ class Statusbar(gtk.HBox):
|
||||
programming fault.
|
||||
|
||||
"""
|
||||
return self._bars[bar_id].push(context_id, text)
|
||||
# HACK: add an extra space so grip doesn't overlap
|
||||
return self._bars[bar_id].push(context_id, text + " ")
|
||||
|
||||
def pop(self, context_id, bar_id=0):
|
||||
"""Remove the top message from a statusbar's stack.
|
||||
@@ -244,16 +223,16 @@ def main(args):
|
||||
statusbar = Statusbar()
|
||||
vbox.pack_end(statusbar, False)
|
||||
|
||||
statusbar.push(1, "This is my statusbar...")
|
||||
statusbar.push(1, "My statusbar")
|
||||
|
||||
my_statusbar = statusbar.insert(min_width=24)
|
||||
statusbar.push(1, "Testing status bar width", my_statusbar)
|
||||
my_statusbar = statusbar.insert()
|
||||
statusbar.push(1, "Testing width", my_statusbar)
|
||||
|
||||
yet_another_statusbar = statusbar.insert(1, 11)
|
||||
yet_another_statusbar = statusbar.insert()
|
||||
statusbar.push(1, "A short one", yet_another_statusbar)
|
||||
|
||||
last_statusbar = statusbar.insert(min_width=41, ralign=True)
|
||||
statusbar.push(1, "The last statusbar has always fixed width",
|
||||
last_statusbar = statusbar.insert(ralign=True)
|
||||
statusbar.push(1, "The last statusbar",
|
||||
last_statusbar)
|
||||
|
||||
win.show_all()
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id: $
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
gtk textbuffer with undo functionality
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id: validatedmaskedentry.py 14091 2010-01-18 04:42:17Z pez4brian $
|
||||
# $Id$
|
||||
|
||||
__all__ = ["UndoableEntry"]
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id: $
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
gtk textbuffer with undo functionality
|
||||
|
||||
Reference in New Issue
Block a user