Fix #958145 ([Enhancement] add a link to 'adding books' preferences in the 'add books' function)

This commit is contained in:
Kovid Goyal 2012-03-18 19:29:26 +05:30
parent 86771a5286
commit 34da8d4060

View File

@ -70,6 +70,9 @@ class AddAction(InterfaceAction):
self.add_menu.addSeparator()
ma('add-formats', _('Add files to selected book records'),
triggered=self.add_formats, shortcut=_('Shift+A'))
self.add_menu.addSeparator()
ma('add-config', _('Configure the adding of books'),
triggered=self.add_config)
self.qaction.triggered.connect(self.add_books)
@ -78,6 +81,11 @@ class AddAction(InterfaceAction):
for action in list(self.add_menu.actions())[1:]:
action.setEnabled(enabled)
def add_config(self):
self.gui.iactions['Preferences'].do_config(
initial_plugin=('Import/Export', 'Adding'),
close_after_initial=True)
def add_formats(self, *args):
if self.gui.stack.currentIndex() != 0:
return