diff --git a/gramps/gen/utils/configmanager.py b/gramps/gen/utils/configmanager.py
index c168d7617..05a14dc54 100644
--- a/gramps/gen/utils/configmanager.py
+++ b/gramps/gen/utils/configmanager.py
@@ -327,33 +327,29 @@ class ConfigManager:
filename = self.filename
if filename:
try:
- head = os.path.split( filename )[0]
- os.makedirs( head )
+ head = os.path.split(filename)[0]
+ os.makedirs(head)
except OSError as exp:
if exp.errno != errno.EEXIST:
raise
try:
with open(filename, "w", encoding="utf-8") as key_file:
key_file.write(";; Gramps key file\n")
- key_file.write((";; Automatically created at %s" %
- time.strftime("%Y/%m/%d %H:%M:%S")) + "\n\n")
- sections = sorted(self.data)
- for section in sections:
- key_file.write(("[%s]\n") % section)
- keys = sorted(self.data[section])
- for key in keys:
+ key_file.write(";; Automatically created at %s" %
+ time.strftime("%Y/%m/%d %H:%M:%S") + "\n\n")
+ for section in sorted(self.data):
+ key_file.write("[%s]\n" % section)
+ for key in sorted(self.data[section]):
value = self.data[section][key]
- # If it has a default:
+ default = "" # might be a third-party setting
if self.has_default("%s.%s" % (section, key)):
- if value == self.get_default("%s.%s" % (section, key)):
+ if value == self.get_default("%s.%s"
+ % (section, key)):
default = ";;"
- else:
- default = ""
- if isinstance(value, int):
- value = int(value)
- key_file.write(("%s%s=%s\n")% (default,
- key,
- repr(value)))
+ if isinstance(value, int):
+ value = int(value) # TODO why is this needed?
+ key_file.write("%s%s=%s\n" % (default, key,
+ repr(value)))
key_file.write("\n")
# else, no filename given; nothing to save so do nothing quietly
except IOError as err:
diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py
index 2d8afcc6b..a5b842f2e 100644
--- a/gramps/gui/managedwindow.py
+++ b/gramps/gui/managedwindow.py
@@ -545,8 +545,8 @@ class ManagedWindow:
Takes care of closing children and removing itself from menu.
"""
+ self._save_position(save_config=False) # the next line will save it
self._save_size()
- self._save_position()
self.clean_up()
self.uistate.gwm.close_track(self.track)
self.opened = False
@@ -596,16 +596,19 @@ class ManagedWindow:
vert_position = config.get(self.vert_position_key)
self.window.move(horiz_position, vert_position)
- def _save_position(self):
+ def _save_position(self, save_config=True):
"""
Save the window's position to the config file
+
+ (You can set save_config False if a _save_size() will instantly follow)
"""
# self.horiz_position_key is set in the subclass (or in setup_configs)
if self.horiz_position_key is not None:
(horiz_position, vert_position) = self.window.get_position()
config.set(self.horiz_position_key, horiz_position)
config.set(self.vert_position_key, vert_position)
- config.save()
+ if save_config:
+ config.save()
def setup_configs(self, config_base,
default_width, default_height,
diff --git a/gramps/gui/plug/export/_exportassistant.py b/gramps/gui/plug/export/_exportassistant.py
index d201fee37..84c60dcbf 100644
--- a/gramps/gui/plug/export/_exportassistant.py
+++ b/gramps/gui/plug/export/_exportassistant.py
@@ -79,7 +79,7 @@ _ExportAssistant_pages = {
'summary' : 5,
}
-class ExportAssistant(Gtk.Assistant, ManagedWindow) :
+class ExportAssistant(ManagedWindow, Gtk.Assistant):
"""
This class creates a GTK assistant to guide the user through the various
Save as/Export options.
@@ -120,9 +120,8 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
ManagedWindow.__init__(self, uistate, [], self.__class__, modal=True)
#set_window is present in both parent classes
- ManagedWindow.set_window(self, self, None,
- self.top_title, isWindow=True)
- self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
+ self.set_window(self, None, self.top_title, isWindow=True)
+ self.setup_configs('interface.exportassistant', 760, 500)
#set up callback method for the export plugins
self.callback = self.pulse_progressbar
@@ -155,7 +154,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
self.set_forward_page_func(self.forward_func, None)
#ManagedWindow show method
- ManagedWindow.show(self)
+ self.show()
def build_menu_names(self, obj):
"""Override ManagedWindow method."""
@@ -172,7 +171,6 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
image.set_from_file(SPLASH)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
- box.set_size_request(600, -1) # wide enough it won't have to expand
box.pack_start(image, False, False, 5)
box.pack_start(label, False, False, 5)
@@ -234,7 +232,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
def create_page_options(self):
# as we do not know yet what to show, we create an empty page
page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
- page.set_border_width(12)
+ page.set_border_width(0)
page.set_spacing(12)
page.show_all()
@@ -529,11 +527,6 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
#remember previous page for next time
self.__previous_page = page_number
- def close(self, *obj) :
- #clean up ManagedWindow menu, then destroy window, bring forward parent
- Gtk.Assistant.destroy(self)
- ManagedWindow.close(self,*obj)
-
def get_intro_text(self):
return _('Under normal circumstances, Gramps does not require you '
'to directly save your changes. All changes you make are '
@@ -622,20 +615,17 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
self.writestarted = False
def set_busy_cursor(self,value):
- """Set or unset the busy cursor while saving data.
-
- Note : self.get_window() is the Gtk.Assistant Gtk.Window, not
- a part of ManagedWindow
-
+ """
+ Set or unset the busy cursor while saving data.
"""
BUSY_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
Gdk.CursorType.WATCH)
if value:
- self.get_window().set_cursor(BUSY_CURSOR)
+ Gtk.Assistant.get_window(self).set_cursor(BUSY_CURSOR)
#self.set_sensitive(0)
else:
- self.get_window().set_cursor(None)
+ Gtk.Assistant.get_window(self).set_cursor(None)
#self.set_sensitive(1)
while Gtk.events_pending():
diff --git a/gramps/gui/plug/export/_exportoptions.py b/gramps/gui/plug/export/_exportoptions.py
index f2a119af3..ce0796393 100644
--- a/gramps/gui/plug/export/_exportoptions.py
+++ b/gramps/gui/plug/export/_exportoptions.py
@@ -275,12 +275,14 @@ class WriterOptionBox:
button.set_size_request(107, -1)
button.connect("clicked", self.show_preview_data)
button.proxy_name = proxy_name
+ colon = _(':') # translators: needed for French, ignore otherwise
if proxy_name == "person":
# Frame Person:
self.filter_obj = Gtk.ComboBox()
- label = Gtk.Label(label=_('_Person Filter') + ": ")
+ label = Gtk.Label(label=_('_Person Filter') + colon)
label.set_halign(Gtk.Align.START)
- label.set_size_request(150, -1)
+ label.set_size_request(120, -1)
+ label.set_padding(5, 0)
label.set_use_underline(True)
label.set_mnemonic_widget(self.filter_obj)
box = Gtk.Box()
@@ -295,9 +297,10 @@ class WriterOptionBox:
# Frame Note:
# Objects for choosing a Note filter:
self.filter_note = Gtk.ComboBox()
- label_note = Gtk.Label(label=_('_Note Filter') + ": ")
+ label_note = Gtk.Label(label=_('_Note Filter') + colon)
label_note.set_halign(Gtk.Align.START)
- label_note.set_size_request(150, -1)
+ label_note.set_size_request(120, -1)
+ label_note.set_padding(5, 0)
label_note.set_use_underline(True)
label_note.set_mnemonic_widget(self.filter_note)
box = Gtk.Box()
@@ -310,18 +313,20 @@ class WriterOptionBox:
button.set_tooltip_text(_("Click to see preview after note filter"))
elif proxy_name == "privacy":
# Frame 3:
- label = Gtk.Label(label=_("Privacy Filter") + ":")
+ label = Gtk.Label(label=_("Privacy Filter") + colon)
label.set_halign(Gtk.Align.START)
- label.set_size_request(150, -1)
+ label.set_size_request(120, -1)
+ label.set_padding(5, 0)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.add(self.private_check)
button.set_tooltip_text(_("Click to see preview after privacy filter"))
elif proxy_name == "living":
# Frame 4:
- label = Gtk.Label(label=_("Living Filter") + ":")
+ label = Gtk.Label(label=_("Living Filter") + colon)
label.set_halign(Gtk.Align.START)
- label.set_size_request(150, -1)
+ label.set_size_request(120, -1)
+ label.set_padding(5, 0)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
self.restrict_option = Gtk.ComboBox()
@@ -330,9 +335,10 @@ class WriterOptionBox:
elif proxy_name == "reference":
# Frame 5:
self.reference_filter = Gtk.ComboBox()
- label = Gtk.Label(label=_('Reference Filter') + ": ")
+ label = Gtk.Label(label=_('Reference Filter') + colon)
label.set_halign(Gtk.Align.START)
- label.set_size_request(150, -1)
+ label.set_size_request(120, -1)
+ label.set_padding(5, 0)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.pack_start(self.reference_filter, True, True, 0)
diff --git a/gramps/gui/plug/quick/_textbufdoc.py b/gramps/gui/plug/quick/_textbufdoc.py
index cefea83e0..4ba7b378c 100644
--- a/gramps/gui/plug/quick/_textbufdoc.py
+++ b/gramps/gui/plug/quick/_textbufdoc.py
@@ -61,7 +61,8 @@ class DisplayBuf(ManagedWindow):
buttons=(_('_Close'),
Gtk.ResponseType.CLOSE)),
None, title, True)
- self.window.set_size_request(600,400)
+ self.setup_configs('interface.' + title.lower().replace(' ', ''),
+ 600, 400)
scrolled_window = Gtk.ScrolledWindow()
scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC,Gtk.PolicyType.AUTOMATIC)
document.text_view = Gtk.TextView()
diff --git a/gramps/plugins/lib/libmetadata.py b/gramps/plugins/lib/libmetadata.py
index ab47a8754..8a84f0126 100644
--- a/gramps/plugins/lib/libmetadata.py
+++ b/gramps/plugins/lib/libmetadata.py
@@ -32,6 +32,8 @@ import os
#
#-------------------------------------------------------------------------
from gi.repository import Gtk
+import gi
+gi.require_version('GExiv2', '0.10')
from gi.repository import GExiv2
#-------------------------------------------------------------------------
diff --git a/gramps/plugins/tool/check.glade b/gramps/plugins/tool/check.glade
index c5b206e23..a75954a41 100644
--- a/gramps/plugins/tool/check.glade
+++ b/gramps/plugins/tool/check.glade
@@ -4,8 +4,6 @@