about dialog compiler and Qt version used to build meshlab

This commit is contained in:
alemuntoni 2020-11-02 16:59:39 +01:00
parent 2a2f6a7f98
commit 8a9efd513b
3 changed files with 74 additions and 43 deletions

View File

@ -2,29 +2,40 @@
#include "mlexception.h"
#include <vcg/complex/complex.h>
#define xstr(a) str(a)
#define str(a) #a
#ifndef MESHLAB_VERSION
#define MESHLAB_VERSION 2020.09
#endif
#if defined(__GNUC__) || defined(__GNUG__)
#define ML_COMPILER "GCC"
#define ML_COMPILER_VER MeshLabApplication::versionString(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
#elif defined(__clang__)
#define ML_COMPILER "Clang"
#define ML_COMPILER_VER MeshLabApplication::versionString(__clang_major__, __clang_minor__, __clang_patchlevel__)
#elif defined(_MSC_VER)
#define ML_COMPILER "MSVC"
#define ML_COMPILER_VER std::to_string(_MSC_VER)
#endif
#define xstr(a) stringify(a)
#define stringify(a) #a
bool MeshLabApplication::notify( QObject * rec, QEvent * ev )
{
try
{
return QApplication::notify(rec,ev);
}
catch (MLException& e)
{
qCritical("%s",e.what());
}
catch (vcg::MissingComponentException &e )
{
qCritical("%s",e.what());
abort();
}
catch (...)
{
qCritical("Something really bad happened!!!!!!!!!!!!!");
abort();
}
try {
return QApplication::notify(rec,ev);
}
catch (MLException& e) {
qCritical("%s",e.what());
}
catch (vcg::MissingComponentException &e ) {
qCritical("%s",e.what());
abort();
}
catch (...) {
qCritical("Something really bad happened!!!!!!!!!!!!!");
abort();
}
return false;
}
@ -33,3 +44,20 @@ const QString MeshLabApplication::appVer()
return QString(xstr(MESHLAB_VERSION));
}
const QString MeshLabApplication::compilerVersion()
{
return QString(ML_COMPILER) + QString(" ") + QString::fromStdString(ML_COMPILER_VER);
}
const QString MeshLabApplication::qtVersion()
{
return QString(QT_VERSION_STR);
}
std::string MeshLabApplication::versionString(int a, int b, int c)
{
std::ostringstream ss;
ss << a << '.' << b << '.' << c;
return ss.str();
}

View File

@ -7,32 +7,33 @@
#include <wrap/gl/gl_mesh_attributes_info.h>
#include "ml_mesh_type.h"
#ifndef MESHLAB_VERSION
#define MESHLAB_VERSION 2020.02
#endif
class MeshLabApplication : public QApplication
{
public:
enum HW_ARCHITECTURE {HW_32BIT = 32,HW_64BIT = 64};
MeshLabApplication(int &argc, char *argv[]):QApplication(argc,argv){}
~MeshLabApplication(){}
enum HW_ARCHITECTURE {HW_32BIT = 32,HW_64BIT = 64};
MeshLabApplication(int &argc, char *argv[]):QApplication(argc,argv){}
~MeshLabApplication(){}
bool notify(QObject * rec, QEvent * ev);
static const QString appName(){return tr("MeshLab"); }
static const QString architecturalSuffix(const HW_ARCHITECTURE hw) {return "_" + QString::number(int(hw)) + "bit";}
static const QString appArchitecturalName(const HW_ARCHITECTURE hw) {return appName() + architecturalSuffix(hw) + "_" + MeshLabScalarTest<MESHLAB_SCALAR>::floatingPointPrecision();}
static const QString appName(){return tr("MeshLab"); }
static const QString architecturalSuffix(const HW_ARCHITECTURE hw) {return "_" + QString::number(int(hw)) + "bit";}
static const QString appArchitecturalName(const HW_ARCHITECTURE hw) {return appName() + architecturalSuffix(hw) + "_" + MeshLabScalarTest<MESHLAB_SCALAR>::floatingPointPrecision();}
static const QString appVer();
static const QString shortName() { return appName() + " " + appVer(); }
static const QString completeName(const HW_ARCHITECTURE hw){return appArchitecturalName(hw) + " v" + appVer(); }
static const QString organization(){return tr("VCG");}
static const QString organizationHost() {return tr("http://vcg.isti.cnr.it");}
static const QString webSite() {return tr("http://www.meshlab.net/");}
static const QString downloadSite() {return tr("http://www.meshlab.net/#download");}
static const QString pluginsPathRegisterKeyName() {return tr("pluginsPath");}
static const QString versionRegisterKeyName() {return tr("version");}
static const QString wordSizeKeyName() {return tr("wordSize");}
static const QString compilerVersion();
static const QString qtVersion();
static const QString shortName() { return appName() + " " + appVer(); }
static const QString completeName(const HW_ARCHITECTURE hw){return appArchitecturalName(hw) + " v" + appVer(); }
static const QString organization(){return tr("VCG");}
static const QString organizationHost() {return tr("http://vcg.isti.cnr.it");}
static const QString webSite() {return tr("http://www.meshlab.net/");}
static const QString downloadSite() {return tr("http://www.meshlab.net/#download");}
static const QString pluginsPathRegisterKeyName() {return tr("pluginsPath");}
static const QString versionRegisterKeyName() {return tr("version");}
static const QString wordSizeKeyName() {return tr("wordSize");}
private:
static std::string versionString(int a, int b, int c);
};
#endif

View File

@ -2646,8 +2646,10 @@ void MainWindow::about()
QDialog *about_dialog = new QDialog();
Ui::aboutDialog temp;
temp.setupUi(about_dialog);
temp.labelMLName->setText(MeshLabApplication::completeName(MeshLabApplication::HW_ARCHITECTURE(QSysInfo::WordSize))+" (built on "+__DATE__+")");
//about_dialog->setFixedSize(566,580);
temp.labelMLName->setText(
MeshLabApplication::completeName(MeshLabApplication::HW_ARCHITECTURE(QSysInfo::WordSize)) + "\n" +
"built on "+__DATE__+" with " + MeshLabApplication::compilerVersion() +
" and Qt " + MeshLabApplication::qtVersion() + ".");
about_dialog->show();
}