--- Vago/trunk/Vago/bgImageWizard/bgimagepage2.cpp 2016/10/12 21:35:13 1054 +++ s10k/Vago/bgImageWizard/bgimagepage2.cpp 2017/12/30 13:57:32 1093 @@ -1,12 +1,11 @@ #include "bgimagepage2.h" #include "ui_bgimagepage2.h" -BGImagePage2::BGImagePage2(Logger *myLogger, QWidget *parent) : +BGImagePage2::BGImagePage2(QWidget *parent) : QWizardPage(parent), ui(new Ui::BGImagePage2) { ui->setupUi(this); - this->myLogger = myLogger; this->setTitle("Image to use as background"); 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."); @@ -45,7 +44,7 @@ bool BGImagePage2::validatePage(){ bool BGImagePage2::validateField(QString &field){ if(field.isEmpty()){ - Util::showErrorPopUp("You need to choose an image."); + Util::Dialogs::showError("You need to choose an image."); return false; } @@ -65,12 +64,12 @@ void BGImagePage2::on_pbBrowse_clicked() QImage myImage; if(!myImage.load(selectedImage)){ - UtilVago::showAndLogErrorPopUp(this->myLogger,"Couldn't load image '" + Util::cutNameWithoutBackSlash(selectedImage) + "'. Is the image corrupt?"); + UtilVago::showAndLogErrorPopUp("Couldn't load image '" + Util::FileSystem::cutNameWithoutBackSlash(selectedImage) + "'. Is the image corrupt?"); return; } if(myImage.width() < 256 || myImage.height() < 256){ - UtilVago::showAndLogErrorPopUp(this->myLogger,"Image '" + Util::cutNameWithoutBackSlash(selectedImage) + + UtilVago::showAndLogErrorPopUp("Image '" + Util::FileSystem::cutNameWithoutBackSlash(selectedImage) + "' does not have a width and height >= 256."); return; } @@ -105,7 +104,15 @@ void BGImagePage2::setImage(const QStrin ui->lbImagePreview->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored ); // Update image information - ui->lbImageName->setText(myImageFileInfo.baseName().replace("." + myImageFileInfo.suffix(), "")); + QString imageName = myImageFileInfo.baseName().replace("." + myImageFileInfo.suffix(), ""); + + ui->lbImageName->setToolTip(imageName); + + if(imageName.length() > 30){ + imageName = imageName.mid(0,27) + "..."; + } + + ui->lbImageName->setText(imageName); ui->lbImageWidth->setText(QString::number(image.width())); ui->lbImageHeight->setText(QString::number(image.height())); ui->lbImageType->setText(myImageFileInfo.suffix());