mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
fd7cbbe464
commit
09a8064c1d
@ -263,7 +263,8 @@ class Boss(QObject):
|
|||||||
ed = self.gui.central.current_editor
|
ed = self.gui.central.current_editor
|
||||||
if ed is not None:
|
if ed is not None:
|
||||||
ed.mark_selected_text()
|
ed.mark_selected_text()
|
||||||
self.gui.central.search_panel.set_where('selected-text')
|
if ed.has_marked_text:
|
||||||
|
self.gui.central.search_panel.set_where('selected-text')
|
||||||
|
|
||||||
def search(self, action, overrides=None):
|
def search(self, action, overrides=None):
|
||||||
' Run a search/replace '
|
' Run a search/replace '
|
||||||
@ -286,6 +287,9 @@ class Boss(QObject):
|
|||||||
err = _('No file is being edited.')
|
err = _('No file is being edited.')
|
||||||
elif where == 'selected' and not searchable_names['selected']:
|
elif where == 'selected' and not searchable_names['selected']:
|
||||||
err = _('No files are selected in the Files Browser')
|
err = _('No files are selected in the Files Browser')
|
||||||
|
elif where == 'selected-text' and not ed.has_marked_text:
|
||||||
|
err = _('No text is marked. First select some text, and then use'
|
||||||
|
' The "Mark selected text" action in the Search menu to mark it.')
|
||||||
if not err and not state['find']:
|
if not err and not state['find']:
|
||||||
err = _('No search query specified')
|
err = _('No search query specified')
|
||||||
if err:
|
if err:
|
||||||
@ -307,7 +311,7 @@ class Boss(QObject):
|
|||||||
else:
|
else:
|
||||||
pass # TODO: Find the first name with a match and open its editor
|
pass # TODO: Find the first name with a match and open its editor
|
||||||
else:
|
else:
|
||||||
pass # selected text TODO: Implement this
|
pass # marked text TODO: Implement this
|
||||||
|
|
||||||
def save_book(self):
|
def save_book(self):
|
||||||
c = current_container()
|
c = current_container()
|
||||||
|
@ -70,6 +70,10 @@ class Editor(QMainWindow):
|
|||||||
def mark_selected_text(self):
|
def mark_selected_text(self):
|
||||||
self.editor.mark_selected_text()
|
self.editor.mark_selected_text()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def has_marked_text(self):
|
||||||
|
return self.editor.current_search_mark is not None
|
||||||
|
|
||||||
@dynamic_property
|
@dynamic_property
|
||||||
def is_modified(self):
|
def is_modified(self):
|
||||||
def fget(self):
|
def fget(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user