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
This commit is contained in:
parent
560687b768
commit
df08b06d33
@ -215,6 +215,7 @@ class MainWindowBook(QtGui.QMainWindow):
|
|||||||
def onBookAddDirectory(self):
|
def onBookAddDirectory(self):
|
||||||
directory = QtGui.QFileDialog.getExistingDirectory(self, 'Select an image directory to add')
|
directory = QtGui.QFileDialog.getExistingDirectory(self, 'Select an image directory to add')
|
||||||
if not directory.isNull():
|
if not directory.isNull():
|
||||||
|
self.book.title = os.path.basename(os.path.normpath(unicode(directory)))
|
||||||
self.addImageDirs([directory])
|
self.addImageDirs([directory])
|
||||||
|
|
||||||
|
|
||||||
@ -375,7 +376,7 @@ class MainWindowBook(QtGui.QMainWindow):
|
|||||||
path = os.path.join(directory, item)
|
path = os.path.join(directory, item)
|
||||||
if self.isImageFile(path):
|
if self.isImageFile(path):
|
||||||
filenames.append(path)
|
filenames.append(path)
|
||||||
elif os.path.isdir:
|
elif os.path.isdir(path):
|
||||||
self.addImageDirs([path])
|
self.addImageDirs([path])
|
||||||
|
|
||||||
self.addImageFiles(filenames)
|
self.addImageFiles(filenames)
|
||||||
|
Loading…
Reference in New Issue
Block a user