diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-02-27 18:48:34 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-02-27 18:48:34 (GMT) |
commit | ed44de57dd20af2bf1ef7ca66542688cf28854bc (patch) | |
tree | 1251986889b3fe4674a5491ace43934126537b4a /addon/doxywizard | |
parent | 910d2c0d0c226e86d3181cd5da32118002835f24 (diff) | |
parent | 164864d9bc8ea7e32a69fbc0e47cff54dc678a48 (diff) | |
download | Doxygen-ed44de57dd20af2bf1ef7ca66542688cf28854bc.zip Doxygen-ed44de57dd20af2bf1ef7ca66542688cf28854bc.tar.gz Doxygen-ed44de57dd20af2bf1ef7ca66542688cf28854bc.tar.bz2 |
Merge pull request #126 from albert-github/feature/bug_doxywizard_logo_msg
Give message when PROJECT_LOGO cannot be found or cannot be converted
Diffstat (limited to 'addon/doxywizard')
-rw-r--r-- | addon/doxywizard/wizard.cpp | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/addon/doxywizard/wizard.cpp b/addon/doxywizard/wizard.cpp index ce989e7..c4cda76 100644 --- a/addon/doxywizard/wizard.cpp +++ b/addon/doxywizard/wizard.cpp @@ -481,10 +481,7 @@ Step1::Step1(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(w m_projNumber = new QLineEdit; QPushButton *projIconSel = new QPushButton(this); projIconSel->setText(tr("Select...")); - QPixmap pm(QSize(120,55)); - pm.fill(); m_projIconLab = new QLabel; - m_projIconLab->setPixmap(pm); grid->addWidget(m_projName,0,1,1,2); grid->addWidget(m_projBrief,1,1,1,2); @@ -567,12 +564,24 @@ void Step1::selectProjectIcon() QString path = QFileInfo(MainWindow::instance().configFileName()).path(); QString iconName = QFileDialog::getOpenFileName(this, tr("Select project icon/image"),path); - QPixmap pm(iconName); - if (!pm.isNull()) + QFile Fout(iconName); + if(!Fout.exists()) { - m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation)); - updateStringOption(m_modelData,STR_PROJECT_LOGO,iconName); + m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromAscii(");")); } + else + { + QPixmap pm(iconName); + if (!pm.isNull()) + { + m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation)); + } + else + { + m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromAscii(");")); + } + } + updateStringOption(m_modelData,STR_PROJECT_LOGO,iconName); } void Step1::selectSourceDir() @@ -663,17 +672,27 @@ void Step1::init() QString iconName = getStringOption(m_modelData,STR_PROJECT_LOGO); if (!iconName.isEmpty()) { - QPixmap pm(iconName); - if (!pm.isNull()) + QFile Fout(iconName); + if(!Fout.exists()) { - m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation)); + m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromAscii(");")); + } + else + { + QPixmap pm(iconName); + if (!pm.isNull()) + { + m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation)); + } + else + { + m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromAscii(");")); + } } } else { - QPixmap pm(QSize(120,55)); - pm.fill(); - m_projIconLab->setPixmap(pm); + m_projIconLab->setText(tr("No Project logo selected.")); } option = m_modelData[STR_INPUT]; if (option->value().toStringList().count()>0) |