diff --git a/src/meshlab/CMakeLists.txt b/src/meshlab/CMakeLists.txt index eb0e6daf3..80a21050b 100644 --- a/src/meshlab/CMakeLists.txt +++ b/src/meshlab/CMakeLists.txt @@ -23,6 +23,7 @@ set(SOURCES plugindialog.cpp saveSnapshotDialog.cpp savemaskexporter.cpp + dialogs/congrats_dialog.cpp rich_parameter_gui/richparameterlistdialog.cpp rich_parameter_gui/richparameterlistframe.cpp rich_parameter_gui/richparameterwidgets.cpp @@ -50,6 +51,7 @@ set(HEADERS saveSnapshotDialog.h savemaskexporter.h snapshotsetting.h + dialogs/congrats_dialog.h rich_parameter_gui/richparameterlistdialog.h rich_parameter_gui/richparameterlistframe.h rich_parameter_gui/richparameterwidgets.h @@ -62,8 +64,8 @@ set(HEADERS set(RESOURCES meshlab.qrc) set(UI + dialogs/congrats_dialog.ui ui/aboutDialog.ui - ui/congratsDialog.ui ui/filterScriptDialog.ui ui/filtercreatortab.ui ui/filtergui.ui diff --git a/src/meshlab/dialogs/congrats_dialog.cpp b/src/meshlab/dialogs/congrats_dialog.cpp new file mode 100644 index 000000000..28b3d95f6 --- /dev/null +++ b/src/meshlab/dialogs/congrats_dialog.cpp @@ -0,0 +1,48 @@ +#include "congrats_dialog.h" +#include "ui_congrats_dialog.h" + +#include + +#include +#include + +CongratsDialog::CongratsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::CongratsDialog) +{ + ui->setupUi(this); +} + +CongratsDialog::~CongratsDialog() +{ + delete ui; +} + +void CongratsDialog::on_githubButton_clicked() +{ + QDesktopServices::openUrl(QUrl("https://github.com/cnr-isti-vclab/meshlab/discussions/new")); +} + +void CongratsDialog::on_emailButton_clicked() +{ + QDesktopServices::openUrl(QUrl("mailto:paolo.cignoni@isti.cnr.it;alessandro.muntoni@isti.cnr.it?subject=[MeshLab] Reporting Info on MeshLab Usage - V"+MeshLabApplication::appVer())); +} + +void CongratsDialog::on_closeButton_clicked() +{ + updateDontShowSetting(); + close(); +} + +void CongratsDialog::updateDontShowSetting() +{ + const QString dontRemindMeToSendEmailVar("dontRemindMeToSendEmail"); + QSettings settings; + //This preference values store when you did the last request for a mail + int congratsMeshCounter = settings.value("congratsMeshCounter", 50).toInt(); + settings.setValue("congratsMeshCounter", congratsMeshCounter * 2); + if (ui->dontShowCheckBox->isChecked()) + settings.setValue(dontRemindMeToSendEmailVar, true); + else + settings.setValue(dontRemindMeToSendEmailVar, false); +} diff --git a/src/meshlab/dialogs/congrats_dialog.h b/src/meshlab/dialogs/congrats_dialog.h new file mode 100644 index 000000000..e5127b6b7 --- /dev/null +++ b/src/meshlab/dialogs/congrats_dialog.h @@ -0,0 +1,30 @@ +#ifndef CONGRATS_DIALOG_H +#define CONGRATS_DIALOG_H + +#include + +namespace Ui { +class CongratsDialog; +} + +class CongratsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit CongratsDialog(QWidget *parent = nullptr); + ~CongratsDialog(); + +private slots: + void on_githubButton_clicked(); + + void on_emailButton_clicked(); + + void on_closeButton_clicked(); + +private: + void updateDontShowSetting(); + Ui::CongratsDialog *ui; +}; + +#endif // CONGRATS_DIALOG_H diff --git a/src/meshlab/dialogs/congrats_dialog.ui b/src/meshlab/dialogs/congrats_dialog.ui new file mode 100644 index 000000000..4ad95278b --- /dev/null +++ b/src/meshlab/dialogs/congrats_dialog.ui @@ -0,0 +1,99 @@ + + + CongratsDialog + + + + 0 + 0 + 758 + 486 + + + + Dialog + + + + + + Close + + + + :/images/stop.png:/images/stop.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Send us an email + + + + :/images/email-icon.png:/images/email-icon.png + + + + + + + Share on GitHub + + + + :/images/github-icon.png:/images/github-icon.png + + + true + + + + + + + Don't show this message again. + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + Congratulations + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><title>Congratulations</title><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Sans'; font-size:18pt;">Congratulations! </span><br /><span style=" font-family:'Lucida Sans';"><br />You have successfully used MeshLab to open and process more than </span><span style=" font-family:'Lucida Sans'; font-style:italic;">one hundred meshes</span><span style=" font-family:'Lucida Sans';">!<br />We hope that this means that you have found MeshLab useful.<br /><br />Please consider to share your experience on GitHub, or to send a short email to the developers of MeshLab, describing how MeshLab fitted your needs. Attach some screenshots of your processed meshes and tell us your impression about MeshLab. <br /><br />MeshLab is developed on public funding and assessment of its impact on the whole community is necessary, so, </span><span style=" font-family:'Lucida Sans'; font-style:italic;">please</span><span style=" font-family:'Lucida Sans';">, spend a couple of minutes sharing your experience to us (or at least connect with the MeshLab FaceBook page).<br /><br />Thanks for using MeshLab<br /><br />Paolo Cignoni<br /><br /></span><a href="http://www.facebook.com/MeshLab"><img src=":images/facebook.gif" /></a><span style=" font-family:'Lucida Sans';"> </span></p></body></html> + + + + + + + + + + diff --git a/src/meshlab/images/100mesh.html b/src/meshlab/images/100mesh.html deleted file mode 100644 index 4b5742fc3..000000000 --- a/src/meshlab/images/100mesh.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -
-
- - Congratulations! -
-
- You have successfully used MeshLab to open and process more than one hundred meshes!
- We hope that this means that you have found MeshLab useful.

- Please consider to send a short email to the developers of MeshLab, describing how MeshLab fitted your needs, - attach to the email some screenshots of your processed meshes and tell us your impression about MeshLab.
-
- MeshLab is developed on public funding and assessment of its impact on the whole community is necessary, so, - please, spend a couple of minutes writing down a mail to us - (or at least connect with the MeshLab FaceBook page).

- Thanks for using MeshLab
-
- Paolo Cignoni
-
- -
-
-
- - \ No newline at end of file diff --git a/src/meshlab/images/email-icon.png b/src/meshlab/images/email-icon.png new file mode 100644 index 000000000..3a6fabb6c Binary files /dev/null and b/src/meshlab/images/email-icon.png differ diff --git a/src/meshlab/images/github-icon.png b/src/meshlab/images/github-icon.png new file mode 100644 index 000000000..e613fc954 Binary files /dev/null and b/src/meshlab/images/github-icon.png differ diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 0296df1e0..282d22680 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -43,8 +43,7 @@ #include "plugindialog.h" #include "meshlab_settings/meshlabsettingsdialog.h" #include "saveSnapshotDialog.h" -#include "ui_congratsDialog.h" - +#include "dialogs/congrats_dialog.h" QProgressBar *MainWindow::qb; @@ -949,30 +948,11 @@ void MainWindow::sendUsAMail() return; int loadedMeshCounter = settings.value("loadedMeshCounter").toInt(); - //int connectionInterval = settings.value("connectionInterval", 20).toInt(); - //int lastComunicatedValue = settings.value("lastComunicatedValue", 0).toInt(); int congratsMeshCounter = settings.value("congratsMeshCounter", 50).toInt(); - if (loadedMeshCounter > congratsMeshCounter) - { - QDialog *congratsDialog = new QDialog(); - Ui::CongratsDialog temp; - temp.setupUi(congratsDialog); - temp.buttonBox->addButton("Send Mail", QDialogButtonBox::AcceptRole); - - QCheckBox dontRemindMeCheckBox("Don't show this message again."); - dontRemindMeCheckBox.blockSignals(true); - temp.buttonBox->addButton(&dontRemindMeCheckBox, QDialogButtonBox::ActionRole); - - congratsDialog->exec(); - if (congratsDialog->result() == QDialog::Accepted) - QDesktopServices::openUrl(QUrl("mailto:paolo.cignoni@isti.cnr.it;alessandro.muntoni@isti.cnr.it?subject=[MeshLab] Reporting Info on MeshLab Usage - V"+MeshLabApplication::appVer())); - // This preference values store when you did the last request for a mail - settings.setValue("congratsMeshCounter", congratsMeshCounter * 2); - - // See if the user checked the box to not be reminded again - if (dontRemindMeCheckBox.checkState() == Qt::Checked) - settings.setValue(dontRemindMeToSendEmailVar, true); + if (loadedMeshCounter > congratsMeshCounter) { + CongratsDialog* congratsDialog = new CongratsDialog(this); + congratsDialog->show(); } } diff --git a/src/meshlab/meshlab.pro b/src/meshlab/meshlab.pro index e2da7a2d1..c52db8bec 100644 --- a/src/meshlab/meshlab.pro +++ b/src/meshlab/meshlab.pro @@ -16,7 +16,7 @@ INCLUDEPATH *= \ ../.. \ $$MESHLAB_EXTERNAL_DIRECTORY/easyexif \ $$VCGDIR \ - $$EIGENDIR + $$EIGENDIR !CONFIG(system_glew): INCLUDEPATH *= $$GLEWDIR/include @@ -28,6 +28,7 @@ DEPENDPATH += \ HEADERS += \ mainwindow.h \ glarea.h \ + dialogs/congrats_dialog.h \ meshlab_settings/meshlabsettingsdialog.h \ meshlab_settings/settingdialog.h \ multiViewer_Container.h \ @@ -56,6 +57,7 @@ SOURCES += \ mainwindow_Init.cpp \ mainwindow_RunTime.cpp \ glarea.cpp \ + dialogs/congrats_dialog.cpp \ meshlab_settings/meshlabsettingsdialog.cpp \ meshlab_settings/settingdialog.cpp \ multiViewer_Container.cpp \ @@ -76,16 +78,16 @@ SOURCES += \ glarea_setting.cpp \ rich_parameter_gui/richparameterlistdialog.cpp \ rich_parameter_gui/richparameterlistframe.cpp \ - rich_parameter_gui/richparameterwidgets.cpp + rich_parameter_gui/richparameterwidgets.cpp FORMS += \ + dialogs/congrats_dialog.ui \ ui/layerDialog.ui \ ui/filterScriptDialog.ui \ ui/savesnapshotDialog.ui \ ui/aboutDialog.ui \ ui/renametexture.ui \ ui/savemaskexporter.ui \ - ui/congratsDialog.ui \ ui/filtergui.ui RESOURCES += \ diff --git a/src/meshlab/meshlab.qrc b/src/meshlab/meshlab.qrc index 72f7122ca..476b9af90 100644 --- a/src/meshlab/meshlab.qrc +++ b/src/meshlab/meshlab.qrc @@ -32,7 +32,6 @@ images/layer_eye_close.png images/layer_edit_locked.png images/layer_edit_unlocked.png - images/100mesh.html images/facebook.gif images/onscreenHelp.txt images/splitV.png @@ -51,5 +50,7 @@ images/search.png images/dummy.png images/meshlabLogo_256x256.png + images/email-icon.png + images/github-icon.png diff --git a/src/meshlab/ui/congratsDialog.ui b/src/meshlab/ui/congratsDialog.ui deleted file mode 100644 index 7ca682e0e..000000000 --- a/src/meshlab/ui/congratsDialog.ui +++ /dev/null @@ -1,92 +0,0 @@ - - - CongratsDialog - - - Qt::ApplicationModal - - - - 0 - 0 - 641 - 449 - - - - - 0 - 0 - - - - MeshLab Congratulations! - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Congratulations</span>! <br /><br />You have successfully used MeshLab to open and process more than one hundred meshes!<br />We hope that this means that you have found MeshLab useful.<br /><br />Please consider to send a short email to the developers of MeshLab, describing how MeshLab fitted your needs, attach to the email some screenshots of your processed meshes and tell us your impression about MeshLab. <br /><br />MeshLab is developed on public funding and assessment of its impact on the whole community is necessary, so, please, spend a couple of minutes writing down a mail to us (or at least connect with the MeshLab FaceBook page).<br /><br />Thanks for using MeshLab<br /><br />Paolo Cignoni<br /><br /><a href="http://www.facebook.com/MeshLab"><img src=":images/facebook.gif" /></a></p></body></html> - - - - qrc:/images/100mesh.html - - - - true - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel - - - - - - - - - buttonBox - accepted() - CongratsDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - CongratsDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -