-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #559 from oleg-alexandrov/master
Allow the user to opt out from contacting the developers
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
|
@@ -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); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters