"Fossies" - the Fresh Open Source Software Archive

Member "ffmulticonverter-1.8.0/ffmulticonverter/documenttab.py" (20 Jun 2016, 1913 Bytes) of package /linux/privat/ffmulticonverter-1.8.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "documenttab.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.7.2_vs_1.8.0.

    1 # Copyright (C) 2011-2016 Ilias Stamatis <stamatis.iliass@gmail.com>
    2 #
    3 # This program is free software: you can redistribute it and/or modify
    4 # it under the terms of the GNU General Public License as published by
    5 # the Free Software Foundation, either version 3 of the License, or
    6 # (at your option) any later version.
    7 #
    8 # This program is distributed in the hope that it will be useful,
    9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   11 # GNU General Public License for more details.
   12 #
   13 # You should have received a copy of the GNU General Public License
   14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
   15 
   16 from PyQt5.QtWidgets import QWidget, QLabel, QComboBox, QMessageBox
   17 
   18 from ffmulticonverter import utils
   19 from ffmulticonverter import config
   20 
   21 
   22 class ValidationError(Exception):
   23     pass
   24 
   25 
   26 class DocumentTab(QWidget):
   27     def __init__(self, parent):
   28         self.parent = parent
   29         super(DocumentTab, self).__init__(parent)
   30         self.name = 'Documents'
   31         self.formats = config.document_formats
   32 
   33         convertQL = QLabel(self.tr('Convert to:'))
   34         self.extQCB = QComboBox()
   35         final_layout = utils.add_to_layout('h', convertQL, self.extQCB, None)
   36         self.setLayout(final_layout)
   37 
   38     def fill_extension_combobox(self, extraformats):
   39         self.extQCB.clear()
   40         self.extQCB.addItems(sorted(self.formats + extraformats))
   41 
   42     def ok_to_continue(self):
   43         """
   44         Check if everything is ok with documenttab to continue conversion.
   45 
   46         Checks if:
   47         - unoconv is missing.
   48 
   49         Return True if all tests pass, else False.
   50         """
   51         if not self.parent.unoconv:
   52             QMessageBox.warning(self, 'FF Multi Converter - ' + self.tr('Error!'),
   53                     self.tr('Unocov is not installed!'))
   54             return False
   55         return True