From 5c754506e0b40ba43a23464666a78509e09b6442 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Thu, 16 Aug 2012 20:20:52 +0000 Subject: [PATCH] Gtk3 conversion fixes for editors svn: r20225 --- src/gui/editors/editaddress.py | 2 +- src/gui/editors/editattribute.py | 2 +- src/gui/editors/editldsord.py | 4 ++-- src/gui/editors/editmedia.py | 1 + src/gui/editors/editname.py | 3 ++- src/gui/editors/editpersonref.py | 2 +- src/gui/widgets/styledtexteditor.py | 14 +++++++------- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/gui/editors/editaddress.py b/src/gui/editors/editaddress.py index 39af6cc7e..fb2d73985 100644 --- a/src/gui/editors/editaddress.py +++ b/src/gui/editors/editaddress.py @@ -150,7 +150,7 @@ class EditAddress(EditSecondary): self._setup_notebook_tabs( notebook) notebook.show_all() - self.top.get_object('vbox').pack_start(notebook,True) + self.top.get_object('vbox').pack_start(notebook, True, True, 0) def build_menu_names(self, obj): return (_('Address'),_('Address Editor')) diff --git a/src/gui/editors/editattribute.py b/src/gui/editors/editattribute.py index fa70e296f..5254b1aa3 100644 --- a/src/gui/editors/editattribute.py +++ b/src/gui/editors/editattribute.py @@ -123,7 +123,7 @@ class EditAttribute(EditSecondary): self._setup_notebook_tabs( notebook) notebook.show_all() - self.top.get_object('vbox').pack_start(notebook,True) + self.top.get_object('vbox').pack_start(notebook, True, True, 0) def build_menu_names(self, attrib): if not attrib: diff --git a/src/gui/editors/editldsord.py b/src/gui/editors/editldsord.py index bdc34c3e4..55cdc93e6 100644 --- a/src/gui/editors/editldsord.py +++ b/src/gui/editors/editldsord.py @@ -254,7 +254,7 @@ class EditLdsOrd(EditSecondary): self._setup_notebook_tabs( notebook) notebook.show_all() - self.top.get_object('vbox').pack_start(notebook,True) + self.top.get_object('vbox').pack_start(notebook, True, True, 0) def select_parents_clicked(self, obj): SelectFamily = SelectorFactory('Family') @@ -419,7 +419,7 @@ class EditFamilyLdsOrd(EditSecondary): self.track_ref_for_deletion("note_tab") notebook.show_all() - self.top.get_object('vbox').pack_start(notebook,True) + self.top.get_object('vbox').pack_start(notebook, True, True, 0) def build_menu_names(self, attrib): label = _("LDS Ordinance") diff --git a/src/gui/editors/editmedia.py b/src/gui/editors/editmedia.py index 376494480..79de8f6d1 100644 --- a/src/gui/editors/editmedia.py +++ b/src/gui/editors/editmedia.py @@ -36,6 +36,7 @@ from gen.ggettext import gettext as _ # #------------------------------------------------------------------------- from gi.repository import Gtk +from gi.repository import Gdk #------------------------------------------------------------------------- # diff --git a/src/gui/editors/editname.py b/src/gui/editors/editname.py index ba53d9f0e..8f033a681 100644 --- a/src/gui/editors/editname.py +++ b/src/gui/editors/editname.py @@ -124,7 +124,8 @@ class EditName(EditSecondary): hbox_surn.set_size_request(-1, int(config.get('interface.surname-box-height'))) hbox_surn.pack_start(SurnameTab(self.dbstate, self.uistate, self.track, - self.obj, top_label=None)) + self.obj, top_label=None), + True, True, 0) #recreate start page as GrampsTab notebook.remove_page(0) self.gennam = GeneralNameTab(self.dbstate, self.uistate, self.track, diff --git a/src/gui/editors/editpersonref.py b/src/gui/editors/editpersonref.py index a95c152cc..5478ad6f3 100644 --- a/src/gui/editors/editpersonref.py +++ b/src/gui/editors/editpersonref.py @@ -156,7 +156,7 @@ class EditPersonRef(EditSecondary): self._setup_notebook_tabs(notebook) notebook.show_all() - self.top.get_object('vbox').pack_start(notebook, True) + self.top.get_object('vbox').pack_start(notebook, True, True, 0) def build_menu_names(self, obj): return (_('Person Reference'),_('Person Reference Editor')) diff --git a/src/gui/widgets/styledtexteditor.py b/src/gui/widgets/styledtexteditor.py index c782f75a2..b5df28ae2 100644 --- a/src/gui/widgets/styledtexteditor.py +++ b/src/gui/widgets/styledtexteditor.py @@ -636,22 +636,22 @@ class StyledTextEditor(Gtk.TextView): current_value = self.textbuffer.get_style_at_cursor(style) if style == StyledTextTagType.FONTCOLOR: - color_selection = Gtk.ColorSelectionDialog(_("Select font color")) + color_dialog = Gtk.ColorSelectionDialog(_("Select font color")) elif style == StyledTextTagType.HIGHLIGHT: - color_selection = Gtk.ColorSelectionDialog(_("Select " + color_dialog = Gtk.ColorSelectionDialog(_("Select " "background color")) else: _LOG.debug("unknown style: '%d'" % style) return + color_selection = color_dialog.get_color_selection() if current_value: - color_selection.colorsel.set_current_color( - hex_to_color(current_value)) + color_selection.set_current_color(hex_to_color(current_value)) - response = color_selection.run() - color = color_selection.colorsel.get_current_color() + response = color_dialog.run() + color = color_selection.get_current_color() value = color_to_hex(color) - color_selection.destroy() + color_dialog.destroy() if response == Gtk.ResponseType.OK: _LOG.debug("applying style '%d' with value '%s'" %