예제 #1
0
    def onBookExport(self):
        if len(self.book.images) == 0:
            QtGui.QMessageBox.warning(self, 'Mangle', 'This book has no images to export')
            return

        if self.book.title == None:
            dialog = DialogOptions(self, self.book)
            if dialog.exec_() == QtGui.QDialog.Rejected:
                return

        # If exporting to CBZ, this is a filename. If not, this is a directory name.
        out_path = ""

        if self.book.cbz == False:
            out_path = QtGui.QFileDialog.getExistingDirectory(self, 'Select a directory to export book to', self.current_dir)
            # Keep track of wherever they moved to find this directory.
            self.current_dir = str(out_path)
        else:
            out_path = QtGui.QFileDialog.getSaveFileName(
                self,
                'Select image file(s) to add',
                # Default to the current directory + the book's title + the cbz extension.
                os.path.join(self.current_dir, "%s.cbz" % self.book.title),
                'Comic Book Archive File (*.cbz);;All files (*.*)'
            )
            # Keep track of wherever they moved to find this file.
            self.current_dir = os.path.split(str(out_path))[0]
        
        if not out_path.isNull():
            dialog = DialogConvert(self, self.book, out_path)
            dialog.exec_()
예제 #2
0
    def onBookExport(self):
        if len(self.book.images) == 0:
            QtGui.QMessageBox.warning(self, 'Mangle',
                                      'This book has no images to export')
            return

        if self.book.title == None:
            dialog = DialogOptions(self, self.book)
            if dialog.exec_() == QtGui.QDialog.Rejected:
                return

        # If exporting to CBZ, this is a filename. If not, this is a directory name.
        out_path = ""

        if self.book.cbz == False:
            out_path = QtGui.QFileDialog.getExistingDirectory(
                self, 'Select a directory to export book to', self.current_dir)
            # Keep track of wherever they moved to find this directory.
            self.current_dir = str(out_path)
        else:
            out_path = QtGui.QFileDialog.getSaveFileName(
                self,
                'Select image file(s) to add',
                # Default to the current directory + the book's title + the cbz extension.
                os.path.join(self.current_dir, "%s.cbz" % self.book.title),
                'Comic Book Archive File (*.cbz);;All files (*.*)')
            # Keep track of wherever they moved to find this file.
            self.current_dir = os.path.split(str(out_path))[0]

        if not out_path.isNull():
            dialog = DialogConvert(self, self.book, out_path)
            dialog.exec_()
예제 #3
0
파일: book.py 프로젝트: soapyie/mangle
    def onBookExport(self):
        if len(self.book.images) == 0:
            QtGui.QMessageBox.warning(self, 'Mangle', 'This book has no images to export')
            return

        if self.book.title is None:
            dialog = DialogOptions(self, self.book)
            if dialog.exec_() == QtGui.QDialog.Rejected:
                return

        directory = QtGui.QFileDialog.getExistingDirectory(self, 'Select a directory to export book to')
        if not directory.isNull():
            dialog = DialogConvert(self, self.book, directory)
            dialog.exec_()
예제 #4
0
파일: book.py 프로젝트: soapyie/mangle
 def onBookOptions(self):
     dialog = DialogOptions(self, self.book)
     dialog.exec_()
예제 #5
0
파일: book.py 프로젝트: jcokimle/mangle
 def onBookOptions(self):
     dialog = DialogOptions(self, self.book)
     if dialog.exec_() == QtGui.QDialog.Accepted:
         self.book.titleSet = True