* src/gramps_main.py (undo_callback,redo_callback): Minor

improvements, (read_file): Always re-initialize Undo and Redo items
to insensitive blanks after new database load; (post_load): Set up
database's callbacks for Undo and Redo after load.
* src/gramps.glade: Make Redo label non-stock to allow label change.


svn: r4253
This commit is contained in:
Alex Roitman 2005-03-29 19:47:59 +00:00
parent a1ede6bcfb
commit c25d2162ed
3 changed files with 62 additions and 43 deletions

View File

@ -4,6 +4,12 @@
* src/gramps_main.py (delete_person_response): Object/handle mixups,
remove unneeded commits.
* src/gramps_main.py (undo_callback,redo_callback): Minor
improvements, (read_file): Always re-initialize Undo and Redo items
to insensitive blanks after new database load; (post_load): Set up
database's callbacks for Undo and Redo after load.
* src/gramps.glade: Make Redo label non-stock to allow label change.
2005-03-29 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* src/plugins/ScratchPad.py (on_object_select_row): fixed the drop of
text into TextView widgets.

View File

@ -56,7 +56,7 @@
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2473">
<widget class="GtkImage" id="image2533">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@ -78,7 +78,7 @@
<accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2474">
<widget class="GtkImage" id="image2534">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
@ -115,7 +115,7 @@
<accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2475">
<widget class="GtkImage" id="image2535">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
@ -137,7 +137,7 @@
<accelerator key="S" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2476">
<widget class="GtkImage" id="image2536">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
<property name="icon_size">1</property>
@ -159,7 +159,7 @@
<accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2477">
<widget class="GtkImage" id="image2537">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
<property name="icon_size">1</property>
@ -196,7 +196,7 @@
<accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2478">
<widget class="GtkImage" id="image2538">
<property name="visible">True</property>
<property name="stock">gtk-quit</property>
<property name="icon_size">1</property>
@ -231,7 +231,7 @@
<accelerator key="z" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2479">
<widget class="GtkImage" id="image2539">
<property name="visible">True</property>
<property name="stock">gtk-undo</property>
<property name="icon_size">1</property>
@ -247,8 +247,22 @@
<child>
<widget class="GtkImageMenuItem" id="redolabel">
<property name="visible">True</property>
<property name="stock_item">GNOMEUIINFO_MENU_REDO_ITEM</property>
<signal name="activate" handler="on_redo1_activate" last_modification_time="Sun, 25 Apr 2004 05:57:09 GMT"/>
<property name="label" translatable="yes">_Redo</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_redo_activate" last_modification_time="Tue, 18 May 2004 14:34:56 GMT"/>
<accelerator key="z" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2540">
<property name="visible">True</property>
<property name="stock">gtk-redo</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
@ -268,7 +282,7 @@
<accelerator key="Insert" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2480">
<widget class="GtkImage" id="image2541">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@ -291,7 +305,7 @@
<accelerator key="Delete" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2481">
<widget class="GtkImage" id="image2542">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
@ -329,7 +343,7 @@
<accelerator key="M" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2482">
<widget class="GtkImage" id="image2543">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
@ -356,7 +370,7 @@
<signal name="activate" handler="on_preferences1_activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2483">
<widget class="GtkImage" id="image2544">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@ -377,7 +391,7 @@
<signal name="activate" handler="on_column_order_activate" last_modification_time="Wed, 10 Mar 2004 04:36:07 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image2484">
<widget class="GtkImage" id="image2545">
<property name="visible">True</property>
<property name="stock">gtk-properties</property>
<property name="icon_size">1</property>
@ -398,7 +412,7 @@
<signal name="activate" handler="on_default_person_activate" last_modification_time="Sat, 16 Aug 2003 01:58:26 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image2485">
<widget class="GtkImage" id="image2546">
<property name="visible">True</property>
<property name="stock">gtk-home</property>
<property name="icon_size">1</property>
@ -484,7 +498,7 @@
<accelerator key="D" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2486">
<widget class="GtkImage" id="image2547">
<property name="visible">True</property>
<property name="stock">gtk-index</property>
<property name="icon_size">1</property>
@ -506,7 +520,7 @@
<accelerator key="B" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2487">
<widget class="GtkImage" id="image2548">
<property name="visible">True</property>
<property name="stock">gnome-stock-book-open</property>
<property name="icon_size">1</property>
@ -579,7 +593,7 @@
<accelerator key="F1" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2488">
<widget class="GtkImage" id="image2549">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
<property name="icon_size">1</property>
@ -600,7 +614,7 @@
<signal name="activate" handler="on_faq_activate" last_modification_time="Wed, 26 Nov 2003 17:59:23 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image2489">
<widget class="GtkImage" id="image2550">
<property name="visible">True</property>
<property name="stock">gnome-stock-book-open</property>
<property name="icon_size">1</property>
@ -627,7 +641,7 @@
<signal name="activate" handler="on_gramps_home_page_activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2490">
<widget class="GtkImage" id="image2551">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
<property name="icon_size">1</property>
@ -648,7 +662,7 @@
<signal name="activate" handler="on_gramps_mailing_lists_activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image2491">
<widget class="GtkImage" id="image2552">
<property name="visible">True</property>
<property name="stock">gnome-stock-mail</property>
<property name="icon_size">1</property>
@ -702,7 +716,7 @@
<signal name="activate" handler="on_about_activate" last_modification_time="Tue, 01 Apr 2003 03:44:24 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image2492">
<widget class="GtkImage" id="image2553">
<property name="visible">True</property>
<property name="stock">gnome-stock-about</property>
<property name="icon_size">1</property>

View File

@ -296,9 +296,6 @@ class Gramps:
self.redolabel = self.gtop.get_widget('redolabel')
self.open_recent = self.gtop.get_widget('open_recent1')
self.db.set_undo_callback(self.undo_callback)
self.db.set_redo_callback(self.redo_callback)
self.child_model = gtk.ListStore(
gobject.TYPE_INT, gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,
@ -477,25 +474,22 @@ class Gramps:
self.build_recent_menu()
def undo_callback(self,text):
if text == None:
self.undolabel.set_sensitive(0)
self.undolabel.get_children()[0].set_text(_("_Undo"))
self.undolabel.get_children()[0].set_use_underline(1)
else:
self.undolabel.set_sensitive(1)
label = self.undolabel.get_children()[0]
self.undolabel.set_sensitive(bool(text))
label = self.undolabel.get_children()[0]
if text:
label.set_text(text)
label.set_use_underline(1)
else:
label.set_text(_("_Undo"))
label.set_use_underline(1)
def redo_callback(self,text):
if text == None:
self.redolabel.set_sensitive(0)
self.redolabel.get_children()[0].set_text(_("_Redo"))
else:
self.redolabel.set_sensitive(1)
label = self.redolabel.get_children()[0]
self.redolabel.set_sensitive(bool(text))
label = self.redolabel.get_children()[0]
if text:
label.set_text(text)
label.set_use_underline(1)
else:
label.set_text(_("_Redo"))
label.set_use_underline(1)
def undo(self,*args):
self.db.undo()
@ -1211,12 +1205,13 @@ class Gramps:
_('%s could not be opened.' % filename) + '\n' + msg[1])
return 0
self.topWindow.set_resizable(True)
# Undo/Redo always start with standard labels and insensitive state
self.undo_callback(None)
self.redo_callback(None)
# The rest depends on readonly-ness of the database
self.gtop.get_widget('import1').set_sensitive(not self.db.readonly)
self.gtop.get_widget('abandon').set_sensitive(not self.db.readonly)
self.gtop.get_widget('undolabel').set_sensitive(not self.db.readonly)
self.gtop.get_widget('redolabel').set_sensitive(not self.db.readonly)
self.gtop.get_widget('add_item').set_sensitive(not self.db.readonly)
self.gtop.get_widget('remove_item').set_sensitive(not self.db.readonly)
self.gtop.get_widget('merge').set_sensitive(not self.db.readonly)
@ -1686,6 +1681,10 @@ class Gramps:
self.db.set_researcher(owner)
self.setup_bookmarks()
self.db.set_undo_callback(self.undo_callback)
self.db.set_redo_callback(self.redo_callback)
if self.db.need_upgrade():
if callback:
callback(_('Upgrading database...'))