"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ffmulticonverter/imagetab.py" between
ffmulticonverter-1.7.2.tar.gz and ffmulticonverter-1.8.0.tar.gz

About: FF Multi Converter is a graphical application which enables you to convert audio, video, image and document files between all popular formats, using and combining other programs.

imagetab.py  (ffmulticonverter-1.7.2):imagetab.py  (ffmulticonverter-1.8.0)
# Copyright (C) 2011-2015 Ilias Stamatis <stamatis.iliass@gmail.com> # Copyright (C) 2011-2016 Ilias Stamatis <stamatis.iliass@gmail.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt4.QtCore import QRegExp from PyQt5.QtCore import QRegExp
from PyQt4.QtGui import ( from PyQt5.QtGui import QRegExpValidator
QWidget, QRegExpValidator, QLabel, QComboBox, QCheckBox, QLineEdit, from PyQt5.QtWidgets import (
QMessageBox QWidget, QLabel, QComboBox, QCheckBox, QLineEdit, QMessageBox
) )
from ffmulticonverter import utils from ffmulticonverter import utils
from ffmulticonverter import config from ffmulticonverter import config
class ImageTab(QWidget): class ImageTab(QWidget):
def __init__(self, parent): def __init__(self, parent):
super(ImageTab, self).__init__(parent) super(ImageTab, self).__init__(parent)
self.parent = parent self.parent = parent
self.name = 'Images' self.name = 'Images'
self.formats = config.image_formats self.formats = config.image_formats
self.extra_img = config.image_extra_formats self.extra_img = config.image_extra_formats
validator = QRegExpValidator(QRegExp(r'^[1-9]\d*'), self) validator = QRegExpValidator(QRegExp(r'^[1-9]\d*'), self)
converttoQL = QLabel(self.tr('Convert to:')) converttoQL = QLabel(self.tr('Convert to:'))
self.extQCB = QComboBox() self.extQCB = QComboBox()
self.extQCB.addItems(self.formats)
commandQL = QLabel(self.tr('Extra options:')) commandQL = QLabel(self.tr('Extra options:'))
self.commandQLE = QLineEdit() self.commandQLE = QLineEdit()
hlayout2 = utils.add_to_layout( hlayout2 = utils.add_to_layout(
'h', converttoQL, self.extQCB, commandQL, self.commandQLE) 'h', converttoQL, self.extQCB, commandQL, self.commandQLE)
sizeQL = QLabel( sizeQL = QLabel(
'<html><p align="center">' + self.tr('Image Size:') + '<html><p align="center">' + self.tr('Image Size:') +
'</p></html>') '</p></html>')
self.widthQLE = utils.create_LineEdit((50, 16777215), validator, 4) self.widthQLE = utils.create_LineEdit((50, 16777215), validator, 4)
skipping to change at line 88 skipping to change at line 87
self.widthQLE.clear() self.widthQLE.clear()
self.heightQLE.clear() self.heightQLE.clear()
self.commandQLE.clear() self.commandQLE.clear()
self.rotateQLE.clear() self.rotateQLE.clear()
self.imgaspectQChB.setChecked(False) self.imgaspectQChB.setChecked(False)
self.autocropQChB.setChecked(False) self.autocropQChB.setChecked(False)
self.vflipQChB.setChecked(False) self.vflipQChB.setChecked(False)
self.hflipQChB.setChecked(False) self.hflipQChB.setChecked(False)
def fill_extension_combobox(self, extraformats): def fill_extension_combobox(self, extraformats):
extraformats = [i for i in extraformats.split("\n")] if extraformats els e []
self.extQCB.clear() self.extQCB.clear()
self.extQCB.addItems(sorted(self.formats + extraformats)) self.extQCB.addItems(sorted(self.formats + extraformats))
def ok_to_continue(self): def ok_to_continue(self):
""" """
Check if everything is ok with imagetab to continue conversion. Check if everything is ok with imagetab to continue conversion.
Check if: Check if:
- ImageMagick is missing. - ImageMagick is missing.
- Either none or both size lineEdits are active at a time. - Either none or both size lineEdits are active at a time.
Return True if all tests pass, else False. Return True if all tests pass, else False.
""" """
width = self.widthQLE.text() width = self.widthQLE.text()
height = self.heightQLE.text() height = self.heightQLE.text()
if not self.parent.imagemagick: if not self.parent.imagemagick:
QMessageBox.warning(self, 'FF Multi Converter - ' + self.tr( QMessageBox.warning(self, 'FF Multi Converter - ' + self.tr(
'Error!'), self.tr('ImageMagick is not installed.\nYou will ' 'Error!'), self.tr('ImageMagick is not installed!'))
'not be able to convert image files until you install it.'))
return False return False
if (width and not height) or (not width and height): if (width and not height) or (not width and height):
QMessageBox.warning(self, 'FF Multi Converter - ' + self.tr( QMessageBox.warning(self, 'FF Multi Converter - ' + self.tr(
'Error!'), self.tr('The size LineEdit may not be empty.')) 'Error!'), self.tr('The size LineEdit may not be empty.'))
if width and not height: if width and not height:
self.heightQLE.setFocus() self.heightQLE.setFocus()
else: else:
self.widthQLE.setFocus() self.widthQLE.setFocus()
return False return False
return True return True
 End of changes. 5 change blocks. 
9 lines changed or deleted 6 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS