comparison main/Surveyer.cpp @ 334:f50fa43143ae

* Fixes to newer-version and survey-offering logic
author Chris Cannam
date Thu, 27 Aug 2009 16:49:29 +0000
parents faff9cd8f663
children 12888de0dd89
comparison
equal deleted inserted replaced
333:faff9cd8f663 334:f50fa43143ae
94 94
95 QString response = lines[0]; 95 QString response = lines[0];
96 // if (response != "yes") return; 96 // if (response != "yes") return;
97 97
98 QString title = "Sonic Visualiser - User Survey"; 98 QString title = "Sonic Visualiser - User Survey";
99 QString text = "<h3>Sonic Visualiser: Take part in our survey!</h3><p>We at Queen Mary, University of London are running a short survey for users of Sonic Visualiser. We are trying to find out how useful Sonic Visualiser is to people, and what we can do to improve it.</p><p>We do not ask for any personal information, and there's absolutely nothing commercial about it, and it should only take five minutes!</p><p>Would you like to take part?</p>"; 99 QString text = "<h3>Sonic Visualiser: Take part in our survey!</h3><p>We at Queen Mary, University of London are running a short survey for users of Sonic Visualiser. We are trying to find out how useful Sonic Visualiser is to people, and what we can do to improve it.</p><p>We do not ask for any personal information, and it should only take five minutes.</p><p>Would you like to take part?</p>";
100 100
101 QMessageBox mb(dynamic_cast<QWidget *>(parent())); 101 QMessageBox mb(dynamic_cast<QWidget *>(parent()));
102 mb.setWindowTitle(title); 102 mb.setWindowTitle(title);
103 mb.setText(text); 103 mb.setText(text);
104 104
105 QPushButton *yes = mb.addButton(tr("Yes! Take me to the survey"), QMessageBox::ActionRole); 105 QPushButton *yes = mb.addButton(tr("Yes! Take me to the survey"), QMessageBox::ActionRole);
106 mb.addButton(tr("No thanks"), QMessageBox::RejectRole); 106 mb.addButton(tr("No, thanks"), QMessageBox::RejectRole);
107 107
108 mb.exec(); 108 mb.exec();
109
110 QSettings settings;
111 settings.beginGroup("Survey");
112 settings.setValue("countdown", -1);
113 settings.endGroup();
109 114
110 if (mb.clickedButton() == yes) { 115 if (mb.clickedButton() == yes) {
111 QString svarg = SV_VERSION; 116 QString svarg = SV_VERSION;
112 QString platformarg = "unknown"; 117 QString platformarg = "unknown";
113 #ifdef _WIN32 118 #ifdef _WIN32
129 Transform t; 134 Transform t;
130 t.setIdentifier(id); 135 t.setIdentifier(id);
131 QString plugid = t.getPluginIdentifier(); 136 QString plugid = t.getPluginIdentifier();
132 QString type, soname, label; 137 QString type, soname, label;
133 PluginIdentifier::parseIdentifier(plugid, type, soname, label); 138 PluginIdentifier::parseIdentifier(plugid, type, soname, label);
134 packages.insert(soname); 139 if (type == "vamp") packages.insert(soname);
135 } 140 }
136 for (std::set<QString>::const_iterator i = packages.begin(); 141 for (std::set<QString>::const_iterator i = packages.begin();
137 i != packages.end(); ++i) { 142 i != packages.end(); ++i) {
138 if (plugsarg != "") plugsarg = plugsarg + ","; 143 if (plugsarg != "") plugsarg = plugsarg + ",";
139 plugsarg = plugsarg + *i; 144 plugsarg = plugsarg + *i;