From df08b06d33c6ca2aecc9af65763db47ab3b14eab Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 10 Oct 2013 18:54:46 +1100 Subject: [PATCH] Auto set book title to image directory When adding an image directory set the book title to the name of the directory (which is usually the name of the manga/chapter) Fixed a slip with isdir --- mangle/book.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mangle/book.py b/mangle/book.py index 00dd44e..7b9fe72 100644 --- a/mangle/book.py +++ b/mangle/book.py @@ -215,6 +215,7 @@ class MainWindowBook(QtGui.QMainWindow): def onBookAddDirectory(self): directory = QtGui.QFileDialog.getExistingDirectory(self, 'Select an image directory to add') if not directory.isNull(): + self.book.title = os.path.basename(os.path.normpath(unicode(directory))) self.addImageDirs([directory]) @@ -375,7 +376,7 @@ class MainWindowBook(QtGui.QMainWindow): path = os.path.join(directory, item) if self.isImageFile(path): filenames.append(path) - elif os.path.isdir: + elif os.path.isdir(path): self.addImageDirs([path]) self.addImageFiles(filenames)