mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Nicer error message when clicking new file if no book has been opened.
This commit is contained in:
parent
6c0269b940
commit
cd01049c6e
@ -201,6 +201,11 @@ class Boss(QObject):
|
|||||||
editors[c.opf_name].replace_data(c.raw_data(c.opf_name))
|
editors[c.opf_name].replace_data(c.raw_data(c.opf_name))
|
||||||
|
|
||||||
def add_file(self):
|
def add_file(self):
|
||||||
|
if current_container() is None:
|
||||||
|
return error_dialog(self.gui, _('No open book'), _(
|
||||||
|
'You must first open a book to tweak, before trying to create new files'
|
||||||
|
' in it.'), show=True)
|
||||||
|
|
||||||
if not self.check_opf_dirtied():
|
if not self.check_opf_dirtied():
|
||||||
return
|
return
|
||||||
d = NewFileDialog(self.gui)
|
d = NewFileDialog(self.gui)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user