From 865d0ed90e65caebb3f6d18e9e0bd0cac9c86dd7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 15 Feb 2014 09:42:48 +0530 Subject: [PATCH] Dont mark keyboard shortcuts for translation. Fixes #1280403 [Double key assignment (in german only?)](https://bugs.launchpad.net/calibre/+bug/1280403) --- src/calibre/gui2/actions/add.py | 4 ++-- src/calibre/gui2/actions/next_match.py | 4 ++-- src/calibre/gui2/actions/preferences.py | 2 +- src/calibre/gui2/actions/restart.py | 2 +- src/calibre/gui2/actions/similar_books.py | 8 ++++---- src/calibre/gui2/init.py | 10 +++++----- src/calibre/gui2/jobs.py | 2 +- src/calibre/gui2/layout.py | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index afdbb46260..cbe4e1d1f6 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -68,11 +68,11 @@ class AddAction(InterfaceAction): self.add_recursive_multiple) self.add_menu.addSeparator() ma('add-empty', _('Add Empty book. (Book entry with no formats)'), - shortcut=_('Shift+Ctrl+E')).triggered.connect(self.add_empty) + shortcut='Shift+Ctrl+E').triggered.connect(self.add_empty) ma('add-isbn', _('Add from ISBN')).triggered.connect(self.add_from_isbn) self.add_menu.addSeparator() ma('add-formats', _('Add files to selected book records'), - triggered=self.add_formats, shortcut=_('Shift+A')) + triggered=self.add_formats, shortcut='Shift+A') self.add_menu.addSeparator() ma('add-config', _('Control the adding of books'), triggered=self.add_config) diff --git a/src/calibre/gui2/actions/next_match.py b/src/calibre/gui2/actions/next_match.py index c604dc635c..005fb6c928 100644 --- a/src/calibre/gui2/actions/next_match.py +++ b/src/calibre/gui2/actions/next_match.py @@ -23,8 +23,8 @@ class NextMatchAction(InterfaceAction): self.can_move = None self.qaction.triggered.connect(self.move_forward) self.create_action(spec=(_('Move to previous item'), 'arrow-up.png', - _('Move to previous highlighted item'), [_('Shift+N'), - _('Shift+F3')]), attr='p_action') + _('Move to previous highlighted item'), ['Shift+N', + 'Shift+F3']), attr='p_action') self.gui.addAction(self.p_action) self.p_action.triggered.connect(self.move_backward) diff --git a/src/calibre/gui2/actions/preferences.py b/src/calibre/gui2/actions/preferences.py index b1e066f979..d692832ec6 100644 --- a/src/calibre/gui2/actions/preferences.py +++ b/src/calibre/gui2/actions/preferences.py @@ -17,7 +17,7 @@ from calibre.constants import DEBUG, isosx class PreferencesAction(InterfaceAction): name = 'Preferences' - action_spec = (_('Preferences'), 'config.png', _('Configure calibre'), _('Ctrl+P')) + action_spec = (_('Preferences'), 'config.png', _('Configure calibre'), 'Ctrl+P') action_add_menu = True action_menu_clone_qaction = _('Change calibre behavior') diff --git a/src/calibre/gui2/actions/restart.py b/src/calibre/gui2/actions/restart.py index 19619e581f..c3453868b3 100644 --- a/src/calibre/gui2/actions/restart.py +++ b/src/calibre/gui2/actions/restart.py @@ -11,7 +11,7 @@ from calibre.gui2.actions import InterfaceAction class RestartAction(InterfaceAction): name = 'Restart' - action_spec = (_('Restart'), None, _('Restart calibre'), _('Ctrl+R')) + action_spec = (_('Restart'), None, _('Restart calibre'), 'Ctrl+R') def genesis(self): self.qaction.triggered.connect(self.restart) diff --git a/src/calibre/gui2/actions/similar_books.py b/src/calibre/gui2/actions/similar_books.py index 93cb631ef7..81c5c1e507 100644 --- a/src/calibre/gui2/actions/similar_books.py +++ b/src/calibre/gui2/actions/similar_books.py @@ -22,11 +22,11 @@ class SimilarBooksAction(InterfaceAction): def genesis(self): m = self.qaction.menu() for text, icon, target, shortcut in [ - (_('Books by same author'), 'user_profile.png', 'authors', _('Alt+A')), + (_('Books by same author'), 'user_profile.png', 'authors', 'Alt+A'), (_('Books in this series'), 'books_in_series.png', 'series', - _('Alt+Shift+S')), - (_('Books by this publisher'), 'publisher.png', 'publisher', _('Alt+P')), - (_('Books with the same tags'), 'tags.png', 'tags', _('Alt+T')),]: + 'Alt+Shift+S'), + (_('Books by this publisher'), 'publisher.png', 'publisher', 'Alt+P'), + (_('Books with the same tags'), 'tags.png', 'tags', 'Alt+T'),]: ac = self.create_action(spec=(text, icon, None, shortcut), attr=target) m.addAction(ac) diff --git a/src/calibre/gui2/init.py b/src/calibre/gui2/init.py index 8703d6c228..5747fd2516 100644 --- a/src/calibre/gui2/init.py +++ b/src/calibre/gui2/init.py @@ -115,7 +115,7 @@ class LibraryWidget(Splitter): # {{{ orientation=orientation, parent=parent, connect_button=not config['separate_cover_flow'], side_index=idx, initial_side_size=size, initial_show=False, - shortcut=_('Shift+Alt+B')) + shortcut='Shift+Alt+B') parent.library_view = BooksView(parent) parent.library_view.setObjectName('library_view') stack = QStackedWidget(self) @@ -137,7 +137,7 @@ class Stack(QStackedWidget): # {{{ parent.tb_splitter = Splitter('tag_browser_splitter', _('Tag Browser'), I('tags.png'), parent=parent, side_index=0, initial_side_size=200, - shortcut=_('Shift+Alt+T')) + shortcut='Shift+Alt+T') parent.tb_splitter.state_changed.connect( self.tb_widget.set_pane_is_visible, Qt.QueuedConnection) parent.tb_splitter.addWidget(self.tb_widget) @@ -245,7 +245,7 @@ class StatusBar(QStatusBar): # {{{ class GridViewButton(LayoutButton): # {{{ def __init__(self, gui): - sc = _('Shift+Alt+G') + sc = 'Shift+Alt+G' LayoutButton.__init__(self, I('grid.png'), _('Cover Grid'), parent=gui, shortcut=sc) self.set_state_to_show() self.action_toggle = QAction(self.icon(), _('Toggle') + ' ' + self.label, self) @@ -384,7 +384,7 @@ class LayoutMixin(object): # {{{ self.bd_splitter = Splitter('book_details_splitter', _('Book Details'), I('book.png'), orientation=Qt.Vertical, parent=self, side_index=1, - shortcut=_('Shift+Alt+D')) + shortcut='Shift+Alt+D') self.bd_splitter.addWidget(self.stack) self.bd_splitter.addWidget(self.book_details) self.bd_splitter.setCollapsible(self.bd_splitter.other_index, False) @@ -395,7 +395,7 @@ class LayoutMixin(object): # {{{ self.bd_splitter = Splitter('book_details_splitter', _('Book Details'), I('book.png'), initial_side_size=200, orientation=Qt.Horizontal, parent=self, side_index=1, - shortcut=_('Shift+Alt+D')) + shortcut='Shift+Alt+D') self.stack = Stack(self) self.bd_splitter.addWidget(self.stack) self.book_details = BookDetails(True, self) diff --git a/src/calibre/gui2/jobs.py b/src/calibre/gui2/jobs.py index c5da726f59..9fe0091838 100644 --- a/src/calibre/gui2/jobs.py +++ b/src/calibre/gui2/jobs.py @@ -445,7 +445,7 @@ class JobsButton(QFrame): # {{{ self.pi = ProgressIndicator(self, size) self._jobs = QLabel(''+_('Jobs:')+' 0') self._jobs.mouseReleaseEvent = self.mouseReleaseEvent - self.shortcut = _('Shift+Alt+J') + self.shortcut = 'Shift+Alt+J' if horizontal: self.setLayout(QHBoxLayout()) diff --git a/src/calibre/gui2/layout.py b/src/calibre/gui2/layout.py index a1c8063dd8..f3dffa7436 100644 --- a/src/calibre/gui2/layout.py +++ b/src/calibre/gui2/layout.py @@ -202,7 +202,7 @@ class SearchBar(QWidget): # {{{ parent.advanced_search_toggle_action = ac = QAction(parent) parent.addAction(ac) parent.keyboard.register_shortcut('advanced search toggle', - _('Advanced search'), default_keys=(_("Shift+Ctrl+F"),), + _('Advanced search'), default_keys=("Shift+Ctrl+F",), action=ac) ac.triggered.connect(x.click) x.setIcon(QIcon(I('search.png')))