Commit Graph
29 Commits
Author SHA1 Message Date
Vasily 148acf08ef Prefix OverlayController TabController members with m_ 2019-01-11 23:04:57 +01:00
Vasily d4fbdf5877 Prefix additional member variables in OverlayController with m_ 2019-01-11 23:04:56 +01:00
Vasily 65d1c8da38 Prefix desktopMode and noSound member vars with m_
This keeps consistency with the rest of the class and reduces possible
confusion, especially when member vars and parameters have the same
name.
2019-01-11 23:04:56 +01:00
Vasily 6ce10bd2f0 Change OverlayController from singleton pattern to regular RAII
The singleton pattern was poorly implemented and didn't provide the
benefits usually associated with the singleton pattern, with all the
negatives.

Refer to this github issue:
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/29
2019-01-11 23:04:55 +01:00
username223 9c7022f802 Fix QML error spam from MyStackViewPage and PlayspacePage (#24)
* Move logging set up into own function

This does not affect the ability to log, the logging macros are
available globally.

* Clean up logging logic and add comments

The logic to find the logging location was broken, in that it always
placed the logs in the directory of the executable.
It was supposed to place the logs in
AppData/Roaming/matzman666/OpenVRAdvancedSettings/AdvancedSettings.log,
but it hasn't done this since at least git tag "v2.7". Since the change
hasn't been documented anywhere it is assumed to be an unintentional
regression.
The settings file is also currently placed in
AppData/Roaming/matzman666/OpenVRAdvancedSettings.ini, so this commit
undoes the probable regression until a strategy can be developed for
changing all paths at once.

* Move command line arg logging calls and add to manifest calls

The LOG_IF macros are cleaner than if blocks, and they do not need to be
in the middle of the Qt logic inside a giant try block.

* Remove unused QCoreApplication constructor in manifest logic

The object is not used in any of the manifest logic functions and
running without the remove/install manifest calls does not use it
either.

* Unindent logic in installManifest

The error checking was unnecessarily done in an else block. Moving it
into an if block and negating the result does the same but leaves the
rest of the logic at a much smaller indentation level.

* Change array in installManifest to be 0 intialized

Not zero initializing could lead to strange bugs if the terminating null
isn't there.

* Move manifest install/removal to separate function

The manifest handling is tangential to the actual main operation of the
program, hence moving it to a separate function improves readability of
the actual program.

The enum ReturnErrorCode has also been moved to the top in order to be
available to all functions. On introspection it is revealed that it
should always have been placed at the top.

* Unindent logic in removeManifest

The logic is unnecessarily indented, leading to harder to follow logic.

While the current logic isn't that hard to understand, it's better if it
follows the same rhythm as installManifest, which errors checks the same
way with a !QFile::exists( manifestQPath ).

* Move manifestPath out of install/removeManifest

Moving the variable outside of the functions reduces code duplication
and increases the versatility of the functions.

Variable was renamed from manifestQPath to manifestPath, because the Q
does not add anything to the name except (maybe wrongfully in the
future) typing a variable that has been typed with 'auto'.

The default variable has been removed, as it did not improve readability
at all.

* Rename installManifest to handleManifestInstallLogic

The new name better reflects the overall purpose. installManifest should
be a function that only installs the manifest.

* Move manifest related things into manifest namespace

* Move manifestInstallation logic into functions

The logic becomes clearer when replaced by function names instead of
just blocks of error checking.

* Refactor installManifest into separate functions

The uses for the removeManifest and installManifest functions could be
boiled down to three separate use cases:
    * If the application was passed the "-installmanifest" arg:
        Reinstall the manifest and enable application autostart.
    * If the application was passed thed "-removemanifest" arg:
        Remove the manifest.
    * If the application was not passed "-desktop" and also not passed
    "-nomanifest" (basically every start):
        Install the manifest.

Where reinstalling means to remove the manifest if installed and then
install it.

The relatively complex logic in installManifest hid this logic behind
several if statements and changing what the "alreadyInstalled" bool
signified.

The refactored functions should make everything easier to understand.

* Add variable for manifest name

* Rename variables in main to camelCase

This appears to be the style chosen for the majority of the project.

* Change cerr to be LOG(ERROR) and add logging for manifest completion

The cerr calls are not likely to be seen by anybody. Logging them as
ERROR will make sure they are available for diagnostics.

* Add comments for new manifest functions

* Reorder namespaces and functions in main

Namespaces and functions are now ordered as they appear in main.

* Add static_cast to height and width in func call in main

width and height are "qreal" (typedef for double). Having them
implicitly cast to int leads to warnings on some compilers, and can lead
to doubt whether they're supposed to be converted.

* Move organizationName and applicationName into overlaycontroller.h

The string have been moved to static constexpr autos inside the
overlaycontroller.

Them remaining static means that they are included in the final binary,
even if they don't need to be included as static.

They should probably also not be directly gotten, instead being offered
up as static getters, but it's better to do them all at the same time in
a specific commit for that.

* Add comment to installApplicationManifest

Describing that OpenVR must be initialized before the function is
called.

* Change QApplication var name and add comments

The previous QApplication was named "a". This is obviously not
sufficient for such a large part of the application, even if the class
is rather boilerplate heavy.

* Add comments to Qt portions of main

Some things have been left uncommented. That's because I don't know what
it does.

* Change documentation for command line arguments, logging config

The information under the Desktop Mode header could be rolled under the
"-desktop" command line arg.

Support for the command line args of Easylogging++ and custom logging
files have not been supported for the original developer. Both should
probably be dropped in favor of having the same logging behavior for all
users.

* Remove error causing property from QML MyStackViewPage and PlayspacePage

The properties were causing an error message to be spammed in the log
QML QQuickText: Detected anchors on an item that is managed by a layout.
This is undefined behavior; use Layout.alignment instead.

and

QML RowLayout: Detected anchors on an item that is managed by a layout.
This is undefined behavior; use Layout.alignment instead.

Removing them fixed the spam and didn't noticeably change the appearance
of the pages.
2019-01-07 19:24:20 -06:00
Vasily 644c887f71 Update version strings, update NSIS file, move around extra files
The additional files packaged with the installer have been moved to
their own dir to separate them from the C++ source.

All licenses are now also included in the installer, as per the terms.

The version string in overlaycontroller.h has been updated to 2.8.0.
2019-01-04 17:06:02 +01:00
Vasily a49d889ee8 Move easylogging++ include into necessary files
logging.h previously had logic to enable debug logging even on release
builds. This logic was moved to the QMAKE file, hence the logging.h file
is no longer necessary.
2018-12-28 20:07:00 +01:00
Vasily 51057c1d79 Format every single file using .clang-format 2018-12-28 03:06:42 +01:00
Vasily f4feafaa03 Add parens around statement to banish warning 2018-12-27 01:26:13 +01:00
Robin Appelman dcf33f1384 fix mouse coordinates under linux 2018-11-09 00:58:38 +01:00
Robin Appelman 5fc0cc8fcb offset all 3 axis in one go 2018-03-21 21:35:53 +01:00
matzman f48b583aca Reimplemented sound effects.
Added chaperone proximity warnings.
Other bugfixes and improvements.
2017-08-15 21:44:29 +02:00
matzman 0960394335 Fixed Restart SteamVR functionality (May crash the Steam overlay when SteamVR Home is running when you restart. Therefore I advice that you close SteamVR Home before restarting).
Completely disabled sounds to see whether this fixes crashes some people are still experiencing.
Added "Enable Advanced Supersample Filtering" toggle.
2017-05-21 14:24:24 +02:00
matzman 5f7fb405ca Updated readme and version to 2.4. 2017-05-19 19:18:15 +02:00
matzman 2baee40630 Updated readme.
Updated version to 2.3.
Some bug-fixes and improvements.
2017-02-16 22:45:36 +01:00
Mel Klimushyn 1aa1580a90 Move the push-to-toggle y axis adjustment from the playspace page to a new Accessibility Tools tab, packaged as a new height adjustment tool. Height offset is saved and can be set via slider. 2017-02-07 00:13:41 -08:00
matzman ff885b63ce Added don't annoy me toggle to alarm clock.
Changed version to v2.2.1.
2017-01-12 00:06:01 +01:00
matzman b4bfd0f744 Fine-tuned granularity of spinner boxes on revive page.
Added check for outdated OpenVR installation.
Changed version string to v2.2.
2017-01-07 15:26:16 +01:00
matzman 2a2f747518 Updated to OpenVR 1.0.5
Added simple alarm clock to utilities page.
Bugfixes and Improvements.
2017-01-05 18:28:54 +01:00
matzman 93484d2bdc Added keyboard input utilities. Allows to send text input as emulated key strokes to the active application. 2016-12-29 16:02:17 +01:00
matzman 342f4795df Added "Force Revive Page" checkbox to application settings. 2016-12-24 15:56:21 +01:00
matzman 129c6e3db1 First more or less complete version of Revive tab. 2016-12-17 00:39:17 +01:00
matzman 7949ad4f43 Added MyTextField and overhauled Playspace page. 2016-12-13 20:28:57 +01:00
matzman c54ee1b4c0 Some fixes more log statements, and changed version to v2.1. 2016-12-09 22:07:13 +01:00
matzman 68cfa664e3 Fixed crash on exit. 2016-12-09 00:17:38 +01:00
matzman b766dc72cc Added desktop and no-sound modes.
When -desktop is given on the command line then the settings menu is shown on
the desktop instead of an vr overlay.
When -nosound is given on the command line then there are no sound
effects.
2016-12-04 23:37:00 +01:00
matzman e39c240ff5 Complete GUI overhaul (from Qt Widgets to Qt Quick Controls 2)
Added chaperone profiles
Added separate supersampling sliders for applications/compositor
Added asynchronous reprojection on/off switch
Merged in Microphone Control Overlay
Added Push-to-Talk profiles
Updated to OpenVR 1.0.3
Requires at least SteamVR beta 1477423729.
2016-10-28 18:38:05 +02:00
matzman af956a8702 Updated Readme and added files missing from last commit. 2016-09-16 21:52:34 +02:00
matzman de0fdb3e1f Inial commit v1.0. 2016-09-11 21:42:12 +02:00