diff --git a/src/calibre/gui2/preferences/toolbar.py b/src/calibre/gui2/preferences/toolbar.py
index 1f62336de7..7a2cfdcff4 100644
--- a/src/calibre/gui2/preferences/toolbar.py
+++ b/src/calibre/gui2/preferences/toolbar.py
@@ -231,6 +231,8 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
def genesis(self, gui):
self.models = {}
+ self.what.addItem(_('Click to choose toolbar or menu to customize'),
+ 'blank')
for key, text in self.LOCATIONS:
self.what.addItem(text, key)
all_model = AllModel(key, gui)
@@ -247,8 +249,14 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
def what_changed(self, idx):
key = unicode(self.what.itemData(idx).toString())
- self.all_actions.setModel(self.models[key][0])
- self.current_actions.setModel(self.models[key][1])
+ if key == 'blank':
+ self.actions_widget.setVisible(False)
+ self.spacer_widget.setVisible(True)
+ else:
+ self.actions_widget.setVisible(True)
+ self.spacer_widget.setVisible(False)
+ self.all_actions.setModel(self.models[key][0])
+ self.current_actions.setModel(self.models[key][1])
def add_action(self, *args):
x = self.all_actions.selectionModel().selectedIndexes()
diff --git a/src/calibre/gui2/preferences/toolbar.ui b/src/calibre/gui2/preferences/toolbar.ui
index a364d067c3..c8ff4977eb 100644
--- a/src/calibre/gui2/preferences/toolbar.ui
+++ b/src/calibre/gui2/preferences/toolbar.ui
@@ -13,16 +13,19 @@
Form
-
- -
-
-
-
- 20
- 75
- true
-
+
+
-
+
+
+ <p>The toolbar in calibre is different depending on whether a device is connected or not. Choose <b>which toolbar</b> you would like to customize:
+
+ true
+
+
+
+ -
+
Choose the toolbar to customize
@@ -34,132 +37,59 @@
- -
-
-
- A&vailable actions
-
-
+
-
+
+
+
+ 0
+
-
-
-
- QAbstractItemView::MultiSelection
-
-
-
- 32
- 32
-
-
-
- 10
-
-
- true
-
-
-
-
-
-
- -
-
-
-
-
-
- Add selected actions to toolbar
-
-
- ...
-
-
-
- :/images/forward.png:/images/forward.png
-
-
-
- 24
- 24
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
- Remove selected actions from toolbar
-
-
- ...
-
-
-
- :/images/back.png:/images/back.png
-
-
-
- 24
- 24
-
-
-
-
-
-
- -
-
-
- &Current actions
-
-
-
-
-
-
- QAbstractItemView::MultiSelection
-
-
-
- 32
- 32
-
-
-
- 10
-
-
- true
+
+
+ A&vailable actions
+
+
-
+
+
+
+ 0
+ 100
+
+
+
+ QAbstractItemView::MultiSelection
+
+
+
+ 32
+ 32
+
+
+
+ 10
+
+
+ true
+
+
+
+
-
-
+
-
-
+
- Move selected action up
+ Add selected actions to toolbar
...
- :/images/arrow-up.png:/images/arrow-up.png
+ :/images/forward.png:/images/forward.png
@@ -170,10 +100,13 @@
-
-
+
Qt::Vertical
+
+ QSizePolicy::Fixed
+
20
@@ -183,16 +116,16 @@
-
-
+
- Move selected action down
+ Remove selected actions from toolbar
...
- :/images/arrow-down.png:/images/arrow-down.png
+ :/images/back.png:/images/back.png
@@ -200,24 +133,124 @@
24
-
- Ctrl+S
-
+ -
+
+
+ &Current actions
+
+
+
-
+
+
+
+ 0
+ 100
+
+
+
+ QAbstractItemView::MultiSelection
+
+
+
+ 32
+ 32
+
+
+
+ 10
+
+
+ true
+
+
+
+ -
+
+
-
+
+
+ Move selected action up
+
+
+ ...
+
+
+
+ :/images/arrow-up.png:/images/arrow-up.png
+
+
+
+ 24
+ 24
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
+ Move selected action down
+
+
+ ...
+
+
+
+ :/images/arrow-down.png:/images/arrow-down.png
+
+
+
+ 24
+ 24
+
+
+
+ Ctrl+S
+
+
+
+
+
+
+
+
- -
-
-
- <p>The toolbar in calibre is different depending on whether a device is connected or not. To customize the toolbar when a device is connected as well as customizing right click menus, <b>click the dropdown above</b> and select which toolbar/menu you want to customize.
-
-
- true
-
+
-
+
+
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 224
+
+
+
+
+