Skip to content

Commit

Permalink
Merge pull request #559 from oleg-alexandrov/master
Browse files Browse the repository at this point in the history
Allow the user to opt out from contacting the developers
  • Loading branch information
alemuntoni authored Jan 27, 2020
2 parents 64c2c45 + 18db38b commit 2534235
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/meshlab/glarea.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public slots:
}
}

void updatePerMeshDecorators(int mesh_id)
void updatePerMeshDecorators(int)
{
update();
}
Expand Down
18 changes: 18 additions & 0 deletions src/meshlab/mainwindow_Init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,15 @@ void MainWindow::saveRecentFileList(const QString &fileName)
void MainWindow::sendUsAMail()
{
QSettings settings;

// Check if the user specified not to be reminded to send email
const QString dontRemindMeToSendEmailVar("dontRemindMeToSendEmail");
bool dontRemindMeToSendEmailVal = false;
if (settings.contains(dontRemindMeToSendEmailVar))
dontRemindMeToSendEmailVal = settings.value(dontRemindMeToSendEmailVar).toBool();
if (dontRemindMeToSendEmailVal)
return;

int loadedMeshCounter = settings.value("loadedMeshCounter").toInt();
//int connectionInterval = settings.value("connectionInterval", 20).toInt();
//int lastComunicatedValue = settings.value("lastComunicatedValue", 0).toInt();
Expand All @@ -1102,11 +1111,20 @@ void MainWindow::sendUsAMail()
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:[email protected];[email protected]?subject=[MeshLab] Reporting Info on MeshLab Usage"));
// 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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/meshlab/ml_default_decorators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void MLDefaultMeshDecorators::drawQuotedLine(const vcg::Point3d &a,const vcg::Po
glDisable(GL_LIGHT0);
glDisable(GL_NORMALIZE);
float labelMargin =tickScalarDistance /4.0;
float firstTick;
float firstTick = 0.0;
// fmod returns the floating-point remainder of numerator/denominator (with the sign of the dividend)
// fmod ( 104.5 , 10) returns 4.5 --> aVal - fmod(aval/tick) = 100
// fmod ( -104.5 , 10) returns -4.5
Expand All @@ -333,7 +333,7 @@ void MLDefaultMeshDecorators::drawQuotedLine(const vcg::Point3d &a,const vcg::Po


float tickDistTen=tickScalarDistance /10.0f;
float firstTickTen;
float firstTickTen = 0.0;
if(aVal > 0) firstTickTen = aVal - fmod(aVal,tickDistTen) + tickDistTen;
else firstTickTen = aVal - fmod(aVal,tickDistTen);

Expand Down

0 comments on commit 2534235

Please sign in to comment.