* src/EditPerson.py: handle the new "dont-ask" key

* src/GrampsGconfKeys.py: handle the new "dont-ask" key
* src/ImageSelect.py: remove debugging statements
* src/Marriage.py: handle the new "dont-ask" key
* src/QuestionDialog.py: handle the new "dont-ask" key
* src/gramps.glade: added "dont ask" button to SaveDialog
to turn off the nagging
* src/data/gramps.schemas: added the "dont-ask" key


svn: r3721
This commit is contained in:
Don Allingham 2004-11-11 04:28:40 +00:00
parent 2d0da3a34c
commit c5247c4d02
8 changed files with 61 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2004-11-10 Don Allingham <dallingham@users.sourceforge.net>
* src/EditPerson.py: handle the new "dont-ask" key
* src/GrampsGconfKeys.py: handle the new "dont-ask" key
* src/ImageSelect.py: remove debugging statements
* src/Marriage.py: handle the new "dont-ask" key
* src/QuestionDialog.py: handle the new "dont-ask" key
* src/gramps.glade: added "dont ask" button to SaveDialog
to turn off the nagging
* src/data/gramps.schemas: added the "dont-ask" key
2004-11-09 Don Allingham <dallingham@users.sourceforge.net>
* src/gramps_main.py: fix goto_active_person
* src/DateParser.py: Handle month=12 in gregorian_valid

View File

@ -1070,7 +1070,8 @@ class EditPerson:
def on_cancel_edit(self,obj):
"""If the data has changed, give the user a chance to cancel
the close window"""
if self.did_data_change():
if self.did_data_change() and not GrampsGconfKeys.get_dont_ask():
n = "<i>%s</i>" % self.person.get_primary_name().get_regular_name()
SaveDialog(_('Save changes to %s?') % n,
_('If you close without saving, the changes you '
@ -1086,7 +1087,7 @@ class EditPerson:
def on_delete_event(self,obj,b):
"""If the data has changed, give the user a chance to cancel
the close window"""
if self.did_data_change():
if self.did_data_change() and not GrampsGconfKeys.get_dont_ask():
n = "<i>%s</i>" % self.person.get_primary_name().get_regular_name()
SaveDialog(_('Save Changes to %s?') % n,
_('If you close without saving, the changes you '

View File

@ -70,6 +70,12 @@ def get_filter():
def save_filter(val):
set_bool("/apps/gramps/interface/filter",val)
def get_dont_ask():
return get_bool("/apps/gramps/interface/dont-ask")
def save_dont_ask(val):
set_bool("/apps/gramps/interface/dont-ask",val)
def get_index_visible():
return get_bool("/apps/gramps/interface/index-visible")

View File

@ -353,11 +353,9 @@ class Gallery(ImageSelect):
def savephoto(self, photo):
"""Save the photo in the dataobj object. (Required function)"""
print "In save photo"
self.db.add_object(photo,None)
oref = RelLib.MediaRef()
oref.set_reference_handle(photo.get_handle())
print photo.get_handle(), photo.get_path()
self.db.set_thumbnail_image(photo.get_handle(),photo.get_path())
self.dataobj.add_media_reference(oref)

View File

@ -48,6 +48,7 @@ import RelLib
import ImageSelect
import DateHandler
import Sources
import GrampsGconfKeys
from QuestionDialog import QuestionDialog, WarningDialog, SaveDialog
from gettext import gettext as _
@ -555,7 +556,7 @@ class Marriage:
self.close(0)
def on_cancel_edit(self,obj):
if self.did_data_change():
if self.did_data_change() and not GrampsGconfKeys.get_dont_ask():
global quit
self.quit = obj
SaveDialog(_('Save Changes?'),

View File

@ -21,6 +21,7 @@
import gtk
import gtk.glade
import const
import GrampsGconfKeys
from gettext import gettext as _
@ -28,6 +29,7 @@ class SaveDialog:
def __init__(self,msg1,msg2,task1,task2,parent=None):
self.xml = gtk.glade.XML(const.errdialogsFile,"savedialog","gramps")
self.top = self.xml.get_widget('savedialog')
self.dontask = self.xml.get_widget('dontask')
self.task1 = task1
self.task2 = task2
@ -47,6 +49,8 @@ class SaveDialog:
self.task1()
elif response == gtk.RESPONSE_YES:
self.task2()
GrampsGconfKeys.save_dont_ask(self.dontask.get_active())
self.top.destroy()
class QuestionDialog:

View File

@ -42,6 +42,19 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/preferences/dont-ask</key>
<applyto>/apps/gramps/preferences/dont-ask</applyto>
<owner>gramps</owner>
<type>bool</type>
<default>0</default>
<locale name="C">
<short>Do not prompt on save</short>
<long>This key disables prompting when data has changed
and the Cancel button has been pressed.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/defaultview</key>
<applyto>/apps/gramps/interface/defaultview</applyto>

View File

@ -25121,7 +25121,7 @@ Other</property>
<widget class="GtkTable" id="table2">
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
@ -25194,6 +25194,28 @@ Other</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="dontask">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Do not ask again</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</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>
</widget>
<packing>
<property name="padding">0</property>