Fix deprecation of Gtk positional arguments
This commit is contained in:
parent
0f925a86f5
commit
57f7502105
@ -690,7 +690,7 @@ class GrampsPreferences(ConfigureDialog):
|
||||
hbox.pack_start(lwidget, False, False, 0)
|
||||
hbox.pack_start(self.color_scheme_box, False, False, 0)
|
||||
|
||||
restore_btn = Gtk.Button(_('Restore to defaults'))
|
||||
restore_btn = Gtk.Button(label=_('Restore to defaults'))
|
||||
restore_btn.set_tooltip_text(
|
||||
_('Restore colors for current theme to default.'))
|
||||
restore_btn.connect('clicked', self.restore_colors)
|
||||
@ -1827,12 +1827,10 @@ class GrampsPreferences(ConfigureDialog):
|
||||
Show dialog to choose media directory.
|
||||
"""
|
||||
f = Gtk.FileChooserDialog(title=_("Select media directory"),
|
||||
parent=self.window,
|
||||
action=Gtk.FileChooserAction.SELECT_FOLDER,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'),
|
||||
Gtk.ResponseType.OK))
|
||||
transient_for=self.window,
|
||||
action=Gtk.FileChooserAction.SELECT_FOLDER)
|
||||
f.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'), Gtk.ResponseType.OK)
|
||||
mpath = media_path(self.dbstate.db)
|
||||
f.set_current_folder(os.path.dirname(mpath))
|
||||
|
||||
@ -1877,12 +1875,10 @@ class GrampsPreferences(ConfigureDialog):
|
||||
Show dialog to choose backup directory.
|
||||
"""
|
||||
f = Gtk.FileChooserDialog(title=_("Select backup directory"),
|
||||
parent=self.window,
|
||||
action=Gtk.FileChooserAction.SELECT_FOLDER,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'),
|
||||
Gtk.ResponseType.OK))
|
||||
transient_for=self.window,
|
||||
action=Gtk.FileChooserAction.SELECT_FOLDER)
|
||||
f.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'), Gtk.ResponseType.OK)
|
||||
backup_path = config.get('database.backup-path')
|
||||
if not backup_path:
|
||||
backup_path = config.get('database.path')
|
||||
|
@ -380,7 +380,7 @@ class GrampsLoginDialog(ManagedWindow):
|
||||
self.title = _("Login")
|
||||
ManagedWindow.__init__(self, uistate, [], self.__class__, modal=True)
|
||||
|
||||
dialog = Gtk.Dialog(parent=uistate.window)
|
||||
dialog = Gtk.Dialog(transient_for=uistate.window)
|
||||
grid = Gtk.Grid()
|
||||
grid.set_border_width(6)
|
||||
grid.set_row_spacing(6)
|
||||
|
@ -1087,9 +1087,9 @@ class EditPerson(EditPrimary):
|
||||
class GenderDialog(Gtk.MessageDialog):
|
||||
def __init__(self, parent=None):
|
||||
Gtk.MessageDialog.__init__(self,
|
||||
parent,
|
||||
flags=Gtk.DialogFlags.MODAL,
|
||||
type=Gtk.MessageType.QUESTION,
|
||||
transient_for=parent,
|
||||
modal=True,
|
||||
message_type=Gtk.MessageType.QUESTION,
|
||||
)
|
||||
self.set_icon(ICON)
|
||||
self.set_title('')
|
||||
|
@ -101,7 +101,7 @@ class EditTagList(ManagedWindow):
|
||||
Create a dialog box to select tags.
|
||||
"""
|
||||
# pylint: disable-msg=E1101
|
||||
top = Gtk.Dialog(parent=self.uistate.window)
|
||||
top = Gtk.Dialog(transient_for=self.uistate.window)
|
||||
top.vbox.set_spacing(5)
|
||||
|
||||
columns = [('', -1, 300),
|
||||
|
@ -301,9 +301,9 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
|
||||
sw_frame = Gtk.Frame()
|
||||
sw_frame.add(swin)
|
||||
|
||||
reset = Gtk.Button("Reset")
|
||||
reset = Gtk.Button(label="Reset")
|
||||
reset.connect('clicked', self._reset_error_details)
|
||||
clear = Gtk.Button("Clear")
|
||||
clear = Gtk.Button(label="Clear")
|
||||
clear.connect('clicked', self._clear_error_details)
|
||||
|
||||
button_box = Gtk.ButtonBox()
|
||||
@ -382,9 +382,9 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
|
||||
sw_frame = Gtk.Frame()
|
||||
sw_frame.add(swin)
|
||||
|
||||
reset = Gtk.Button("Reset")
|
||||
reset = Gtk.Button(label="Reset")
|
||||
reset.connect('clicked', self._reset_sys_information)
|
||||
clear = Gtk.Button("Clear")
|
||||
clear = Gtk.Button(label="Clear")
|
||||
clear.connect('clicked', self._clear_sys_information)
|
||||
|
||||
|
||||
@ -459,7 +459,7 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
|
||||
sw_frame = Gtk.Frame()
|
||||
sw_frame.add(swin)
|
||||
|
||||
clear = Gtk.Button("Clear")
|
||||
clear = Gtk.Button(label="Clear")
|
||||
clear.connect('clicked', self._clear_user_information)
|
||||
|
||||
button_box = Gtk.ButtonBox()
|
||||
@ -599,7 +599,7 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
|
||||
url_label.set_line_wrap(True)
|
||||
url_label.set_size_request(200, -1)
|
||||
|
||||
url_button = Gtk.Button("File bug report")
|
||||
url_button = Gtk.Button(label="File bug report")
|
||||
url_button.connect('clicked', self._start_gramps_bts_in_browser)
|
||||
url_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
url_button_vbox.pack_start(url_button, True, False, 0)
|
||||
@ -624,7 +624,7 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
|
||||
clip_label.set_line_wrap(True)
|
||||
clip_label.set_size_request(200, -1)
|
||||
|
||||
clip_button = Gtk.Button("Copy to clipboard")
|
||||
clip_button = Gtk.Button(label="Copy to clipboard")
|
||||
clip_button.connect('clicked', self._copy_to_clipboard)
|
||||
clip_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
clip_button_vbox.pack_start(clip_button, True, False, 0)
|
||||
|
@ -105,7 +105,7 @@ class ErrorView(ManagedWindow):
|
||||
|
||||
def draw_window(self):
|
||||
title = "%s - Gramps" % _("Error Report")
|
||||
self.top = Gtk.Dialog(title)
|
||||
self.top = Gtk.Dialog(title=title)
|
||||
# look over the top level windows, it seems the oldest come first, so
|
||||
# the most recent still visible window appears to be a good choice for
|
||||
# a transient parent
|
||||
|
@ -75,16 +75,17 @@ class LastNameDialog(ManagedWindow):
|
||||
def __init__(self, database, uistate, track, surnames, skip_list=set()):
|
||||
|
||||
ManagedWindow.__init__(self, uistate, track, self, modal=True)
|
||||
flags = Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT
|
||||
buttons = (_('_Cancel'), Gtk.ResponseType.REJECT,
|
||||
_('_OK'), Gtk.ResponseType.ACCEPT)
|
||||
self.__dlg = Gtk.Dialog(None, uistate.window, flags, buttons)
|
||||
self.__dlg = Gtk.Dialog(
|
||||
transient_for=uistate.window, destroy_with_parent=True,
|
||||
modal=True)
|
||||
self.__dlg.add_buttons(_('_Cancel'), Gtk.ResponseType.REJECT,
|
||||
_('_OK'), Gtk.ResponseType.ACCEPT)
|
||||
self.set_window(self.__dlg, None, _('Select surname'))
|
||||
self.setup_configs('interface.lastnamedialog', 400, 400)
|
||||
|
||||
# build up a container to display all of the people of interest
|
||||
self.__model = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_INT)
|
||||
self.__tree_view = Gtk.TreeView(self.__model)
|
||||
self.__tree_view = Gtk.TreeView(model=self.__model)
|
||||
col1 = Gtk.TreeViewColumn(_('Surname'), Gtk.CellRendererText(), text=0)
|
||||
col2 = Gtk.TreeViewColumn(_('Count'), Gtk.CellRendererText(), text=1)
|
||||
col1.set_resizable(True)
|
||||
@ -1739,12 +1740,10 @@ class GuiDestinationOption(Gtk.Box):
|
||||
else:
|
||||
my_action = Gtk.FileChooserAction.SAVE
|
||||
|
||||
fcd = Gtk.FileChooserDialog(_("Save As"), action=my_action,
|
||||
parent=self.__uistate.window,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Open'),
|
||||
Gtk.ResponseType.OK))
|
||||
fcd = Gtk.FileChooserDialog(title=_("Save As"), action=my_action,
|
||||
transient_for=self.__uistate.window)
|
||||
fcd.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Open'), Gtk.ResponseType.OK)
|
||||
|
||||
name = os.path.abspath(self.__option.get_value())
|
||||
if self.__option.get_directory_entry():
|
||||
|
@ -435,12 +435,10 @@ class PluginStatus(ManagedWindow):
|
||||
"""
|
||||
Select a file from the file system.
|
||||
"""
|
||||
fcd = Gtk.FileChooserDialog(_("Load Addon"),
|
||||
parent=self.__uistate.window,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Open'),
|
||||
Gtk.ResponseType.OK))
|
||||
fcd = Gtk.FileChooserDialog(title=_("Load Addon"),
|
||||
transient_for=self.__uistate.window)
|
||||
fcd.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Open'), Gtk.ResponseType.OK)
|
||||
name = self.install_addon_path.get_text()
|
||||
dir = os.path.dirname(name)
|
||||
if not os.path.isdir(dir):
|
||||
@ -688,10 +686,10 @@ class PluginTrace(ManagedWindow):
|
||||
) % {'str1': _("Plugin Error"), 'str2': name}
|
||||
ManagedWindow.__init__(self, uistate, track, self)
|
||||
|
||||
self.set_window(Gtk.Dialog("", uistate.window,
|
||||
Gtk.DialogFlags.DESTROY_WITH_PARENT,
|
||||
(_('_Close'), Gtk.ResponseType.CLOSE)),
|
||||
None, title)
|
||||
dlg = Gtk.Dialog(title="", transient_for=uistate.window,
|
||||
destroy_with_parent=True)
|
||||
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE),
|
||||
self.set_window(dlg, None, title)
|
||||
self.setup_configs('interface.plugintrace', 600, 400)
|
||||
self.window.connect('response', self.close)
|
||||
|
||||
@ -742,7 +740,7 @@ class ToolManagedWindowBase(ManagedWindow):
|
||||
self.format_menu = None
|
||||
self.style_button = None
|
||||
|
||||
window = Gtk.Dialog('Tool')
|
||||
window = Gtk.Dialog(title='Tool')
|
||||
self.set_window(window, None, self.get_title())
|
||||
|
||||
#self.window.connect('response', self.close)
|
||||
|
@ -286,7 +286,7 @@ class ExportAssistant(ManagedWindow, Gtk.Assistant):
|
||||
self.set_page_complete(vbox, True)
|
||||
|
||||
def create_page_fileselect(self):
|
||||
self.chooser = Gtk.FileChooserWidget(Gtk.FileChooserAction.SAVE)
|
||||
self.chooser = Gtk.FileChooserWidget(action=Gtk.FileChooserAction.SAVE)
|
||||
self.chooser.set_homogeneous(False) # Fix for bug #8350.
|
||||
#add border
|
||||
self.chooser.set_border_width(12)
|
||||
|
@ -164,9 +164,9 @@ class WriterOptionBox:
|
||||
full_database_row.pack_start(label, True, True, 0)
|
||||
people_count = len(self.dbstate.db.get_person_handles())
|
||||
# translators: leave all/any {...} untranslated
|
||||
button = Gtk.Button(ngettext("{number_of} Person",
|
||||
"{number_of} People", people_count
|
||||
).format(number_of=people_count) )
|
||||
button = Gtk.Button(label=ngettext("{number_of} Person",
|
||||
"{number_of} People", people_count
|
||||
).format(number_of=people_count))
|
||||
button.set_tooltip_text(_("Click to see preview of unfiltered data"))
|
||||
button.set_size_request(107, -1)
|
||||
button.connect("clicked", self.show_preview_data)
|
||||
@ -271,9 +271,9 @@ class WriterOptionBox:
|
||||
from gi.repository import Gtk
|
||||
from ...widgets import SimpleButton
|
||||
# translators: leave all/any {...} untranslated
|
||||
button = Gtk.Button(ngettext("{number_of} Person",
|
||||
"{number_of} People", 0
|
||||
).format(number_of=0) )
|
||||
button = Gtk.Button(label=ngettext("{number_of} Person",
|
||||
"{number_of} People", 0
|
||||
).format(number_of=0))
|
||||
button.set_size_request(107, -1)
|
||||
button.connect("clicked", self.show_preview_data)
|
||||
button.proxy_name = proxy_name
|
||||
|
@ -58,13 +58,11 @@ class FileEntry(Gtk.Box):
|
||||
else:
|
||||
my_action = Gtk.FileChooserAction.SAVE
|
||||
|
||||
dialog = Gtk.FileChooserDialog(self.title,
|
||||
self.parent,
|
||||
action=my_action,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Open'),
|
||||
Gtk.ResponseType.OK))
|
||||
dialog = Gtk.FileChooserDialog(title=self.title,
|
||||
transient_for=self.parent,
|
||||
action=my_action)
|
||||
dialog.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Open'), Gtk.ResponseType.OK)
|
||||
|
||||
name = os.path.basename(self.entry.get_text())
|
||||
if self.dir:
|
||||
|
@ -414,7 +414,7 @@ class StyleEditor(ManagedWindow):
|
||||
spin.set_value(t.get_column_width(i))
|
||||
self.column.append(spin)
|
||||
hbox.pack_start(spin, False, False, 6)
|
||||
hbox.pack_start(Gtk.Label('%'), False, False, 6)
|
||||
hbox.pack_start(Gtk.Label(label='%'), False, False, 6)
|
||||
hbox.show_all()
|
||||
self.vbox.pack_start(hbox, False, False, 3)
|
||||
|
||||
|
@ -1649,9 +1649,9 @@ class QuickBackup(ManagedWindow): # TODO move this class into its own module
|
||||
self.user = user
|
||||
|
||||
ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
window = Gtk.Dialog('',
|
||||
self.uistate.window,
|
||||
Gtk.DialogFlags.DESTROY_WITH_PARENT, None)
|
||||
window = Gtk.Dialog(title='',
|
||||
transient_for=self.uistate.window,
|
||||
destroy_with_parent=True)
|
||||
self.set_window(window, None, _("Gramps XML Backup"))
|
||||
self.setup_configs('interface.quick-backup', 500, 150)
|
||||
close_button = window.add_button(_('_Close'),
|
||||
@ -1787,12 +1787,10 @@ class QuickBackup(ManagedWindow): # TODO move this class into its own module
|
||||
"""
|
||||
fdialog = Gtk.FileChooserDialog(
|
||||
title=_("Select backup directory"),
|
||||
parent=self.window,
|
||||
action=Gtk.FileChooserAction.SELECT_FOLDER,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'),
|
||||
Gtk.ResponseType.OK))
|
||||
transient_for=self.window,
|
||||
action=Gtk.FileChooserAction.SELECT_FOLDER)
|
||||
fdialog.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'), Gtk.ResponseType.OK)
|
||||
mpath = path_entry.get_text()
|
||||
if not mpath:
|
||||
mpath = HOME_DIR
|
||||
|
@ -269,7 +269,7 @@ class BookmarksDialog(ManagedWindow):
|
||||
|
||||
def draw_window(self):
|
||||
"""Draw the bookmark dialog box."""
|
||||
self.top = Gtk.Dialog(parent=self.parent_window)
|
||||
self.top = Gtk.Dialog(transient_for=self.parent_window)
|
||||
self.top.vbox.set_spacing(5)
|
||||
label = Gtk.Label(label='<span size="larger" weight="bold">%s</span>'
|
||||
% _("Organize Bookmarks"))
|
||||
|
@ -1059,11 +1059,11 @@ class ListView(NavigationView):
|
||||
####################################################################
|
||||
def export(self, *obj):
|
||||
chooser = Gtk.FileChooserDialog(
|
||||
_("Export View as Spreadsheet"),
|
||||
self.uistate.window,
|
||||
Gtk.FileChooserAction.SAVE,
|
||||
(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Save'), Gtk.ResponseType.OK))
|
||||
title=_("Export View as Spreadsheet"),
|
||||
transient_for=self.uistate.window,
|
||||
action=Gtk.FileChooserAction.SAVE)
|
||||
chooser.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Save'), Gtk.ResponseType.OK)
|
||||
chooser.set_do_overwrite_confirmation(True)
|
||||
|
||||
combobox = Gtk.ComboBoxText()
|
||||
|
@ -331,7 +331,8 @@ class NavigationView(PageView):
|
||||
"""
|
||||
A dialog to move to a Gramps ID entered by the user.
|
||||
"""
|
||||
dialog = Gtk.Dialog(_('Jump to by Gramps ID'), self.uistate.window)
|
||||
dialog = Gtk.Dialog(title=_('Jump to by Gramps ID'),
|
||||
transient_for=self.uistate.window)
|
||||
dialog.set_border_width(12)
|
||||
label = Gtk.Label(label='<span weight="bold" size="larger">%s</span>' %
|
||||
_('Jump to by Gramps ID'))
|
||||
|
@ -459,7 +459,7 @@ class OrganizeTagsDialog(ManagedWindow):
|
||||
Create a dialog box to organize tags.
|
||||
"""
|
||||
# pylint: disable-msg=E1101
|
||||
top = Gtk.Dialog(parent=self.parent_window)
|
||||
top = Gtk.Dialog(transient_for=self.parent_window)
|
||||
top.vbox.set_spacing(5)
|
||||
label = Gtk.Label(label='<span size="larger" weight="bold">%s</span>'
|
||||
% _("Organize Tags"))
|
||||
@ -688,7 +688,7 @@ class EditTag(ManagedWindow):
|
||||
Create a dialog box to enter a new tag.
|
||||
"""
|
||||
# pylint: disable-msg=E1101
|
||||
top = Gtk.Dialog(parent=self.parent_window)
|
||||
top = Gtk.Dialog(transient_for=self.parent_window)
|
||||
top.vbox.set_spacing(5)
|
||||
|
||||
hbox = Gtk.Box()
|
||||
|
@ -630,13 +630,11 @@ class DetachedWindow(ManagedWindow):
|
||||
self.grampletbar = grampletbar
|
||||
self.gramplet = gramplet
|
||||
|
||||
ManagedWindow.__init__(self, gramplet.uistate, [],
|
||||
self.title)
|
||||
self.set_window(Gtk.Dialog("", gramplet.uistate.window,
|
||||
Gtk.DialogFlags.DESTROY_WITH_PARENT,
|
||||
(_('_Close'), Gtk.ResponseType.CLOSE)),
|
||||
None,
|
||||
self.title)
|
||||
ManagedWindow.__init__(self, gramplet.uistate, [], self.title)
|
||||
dlg = Gtk.Dialog(transient_for=gramplet.uistate.window,
|
||||
destroy_with_parent = True)
|
||||
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE)
|
||||
self.set_window(dlg, None, self.title)
|
||||
self.window.move(x_pos, y_pos)
|
||||
self.window.set_default_size(gramplet.detached_width,
|
||||
gramplet.detached_height)
|
||||
|
@ -233,12 +233,11 @@ class GrampletWindow(ManagedWindow):
|
||||
self.docked_state = gramplet.gstate
|
||||
# Now detach it
|
||||
self.gramplet.set_state("detached")
|
||||
ManagedWindow.__init__(self, gramplet.uistate, [],
|
||||
self.title)
|
||||
self.set_window(Gtk.Dialog("", gramplet.uistate.window,
|
||||
Gtk.DialogFlags.DESTROY_WITH_PARENT,
|
||||
(_('_Close'), Gtk.ResponseType.CLOSE)),
|
||||
None, self.title)
|
||||
ManagedWindow.__init__(self, gramplet.uistate, [], self.title)
|
||||
dlg = Gtk.Dialog(transient_for=gramplet.uistate.window,
|
||||
destroy_with_parent=True)
|
||||
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE)
|
||||
self.set_window(dlg, None, self.title)
|
||||
cfg_name = gramplet.gname.replace(' ', '').lower() + '-gramplet'
|
||||
self.setup_configs('interface.' + cfg_name,
|
||||
gramplet.detached_width, gramplet.detached_height)
|
||||
|
@ -988,11 +988,11 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
filtering = Gtk.FileFilter()
|
||||
filtering.add_pattern("*.kml")
|
||||
kml = Gtk.FileChooserDialog(
|
||||
_("Select a kml file used to add places"),
|
||||
title=_("Select a kml file used to add places"),
|
||||
action=Gtk.FileChooserAction.OPEN,
|
||||
parent=self.uistate.window,
|
||||
buttons=(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'), Gtk.ResponseType.OK))
|
||||
transient_for=self.uistate.window)
|
||||
kml.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'), Gtk.ResponseType.OK)
|
||||
mpath = HOME_DIR
|
||||
kml.set_current_folder(os.path.dirname(mpath))
|
||||
kml.set_filter(filtering)
|
||||
@ -1284,13 +1284,11 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
"""
|
||||
dummy_obj = obj
|
||||
selected_dir = Gtk.FileChooserDialog(
|
||||
_("Select tile cache directory for offline mode"),
|
||||
title=_("Select tile cache directory for offline mode"),
|
||||
action=Gtk.FileChooserAction.SELECT_FOLDER,
|
||||
parent=self.uistate.window,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'),
|
||||
Gtk.ResponseType.OK))
|
||||
transient_for=self.uistate.window)
|
||||
selected_dir.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Apply'), Gtk.ResponseType.OK)
|
||||
mpath = config.get('geography.path')
|
||||
if not mpath:
|
||||
mpath = HOME_DIR
|
||||
|
@ -115,10 +115,10 @@ class PlaceSelection(ManagedWindow, OsmGps):
|
||||
self.selection_layer = layer
|
||||
self.layer = layer
|
||||
self.warning = False
|
||||
self.set_window(
|
||||
Gtk.Dialog(_('Place Selection in a region'), uistate.window,
|
||||
buttons=(_('_Close'), Gtk.ResponseType.CLOSE)),
|
||||
None, _('Place Selection in a region'), None)
|
||||
dlg = Gtk.Dialog(title=_('Place Selection in a region'),
|
||||
transient_for=uistate.window)
|
||||
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE)
|
||||
self.set_window(dlg, None, _('Place Selection in a region'), None)
|
||||
mylabel = _('Choose the radius of the selection.\n'
|
||||
'On the map you should see a circle or an'
|
||||
' oval depending on the latitude.')
|
||||
@ -139,11 +139,11 @@ class PlaceSelection(ManagedWindow, OsmGps):
|
||||
slider.connect('value-changed', self.slider_change, self.lat, self.lon)
|
||||
self.window.vbox.pack_start(slider, False, True, 0)
|
||||
self.vadjust = Gtk.Adjustment(page_size=15)
|
||||
self.scroll = Gtk.ScrolledWindow(self.vadjust)
|
||||
self.scroll = Gtk.ScrolledWindow(vadjustment=self.vadjust)
|
||||
self.scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
|
||||
self.scroll.set_shadow_type(Gtk.ShadowType.IN)
|
||||
self.plist = Gtk.ListStore(str, str, str, str, str)
|
||||
self.choices = Gtk.TreeView(self.plist)
|
||||
self.choices = Gtk.TreeView(model=self.plist)
|
||||
self.scroll.add(self.choices)
|
||||
self.renderer = Gtk.CellRendererText()
|
||||
self.tvcol1 = Gtk.TreeViewColumn(_('Country'), self.renderer, markup=0)
|
||||
|
@ -775,10 +775,10 @@ class CheckIntegrity:
|
||||
'kept')
|
||||
|
||||
fs_top = Gtk.FileChooserDialog(
|
||||
"%s - Gramps" % _("Select file"),
|
||||
parent=self.parent_window,
|
||||
buttons=(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_OK'), Gtk.ResponseType.OK))
|
||||
title="%s - Gramps" % _("Select file"),
|
||||
transient_for=self.parent_window)
|
||||
fs_top.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_OK'), Gtk.ResponseType.OK)
|
||||
fs_top.set_current_folder(self.last_img_dir)
|
||||
response = fs_top.run()
|
||||
if response == Gtk.ResponseType.OK:
|
||||
|
@ -393,12 +393,10 @@ class EventComparisonResults(ManagedWindow):
|
||||
|
||||
def on_write_table(self, obj):
|
||||
f = Gtk.FileChooserDialog(_("Select filename"),
|
||||
parent=self.window,
|
||||
action=Gtk.FileChooserAction.SAVE,
|
||||
buttons=(_('_Cancel'),
|
||||
Gtk.ResponseType.CANCEL,
|
||||
_('_Save'),
|
||||
Gtk.ResponseType.OK))
|
||||
transient_for=self.window,
|
||||
action=Gtk.FileChooserAction.SAVE)
|
||||
f.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
|
||||
_('_Save'), Gtk.ResponseType.OK)
|
||||
|
||||
f.set_current_folder(get_curr_dir())
|
||||
status = f.run()
|
||||
|
@ -84,15 +84,16 @@ class PopulateSources(tool.Tool, ManagedWindow):
|
||||
num_citations = self.options.handler.options_dict['citations']
|
||||
|
||||
# GUI setup:
|
||||
dialog = Gtk.Dialog("Populate sources and citations tool",
|
||||
self.uistate.window,
|
||||
Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT,
|
||||
(_('_Cancel'), Gtk.ResponseType.REJECT,
|
||||
_('_OK'), Gtk.ResponseType.ACCEPT))
|
||||
label = Gtk.Label("Enter a valid number of sources and citations."
|
||||
" This will create the requested number of sources,"
|
||||
" and for each source, will create the requested"
|
||||
" number of citations.")
|
||||
dialog = Gtk.Dialog(title="Populate sources and citations tool",
|
||||
transient_for=self.uistate.window,
|
||||
modal=True, destroy_with_parent=True)
|
||||
dialog.add_buttons(_('_Cancel'), Gtk.ResponseType.REJECT,
|
||||
_('_OK'), Gtk.ResponseType.ACCEPT)
|
||||
label = Gtk.Label(
|
||||
label="Enter a valid number of sources and citations."
|
||||
" This will create the requested number of sources,"
|
||||
" and for each source, will create the requested"
|
||||
" number of citations.")
|
||||
label.set_line_wrap(True)
|
||||
|
||||
hbox1 = Gtk.Box()
|
||||
|
@ -272,7 +272,7 @@ class TestcaseGenerator(tool.BatchTool):
|
||||
|
||||
def init_gui(self, uistate):
|
||||
title = "%s - Gramps" % _("Generate testcases")
|
||||
self.top = Gtk.Dialog(title, parent=uistate.window)
|
||||
self.top = Gtk.Dialog(title=title, transient_for=uistate.window)
|
||||
self.window = uistate.window
|
||||
self.top.set_default_size(400, 150)
|
||||
self.top.vbox.set_spacing(5)
|
||||
|
@ -573,9 +573,9 @@ class CairoPrintSave():
|
||||
(typically evince not installed)!
|
||||
"""
|
||||
dummy_preview = preview
|
||||
dlg = Gtk.MessageDialog(parent,
|
||||
flags=Gtk.DialogFlags.MODAL,
|
||||
type=Gtk.MessageType.WARNING,
|
||||
dlg = Gtk.MessageDialog(transient_for=parent,
|
||||
modal=True,
|
||||
message_type=Gtk.MessageType.WARNING,
|
||||
buttons=Gtk.ButtonsType.CLOSE,
|
||||
message_format=_('No preview available'))
|
||||
self.preview = dlg
|
||||
|
@ -561,9 +561,9 @@ class CairoPrintSave:
|
||||
(typically evince not installed)!
|
||||
"""
|
||||
dummy_preview = preview
|
||||
dlg = Gtk.MessageDialog(parent,
|
||||
flags=Gtk.DialogFlags.MODAL,
|
||||
type=Gtk.MessageType.WARNING,
|
||||
dlg = Gtk.MessageDialog(transient_for=parent,
|
||||
modal=True,
|
||||
message_type=Gtk.MessageType.WARNING,
|
||||
buttons=Gtk.ButtonsType.CLOSE,
|
||||
message_format=_('No preview available'))
|
||||
self.preview = dlg
|
||||
|
@ -659,9 +659,9 @@ class CairoPrintSave:
|
||||
(typically evince not installed)!
|
||||
"""
|
||||
dummy_preview = preview
|
||||
dlg = Gtk.MessageDialog(parent,
|
||||
flags=Gtk.DialogFlags.MODAL,
|
||||
type=Gtk.MessageType.WARNING,
|
||||
dlg = Gtk.MessageDialog(transient_for=parent,
|
||||
modal=True,
|
||||
message_type=Gtk.MessageType.WARNING,
|
||||
buttons=Gtk.ButtonsType.CLOSE,
|
||||
message_format=_('No preview available'))
|
||||
self.preview = dlg
|
||||
|
Loading…
Reference in New Issue
Block a user