| 1 |  | #include "bgimagepage2.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 |  | #include "ui_bgimagepage2.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 3 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 4 | < | BGImagePage2::BGImagePage2(Logger *myLogger, QWidget *parent) : | 
 
 
 
 
 
 
 
 
 | 4 | > | BGImagePage2::BGImagePage2(QWidget *parent) : | 
 
 
 
 
 
 
 
 
 
 
 | 5 |  | QWizardPage(parent), | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 6 |  | ui(new Ui::BGImagePage2) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 7 |  | { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 8 |  | ui->setupUi(this); | 
 
 
 
 
 
 
 
 
 | 9 | – | this->myLogger = myLogger; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 9 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 |  | this->setTitle("Image to use as background"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 |  | this->setSubTitle("Add here the image that you want to convert. Image width and height must be greater than or equal 256 pixels. Example of valid image resolutions: 640x480, 1024x768."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 44 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 45 |  | bool BGImagePage2::validateField(QString &field){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 |  | if(field.isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 | 47 | < | Util::showErrorPopUp("You need to choose an image."); | 
 
 
 
 
 
 
 
 
 | 47 | > | Util::Dialogs::showError("You need to choose an image."); | 
 
 
 
 
 
 
 
 
 
 
 | 48 |  | return false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 50 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 64 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 65 |  | QImage myImage; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 66 |  | if(!myImage.load(selectedImage)){ | 
 
 
 
 
 
 
 
 
 
 
 | 67 | < | UtilVago::showAndLogErrorPopUp(this->myLogger,"Couldn't load image '" + Util::cutNameWithoutBackSlash(selectedImage) + "'. Is the image corrupt?"); | 
 
 
 
 
 
 
 
 
 | 67 | > | UtilVago::showAndLogErrorPopUp("Couldn't load image '" + Util::FileSystem::cutNameWithoutBackSlash(selectedImage) + "'. Is the image corrupt?"); | 
 
 
 
 
 
 
 
 
 
 
 | 68 |  | return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 69 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 70 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 71 |  | if(myImage.width() < 256 || myImage.height() < 256){ | 
 
 
 
 
 
 
 
 
 
 
 | 72 | < | UtilVago::showAndLogErrorPopUp(this->myLogger,"Image '" + Util::cutNameWithoutBackSlash(selectedImage) + | 
 
 
 
 
 
 
 
 
 | 72 | > | UtilVago::showAndLogErrorPopUp("Image '" + Util::FileSystem::cutNameWithoutBackSlash(selectedImage) + | 
 
 
 
 
 
 
 
 
 
 
 | 73 |  | "' does not have a width and height >= 256."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 |  | return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 |  | } |