mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix standalone editor launch not working
This commit is contained in:
parent
c7ff021541
commit
6cda45e42f
@ -76,10 +76,16 @@ class Editor(QMainWindow):
|
||||
self.action_bar = b = self.addToolBar(_('File actions tool bar'))
|
||||
b.setObjectName('action_bar') # Needed for saveState
|
||||
for x in ('save', 'undo', 'redo'):
|
||||
try:
|
||||
b.addAction(actions['editor-%s' % x])
|
||||
except KeyError:
|
||||
pass
|
||||
self.edit_bar = b = self.addToolBar(_('Edit actions tool bar'))
|
||||
for x in ('cut', 'copy', 'paste'):
|
||||
try:
|
||||
b.addAction(actions['editor-%s' % x])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
def break_cycles(self):
|
||||
self.modification_state_changed.disconnect()
|
||||
@ -136,7 +142,7 @@ def launch_editor(path_to_edit, path_is_raw=False, syntax='html'):
|
||||
syntax = 'css'
|
||||
app = QApplication([])
|
||||
t = Editor(syntax)
|
||||
t.load_text(raw, syntax=syntax)
|
||||
t.data = raw
|
||||
t.show()
|
||||
app.exec_()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user