* src/EditPlace.py: WATCH cursor and temp label for References tab.

* src/EditSource.py: Improve manipulating notebook tab labels.
* src/Utils.py (temp_label): Add function;
(bold_label,unbold_label): Properly set cursor to default.
* src/gramps.glade (event editor, source editor, place editor):
Add icons to notebook tabs.


svn: r4683
This commit is contained in:
Alex Roitman
2005-05-26 05:04:36 +00:00
parent d2a89b0f89
commit 25c9f77a18
5 changed files with 570 additions and 2493 deletions

View File

@ -34,6 +34,7 @@ import locale
#
#-------------------------------------------------------------------------
import gtk
import gtk.gdk
import gnome
try:
@ -402,33 +403,40 @@ def search_for(name):
# Change label apperance
#
#-------------------------------------------------------------------------
def bold_label(label):
try:
clist = label.get_children()
text = unicode(clist[1].get_text())
clist[0].show()
clist[1].set_text("<b>%s</b>" % text )
clist[1].set_use_markup(True)
except AttributeError:
text = unicode(label.get_text())
label.set_text("<b>%s</b>" % text )
label.set_use_markup(1)
def bold_label(label,widget=None):
clist = label.get_children()
text = unicode(clist[1].get_text())
text = text.replace('<i>','')
text = text.replace('</i>','')
clist[0].show()
clist[1].set_text("<b>%s</b>" % text )
clist[1].set_use_markup(True)
if widget:
widget.window.set_cursor(None)
def unbold_label(label,widget=None):
clist = label.get_children()
text = unicode(clist[1].get_text())
text = text.replace('<b>','')
text = text.replace('</b>','')
text = text.replace('<i>','')
text = text.replace('</i>','')
clist[0].hide()
clist[1].set_text(text)
clist[1].set_use_markup(False)
if widget:
widget.window.set_cursor(None)
def unbold_label(label):
try:
clist = label.get_children()
text = unicode(clist[1].get_text())
text = text.replace('<b>','')
text = text.replace('</b>','')
clist[0].hide()
clist[1].set_text(text)
clist[1].set_use_markup(False)
except AttributeError:
text = unicode(label.get_text())
text = text.replace('<b>','')
text = text.replace('</b>','')
label.set_text(text)
label.set_use_markup(0)
def temp_label(label,widget=None):
clist = label.get_children()
text = unicode(clist[1].get_text())
text = text.replace('<b>','')
text = text.replace('</b>','')
clist[0].hide()
clist[1].set_text("<i>%s</i>" % text )
clist[1].set_use_markup(True)
if widget:
widget.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
#-------------------------------------------------------------------------
#