* 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:
parent
06913ac261
commit
d9c8ebef56
@ -1,3 +1,11 @@
|
||||
2005-05-25 Alex Roitman <shura@gramps-project.org>
|
||||
* 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.
|
||||
|
||||
2005-05-25 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
||||
* src/plugins/ScratchPad.py: disabled search because it does not do
|
||||
what the user expects.
|
||||
|
@ -182,12 +182,16 @@ class EditPlace:
|
||||
self.preform.set_active(1)
|
||||
else:
|
||||
self.flowed.set_active(1)
|
||||
else:
|
||||
Utils.unbold_label(self.notes_label)
|
||||
|
||||
self.flowed.set_sensitive(mode)
|
||||
self.preform.set_sensitive(mode)
|
||||
|
||||
if self.place.get_media_list():
|
||||
Utils.bold_label(self.gallery_label)
|
||||
else:
|
||||
Utils.unbold_label(self.gallery_label)
|
||||
|
||||
self.top_window.signal_autoconnect({
|
||||
"on_switch_page" : self.on_switch_page,
|
||||
@ -237,12 +241,13 @@ class EditPlace:
|
||||
|
||||
self.redraw_url_list()
|
||||
self.redraw_location_list()
|
||||
self.display_references()
|
||||
if parent_window:
|
||||
self.top.set_transient_for(parent_window)
|
||||
self.add_itself_to_menu()
|
||||
self.top_window.get_widget('ok').set_sensitive(not self.db.readonly)
|
||||
Utils.temp_label(self.refs_label,self.top)
|
||||
self.top.show()
|
||||
gobject.idle_add(self.display_references)
|
||||
|
||||
def on_delete_event(self,obj,b):
|
||||
self.glry.close()
|
||||
@ -407,7 +412,8 @@ class EditPlace:
|
||||
self.glry.load_images()
|
||||
elif page == 6 and self.ref_not_loaded:
|
||||
self.ref_not_loaded = 0
|
||||
self.display_references()
|
||||
Utils.temp_label(self.refs_label,self.top)
|
||||
gobject.idle_add(self.display_references)
|
||||
text = unicode(self.note_buffer.get_text(self.note_buffer.get_start_iter(),
|
||||
self.note_buffer.get_end_iter(),False))
|
||||
if text:
|
||||
@ -544,7 +550,9 @@ class EditPlace:
|
||||
|
||||
self.refinfo.get_buffer().set_text(msg)
|
||||
if any:
|
||||
Utils.bold_label(self.refs_label)
|
||||
Utils.bold_label(self.refs_label,self.top)
|
||||
else:
|
||||
Utils.unbold_label(self.refs_label,self.top)
|
||||
|
||||
self.ref_not_loaded = 0
|
||||
|
||||
|
@ -34,7 +34,6 @@ from gettext import gettext as _
|
||||
#-------------------------------------------------------------------------
|
||||
import gobject
|
||||
import gtk.glade
|
||||
import gtk.gdk
|
||||
import gnome
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -96,9 +95,10 @@ class EditSource:
|
||||
self.note = self.top_window.get_widget("source_note")
|
||||
self.note.set_editable(mode)
|
||||
self.notes_buffer = self.note.get_buffer()
|
||||
self.gallery_label = self.top_window.get_widget("gallerySourceEditor")
|
||||
self.refs_label = self.top_window.get_widget("refsSourceEditor")
|
||||
self.notes_label = self.top_window.get_widget("notesSourceEditor")
|
||||
self.gallery_label = self.top_window.get_widget("source_edit_gallery")
|
||||
self.refs_label = self.top_window.get_widget("source_edit_refs")
|
||||
self.notes_label = self.top_window.get_widget("source_edit_notes")
|
||||
self.data_label = self.top_window.get_widget("source_edit_data")
|
||||
self.flowed = self.top_window.get_widget("source_flowed")
|
||||
self.flowed.set_sensitive(mode)
|
||||
self.preform = self.top_window.get_widget("source_preform")
|
||||
@ -129,9 +129,13 @@ class EditSource:
|
||||
self.preform.set_active(1)
|
||||
else:
|
||||
self.flowed.set_active(1)
|
||||
else:
|
||||
Utils.unbold_label(self.notes_label)
|
||||
|
||||
if self.source.get_media_list():
|
||||
Utils.bold_label(self.gallery_label)
|
||||
else:
|
||||
Utils.unbold_label(self.gallery_label)
|
||||
|
||||
self.top_window.signal_autoconnect({
|
||||
"on_switch_page" : self.on_switch_page,
|
||||
@ -177,6 +181,11 @@ class EditSource:
|
||||
for item in dmap.keys():
|
||||
self.data_model.append(row=[item,dmap[item]])
|
||||
|
||||
if dmap:
|
||||
Utils.bold_label(self.data_label)
|
||||
else:
|
||||
Utils.unbold_label(self.data_label)
|
||||
|
||||
if parent_window:
|
||||
self.top.set_transient_for(parent_window)
|
||||
|
||||
@ -186,7 +195,7 @@ class EditSource:
|
||||
self.top.set_transient_for(parent_window)
|
||||
self.add_itself_to_menu()
|
||||
self.top.show()
|
||||
self.refs_label.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
Utils.temp_label(self.refs_label,self.top)
|
||||
gobject.idle_add(self.display_references)
|
||||
self.data_sel = self.datalist.get_selection()
|
||||
|
||||
@ -346,12 +355,11 @@ class EditSource:
|
||||
self.model.add([_("Media"),gramps_id,name],(5,handle))
|
||||
|
||||
if any:
|
||||
Utils.bold_label(self.refs_label)
|
||||
Utils.bold_label(self.refs_label,self.top)
|
||||
else:
|
||||
Utils.unbold_label(self.refs_label)
|
||||
Utils.unbold_label(self.refs_label,self.top)
|
||||
|
||||
self.ref_not_loaded = 0
|
||||
self.refs_label.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR))
|
||||
|
||||
def on_source_apply_clicked(self,obj):
|
||||
|
||||
@ -407,14 +415,14 @@ class EditSource:
|
||||
self.gallery.load_images()
|
||||
elif page == 3 and self.ref_not_loaded:
|
||||
self.ref_not_loaded = 0
|
||||
self.refs_label.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
gobject.idle_add(self.display_references)
|
||||
Utils.temp_label(self.refs_label,self.top)
|
||||
gobject.idle_add(display_references)
|
||||
text = unicode(self.notes_buffer.get_text(self.notes_buffer.get_start_iter(),
|
||||
self.notes_buffer.get_end_iter(),False))
|
||||
if text:
|
||||
Utils.bold_label(self.notes_label)
|
||||
Utils.bold_label(self.notes_label,self.top)
|
||||
else:
|
||||
Utils.unbold_label(self.notes_label)
|
||||
Utils.unbold_label(self.notes_label,self.top)
|
||||
|
||||
|
||||
class DelSrcQuery:
|
||||
|
@ -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))
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user