Commit graph

22 commits

Author SHA1 Message Date
Dirk Hohndel
ddc01e39e7 Move helper functions around
We had a ton of helper functions in qt-gui.cpp which really didn't make
much sense. So I moved them all into qthelper.cpp.

Also moved the UserAgent helper that didn't belong in the UpdateHandler to
begin with - that's a generic helper used in many places...

With this we can successfully build using cmake again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23 09:31:08 -08:00
Lubomir I. Ivanov
c45768a09f add and use a version.c / version.h pair
version.c is now object code which is recompiled each time
ssrf-version.h changes, while the interface file version.h
remains that same at all times and files which include it
will not need to be recompiled.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 13:26:51 -08:00
Thiago Macieira
39ffb0fced Fix Subsurface build with Qt 5.4.1 and later
The intention had been all along to use the 5.4 QSysInfo API, but due to
a silly mistake in the QT_VERSION check, it never got enabled for 5.4.0.
On 5.4.1 it does get enabled and, unfortunately, causes compilation
errors because the API changed between the time we backported to
Subsurface and the final version.

This commit backports the final QSysInfo API from Qt 5.4 into
Subsurface, which includes the renaming of a few functions. Since the
prettyOsName function no longer exists in the Qt API in that form, I've
reimplemented it using the API that does exist.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 06:00:52 -08:00
Dirk Hohndel
0f967063c0 Add unique but random UUID to server queries
With this we can easily eliminate duplicates from our user statistics. The
UUID is completely random and there is no way to link it back to a
specific user. By deleting the settings a user can force a new UUID.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 12:02:13 -08:00
Lubomir I. Ivanov
66c9559aef Typos: mid-sentence capitalization in usersurvey.cpp
some common nouns, even if the S in OS is capitalized but
that's when it's in acronym form.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:16:41 -08:00
Dirk Hohndel
02d8dd5d13 Clean up the header files
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 23:00:43 +13:00
Dirk Hohndel
64c9fff850 Survey: rename "Save" button to "Send"
Fixes #701

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 21:41:41 -06:00
Dirk Hohndel
827d4740c3 Better User Agent for Subsurface
This one is less verbose and very easy to parse. It's guaranteed to have
five components, separated by ':' with no other ':' in the string:

Subsurface:<version>:<PrettyOSName>:<appCpuArch[/osCpuArch]>:<UILang>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08 11:13:05 -07:00
Dirk Hohndel
a9f59c0cb3 Revert "Don't translate components of the version"
This reverts commit 6fdbf2069d.

That was actually the wrong thing to do, now that I think about it.
Instead we should show the translated version on screen and send a
compact, easy to parse variation of this as the User-Agent header.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08 10:44:06 -07:00
Dirk Hohndel
6fdbf2069d Don't translate components of the version
When transmitting the Subsurface version string we always want to use the
English terms, not the localized terms.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08 00:31:18 -07:00
Dirk Hohndel
526ba82b53 Give Subsurface a distinct User Agent string
When accessing websites (divelogs.de, subsurface website) we shouldn't
pretend to be Mozilla 5.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-31 11:20:11 -07:00
Sergey Starosek
88a0dc1bb2 Add missing application icon
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-18 10:21:42 -07:00
Tomaz Canabrava
0dd40b7a51 Rely on QNetworkReply finished() signal instead of AccessManager one
The access manager is only one, while we can make requests from
different parts of the application, so relying on the manager
finished() signal to see if something was done or not was a
not very good move.

The QNetworkReply is created when a get() is invocked on the
AccessManager and that's unique. connect it's finished()
signal instead.

bonus: code cleanup.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 13:56:46 -07:00
Sergey Starosek
b2a3e46184 Fix layout for User Survey
- apply vertical layout to top-level dialog. This solves label clipping
- call adjustSize() on dialog to fit all labels (translated text could
  be longer than original)

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:11:04 -07:00
Anton Lundin
4cea594655 usersurvey: Add : for consistency
All the other statements there had : in them.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 18:42:10 -07:00
Tim Wootton
d2d6b7937e Implements consistent capitalisation and minor tweaks to survey text
Makes capitalisation consistent
Replaces Tech diver with Technical diver
Adds title to survey dialog (was "dialog")

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 16:24:55 -07:00
Dirk Hohndel
d818dc1a84 Remove HTML from translated strings
In some strings that won't be possible as the translation needs to be
aware of line breaks, etc. But for these strings it seems like the right
thing to do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09 10:34:51 -07:00
Dirk Hohndel
fd22e8123b User survey: detect the machine the app is running on
We build 32bit Windows binaries - but we really want to know if the OS is
x86_64 or i386. This little hack should give us that information.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30 15:54:49 -07:00
Dirk Hohndel
b2f473d927 User survey: actually collect and send the data to the backend
This switches the QTextEdit fields to QPlainTextEdit (I don't see a reason
why we should allow HTML here), no longer tries to have a default text but
instead adds labels for the two fields, connects the UI so th data is
collected and uses a bastardized WebServices subclass to send the data to
our backend.

Fixes #546

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30 12:30:46 -07:00
Dirk Hohndel
181d4e2fa6 User survey: small updates
Just make it behave a little more sanely
- support Ctrl-W and Ctrl-Q
- remove the silly placeholder text for system info
- add language and version information

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14 14:35:17 -07:00
Joseph W. Joshua
1ec5e6ffc4 OS Detection
Implements automatic OS and architecture detection. This code has
been taken from the Qt repositories for Qt 5.4 (LGPL) and slightly
modified into the SubsurfaceSysInfo class.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14 12:50:35 -07:00
Dirk Hohndel
cdd3b3d9cd Start a user survey dialog
The idea is that a week after the user starts using Subsurface we ask them
if they would like to submit a survey response.

If you are running a development build, don't wait seven days.

This patch doesn't do anything with the user's selections, doesn't submit
anything to our server, etc. It's just a placeholder to tune what we
should ask, etc.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-13 14:03:51 -07:00