diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 5b6430a5e6..ddef5e1265 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -13,7 +13,7 @@ from PyQt4.Qt import QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt, \ ORG_NAME = 'KovidsBrain' APP_UID = 'libprs500' -from calibre.constants import islinux, iswindows, isfreebsd, isfrozen +from calibre.constants import islinux, iswindows, isfreebsd, isfrozen, isosx from calibre.utils.config import Config, ConfigProxy, dynamic, JSONConfig from calibre.utils.localization import set_qt_translator from calibre.ebooks.metadata.meta import get_metadata, metadata_from_formats @@ -23,25 +23,45 @@ from calibre.utils.date import UNDEFINED_DATE # Setup gprefs {{{ gprefs = JSONConfig('gui') -gprefs.defaults['action-layout-menubar'] = () - -gprefs.defaults['action-layout-menubar-device'] = () - -gprefs.defaults['action-layout-toolbar'] = ( +if isosx: + gprefs.defaults['action-layout-menubar'] = ( + 'Add Books', 'Edit Metadata', 'Convert Books', + 'Choose Library', 'Save To Disk', 'Preferences', + 'Help', + ) + gprefs.defaults['action-layout-menubar-device'] = ( + 'Add Books', 'Edit Metadata', 'Convert Books', + 'Location Manager', 'Send To Device', + 'Save To Disk', 'Preferences', 'Help', + ) + gprefs.defaults['action-layout-toolbar'] = ( + 'Add Books', 'Edit Metadata', None, 'Convert Books', 'View', None, + 'Choose Library', 'Donate', None, 'Fetch News', 'Save To Disk', + 'Connect Share', None, 'Remove Books', + ) + gprefs.defaults['action-layout-toolbar-device'] = ( + 'Add Books', 'Edit Metadata', None, 'Convert Books', 'View', + 'Send To Device', None, None, 'Location Manager', None, None, + 'Fetch News', 'Save To Disk', 'Connect Share', None, + 'Remove Books', + ) +else: + gprefs.defaults['action-layout-menubar'] = () + gprefs.defaults['action-layout-menubar-device'] = () + gprefs.defaults['action-layout-toolbar'] = ( 'Add Books', 'Edit Metadata', None, 'Convert Books', 'View', None, 'Choose Library', 'Donate', None, 'Fetch News', 'Save To Disk', 'Connect Share', None, 'Remove Books', None, 'Help', 'Preferences', ) - -gprefs.defaults['action-layout-toolbar-child'] = () - -gprefs.defaults['action-layout-toolbar-device'] = ( + gprefs.defaults['action-layout-toolbar-device'] = ( 'Add Books', 'Edit Metadata', None, 'Convert Books', 'View', 'Send To Device', None, None, 'Location Manager', None, None, 'Fetch News', 'Save To Disk', 'Connect Share', None, 'Remove Books', None, 'Help', 'Preferences', ) +gprefs.defaults['action-layout-toolbar-child'] = () + gprefs.defaults['action-layout-context-menu'] = ( 'Edit Metadata', 'Send To Device', 'Save To Disk', 'Connect Share', 'Copy To Library', None, diff --git a/src/calibre/gui2/layout.py b/src/calibre/gui2/layout.py index a7ae479eb4..e102c35fbe 100644 --- a/src/calibre/gui2/layout.py +++ b/src/calibre/gui2/layout.py @@ -382,16 +382,13 @@ class ToolBar(QToolBar): # {{{ bar.added_actions.append(ac) bar.setup_tool_button(bar, ac, QToolButton.MenuButtonPopup) elif what == 'Donate': + self.d_widget = QWidget() + self.d_widget.setLayout(QVBoxLayout()) + self.d_widget.layout().addWidget(self.donate_button) if isosx: - bar.addAction(self.gui.donate_action) - ch = self.setup_tool_button(bar, self.gui.donate_action) - ch.setText(_('Donate')) - else: - self.d_widget = QWidget() - self.d_widget.setLayout(QVBoxLayout()) - self.d_widget.layout().addWidget(self.donate_button) - bar.addWidget(self.d_widget) - self.showing_donate = True + self.d_widget.setStyleSheet('QWidget, QToolButton {background-color: none; border: none; }') + bar.addWidget(self.d_widget) + self.showing_donate = True elif what in self.gui.iactions: action = self.gui.iactions[what] bar.addAction(action.qaction) diff --git a/src/calibre/gui2/preferences/toolbar.py b/src/calibre/gui2/preferences/toolbar.py index fc8aed48da..7f5e0c4441 100644 --- a/src/calibre/gui2/preferences/toolbar.py +++ b/src/calibre/gui2/preferences/toolbar.py @@ -298,10 +298,12 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): # Ensure preferences are showing in either the toolbar or # the menubar. pref_in_toolbar = self.models['toolbar'][1].has_action('Preferences') + pref_in_menubar = self.models['menubar'][1].has_action('Preferences') lm_in_toolbar = self.models['toolbar-device'][1].has_action('Location Manager') - if not pref_in_toolbar: + lm_in_menubar = self.models['menubar-device'][1].has_action('Location Manager') + if not pref_in_toolbar and not pref_in_menubar: self.models['menubar'][1].add(['Preferences']) - if not lm_in_toolbar: + if not lm_in_toolbar and not lm_in_menubar: self.models['menubar-device'][1].add(['Location Manager']) # Save data.