Nicer error message when clicking new file if no book has been opened.

This commit is contained in:
Kovid Goyal 2013-12-01 15:31:35 +05:30
parent 6c0269b940
commit cd01049c6e

View File

@ -201,6 +201,11 @@ class Boss(QObject):
editors[c.opf_name].replace_data(c.raw_data(c.opf_name))
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():
return
d = NewFileDialog(self.gui)