mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-17 10:04:38 +00:00
new congrats dialog
This commit is contained in:
parent
c4b73202cd
commit
1fb4e85f62
@ -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
|
||||
|
||||
48
src/meshlab/dialogs/congrats_dialog.cpp
Normal file
48
src/meshlab/dialogs/congrats_dialog.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
#include "congrats_dialog.h"
|
||||
#include "ui_congrats_dialog.h"
|
||||
|
||||
#include <common/mlapplication.h>
|
||||
|
||||
#include <QSettings>
|
||||
#include <QDesktopServices>
|
||||
|
||||
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);
|
||||
}
|
||||
30
src/meshlab/dialogs/congrats_dialog.h
Normal file
30
src/meshlab/dialogs/congrats_dialog.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef CONGRATS_DIALOG_H
|
||||
#define CONGRATS_DIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
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
|
||||
99
src/meshlab/dialogs/congrats_dialog.ui
Normal file
99
src/meshlab/dialogs/congrats_dialog.ui
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CongratsDialog</class>
|
||||
<widget class="QDialog" name="CongratsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>758</width>
|
||||
<height>486</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="closeButton">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../meshlab.qrc">
|
||||
<normaloff>:/images/stop.png</normaloff>:/images/stop.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="emailButton">
|
||||
<property name="text">
|
||||
<string>Send us an email</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../meshlab.qrc">
|
||||
<normaloff>:/images/email-icon.png</normaloff>:/images/email-icon.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QPushButton" name="githubButton">
|
||||
<property name="text">
|
||||
<string>Share on GitHub</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../meshlab.qrc">
|
||||
<normaloff>:/images/github-icon.png</normaloff>:/images/github-icon.png</iconset>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="dontShowCheckBox">
|
||||
<property name="text">
|
||||
<string>Don't show this message again.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="6">
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="documentTitle">
|
||||
<string>Congratulations</string>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!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></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../meshlab.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -1,28 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<div style="text-align: center;">
|
||||
<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 <em> one hundred meshes</em>!<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,
|
||||
<em>please</em>, 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>
|
||||
</span>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
BIN
src/meshlab/images/email-icon.png
Normal file
BIN
src/meshlab/images/email-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
BIN
src/meshlab/images/github-icon.png
Normal file
BIN
src/meshlab/images/github-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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 += \
|
||||
|
||||
@ -32,7 +32,6 @@
|
||||
<file>images/layer_eye_close.png</file>
|
||||
<file>images/layer_edit_locked.png</file>
|
||||
<file>images/layer_edit_unlocked.png</file>
|
||||
<file>images/100mesh.html</file>
|
||||
<file>images/facebook.gif</file>
|
||||
<file>images/onscreenHelp.txt</file>
|
||||
<file>images/splitV.png</file>
|
||||
@ -51,5 +50,7 @@
|
||||
<file>images/search.png</file>
|
||||
<file>images/dummy.png</file>
|
||||
<file>images/meshlabLogo_256x256.png</file>
|
||||
<file>images/email-icon.png</file>
|
||||
<file>images/github-icon.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CongratsDialog</class>
|
||||
<widget class="QDialog" name="CongratsDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>641</width>
|
||||
<height>449</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MeshLab Congratulations!</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="congratsTextBrowser">
|
||||
<property name="html">
|
||||
<string><!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></string>
|
||||
</property>
|
||||
<property name="source">
|
||||
<url>
|
||||
<string>qrc:/images/100mesh.html</string>
|
||||
</url>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>CongratsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>CongratsDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Loading…
x
Reference in New Issue
Block a user