2007-03-18 Don Allingham <don@gramps-project.org>

* src/ViewManager.py: use tooltips for buttons when text disabled (bug 959)
	* src/Editors/_EditSourceRef.py: fix help button (bug 960),  delete the cancel
	on the comment tab.
	* src/Editors/_EditReference.py: make sure help button is sensitive if used.
	* src/GrampsDbUtils/_GedcomParse.py: check for UTF16 BOM
	* src/ArgHandler.py: use STOCK_NEW for create of db (bug 947)
	* src/DbLoader.py: use STOCK_NEW for create of db (bug 947)



svn: r8304
This commit is contained in:
Don Allingham 2007-03-19 04:19:49 +00:00
parent 69180989ef
commit 0d778ae075
7 changed files with 25 additions and 11 deletions

View File

@ -1,3 +1,12 @@
2007-03-18 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: use tooltips for buttons when text disabled (bug 959)
* src/Editors/_EditSourceRef.py: fix help button (bug 960), delete the cancel
on the comment tab.
* src/Editors/_EditReference.py: make sure help button is sensitive if used.
* src/GrampsDbUtils/_GedcomParse.py: check for UTF16 BOM
* src/ArgHandler.py: use STOCK_NEW for create of db (bug 947)
* src/DbLoader.py: use STOCK_NEW for create of db (bug 947)
2007-03-17 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/Editors/_EditPlace.py: better tooltip for coordinates; fix position
of those tooltip.

View File

@ -722,7 +722,7 @@ class NewNativeDbPrompter:
gtk.FILE_CHOOSER_ACTION_SAVE,
(gtk.STOCK_CANCEL,
gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,
gtk.STOCK_NEW,
gtk.RESPONSE_OK))
self.state.db.close()

View File

@ -142,7 +142,7 @@ class DbLoader:
self.uistate.window,
gtk.FILE_CHOOSER_ACTION_SAVE,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK))
gtk.STOCK_NEW, gtk.RESPONSE_OK))
# Always add automatic (macth all files) filter
add_all_files_filter(choose)

View File

@ -134,9 +134,10 @@ class EditReference(ManagedWindow.ManagedWindow):
self._cleanup_on_exit()
self.close(obj)
def define_help_button(self,button,tag):
def define_help_button(self, button, tag):
import GrampsDisplay
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
button.set_sensitive(True)
def _cleanup_on_exit(self):
pass

View File

@ -72,15 +72,8 @@ class EditSourceRef(EditReference):
def _connect_signals(self):
self.define_ok_button(self.top.get_widget('ok'),self.ok_clicked)
self.define_cancel_button(self.top.get_widget('cancel'))
self.define_help_button(self.top.get_widget("help"), 'adv-si')
def _cleanup_on_exit(self):
# FIXME: the second call was causing the problem, as it was
# re-setting the whole sref to its original state.
# that problem is fixed, but _cleanup_on_exit SHOULD NOT be run
# in close(), because close() is called on OK.
# Until this is fixed, notes, text and comments are not saved!!!
self.comment_tab.cancel()
def _setup_fields(self):
self.ref_privacy = PrivacyButton(
self.top.get_widget('privacy'), self.source_ref, self.db.readonly)

View File

@ -143,6 +143,9 @@ ADDR3_RE = re.compile('(.+)([\n\r]+)(.+)\s*,(.+)')
TRUNC_MSG = _("Your GEDCOM file is corrupted. "
"It appears to have been truncated.")
BAD_UTF16 = _("Your GEDCOM file is corrupted. "
"The file appears to be encoded using the UTF16 "
"character set, but is missing the BOM marker.")
#-------------------------------------------------------------------------
#
@ -255,6 +258,8 @@ class StageOne:
self.enc = "UTF16"
self.ifile.seek(0)
self.reader = codecs.EncodedFile(self.ifile, 'utf8', 'utf16')
elif line[0] == "\x00" or line[1] == "\x00":
raise Errors.GedcomError(BAD_UTF16)
else:
self.ifile.seek(0)
self.reader = self.ifile

View File

@ -205,6 +205,7 @@ class ViewManager:
self.active_page = None
self.views = []
self.pages = []
self.tips = gtk.Tooltips()
self._key = None
self.file_loaded = False
self._build_main_window()
@ -747,6 +748,10 @@ class ViewManager:
self.prev_nav = PageView.NAVIGATION_NONE
use_text = Config.get(Config.SIDEBAR_TEXT)
if use_text:
self.tips.disable()
else:
self.tips.enable()
index = 0
for page_def in self.views:
@ -776,6 +781,7 @@ class ViewManager:
# create the button and add it to the sidebar
button = gtk.ToggleButton()
self.tips.set_tip(button, page_title)
hbox = gtk.HBox()
hbox.show()
image = gtk.Image()