mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
...
This commit is contained in:
parent
cbc95329fc
commit
bf24620e5f
@ -8,7 +8,7 @@ __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
|||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from PyQt4.Qt import QTimer, QProgressDialog, Qt
|
from PyQt5.Qt import QTimer, QProgressDialog, Qt
|
||||||
|
|
||||||
from calibre import force_unicode
|
from calibre import force_unicode
|
||||||
from calibre.gui2 import warning_dialog
|
from calibre.gui2 import warning_dialog
|
||||||
|
@ -396,13 +396,13 @@ class ToolbarSettings(QWidget):
|
|||||||
prefs = prefs or tprefs
|
prefs = prefs or tprefs
|
||||||
val = self.original_settings = {}
|
val = self.original_settings = {}
|
||||||
for i in xrange(1, self.bars.count()):
|
for i in xrange(1, self.bars.count()):
|
||||||
name = unicode(self.bars.itemData(i).toString())
|
name = unicode(self.bars.itemData(i) or '')
|
||||||
val[name] = copy(prefs[name])
|
val[name] = copy(prefs[name])
|
||||||
self.current_settings = deepcopy(val)
|
self.current_settings = deepcopy(val)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_name(self):
|
def current_name(self):
|
||||||
return unicode(self.bars.itemData(self.bars.currentIndex()).toString())
|
return unicode(self.bars.itemData(self.bars.currentIndex()) or '')
|
||||||
|
|
||||||
def build_lists(self):
|
def build_lists(self):
|
||||||
from calibre.gui2.tweak_book.plugin import plugin_toolbar_actions
|
from calibre.gui2.tweak_book.plugin import plugin_toolbar_actions
|
||||||
@ -482,7 +482,7 @@ class ToolbarSettings(QWidget):
|
|||||||
s = self.current_settings[self.current_name]
|
s = self.current_settings[self.current_name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return
|
return
|
||||||
names = [unicode(i.data(Qt.UserRole).toString()) for i in self.available.selectedItems()]
|
names = [unicode(i.data(Qt.UserRole) or '') for i in self.available.selectedItems()]
|
||||||
if not names:
|
if not names:
|
||||||
return
|
return
|
||||||
for n in names:
|
for n in names:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user