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