mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-30 21:03:53 +02:00
...
This commit is contained in:
parent
b61fdf0eac
commit
bfa79729a2
3 changed files with 17 additions and 1 deletions
|
|
@ -76,6 +76,10 @@
|
|||
<property name="text">
|
||||
<string>&Add a new plugin</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../resources/images.qrc">
|
||||
<normaloff>:/images/plugins.png</normaloff>:/images/plugins.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ def setModelData(self, editor, model, index):
|
|||
custom = []
|
||||
if editor.custom.isChecked():
|
||||
for x in ('1', '2'):
|
||||
sc = getattr(editor, 'shortcut'+x)
|
||||
sc = getattr(editor, 'shortcut'+x, None)
|
||||
if sc is not None:
|
||||
custom.append(sc)
|
||||
|
||||
|
|
@ -266,6 +266,11 @@ def scrollTo(self, index):
|
|||
self.view.scrollTo(index)
|
||||
|
||||
|
||||
@property
|
||||
def is_editing(self):
|
||||
return self.view.state() == self.view.EditingState
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from calibre.gui2 import is_ok_to_use_qt
|
||||
from calibre.gui2.viewer.keys import SHORTCUTS
|
||||
|
|
|
|||
|
|
@ -120,6 +120,13 @@ def __init__(self, shortcuts, parent=None):
|
|||
|
||||
|
||||
def accept(self, *args):
|
||||
if self.shortcut_config.is_editing:
|
||||
from calibre.gui2 import info_dialog
|
||||
info_dialog(self, _('Still editing'),
|
||||
_('You are in the middle of editing a keyboard shortcut'
|
||||
' first complete that, by clicking outside the '
|
||||
' shortcut editing box.'), show=True)
|
||||
return
|
||||
c = config()
|
||||
c.set('serif_family', unicode(self.serif_family.currentFont().family()))
|
||||
c.set('sans_family', unicode(self.sans_family.currentFont().family()))
|
||||
|
|
|
|||
Loading…
Reference in a new issue