diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-04-19 12:39:59 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-04-19 14:27:54 -0700 |
commit | ad66297cfd843199f39e3a231cb8311652ea183c (patch) | |
tree | fedc6cf6422fa120de30c570f3b9a7a1224242de | |
parent | 4fd4b75269469ee1029c51bdaf8275149d20a929 (diff) | |
download | subsurface-ad66297cfd843199f39e3a231cb8311652ea183c.tar.gz |
desktop: remove user survey
We have never made good use of the results. Let's just remove it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | CODINGSTYLE.md | 4 | ||||
-rw-r--r-- | core/dive.h | 2 | ||||
-rw-r--r-- | core/settings/qPrefDisplay.cpp | 6 | ||||
-rw-r--r-- | core/settings/qPrefDisplay.h | 6 | ||||
-rw-r--r-- | core/subsurfacestartup.c | 6 | ||||
-rw-r--r-- | desktop-widgets/CMakeLists.txt | 3 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 33 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.h | 3 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.ui | 6 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 15 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.h | 7 | ||||
-rw-r--r-- | desktop-widgets/usersurvey.cpp | 134 | ||||
-rw-r--r-- | desktop-widgets/usersurvey.h | 31 | ||||
-rw-r--r-- | desktop-widgets/usersurvey.ui | 191 | ||||
-rw-r--r-- | tests/testqPrefDisplay.cpp | 8 | ||||
-rw-r--r-- | tests/tst_qPrefDisplay.qml | 6 |
16 files changed, 3 insertions, 458 deletions
diff --git a/CODINGSTYLE.md b/CODINGSTYLE.md index c6b6e2593..a185f65b0 100644 --- a/CODINGSTYLE.md +++ b/CODINGSTYLE.md @@ -188,11 +188,11 @@ other editors that implement this coding style, please add them here. translation into other languages. - like this ``` - QString msgTitle = tr("Submit user survey."); + QString msgTitle = tr("Check for updates."); ``` - rather than ``` - QString msgTitle = "Submit user survey."; + QString msgTitle = "Check for updates."; ``` This works by default in classes (indirectly) derived from QObject. Each diff --git a/core/dive.h b/core/dive.h index f15204a4a..2c5a28d72 100644 --- a/core/dive.h +++ b/core/dive.h @@ -243,7 +243,7 @@ extern bool autogroup; struct dive *unregister_dive(int idx); extern void delete_single_dive(int idx); -extern int run_survey, quit, force_root, ignore_bt; +extern int quit, force_root, ignore_bt; #ifdef SUBSURFACE_MOBILE_DESKTOP extern char *testqml; #endif diff --git a/core/settings/qPrefDisplay.cpp b/core/settings/qPrefDisplay.cpp index cea33a90a..c733b0c6b 100644 --- a/core/settings/qPrefDisplay.cpp +++ b/core/settings/qPrefDisplay.cpp @@ -17,9 +17,6 @@ static const QString st_lastDir_default; QString qPrefDisplay::st_theme; static const QString st_theme_default = QStringLiteral("Blue"); -QString qPrefDisplay::st_userSurvey; -static const QString st_userSurvey_default; - QByteArray qPrefDisplay::st_mainSplitter; static const QByteArray st_mainSplitter_default; @@ -61,7 +58,6 @@ void qPrefDisplay::loadSync(bool doSync) if (!doSync) { load_tooltip_position(); load_theme(); - load_userSurvey(); load_mainSplitter(); load_topSplitter(); load_bottomSplitter(); @@ -186,8 +182,6 @@ HANDLE_PROP_QSTRING(Display, "Theme/currentTheme", theme); HANDLE_PROP_QPOINTF(Display, "ProfileMap/tooltip_position", tooltip_position); -HANDLE_PROP_QSTRING(Display, "UserSurvey/SurveyDone", userSurvey); - HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/mainSplitter", mainSplitter); HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/topSplitter", topSplitter); diff --git a/core/settings/qPrefDisplay.h b/core/settings/qPrefDisplay.h index 42d5c8e84..61fa5dbaf 100644 --- a/core/settings/qPrefDisplay.h +++ b/core/settings/qPrefDisplay.h @@ -17,7 +17,6 @@ class qPrefDisplay : public QObject { Q_PROPERTY(bool show_developer READ show_developer WRITE set_show_developer NOTIFY show_developerChanged) Q_PROPERTY(QString theme READ theme WRITE set_theme NOTIFY themeChanged) Q_PROPERTY(QPointF tooltip_position READ tooltip_position WRITE set_tooltip_position NOTIFY tooltip_positionChanged) - Q_PROPERTY(QString userSurvey READ userSurvey WRITE set_userSurvey NOTIFY userSurveyChanged) Q_PROPERTY(QByteArray mainSplitter READ mainSplitter WRITE set_mainSplitter NOTIFY mainSplitterChanged) Q_PROPERTY(QByteArray topSplitter READ topSplitter WRITE set_topSplitter NOTIFY topSplitterChanged) Q_PROPERTY(QByteArray bottomSplitter READ bottomSplitter WRITE set_bottomSplitter NOTIFY bottomSplitterChanged) @@ -45,7 +44,6 @@ public: static bool show_developer() { return prefs.show_developer; } static QString theme() { return st_theme; } static QPointF tooltip_position() { return st_tooltip_position; } - static QString userSurvey() { return st_userSurvey; } static QByteArray mainSplitter() { return st_mainSplitter; } static QByteArray topSplitter() { return st_topSplitter; } static QByteArray bottomSplitter() { return st_bottomSplitter; } @@ -65,7 +63,6 @@ public slots: static void set_show_developer(bool value); static void set_theme(const QString &value); static void set_tooltip_position(const QPointF &value); - static void set_userSurvey(const QString &value); static void set_mainSplitter(const QByteArray &value); static void set_topSplitter(const QByteArray &value); static void set_bottomSplitter(const QByteArray &value); @@ -85,7 +82,6 @@ signals: void show_developerChanged(bool value); void themeChanged(const QString &value); void tooltip_positionChanged(const QPointF &value); - void userSurveyChanged(const QString &value); void mainSplitterChanged(const QByteArray &value); void topSplitterChanged(const QByteArray &value); void bottomSplitterChanged(const QByteArray &value); @@ -110,7 +106,6 @@ private: static void load_lastDir(); static void load_theme(); static void load_tooltip_position(); - static void load_userSurvey(); static void load_mainSplitter(); static void load_topSplitter(); static void load_bottomSplitter(); @@ -127,7 +122,6 @@ private: static QString st_lastDir; static QString st_theme; static QPointF st_tooltip_position; - static QString st_userSurvey; static QByteArray st_mainSplitter; static QByteArray st_topSplitter; static QByteArray st_bottomSplitter; diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c index bf61f9878..c5fb7b611 100644 --- a/core/subsurfacestartup.c +++ b/core/subsurfacestartup.c @@ -103,7 +103,6 @@ struct preferences default_prefs = { .extract_video_thumbnails_position = 20, // The first fifth seems like a reasonable place }; -int run_survey; int ignore_bt; #ifdef SUBSURFACE_MOBILE_DESKTOP char *testqml = NULL; @@ -184,7 +183,6 @@ static void print_help() printf("\n --import logfile ... Logs before this option is treated as base, everything after is imported"); printf("\n --verbose|-v Verbose debug (repeat to increase verbosity)"); printf("\n --version Prints current version"); - printf("\n --survey Offer to submit a user survey"); printf("\n --user=<test> Choose configuration space for user <test>"); #ifdef SUBSURFACE_MOBILE_DESKTOP printf("\n --testqml=<dir> Use QML files from <dir> instead of QML resources"); @@ -243,10 +241,6 @@ void parse_argument(const char *arg) print_version(); exit(0); } - if (strcmp(arg, "--survey") == 0) { - run_survey = true; - return; - } if (strcmp(arg, "--allow_run_as_root") == 0) { ++force_root; return; diff --git a/desktop-widgets/CMakeLists.txt b/desktop-widgets/CMakeLists.txt index 82a81321e..499dd27b9 100644 --- a/desktop-widgets/CMakeLists.txt +++ b/desktop-widgets/CMakeLists.txt @@ -43,7 +43,6 @@ set (SUBSURFACE_UI tableview.ui templateedit.ui urldialog.ui - usersurvey.ui webservices.ui tab-widgets/maintab.ui tab-widgets/TabDiveStatistics.ui @@ -130,8 +129,6 @@ set(SUBSURFACE_INTERFACE textedit.h updatemanager.cpp updatemanager.h - usersurvey.cpp - usersurvey.h ) if(NOT NO_USERMANUAL) diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index e7416fe89..d81a2f914 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -51,7 +51,6 @@ #include "desktop-widgets/subsurfacewebservices.h" #include "desktop-widgets/tab-widgets/maintab.h" #include "desktop-widgets/updatemanager.h" -#include "desktop-widgets/usersurvey.h" #include "desktop-widgets/simplewidgets.h" #include "commands/command.h" @@ -125,7 +124,6 @@ MainWindow::MainWindow() : QMainWindow(), helpView(0), #endif state(VIEWALL), - survey(nullptr), findMovedImagesDialog(nullptr) { Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!"); @@ -1177,13 +1175,6 @@ void MainWindow::on_actionUserManual_triggered() #endif } -void MainWindow::on_actionUserSurvey_triggered() -{ - if(!survey) - survey = new UserSurvey(this); - survey->show(); -} - void MainWindow::on_actionHash_images_triggered() { if(!findMovedImagesDialog) @@ -1333,40 +1324,16 @@ void MainWindow::initialUiSetup() void MainWindow::readSettings() { - static bool firstRun = true; init_proxy(); // now make sure that the cloud menu items are enabled IFF cloud account is verified enableDisableCloudActions(); loadRecentFiles(); - if (firstRun) { - checkSurvey(); - firstRun = false; - } } #undef TOOLBOX_PREF_BUTTON -void MainWindow::checkSurvey() -{ - QSettings s; - s.beginGroup("UserSurvey"); - if (!s.contains("FirstUse42")) { - QVariant value = QDate().currentDate(); - s.setValue("FirstUse42", value); - } - // wait a week for production versions, but not at all for non-tagged builds - int waitTime = 7; - QDate firstUse42 = s.value("FirstUse42").toDate(); - if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && !s.contains("SurveyDone"))) { - if (!survey) - survey = new UserSurvey(this); - survey->show(); - } - s.endGroup(); -} - void MainWindow::writeSettings() { QSettings settings; diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 1fb20a7ce..ec09e7223 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -74,7 +74,6 @@ public: void importFiles(const QStringList importFiles); void setToolButtonsEnabled(bool enabled); void printPlan(); - void checkSurvey(); void setApplicationState(ApplicationState state); bool inPlanner(); NotificationWidget *getNotificationWidget(); @@ -127,7 +126,6 @@ slots: /* other menu actions */ void on_actionAboutSubsurface_triggered(); void on_actionUserManual_triggered(); - void on_actionUserSurvey_triggered(); void on_actionDivePlanner_triggered(); void on_actionReplanDive_triggered(); void on_action_Check_for_Updates_triggered(); @@ -217,7 +215,6 @@ private: void setupForAddAndPlan(const char *model); void configureToolbar(); void setupSocialNetworkMenu(); - QDialog *survey; QDialog *findMovedImagesDialog; struct dive copyPasteDive; struct dive_components what; diff --git a/desktop-widgets/mainwindow.ui b/desktop-widgets/mainwindow.ui index 3e839e51b..5b9e318f5 100644 --- a/desktop-widgets/mainwindow.ui +++ b/desktop-widgets/mainwindow.ui @@ -121,7 +121,6 @@ </property> <addaction name="actionAboutSubsurface"/> <addaction name="action_Check_for_Updates"/> - <addaction name="actionUserSurvey"/> <addaction name="actionUserManual"/> </widget> <widget class="QMenu" name="menuImport"> @@ -659,11 +658,6 @@ <string>Toggle tissue heat-map</string> </property> </action> - <action name="actionUserSurvey"> - <property name="text"> - <string>User &survey</string> - </property> - </action> <action name="action_Undo"> <property name="text"> <string>&Undo</string> diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index 80a17af2a..d016a9dc6 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -4,7 +4,6 @@ #include "core/webservice.h" #include "core/settings/qPrefCloudStorage.h" #include "desktop-widgets/mainwindow.h" -#include "desktop-widgets/usersurvey.h" #include "commands/command.h" #include "core/trip.h" #include "core/errorhelper.h" @@ -478,17 +477,3 @@ void DivelogsDeWebServices::buttonClicked(QAbstractButton *button) break; } } - -UserSurveyServices::UserSurveyServices(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) -{ -} - -QNetworkReply *UserSurveyServices::sendSurvey(QString values) -{ - QNetworkRequest request; - request.setUrl(QString("http://subsurface-divelog.org/survey?%1").arg(values)); - request.setRawHeader("Accept", "text/xml"); - request.setRawHeader("User-Agent", getUserAgent().toUtf8()); - QNetworkReply *reply = manager()->get(request); - return reply; -} diff --git a/desktop-widgets/subsurfacewebservices.h b/desktop-widgets/subsurfacewebservices.h index 8f515e27c..e9b593005 100644 --- a/desktop-widgets/subsurfacewebservices.h +++ b/desktop-widgets/subsurfacewebservices.h @@ -76,11 +76,4 @@ private: bool useSelectedDives; }; -class UserSurveyServices : public QDialog { - Q_OBJECT -public: - QNetworkReply* sendSurvey(QString values); - explicit UserSurveyServices(QWidget *parent = 0, Qt::WindowFlags f = 0); -}; - #endif // SUBSURFACEWEBSERVICES_H diff --git a/desktop-widgets/usersurvey.cpp b/desktop-widgets/usersurvey.cpp deleted file mode 100644 index 9f237abea..000000000 --- a/desktop-widgets/usersurvey.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include <QShortcut> -#include <QMessageBox> -#include <QSettings> - -#include "desktop-widgets/usersurvey.h" -#include "ui_usersurvey.h" -#include "core/version.h" -#include "desktop-widgets/subsurfacewebservices.h" -#include "desktop-widgets/updatemanager.h" - -#include "core/qthelper.h" -#include "core/subsurfacesysinfo.h" - -UserSurvey::UserSurvey(QWidget *parent) : QDialog(parent), - ui(new Ui::UserSurvey) -{ - ui->setupUi(this); - ui->buttonBox->buttons().first()->setText(tr("Send")); - this->adjustSize(); - QShortcut *closeKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this); - connect(closeKey, SIGNAL(activated()), this, SLOT(close())); - QShortcut *quitKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); - connect(quitKey, SIGNAL(activated()), parent, SLOT(close())); - - os = QString("ssrfVers=%1").arg(subsurface_canonical_version()); - os.append(QString("&prettyOsName=%1").arg(SubsurfaceSysInfo::prettyOsName())); - QString arch = SubsurfaceSysInfo::buildCpuArchitecture(); - os.append(QString("&appCpuArch=%1").arg(arch)); - if (arch == "i386") { - QString osArch = SubsurfaceSysInfo::currentCpuArchitecture(); - os.append(QString("&osCpuArch=%1").arg(osArch)); - } - os.append(QString("&uiLang=%1").arg(getUiLanguage())); - os.append(QString("&uuid=%1").arg(getUUID())); - ui->system->setPlainText(getVersion()); -} - -QString UserSurvey::getVersion() -{ - QString arch; - // fill in the system data - QString sysInfo = QString("Subsurface %1").arg(subsurface_canonical_version()); - sysInfo.append(tr("\nOperating system: %1").arg(SubsurfaceSysInfo::prettyOsName())); - arch = SubsurfaceSysInfo::buildCpuArchitecture(); - sysInfo.append(tr("\nCPU architecture: %1").arg(arch)); - if (arch == "i386") - sysInfo.append(tr("\nOS CPU architecture: %1").arg(SubsurfaceSysInfo::currentCpuArchitecture())); - sysInfo.append(tr("\nLanguage: %1").arg(getUiLanguage())); - return sysInfo; -} - -UserSurvey::~UserSurvey() -{ - delete ui; -} - -#define ADD_OPTION(_name) values.append(ui->_name->isChecked() ? "&" #_name "=1" : "&" #_name "=0") - -void UserSurvey::on_buttonBox_accepted() -{ - // now we need to collect the data and submit it - QString values = os; - ADD_OPTION(recreational); - ADD_OPTION(tech); - ADD_OPTION(planning); - ADD_OPTION(download); - ADD_OPTION(divecomputer); - ADD_OPTION(manual); - ADD_OPTION(companion); - values.append(QString("&suggestion=%1").arg(ui->suggestions->toPlainText())); - UserSurveyServices uss(this); - connect(uss.sendSurvey(values), SIGNAL(finished()), SLOT(requestReceived())); - hide(); -} - -void UserSurvey::on_buttonBox_rejected() -{ - QMessageBox response(this); - response.setText(tr("Should we ask you later?")); - response.addButton(tr("Don't ask me again"), QMessageBox::RejectRole); - response.addButton(tr("Ask later"), QMessageBox::AcceptRole); - response.setWindowTitle(tr("Ask again?")); // Not displayed on MacOSX as described in Qt API - response.setIcon(QMessageBox::Question); - response.setWindowModality(Qt::WindowModal); - switch (response.exec()) { - case QDialog::Accepted: - // nothing to do here, we'll just ask again the next time they start - break; - case QDialog::Rejected: - QSettings s; - s.beginGroup("UserSurvey"); - s.setValue("SurveyDone", "declined"); - break; - } - hide(); -} - -void UserSurvey::requestReceived() -{ - QMessageBox msgbox; - QString msgTitle = tr("Submit user survey."); - QString msgText = "<h3>" + tr("Subsurface was unable to submit the user survey.") + "</h3>"; - - QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender()); - if (reply->error() != QNetworkReply::NoError) { - //Network Error - msgText = msgText + "<br/><b>" + tr("The following error occurred:") + "</b><br/>" + reply->errorString() - + "<br/><br/><b>" + tr("Please check your internet connection.") + "</b>"; - } else { - //No network error - QString response(reply->readAll()); - QString responseBody = response.split("\"").at(1); - - msgbox.setIcon(QMessageBox::Information); - - if (responseBody == "OK") { - msgText = tr("Survey successfully submitted."); - QSettings s; - s.beginGroup("UserSurvey"); - s.setValue("SurveyDone", "submitted"); - } else { - msgText = tr("There was an error while trying to check for updates.<br/><br/>%1").arg(responseBody); - msgbox.setIcon(QMessageBox::Warning); - } - } - - msgbox.setWindowTitle(msgTitle); - msgbox.setWindowIcon(QIcon(":subsurface-icon")); - msgbox.setText(msgText); - msgbox.setTextFormat(Qt::RichText); - msgbox.exec(); - reply->deleteLater(); -} diff --git a/desktop-widgets/usersurvey.h b/desktop-widgets/usersurvey.h deleted file mode 100644 index 32acfa87b..000000000 --- a/desktop-widgets/usersurvey.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef USERSURVEY_H -#define USERSURVEY_H - -#include <QDialog> -class QNetworkAccessManager; -class QNetworkReply; - -namespace Ui { - class UserSurvey; -} - -class UserSurvey : public QDialog { - Q_OBJECT - -public: - explicit UserSurvey(QWidget *parent = 0); - ~UserSurvey(); - static QString getVersion(); - -private -slots: - void on_buttonBox_accepted(); - void on_buttonBox_rejected(); - void requestReceived(); - -private: - Ui::UserSurvey *ui; - QString os; -}; -#endif // USERSURVEY_H diff --git a/desktop-widgets/usersurvey.ui b/desktop-widgets/usersurvey.ui deleted file mode 100644 index c509fd2a7..000000000 --- a/desktop-widgets/usersurvey.ui +++ /dev/null @@ -1,191 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>UserSurvey</class> - <widget class="QDialog" name="UserSurvey"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>538</width> - <height>714</height> - </rect> - </property> - <property name="windowTitle"> - <string>User survey</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="0" colspan="3"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string><html><head/><body><p>We would love to learn more about our users, their preferences and their usage habits. Please spare a minute to fill out this form and submit it to the Subsurface team.</p></body></html></string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="0" colspan="3"> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="3" column="0" colspan="3"> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>What kind of diver are you?</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QCheckBox" name="tech"> - <property name="text"> - <string>Technical diver</string> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QCheckBox" name="recreational"> - <property name="text"> - <string>Recreational diver</string> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QCheckBox" name="planning"> - <property name="text"> - <string>Dive planner</string> - </property> - </widget> - </item> - <item row="5" column="0" colspan="3"> - <widget class="Line" name="line_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="6" column="0" colspan="3"> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>Where are you importing data from?</string> - </property> - </widget> - </item> - <item row="7" column="0" colspan="3"> - <widget class="QCheckBox" name="download"> - <property name="text"> - <string>Supported dive computer</string> - </property> - </widget> - </item> - <item row="8" column="0" colspan="3"> - <widget class="QCheckBox" name="divecomputer"> - <property name="text"> - <string>Other software/sources</string> - </property> - </widget> - </item> - <item row="9" column="0" colspan="3"> - <widget class="QCheckBox" name="manual"> - <property name="text"> - <string>Manually entering dives</string> - </property> - </widget> - </item> - <item row="10" column="0" colspan="3"> - <widget class="QCheckBox" name="companion"> - <property name="text"> - <string>Android/iPhone companion app</string> - </property> - </widget> - </item> - <item row="11" column="0" colspan="3"> - <widget class="Line" name="line_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="12" column="0" colspan="3"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Any suggestions? (in English)</string> - </property> - </widget> - </item> - <item row="13" column="0" colspan="3"> - <widget class="QPlainTextEdit" name="suggestions"/> - </item> - <item row="14" column="0" colspan="3"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>The following information about your system will also be submitted.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="15" column="0" colspan="3"> - <widget class="QPlainTextEdit" name="system"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="16" column="1" colspan="2"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="focusPolicy"> - <enum>Qt::TabFocus</enum> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set> - </property> - </widget> - </item> - <item row="0" column="0" colspan="3"> - <widget class="QLabel" name="label"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Subsurface user survey</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </widget> - <tabstops> - <tabstop>tech</tabstop> - <tabstop>recreational</tabstop> - <tabstop>planning</tabstop> - <tabstop>download</tabstop> - <tabstop>divecomputer</tabstop> - <tabstop>manual</tabstop> - <tabstop>companion</tabstop> - <tabstop>suggestions</tabstop> - <tabstop>system</tabstop> - <tabstop>buttonBox</tabstop> - </tabstops> - <resources/> - <connections/> -</ui> diff --git a/tests/testqPrefDisplay.cpp b/tests/testqPrefDisplay.cpp index 6e7b31e18..52e827cbd 100644 --- a/tests/testqPrefDisplay.cpp +++ b/tests/testqPrefDisplay.cpp @@ -49,7 +49,6 @@ void TestQPrefDisplay::test_set_struct() display->set_theme("myTheme"); display->set_lastDir("test1"); display->set_tooltip_position(QPointF(512, 3)); - display->set_userSurvey("my1"); display->set_mainSplitter("main1"); display->set_topSplitter("top1"); display->set_bottomSplitter("bottom1"); @@ -66,7 +65,6 @@ void TestQPrefDisplay::test_set_struct() QCOMPARE(display->theme(), QString("myTheme")); QCOMPARE(display->lastDir(), QString("test1")); QCOMPARE(display->tooltip_position(), QPointF(512, 3)); - QCOMPARE(display->userSurvey(), QString("my1")); QCOMPARE(display->mainSplitter(), QByteArray("main1")); QCOMPARE(display->topSplitter(), QByteArray("top1")); QCOMPARE(display->bottomSplitter(), QByteArray("bottom1")); @@ -90,7 +88,6 @@ void TestQPrefDisplay::test_set_load_struct() display->set_theme("myTheme2"); display->set_lastDir("test2"); display->set_tooltip_position(QPointF(612, 3)); - display->set_userSurvey("my2"); display->set_mainSplitter("main2"); display->set_topSplitter("top2"); display->set_bottomSplitter("bottom2"); @@ -117,7 +114,6 @@ void TestQPrefDisplay::test_set_load_struct() QCOMPARE(display->theme(), QString("myTheme2")); QCOMPARE(display->lastDir(), QString("test2")); QCOMPARE(display->tooltip_position(), QPointF(612, 3)); - QCOMPARE(display->userSurvey(), QString("my2")); QCOMPARE(display->mainSplitter(), QByteArray("main2")); QCOMPARE(display->topSplitter(), QByteArray("top2")); QCOMPARE(display->bottomSplitter(), QByteArray("bottom2")); @@ -180,7 +176,6 @@ void TestQPrefDisplay::test_signals() QSignalSpy spy6(qPrefDisplay::instance(), &qPrefDisplay::themeChanged); QSignalSpy spy7(qPrefDisplay::instance(), &qPrefDisplay::lastDirChanged); QSignalSpy spy8(qPrefDisplay::instance(), &qPrefDisplay::tooltip_positionChanged); - QSignalSpy spy9(qPrefDisplay::instance(), &qPrefDisplay::userSurveyChanged); QSignalSpy spy10(qPrefDisplay::instance(), &qPrefDisplay::mainSplitterChanged); QSignalSpy spy11(qPrefDisplay::instance(), &qPrefDisplay::topSplitterChanged); QSignalSpy spy12(qPrefDisplay::instance(), &qPrefDisplay::bottomSplitterChanged); @@ -197,7 +192,6 @@ void TestQPrefDisplay::test_signals() qPrefDisplay::set_theme("signal myTheme"); qPrefDisplay::set_lastDir("signal test1"); qPrefDisplay::set_tooltip_position(QPointF(12, 3)); - qPrefDisplay::set_userSurvey("signal my1"); qPrefDisplay::set_mainSplitter("signal main1"); qPrefDisplay::set_topSplitter("signal top1"); qPrefDisplay::set_bottomSplitter("signal bottom1"); @@ -214,7 +208,6 @@ void TestQPrefDisplay::test_signals() QCOMPARE(spy6.count(), 1); QCOMPARE(spy7.count(), 1); QCOMPARE(spy8.count(), 1); - QCOMPARE(spy9.count(), 1); QCOMPARE(spy10.count(), 1); QCOMPARE(spy11.count(), 1); QCOMPARE(spy12.count(), 1); @@ -230,7 +223,6 @@ void TestQPrefDisplay::test_signals() QVERIFY(spy6.takeFirst().at(0).toString() == "signal myTheme"); QVERIFY(spy7.takeFirst().at(0).toString() == "signal test1"); QVERIFY(spy8.takeFirst().at(0).toPointF() == QPointF(12, 3)); - QVERIFY(spy9.takeFirst().at(0).toString() == "signal my1"); QVERIFY(spy10.takeFirst().at(0).toByteArray() == QByteArray("signal main1")); QVERIFY(spy11.takeFirst().at(0).toByteArray() == QByteArray("signal top1")); QVERIFY(spy12.takeFirst().at(0).toByteArray() == QByteArray("signal bottom1")); diff --git a/tests/tst_qPrefDisplay.qml b/tests/tst_qPrefDisplay.qml index 80107a7fb..79e76c545 100644 --- a/tests/tst_qPrefDisplay.qml +++ b/tests/tst_qPrefDisplay.qml @@ -44,10 +44,6 @@ TestCase { PrefDisplay.lastDir = "myDir" compare(PrefDisplay.lastDir, "myDir") - var x9 = PrefDisplay.UserSurvey - PrefDisplay.UserSurvey = "yes" - compare(PrefDisplay.UserSurvey, "yes") - //TBD var x10 = PrefDisplay.mainSplitter //TBD PrefDisplay.mainSplitter = ??? //TBD compare(PrefDisplay.mainSplitter, ???) @@ -100,7 +96,6 @@ TestCase { onShow_developerChanged: {spyCatcher.spy5 = true } onThemeChanged: {spyCatcher.spy6 = true } onLastDirChanged: {spyCatcher.spy8 = true } - onUserSurveyChanged: {spyCatcher.spy9 = true } onMaximizedChanged: {spyCatcher.spy13 = true } onLastStateChanged: {spyCatcher.spy16 = true } } @@ -114,7 +109,6 @@ TestCase { PrefDisplay.theme = "qml" // 7 has no signal PrefDisplay.lastDir = "qml" - PrefDisplay.userSurvey = "qml" // 10, 11, 12 have no signal PrefDisplay.maximized = ! PrefDisplay.maximized // 14,15 have no signal |