Commit Graph

390 Commits

Author SHA1 Message Date
Terry MacDonald
e2bfa65157 [WIP] Added up and down buttons
Added up and down buttons to the UI
so that you can use the buttons or click
and drag the startup items to where you
want them. All works fine!
2021-05-14 10:40:37 +12:00
Terry MacDonald
829057bcfd [WIP] UI working as intended!
Lots of improvements to make still
but the basic UI is working as it should.
Big thanks to @teawithcookies for the
tip to set DragDropEffects to Move in
order to make DragDrop method fire!
That took me 20 mins to figure out...
2021-05-13 21:50:01 +12:00
Terry MacDonald
a278f183d7 [WIP] First working drag and drop
Drag and drop finally works! But there is
no feedback, and no animation and no
cursor control. And the page still doesn't
actually save the information, and it can't
have new start programs added to it yet.
It's fair to say there is still a lot to do :/
2021-05-11 22:01:51 +12:00
Terry MacDonald
dccd13c019 [WIP] Partially working flowlayout 2021-05-11 16:08:57 +12:00
Terry MacDonald
6131833b25 WIP] First attempt at tablelayout 2021-05-11 15:59:53 +12:00
Terry MacDonald
7534fe6fc6 [WIP] Basic partially working panel
The panel successfully has the usercontrols
put into it, but it doesn't reorganise the rest
of the usercontrols when one is deleted up
to head of the list. I've done some research
and the internet tells me to move from a panel
container to a FlowLayoutPanel or a
TableLayoutPanel to get the automatic redrawing
functionality. It's apparently far easier to swap
than to write the redrawing code yourself.

So thats the plan for later this week.
2021-05-09 21:43:06 +12:00
Terry MacDonald
84c9338be4 [WIP] Basic partially working prototype 2021-05-08 23:22:44 +12:00
Terry MacDonald
7e99af19d1 [WIP] still figuring out user controls 2021-05-08 23:15:01 +12:00
Terry MacDonald
1d752a1021 [WIP] First StartProgram UserControl
First attempt at using a customer User
Control to make it easier to create dynamic
list of start programs to kick off before the
main program is started.

I already have the ability within the data model
to store and track multiple start programs... the
difficulty is in making the WninForms UI handle
a dynamic number of start programs. This is the
basic construction of it, but it needs a LOT of UI
work.
2021-05-08 22:59:38 +12:00
Terry MacDonald
4ec7829a43 Made the shortcut images more reliable
Also added a ton of trace logging to be
able to fix issues remotely.
2021-05-02 22:05:25 +12:00
Terry MacDonald
2e954d5b75 Hotkeys complete!
Managed to add the Hotkey list
that shows the user the entire list
of hotkeys across the application.
Also allows you to delete them all!
This function is now complete, and
is all working based on my testing.
2021-05-01 21:56:31 +12:00
Terry MacDonald
b79aecc7fb Suppress CLS non-compliance
I know its not compliant...that's by
design.
2021-05-01 20:59:26 +12:00
Terry MacDonald
325a1b6012 Working hotkeys of all types
Yay! Managed to get all the hotkey
logic working so all types of hotkeys
work fine. Next step is getting the
list of dynamic hotkeys populated
from the Display Profiles and the
Game Shortcuts, and then hooking up
the Clear All Hotkeys button so that it
clears the dynamic hotkeys too!
2021-05-01 20:58:09 +12:00
Terry MacDonald
b96a846410 First working Hotkeys
In this first working hotkey scenario
the DisplayProfiles and Shortcuts can
be run from Hotkey. I now need to add
the ability to run the mainfor, display profile
config page, and the shortcut library itself.
And of course add the items to the settings
window so they can be changed.
2021-05-01 17:03:15 +12:00
Terry MacDonald
beab71ace4 [WIP] broken Form to form passing 2021-04-30 22:45:11 +12:00
Terry MacDonald
c5121702b2 Fixed the Hotkey selection text
Works fine now. No more errant
selections.
2021-04-30 22:11:36 +12:00
Terry MacDonald
43374ff1b2 Merged in hotfix for 1.0.6 2021-04-30 21:50:41 +12:00
Terry MacDonald
3ae712f578 Update version to v1.0.6 2021-04-30 21:25:34 +12:00
Terry MacDonald
cb08611f39 Fixing tests NuGet reference
Fixing silly OriginLibrary copy paste error.
2021-04-30 17:54:04 +12:00
Terry MacDonald
c4fe410eb9 Fixed missing OriginLibrary references
This iwas a stupid mistake. I forgot to change
the Uplay library references when I copied them
to nmake the OriginLibrary. This caused issues
as they cross pollinated, breaking both :(.
2021-04-30 17:34:11 +12:00
Terry MacDonald
6af0603d8f Fixed OriginLibrary issue
OriginLibrary wasn't added to the validity
checking, so no Origin games would work.
Also added a LOAD more trace logging with the
Origin library so I can see from the logs what's
happening. Also updated the version to 1.0.5.1.
And finally, removed unneeded validityrefresh
from the base ShortcutItem constructor as it
is refreshed later anyway. Should speed up
object creation a little.
2021-04-30 17:28:01 +12:00
Nils Goetje
2bffdbc098 Prevent exception when scanning origin lib 2021-04-29 16:48:24 +02:00
Nils Goetje
0b8117d39b checks matches of regex search before accessing it 2021-04-29 15:21:24 +02:00
Terry MacDonald
0b9f6e7e6f [Wip] Partially working hotkey
Managed to get the hotkeys for
the DisplayProfiles and the Game
Shortccuts to work ok. Still needs
polish for the HotKeyForm, and I
need a way to set the MainWindow,
DisplayProfileWindow and
ShortcutWindow Hotkeys
2021-04-29 22:45:13 +12:00
Terry MacDonald
e9f401960e [WIP] Still moving to NHotkey 2021-04-28 22:14:54 +12:00
Terry MacDonald
209e3f0338 [WIP] Partway through swap to NHotkey
Also trying to port Willy-Kimura's HKL
HotkeySelector code over as well cause
it is ace!
2021-04-27 22:19:44 +12:00
Terry MacDonald
92c0678e79 WIP] commit where I'm up to
This is a stopgap place to commit
while I test out another hotkey lib.
2021-04-27 21:57:27 +12:00
Terry MacDonald
9dc68ff506 Suppress CLS 2021-04-25 22:25:41 +12:00
Terry MacDonald
023a1a8862 [WIP] Shortcut and Profile hotkey UI
Completed the Shortcut and Display Profile
hotkey UI interface to a satisfactory level.
The hotkey settings are stored with the
profile JSON for profiles, and with the
shortcut JSON for shortcuts. This means
they load correctly and are remembered
between runs of DisplayMagician.

Next step is to actually register the Hotkeys
so they work, and then allow them to be
replaced or removed when they are changed.
2021-04-25 21:13:25 +12:00
Terry MacDonald
a5f74576ba Suppress CLS error 2021-04-25 17:06:02 +12:00
Terry MacDonald
e604b1a871 [WIP] Hotkey passing to form working
At this point, we now have a hotkey form
that can generate hotkeys, and we have a way
of passing it some text to make it obvious which
hotkey we are setting. Additonally we can get
the set hotkey back.

Next steps are to store the hotkeys with the
display profiles and the game shortcuts, and
to load them as we load the files in.
2021-04-25 16:54:17 +12:00
Terry MacDonald
0e7ee3acef [WIP] Testing passing hotkeys
Testing the best way to pass hotkeys through
to the Hotkey form in a way that I can reuse it
across the whole application.
2021-04-24 16:06:00 +12:00
Terry MacDonald
b360fc9f37 [WIP] Creating hotkey setting form
This form will show when the user wants
to set a hotkey for a display profile or for
a shortcut. This will not be used for the
setting the main window, or shortcut library
hotkey...those will be set in the settings
window.
2021-04-23 21:42:18 +12:00
Terry MacDonald
fd50594211 [WIP] Adding hotkey buttons to forms 2021-04-23 21:25:42 +12:00
Terry MacDonald
e5be7f65e0 Add HotKeyLibrary to setup
This adds the HotKeyLibrary to the
DisplayMagician setup so that the
HotKey stuff will work once I build
it in!
2021-04-23 20:51:22 +12:00
Terry MacDonald
4ef1100ec2 Updated version to v1.0.5.0 2021-04-23 17:47:18 +12:00
Terry MacDonald
719c7f3350 Updated minimise checkbox to also boot
Made the MainForm's minimise checkbox also
start DisplayMagician on boot.
2021-04-23 17:41:59 +12:00
Terry MacDonald
d7dad2e864 Added Wait for alt game exe option
Added new 'Wait until an alternative
game executable is closed before continuing"
option to the game library part of the
ShortcutForm. This will allow people to
only change display/audio if a different
exe is closed from the game itself.

Closes #9
2021-04-23 14:14:13 +12:00
Terry MacDonald
8356290c3f [WIP] Part way through alt game exe
Have updated the loading and storing of the
alternative game exe monitoring and created
the user interface for it.

Need to next:
- create a file selection dialog
- have the file selected result in the name
   being extracted into the text file
- actually set up the RunShortcut to use
   the alternative monitoring if set
2021-04-21 22:58:45 +12:00
Terry MacDonald
c0b70cb41c Fixing audio and capture permanence 2021-04-21 21:41:36 +12:00
Terry MacDonald
d9d84cc66a Fixed DisplayProfile permanance
Fixed issue that DisplayPermanance was not
working during RunShortcut. Fixes #8

Additionally fixed some issues errors running
a shortcut.
2021-04-20 21:31:59 +12:00
Terry MacDonald
395d4fa5d9 First working version after refactor
Have fixed the mistake I made with the
Parallel.Invoke actions where I accidentally
kept adding the SteamLibrary 3 times!

This now works well, and as a bonus the
game libraries are now thread safe!
2021-04-19 22:32:58 +12:00
Terry MacDonald
4c54e72dc2 [WIP] Moving IsRunning to library
Moving the IsRunning code for the game
libraries to the library itself, rather than having
it within the ShortcutRepository.RunShortcut
function. This should make it easier to modify
each game library detection code to understand
when it is running.
2021-04-19 21:05:57 +12:00
Terry MacDonald
81edd1df2b [WIP] 1st working refactor
The program compiles and pulls
origin game data into the application.
The steam refactor didnt work as there
are 3x entries for each game being loaded
and I need to see why!

Need to also test that the new Origin
shortcuts are being loaded and saved correctly
and that the RunShortcut works now it's had
a massive refactor.
2021-04-19 20:50:29 +12:00
Terry MacDonald
4c46c6315d [WIP] Refactor Gamelibraries singleton pattern
Moved from basic static class to proper thread
safe singleton pattern for the GameLibrary to
simplify the code in ShortcutRepository.

Still only halfway through that ShortcutRepository
code refactor :(
2021-04-18 21:44:52 +12:00
Terry MacDonald
1e4ed0c546 [WIP] initial game library URI refactor 2021-04-18 15:42:00 +12:00
Terry MacDonald
44b620851a [WIP] Origin Games are detected
The Task finds the origin games and
returns them. Just need to add the logic
to actually use the returned data to
populate the game library, as well as
use the game library in the shortcuts
as well as actually run the new library too!
2021-04-16 22:40:58 +12:00
Terry MacDonald
0ec70e42c0 Updated develop changes to match
Updated the develop branch changes from
v1.0.4 to the new string based GameIDs that
we've moved to in order to support the
Origin game ids.
2021-04-10 23:13:05 +12:00
Terry MacDonald
f7d3a04f28 Updating branch with v1.0.4 release code 2021-04-10 23:04:16 +12:00
Terry MacDonald
15bcb0801b Remove uneeded class
No longer require the class
ProcessCommandLines as it's not needed
any longer.
2021-04-10 22:59:17 +12:00
Terry MacDonald
0c4023fa64 Update to v1.0.4 2021-04-10 22:21:56 +12:00
Terry MacDonald
4c58920e61 Attempt to fix shortcut library drawing
This is the first attempt at fixing the shortcut
library drawing issue. When the app is frozen
waiting for some games/apps to finish, the
ImageListView refreshes, but doesn't refresh
with any icons, so it all looks a bit pants.

This is my first attempt at fixing that.
2021-04-10 21:51:51 +12:00
Terry MacDonald
325a15bf6d Fixed game process detection
Reworked the Uplay and Steam game
detection to make them more reliable.
Found a couple of logic errors that were
causing issues with process detection.
Also moved away from accessing
process.MainModule as it was causing
exceptions. Now just using process name
as it is simple and fast.
2021-04-10 21:36:03 +12:00
Terry MacDonald
066a0e30f5 Fixed Steam Update detection (probably)
Have likely fixed the steam update detection
but I'm not able to test at the moment as nothing
needs updating!
2021-04-10 20:08:46 +12:00
Terry MacDonald
b8f1007cd1 Fixed UplayLibrary reading again
This time I know it works as I have checked
games are found even if saved in different
folders on different drives, and even when
Ubiconnect is installed in a non-default
location. It even copes when games are
uninstalled and their remnants are left in
registry.
2021-04-10 19:49:32 +12:00
Terry MacDonald
8c132a79f5 [WIP] Partially working uplay scanning
Updated Uplay library scanning to work
properly, but it requires access to
the HKEY_LOCAL_MACHINE reg key,
which only works with adrministrative
rights. I really don't want to need that,
so I'll be trying to find an alternative way
to get the information I need from the file
system.
2021-04-10 19:19:42 +12:00
Terry MacDonald
b83478a031 Fixed audio volume setting
Modified some logic so that the audio device
volume and capture device volume will still
be applied even if the current device is selected.
Previous logic incorrectly would only change the
volume if the audio device was also changed.
Volume is always evaluated even if the audio
device doesn't have to change (unless don't
change audio device or don't change capture
device are selected).
2021-04-10 16:28:31 +12:00
Terry MacDonald
96749e8ba8 Fixed Desktop link without icon
Logic for determining the shortcut icon
name was flawed, and wouldn't work. Moved
to a new icon naming scheme using shortcut
UUID to make it simpler to update. Icon is written
every time that the shortcut is saved.
2021-04-10 12:25:48 +12:00
Terry MacDonald
26d2e42723 Added some extra exception handling
Added extra exception handling for the
imagelistview in the shortcut form just
in case there is an issue at some point.
2021-04-10 12:03:51 +12:00
Terry MacDonald
07f328b890 Fixing ShortcutForm audio config
Added more robustness and error checks
to handle AudioSwitcher not being able to
detect chipsets, and to cope with situations
with no active audio or capture devices.
Should be much more robust as it also
handles exceptions better, and has better
error logging.
2021-04-10 10:51:20 +12:00
Terry MacDonald
15a80ff0ac Fixed Steam library passing
Steam library processing was missing the
default steam library. This meant that only
people with additional steam libraries were
detecting games. This has been fixed now.

Added in some more TRACE logging for
Steam and for Uplay libraries.
2021-04-09 18:52:05 +12:00
Terry MacDonald
a377f3477f Fixing library with no installed games error
Both Steam and Uplay library logic would error
when the library was installed, but didn't have
any installed games. Thanks to @joeymanson23
for the report. Fixes #4.

Adds a LOT more logging to the Steam and Uplay
libraries to allow for remote troubleshooting via
the log file, especially if the logging settings are
set to TRACE.

Also fixed the long standing issue for being able
to install two copies of DisplayMagician of the
same version. Now the installer will prevent that
from happening!
2021-04-07 23:37:05 +12:00
Terry MacDonald
3fcd90a542 Create app dirs on first boot
Also improve logging detail when
loglevel is set to trace.
2021-04-04 21:49:37 +12:00
Terry MacDonald
ac48efe19d [WIP] Correction of game search 2021-04-02 22:25:38 +13:00
Terry MacDonald
87fcc3e8d0 [WIP] Adding Origin Library 2021-03-31 21:43:34 +13:00
Terry MacDonald
64871f3ddc Update to v1.0.3
Had to update the version so that the
new explorer reboot during setup upgrade
will work.
2021-03-28 22:32:48 +13:00
Terry MacDonald
081d54cbb1 Fixed Game process detection
Also updated the update json so that
it will update correctly.
2021-03-28 21:52:55 +13:00
Terry MacDonald
44e7f0df38 Update toversion 1.0.2 2021-03-28 20:28:42 +13:00
Terry MacDonald
965f73377b Changed shortcut cancellation logic 2021-03-28 20:25:01 +13:00
Terry MacDonald
5b3249642f Can close ApplyingProfile if needed
If there was a problem with applying
a displayprofile, then the exception
would stop the ApplyProfile window
from being closed. And as it was set
to top most window, the user wouldnt
be able to make any changes and would
have to reboot their computer. I have
added an X button up to top right of the
screen to allow people to close the window
when there is a problem.
2021-03-27 21:27:52 +13:00
Terry MacDonald
c7381131f0 DisplayProfile updates properly
DisplayProfile updates after a profile
switch properly. The UI wasn't reflecting
the proper changes after a profile change
made from the DisplayProfile page, but
now it does.
2021-03-27 21:19:30 +13:00
Terry MacDonald
e913640751 Separated profile equals from possible
This change was to separate 'Equals'
(which checks for exactly the same) with
'Possible' (which checks that the connected
displays are available to use. Should make
the profile comparison a lot more accurate.
2021-03-27 16:15:17 +13:00
Terry MacDonald
1b6cc7967d Fixed Profile matching for Surround
Fixed the Profile.Equals logic so that it
could detect the difference between
Surround and non-Surround triple screen
configurations. Now seems to work fine.

Also adjusted the ProfileAdapter so that
the profile imagelistview works correctly.
Moved to using the UUID rather than the
name to allow users to change the name
without affecting the UUID. That was a
change I should have made AGES ago.
2021-03-26 22:57:05 +13:00
Terry MacDonald
11cd923e46 Changed profile matching logic
Relaxed the profile matching logic to
use my looser displayidentifier logic
as it is more likely that connections to
a display is changed rather thant the
display paths, resolution or anything like
that. Will use this as an experiment to
see if it works or not.

Also fixed the shortcut renaming errors
by searching for the UUID, not the shortcut
name which is the pretty much the way
I should have done it in the first place!
2021-03-26 21:54:45 +13:00
Terry MacDonald
5e9c02aa68 Fixed the notify icon when minimised
When the notifyicon was minimised we had
problems as it would close the main window
when trying to update the icon text. This is
fixed now.
2021-03-17 21:38:16 +13:00
Terry MacDonald
baa275b8a6 Option to start pgm only if needed
Added the ability for user to only start a
program if it hasn't been started yet. This
is for things like SimHub that should
already be started by Windows when the
PC first boots.

Also corrects a bug that ignored the autoname
property so that it overwrote the suggested
filename when saving a shortcut.
2021-03-17 21:25:42 +13:00
Terry MacDonald
77110db114 Stop DM closing after running a shortcut
Also allow people to click on the startprograms
checkbox labels to have them change the
checkboxes themselves.
2021-03-17 20:44:59 +13:00
Terry MacDonald
f9de793998 Stop desktop save from closing window
Stop 'save to desktop' button closing the
shortcut window (and the profile window too!)
2021-03-17 20:25:34 +13:00
Terry MacDonald
795f006e2d Updating versions to 1.0.1 2021-03-17 20:13:06 +13:00
Terry MacDonald
87b73adf66 Preparing docs for first release
Also updated the update.json to match.
2021-03-14 21:33:23 +13:00
Terry MacDonald
9f674a1eaf Added donate button and realigned UI 2021-03-14 20:54:03 +13:00
Terry MacDonald
f4c34f5cff Updated nuget packages 2021-03-12 10:09:35 +13:00
Terry MacDonald
75ac861ee7 Changed version to v1.0.0 2021-03-11 21:31:53 +13:00
Terry MacDonald
65bcdf2cd1 Profile changing timer now top most
I had removed the top most setting from
the profile changing window while I was
testing long ago, and I only now
remembered to add it back in!
2021-03-11 21:22:42 +13:00
Terry MacDonald
7b02b9db3b Fixed exception returning from ShortcutForm
ImageListView was too keen when a shortcut was
renamed and it tried updating ShortcutLibraryForm
straight away when it reutned, even before we had
a chance to update the data to ILV uses to populate
itself. The fix was to stop ILV being so keen, and to
suspend ILV from doing redraws until we had a
chance to refresh the UI. Problem solved.
2021-03-11 21:18:19 +13:00
Terry MacDonald
97a586720e Fixes shortcut profile validation
Shortcuts checks for profile validity weren't
very good, but now they work properly. This
helps the notify menu item shortcuts as well.
2021-03-07 17:28:07 +13:00
Terry MacDonald
4531a0d4d5 [WIP] Partially working shortcut detection
Fixed the profile validitiy detection on load,
but now have issue with the shortcut detection
2021-03-07 17:11:46 +13:00
Terry MacDonald
1588cd6a0b Added Save to Desktop Profile Button
Added a button to save a profile shortcut
to the Windows desktop. This will enable
people to quickly change to another display
configuration if they want to using a desktop
display. This will work even if they are unable
to get admin rights to install the background
popup menu.
2021-03-07 14:50:52 +13:00
Terry MacDonald
79597b077f Fixed profile selection for Shortcuts
Fixed the logic for profile selection on
shortcuts so that the profile is either
selected or not based on its existence
or whether the profile is valid to use now
or whether the shortcut is new.
2021-03-07 14:24:58 +13:00
Terry MacDonald
5260d8a087 Refactor shortcut validity
Moved the logic to the right places.
Removed the need for the separate
error and warning lookup arrays.
2021-03-07 13:45:49 +13:00
Terry MacDonald
7b9a676cb6 Disabled internal NLog debugging 2021-03-06 17:55:04 +13:00
Terry MacDonald
07ceed3ec4 Make red error when sc profile gone
This will inform the user to choose another
profile when the profile is used in a shortcut
and yet the profile doesn't exist any longer
2021-03-06 17:43:07 +13:00
Terry MacDonald
cac7810ed5 Added red error triangle
Planning on using this to highlight
shortcuts that cannot work because the
profile has been deleted.
2021-03-05 15:24:11 +13:00
Terry MacDonald
ed4b92fb30 Updated styling of SC profile selector
Updated styling of the profile selector in the
shortcut editing form. It now looks the same
as the others. There is now a slightly annoying
problem where clicking elsewhere in the form
deselects the imagelistview selection, but that
is a small thing to worry about later.
2021-03-05 15:10:53 +13:00
Terry MacDonald
34ae9069c7 Refactored tracking errors
Moved tracking profile errors into ProfileRepository
and moved shortcut errors into ShortcutRepository.
2021-03-05 14:44:53 +13:00
Terry MacDonald
001e351106 Fixing error loading games
It was erroring when loading games into
a blank shortcut screen. This was stopping
us being able to select any games at all.
Fixed another problem with Shortcut.IsValid
causing exception when loading a profle
that no longer existed. It now will correctly
report that the shortcut is isvalid.
2021-03-05 11:12:27 +13:00
Terry MacDonald
634322ed05 Hide all run options when invalid
Added some checks to stop the shortcut 'run'
option being shown in shortcut and button
form when a shortcut is invalid.
2021-03-05 10:45:18 +13:00
Terry MacDonald
f22450b9a0 Fix profile selection issues
Fixed the profiles selection so it doesn't change
when you swap screens. Made the 'View
current display' button refresh the profile validity
too, so that a user now only has to change their
display settings in Windows and then swap back
DisplayMagician and click the View Current Display
button and the profiles will be updated.
2021-03-05 10:34:51 +13:00
Terry MacDonald
fad79cd315 [WIP] fixing profile ILV
Fixing text position and sorting
out the selection rectangle. Have
fixed the shortcut library window
and working fine now.
2021-03-01 21:35:03 +13:00
Terry MacDonald
c3fe6c5b50 Refactor image utils into own class 2021-03-01 20:10:47 +13:00
Terry MacDonald
d6a5b752c9 [WIP] partial profiles ILV render creation 2021-02-28 21:34:59 +13:00
Terry MacDonald
f122719b80 Sped up profile possbility detection
Now caches the possbility detection for
profiles, so it only runs the expensive
detection logic when the UI changes.
2021-02-28 21:24:12 +13:00
Terry MacDonald
7d411b0aff FIxed invalid shortcut detection
Made the shortcuts that were invalid
visually different to the others. This is
now working properly!
2021-02-28 20:55:03 +13:00
Terry MacDonald
3a180d8813 Working shortcut library highlighting
Highlighting colours and structure changed
to work better with the ILV structure. Next step
is to add the ability to visually show invalid
shortcuts to notify when a shortcut won't
work.
2021-02-28 15:34:50 +13:00
Terry MacDonald
29b3989645 Tweaked ILV shortcut display
Aligned the new custom ILV shortcut drawing
so that it looks better.
2021-02-28 11:26:59 +13:00
Terry MacDonald
25df13e52a Library include cleanup 2021-02-21 20:23:41 +13:00
Terry MacDonald
79f535ce08 Fixing broken NLog config 2021-02-20 23:14:16 +13:00
Terry MacDonald
bb37dc908a Changed LogLevel applies immediately
Configured NLog so that the loglevel
UI changes happen straight away. Also
am using NLog to generate the user
messages while it's running.
2021-02-20 22:03:19 +13:00
Terry MacDonald
2959d5f280 Changing the default logging level to info 2021-02-20 21:04:58 +13:00
Terry MacDonald
d9da0a6e8f Shortcut library UI improvements
Added a messagebox to warn the user
when they try to run an invalid shortcut.
It now asks the user if they really want to
do it, or it directly opens the 'edit' window
for if they want to fix things now.
2021-02-15 21:29:12 +13:00
Terry MacDonald
a251962207 Partially added the Uplay Library logging 2021-02-15 20:47:56 +13:00
Terry MacDonald
6b02e2ccbe Added logging and improved readme
Added logging to ProfileRepository and
ShortcutRepository
2021-02-15 20:33:46 +13:00
Terry MacDonald
aece0cce29 Added extra debug logging 2021-02-14 22:42:48 +13:00
Terry MacDonald
b6c007fe6f Updated shortcut repository logging
Added yet more debug logging to the
software so we can get information when
there is an error.
2021-02-14 12:00:47 +13:00
Terry MacDonald
24c1ff29b4 Applied logging to program.cs
Continued to apply logging to the
various software components so that
we can get debugging logs when the
software is released for use.
2021-02-14 09:18:49 +13:00
Terry MacDonald
dd8939b395 Logging changes
Combined DisplayMagicianShared logging into
the main log file to simplify log reporting for the
future. Also started adding info and debug
statements to the program to make the debug
level log work well for troubleshooting. This is
going to take a LONG time to complete, but will
be worth it in the end.
2021-02-10 22:40:22 +13:00
Terry MacDonald
d6834b635c Disabled old FxCop Code analysis
Disabled the FxCopCode Analysis for the
release build in DisplayMagician project.
Should be only using the new .net nuget
package for code analysis.
2021-02-07 15:59:02 +13:00
Terry MacDonald
09a1ca1c96 Updated nuget libraries 2021-02-07 15:47:48 +13:00
Terry MacDonald
a06651190d Upgrade nuget libraries
Upgrade CommanlineUtils, HTMLAgility
and other libraries. Leaving ValveKeyValue
as it requires some breaking changes.
2021-02-07 15:22:54 +13:00
Terry MacDonald
ba636414c0 Improve exception handling of existing ex
Added logger instances for DisplayMagicianShared
functions. Also added logger debug commands to
all exceptions with existing ex objects.
2021-02-07 14:42:17 +13:00
Terry MacDonald
0f38881709 More code analysis suppression 2021-01-28 22:20:00 +13:00
Terry MacDonald
88bd1a71fa Fixing some CodeAnalyzer suggestions 2021-01-28 22:03:02 +13:00
Terry MacDonald
6ab1e0842a Additional suppression messages 2021-01-28 21:34:45 +13:00
Terry MacDonald
3ecababc73 Suppressing CLS compliance errors
Some functions and procedures require CLS
non-compliance due to file formats and the like.
Suppressing these compiler warnings
2021-01-28 21:19:20 +13:00
Terry MacDonald
0afe349eea Converted uint to int
This was done to be more CLS language compliant.
2021-01-28 20:58:35 +13:00
Terry MacDonald
ae106223a0 Removing editorconfig 2021-01-18 07:40:13 +13:00
Terry MacDonald
2b56d3e2b2 Fixing some UI misalignment
Changed some misanchored UI
elements so that they will move correctly
when the UI windows are resized. Also
fixed a mistake that meant the 'Create
Shortcut' message wasn't hidden
when it should be.
2021-01-07 17:31:26 +13:00
Terry MacDonald
3f46beafd3 Reorganisation of Game Start tab
Made a messsage to inform the user
we could't detect any supported game
libraries.
2021-01-07 15:17:37 +13:00
Terry MacDonald
b028ad4478 Align custom paint on form
Fix up misalignment with label
radio button, checkbox when
drawing not enabled on a black
background.
2021-01-07 14:56:29 +13:00
Terry MacDonald
fef3fb34a7 Fully works with no game libraries
Now can handle when no game libraries
are detected. Need to make the game/application
UI nicer by adding groupboxes to it.
2021-01-07 11:51:02 +13:00
Terry MacDonald
8336e910b0 Works without Game libraries installed
Basic checks for game libraries so program
will work with neither Steam or Uplay now.
2021-01-06 16:19:45 +13:00
Terry MacDonald
f1c484637c Modified Game Library installation checks
UplayLibrary was erroring when run without
Uplay installed. Needed to tweak it so that
DisplayMagician will work without Uplay
library or Steam library installed.
2021-01-06 16:00:52 +13:00
Terry MacDonald
ff33dfb95a Fixed SteamGame race condition
Found issue where the IsRunning process
checks were breaking because they were
being running before the steam process
had a chance to create the process. This
meant the information wasn't aviailable for
the SteamGame.IsRunning function to
inspect. Fixed by adding in a 0.5 sec delay.
2020-12-30 22:48:42 +13:00
Terry MacDonald
73d1735769 Added start on boot
Works fine, but just found an error
when DM is minimsed and running a
steamGame.
2020-12-30 22:40:21 +13:00
Terry MacDonald
93fc295bf2 Fixing automatic admin version upgrade
Upgrade processs wasn't upgrading using
elevated privileges. Appears to be doing so
now.
2020-12-28 23:17:13 +13:00
Terry MacDonald
ed167459fa Fixed UplayGame monitoring
Also fixed errors caused by trying to access
32bit processes information from 64-bit
processes by using smoe cool code thanks
to Jeff Mercado and Mike Fuchs:
https://stackoverflow.com/questions/9501771/how-to-avoid-a-win32-exception-when-accessing-process-mainmodule-filename-in-c
2020-12-28 21:34:59 +13:00
Terry MacDonald
c7a1f1ab55 Fix Code Analysis changes that broke things 2020-12-28 10:34:15 +13:00
Terry MacDonald
49329b870e Initial Code Analysis fixes
Also fixed up the Setup properties
file for x64 build configuration.
2020-12-26 21:46:32 +13:00
Terry MacDonald
6759cc4aa0 Renaming main buttons 2020-12-26 20:20:35 +13:00
Terry MacDonald
b5d6f3f680 Fully working Windows Toast 2020-12-26 16:59:45 +13:00
Terry MacDonald
e53f76f0ce Working open and exit toasts
Toasts working for minimised start (allows use to
open the application) and for minimised close
(allows user to open the application or exit the
application).
2020-12-23 21:13:21 +13:00
Terry MacDonald
15386ba756 Basic bidirectional notifications working 2020-12-23 18:29:20 +13:00
Terry MacDonald
2148db3e95 Fixing program settings loglevel
Had missed Fatal loglevel and missed
a mixedcase Error log level. Meant both
logging levels were broken. Now fixed.
2020-12-22 23:23:28 +13:00
Terry MacDonald
26796c9e46 Fixed MainForm control placement 2020-12-22 23:00:25 +13:00
Terry MacDonald
e4ed01f33b Added .Net 4.8 and Win 10 checks to installer 2020-12-21 15:02:06 +13:00
Terry MacDonald
7bc81f0075 Added ShellExtension.dll registration
Now the Desktop Popup Menu works!
2020-12-20 22:27:52 +13:00
Terry MacDonald
9e1ef4a095 [WIP] First working WiX installer
Installer works, but there are a few issues with it.
- It doesn't register the DesktopBackground COM server
- It doesn't create a start menu shortcut with the AUMID
- It doesn't check for .Net Framework 4.8 or later
- It doesn't try to install .Net Framework 4.8 or later if not there
- It doesn't have any customised backgrounds...
- It doesn't ask to run DisplayMagician when install is finished
2020-12-20 20:42:04 +13:00
Terry MacDonald
41fd798a07 Renamed projects to work with WiX file harvesting 2020-12-20 15:50:32 +13:00
Terry MacDonald
3a2b74b049 [WIP] Basic Notification Compat intergration 2020-12-20 15:21:53 +13:00
Terry MacDonald
33689931ca Moved AUMID to Shared project
And also added it to the LogReporter
project.
2020-12-20 12:45:50 +13:00
Terry MacDonald
7a730b7a36 Register DisplayMagician AUMID with Win10
This registers the Application User Model ID
with Win 10 so that it recognises the application
and can interact with it. This allows Toasts, Taskbar
pinning, right-click menus and other functions to
work.
2020-12-20 12:35:36 +13:00
Terry MacDonald
40ab916050 Added a back button to SettingsForm 2020-12-17 00:34:39 +13:00
Terry MacDonald
1c7b208e8b Added SettingsForm so can change settings 2020-12-17 00:23:20 +13:00
Terry MacDonald
2babf74353 Made the updater silent if no updates 2020-12-13 15:17:53 +13:00
Terry MacDonald
0989088450 Update the autoupdate location
It now points to the correct place so that
the autoupdating works as it should.
2020-12-13 15:00:46 +13:00
Terry MacDonald
2d46e4e3f8 [WIP] Adjusted the autoupdate location
Also added a settings button. Still need to add
a settings page exposing the settings.
2020-12-12 22:54:34 +13:00
Terry MacDonald
c662681860 [WIP] Added initial Autoupdater.NET config
Have created the basic setup using the JSON
version of the Autoupdater.NET config shown
on the Autoupdater.NET website at:
https://github.com/ravibpatel/AutoUpdater.NET

JSON file to be stored on the update website:
{
   "version":"0.2.0.0",
   "url":"http://displaymagician.com/downloads/DisplayMagicianSetup.zip",
   "changelog":"https://github.com/terrymacdonald/DisplayMagician/releases",
   "mandatory":{
      "value":false,
      "minVersion": "0.1.0.0",
      "mode":1
   },
   "checksum":{
      "value":"E5F59E50FC91A9E52634FFCB11F32BD37FE0E2F1",
      "hashingAlgorithm":"SHA1"
   }
}
2020-12-12 22:35:13 +13:00
Terry MacDonald
05bb163312 Fix Audio and Capture setting retention
Had problems storing ChangeAudioDevice and
SetAudioVolume settings (and the Capture Device
versions) so had to slightly change the way the
settings were stored.
2020-12-12 21:29:38 +13:00
Terry MacDonald
f55e2c29be Better described timeout as max wait (secs)
Also set it to a more reasonable 20 second timeout
and then it continues through the starting process.
Also added some NLog error handling in RunShortcut.
2020-12-11 21:40:45 +13:00
Terry MacDonald
0f65362860 Fix so application monitoring works
Application monitoring highlighted a failure
in logic, but I fixed it. It now waits for the
timeout period before exiting.
2020-12-11 18:07:17 +13:00
Terry MacDonald
58c8a7f9d2 Fixed failed waiting for game close
Added a 5 second delay before the start of
the monitoring for game closure. This is to
allow the games to be spawned by the game
library (e.g. Steam).
2020-12-11 11:43:51 +13:00
Terry MacDonald
41c48f6ef2 Added popup menu to Shortcut Library
Added a right-click popup menu to the
Shortcut Library just in case people find that
easier to use.
2020-12-11 11:34:19 +13:00
Terry MacDonald
161a39aa21 Clean up ShortcutLibraryForm 2020-12-11 10:57:03 +13:00
Terry MacDonald
71d6ef20e2 Fix Profile IsPossible check
There was an issue with the IsPossible check
as it hadn't been adjusted from when I removed
the Output from the display fingerprint. The
Output number changes in the NVIDIA driver
so it is different after a reboot. I hadn't removed
the Output from the current display device
check, and so it wasn't matching the correct
stored fingerprint.
2020-12-11 09:50:55 +13:00
Terry MacDonald
623bb65650 [WIP] Allowing DisplayView control to be empty 2020-12-10 22:56:20 +13:00
Terry MacDonald
362adbbf41 Added helper messages for new installs
Helper messages added to the MainForm and
to the Shortcut library to try and help people
understand what order to do things in so that
the software works as intended.
2020-12-09 22:30:58 +13:00
Terry MacDonald
40b396701a Forcing users to create displayProfile first
Helped direct users to the display profile page
at first by removing the create shortcut buttons
2020-12-09 22:05:52 +13:00
Terry MacDonald
9a4d8dc0c4 Cleaning up Uplay
Removing uneeded statements from UplayGame
2020-12-09 20:48:49 +13:00
Terry MacDonald
0830ed58dd Fixed Steam and Uplay game detection
Fixed an issue where Steam and Uplay don't detect the
game correctly. Now they find the processes themselves.

Also fixed ProgramSettings so that it generates a new
settings file on startup.

Also added LogLevel option to the ProgramSettings so that
I can start rolling out the NLog log statements to report
errors from the binary when it's installed on people's
PCs.
2020-12-09 20:47:30 +13:00
Terry MacDonald
c0389cdba7 Added NLog to Program.cs
Did the first basic integration and setup for
NLog to the application as part of my push
to get better error logging.
2020-12-08 21:20:26 +13:00
Terry MacDonald
41fc905e8c Skip audio change if same audio device
Only perform an audio device change if the
audio device is a different one.
2020-12-07 21:11:51 +13:00
Terry MacDonald
a7aa06f3e0 Rename Copy function to CopyInto 2020-12-07 21:08:34 +13:00
Terry MacDonald
02485e6de3 Fix audio setup issue and update setup UI
The audio onselect event had an errant bit of
logic that resulted in an exception - now fixed.
Also updated the Setup UI with nicer pictures
and some words that are more reflective of the
purpose of this software.
2020-12-06 22:18:01 +13:00
Terry MacDonald
9522af5574 Added new CreateProfile startup action
CreateProfile will just open a new DisplayProfile
window and that will be used only from the
Shell Extension.
2020-12-06 21:33:00 +13:00
Terry MacDonald
45e2c32c30 Updated shell ext to createprofile 2020-12-06 21:19:03 +13:00
Terry MacDonald
80ef9d807e Initial fixes for Setup 2020-12-05 21:40:20 +13:00
Terry MacDonald
c9957b28a5 Audio volume now set correctly
It also changes the audio device and then
rolls back the changes on game exit.
2020-12-05 17:41:15 +13:00
Terry MacDonald
09b9e185e3 Correcting audio selection loading in UI
Was incorrectly loading audio volume on form
load and also not correctly adjusting it when
selecting a different audio device.
2020-12-05 17:04:30 +13:00
Terry MacDonald
a87d6397fa WIP] Audio volume UI 2020-12-04 23:09:08 +13:00
Terry MacDonald
0eb05639f6 WIP] Adding audio volume to shortcut form 2020-12-04 21:53:15 +13:00
Terry MacDonald
c5cb6e52f1 Removing old code 2020-12-04 21:05:06 +13:00
Terry MacDonald
a596c0b252 Added Audio switching and reverting logic
Audio device now correctly switches and reverts.
Very happy how easy that was to do. This is an
amazing audio library!
2020-12-03 23:10:25 +13:00
Terry MacDonald
cd93986530 Added audioPermanence to choose audio separately
Separated permanence to display and audio separately
so you can choose exactly what reverts.
2020-12-03 22:25:28 +13:00
Terry MacDonald
eb93e84e22 Added audiodevice logic to save it
Added the ability to store the audio device
information within the ShortcutItem, and also
added the logic to the ShortcutForm to correctly
load and save the audio device settings. Also
coped with the edge case of when an audio device
is turned off or unplugged when the user edits the
shortcut... in that case we want to still keep the
old audio device settings as it is likely to be plugged
back in when the shortcut is actually run.
2020-12-03 21:45:24 +13:00
Terry MacDonald
e44c2d045b Disabled rescan audio button by default 2020-12-02 22:49:50 +13:00
Terry MacDonald
b95f7b7a47 Tweaked the rescan audio button appearance 2020-12-02 22:47:39 +13:00
Terry MacDonald
1714cf3a9f [WIP] populated dropdown with audio devices
Part of the work through getting audio devices
into DisplayMagician, as it now scans the devices
and automatically selects the one in use currently.
You can also press the 'rescan' button to have it
update the list. This is the UI part done.

Next step is the saving the chosen audio device
to the saved Shortcut!
2020-12-02 22:44:02 +13:00
Terry MacDonald
6743061962 Fixed missing HeliosPLus renames 2020-12-02 22:06:50 +13:00
Terry MacDonald
c05078dd9a Fixed inadvertent SteamLibrary duplication
Accidentally was adding uplay games to the
steam library. Used AddRange to combine
the game libraries together so it works.
2020-12-02 21:53:11 +13:00
Terry MacDonald
415ff0eed0 Rename HeliosPlus to DisplayMagician
Decided to rename the application to DisplayMagician
to make it way more discoverable. Turns out there are
a LOT of applications named HeliosPlus!
2020-12-02 21:11:23 +13:00