Restrict DBAPI selection to power users
This commit is contained in:
@@ -1429,6 +1429,35 @@ class GrampsPreferences(ConfigureDialog):
|
|||||||
grid.set_row_spacing(6)
|
grid.set_row_spacing(6)
|
||||||
|
|
||||||
current_line = 0
|
current_line = 0
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
lwidget = BasicLabel("%s: " % _('Database backend'))
|
||||||
|
grid.attach(lwidget, 1, current_line, 1, 1)
|
||||||
|
obox = self.__create_backend_combo()
|
||||||
|
grid.attach(obox, 2, current_line, 1, 1)
|
||||||
|
current_line += 1
|
||||||
|
|
||||||
|
self.dbpath_entry = Gtk.Entry()
|
||||||
|
self.add_path_box(grid,
|
||||||
|
_('Family Tree Database path'),
|
||||||
|
current_line, self.dbpath_entry, config.get('database.path'),
|
||||||
|
self.set_dbpath, self.select_dbpath)
|
||||||
|
current_line += 1
|
||||||
|
|
||||||
|
#self.add_entry(grid,
|
||||||
|
# _('Family Tree Database path'),
|
||||||
|
# 0, 'database.path')
|
||||||
|
self.add_checkbox(grid,
|
||||||
|
_('Automatically load last Family Tree'),
|
||||||
|
current_line, 'behavior.autoload')
|
||||||
|
current_line += 1
|
||||||
|
|
||||||
|
return _('Family Tree'), grid
|
||||||
|
|
||||||
|
def __create_backend_combo(self):
|
||||||
|
"""
|
||||||
|
Create backend selection widget.
|
||||||
|
"""
|
||||||
backend_plugins = self.uistate.viewmanager._pmgr.get_reg_databases()
|
backend_plugins = self.uistate.viewmanager._pmgr.get_reg_databases()
|
||||||
obox = Gtk.ComboBox()
|
obox = Gtk.ComboBox()
|
||||||
cell = Gtk.CellRendererText()
|
cell = Gtk.CellRendererText()
|
||||||
@@ -1450,27 +1479,7 @@ class GrampsPreferences(ConfigureDialog):
|
|||||||
# set the default value as active in the combo
|
# set the default value as active in the combo
|
||||||
obox.set_active(active)
|
obox.set_active(active)
|
||||||
obox.connect('changed', self.database_backend_changed)
|
obox.connect('changed', self.database_backend_changed)
|
||||||
lwidget = BasicLabel("%s: " % _('Database backend'))
|
return obox
|
||||||
grid.attach(lwidget, 1, current_line, 1, 1)
|
|
||||||
grid.attach(obox, 2, current_line, 1, 1)
|
|
||||||
current_line += 1
|
|
||||||
|
|
||||||
self.dbpath_entry = Gtk.Entry()
|
|
||||||
self.add_path_box(grid,
|
|
||||||
_('Family Tree Database path'),
|
|
||||||
current_line, self.dbpath_entry, config.get('database.path'),
|
|
||||||
self.set_dbpath, self.select_dbpath)
|
|
||||||
current_line += 1
|
|
||||||
|
|
||||||
#self.add_entry(grid,
|
|
||||||
# _('Family Tree Database path'),
|
|
||||||
# 0, 'database.path')
|
|
||||||
self.add_checkbox(grid,
|
|
||||||
_('Automatically load last Family Tree'),
|
|
||||||
current_line, 'behavior.autoload')
|
|
||||||
current_line += 1
|
|
||||||
|
|
||||||
return _('Family Tree'), grid
|
|
||||||
|
|
||||||
def set_mediapath(self, *obj):
|
def set_mediapath(self, *obj):
|
||||||
if self.path_entry.get_text().strip():
|
if self.path_entry.get_text().strip():
|
||||||
|
@@ -280,6 +280,9 @@ class DbManager(CLIDbManager):
|
|||||||
# Get the current selection
|
# Get the current selection
|
||||||
store, node = selection.get_selected()
|
store, node = selection.get_selected()
|
||||||
|
|
||||||
|
if not __debug__:
|
||||||
|
self.convert.set_visible(False)
|
||||||
|
|
||||||
# if nothing is selected
|
# if nothing is selected
|
||||||
if not node:
|
if not node:
|
||||||
self.connect.set_sensitive(False)
|
self.connect.set_sensitive(False)
|
||||||
|
Reference in New Issue
Block a user