mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-27 11:43:49 +01:00
...
This commit is contained in:
parent
2697f4d0ec
commit
360bc4df7c
1 changed files with 8 additions and 7 deletions
|
|
@ -80,6 +80,12 @@ def names(self, indexes):
|
|||
ans.append(n)
|
||||
return ans
|
||||
|
||||
def has_action(self, name):
|
||||
for a in self._data:
|
||||
if a.name == name:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class AllModel(BaseModel):
|
||||
|
||||
|
|
@ -291,13 +297,8 @@ def move(self, delta, *args):
|
|||
def commit(self):
|
||||
# Ensure preferences are showing in either the toolbar or
|
||||
# the menubar.
|
||||
pref_in_toolbar = lm_in_toolbar = False
|
||||
cm = self.models['toolbar']
|
||||
for x in cm[1]._data:
|
||||
if x.name == 'Preferences':
|
||||
pref_in_toolbar = True
|
||||
if x.name == 'Location Manager':
|
||||
lm_in_toolbar = True
|
||||
pref_in_toolbar = self.models['toolbar'][1].has_action('Preferences')
|
||||
lm_in_toolbar = self.models['toolbar-device'][1].has_action('Location Manager')
|
||||
if not pref_in_toolbar:
|
||||
self.models['menubar'][1].add(['Preferences'])
|
||||
if not lm_in_toolbar:
|
||||
|
|
|
|||
Loading…
Reference in a new issue