Commit Graph

45 Commits

Author SHA1 Message Date
Terry MacDonald
c52950c9b5 Fixed ChangeProfile command line
ChangeProfile command wasn't working, but
now that you can use the Desktop Background
context menu to change profiles I needed to
fix this so that the menu runs this command.
2020-11-22 21:27:29 +13:00
Terry MacDonald
25cf0265fd First working ShellContextMenu extension
Can now apply saved display profiles by
right-clicking on the Desktop Background and
selecting the display profile that you want to
use. It will run <HeliosPlus> ChangeProfile <uuid>
where <HeliosPlus> is the HeliosPlus binary and
<uuid> is the UUID of the relevant display profile.
2020-11-22 20:53:30 +13:00
Terry MacDonald
e9a821e594 [WIP] Working notifyIcon during run
notifyIcon works if run from Shortcutlibrary,
or from clicked shortcut. Next step is to make
the main window show some sort of indication
that the UI is locked until the game exits....
2020-11-19 22:40:08 +13:00
Terry MacDonald
23930a2a15 Added initial ability to minimise to notification area
Used some awesome help from Hans Passant to build
logic to allow minimise to notification area as well as
be able to change profiles etc from the notification area.

https://stackoverflow.com/questions/1730731/how-to-start-winform-app-minimized-to-tray
2020-10-26 14:30:00 +13:00
Terry MacDonald
eaf14afa0c Changing icons for projects 2020-10-23 21:39:09 +13:00
Terry MacDonald
7355b419e8 Added ChangeProfile startup action
Added the ChangeProfile startup action so that
the Notification Icon in the Notification Tray will
be able to change the display profile easily.
2020-10-22 22:05:15 +13:00
Terry MacDonald
12e3229f9d [WIP] Partially working RunShortcut command
The RunShortcut commandline option mostly works
but it fails to cleanly execute thanks to a partially broken
Program.ApplyProfile. The ApplyProfile exception logic
is not working properly and that is causing an exception
in Program.RunShortcut. Just needs some improved
ApplyProfile logic to detect when it does actually
(correctly) fail.
2020-10-11 21:12:52 +13:00
Terry MacDonald
a39a9d202c Improving Profile Form messages 2020-10-10 17:50:27 +13:00
Terry MacDonald
54f3f5271a Fixed NVIDIA IsPossible screen detection
Made the IsPossible deviceIdentification work
correctly with the NvAPIWrapper logic. Issue
was caused by me not really understanding what
the NVIDIA documentation meant. This has been
rectified. HeliosPlus will now invalidate any profiles
that won't work with the currntly attached screens.
2020-10-10 15:18:30 +13:00
Terry MacDonald
7fd4a8117d Fixed error with Paths and Topologies equality
I'd made a revision to the Paths and Topologies
equality comparison and it  used Equals for
sequences rather than SequenceEqual as it should.
Comparison works correctly now.
2020-10-09 17:14:23 +13:00
Terry MacDonald
8421acbd8d CurrentProfile detected in loadedProfiles
Fixed up some broken logic around detecting
loadedProfiles as the currentProfile. Now when
we load the profiles from disk we also correctly
check whether one of the profiles is in use now
and if it is then we use that profile instead of
creating a new one.
2020-10-09 16:27:59 +13:00
Terry MacDonald
ca7c696b06 Bypassed NVIDIA Grid Topology if not needed
Added some logic to check if either the from or to
profile conatins an NVIDIA surround screen. If not,
then there is no need to apply a GridTopology as it
is all single devices! Saves up to 15 seconds on
swap over.
2020-10-07 21:58:05 +13:00
Terry MacDonald
0ccf5176b7 First working surround to non-surround conversion
Was missing a SetTopologies  command from upstream
and the latest GeForce devices don't seem to be able to
read EDID which means the Topologies dont have a
DisplayName peroperty, which in turn causes issues when
trying to change to that topology! So now detect empty
DisplayName and fill it with a default.
2020-10-07 21:32:12 +13:00
Terry MacDonald
8c4604bc58 Renaming Viewports back to Paths 2020-10-07 20:08:36 +13:00
Terry MacDonald
f0088d08e2 [WIP] trying to fix path error 2020-10-06 23:49:10 +13:00
Terry MacDonald
95d87e92f1 Fixed WindowsDisplayAPI Device Identifcation
Fixed the WindowsDisplayAPI Device Identifcation
logic so that it reliably detects the displays in a way
that works when some displays are disabled as well
as when they are enabled. Also divided up the
DeviceIdentification into two separate functions so
that one will list all attached devices, and the other
will only report the devices currently in use.
2020-10-06 21:32:31 +13:00
Terry MacDonald
c716b88068 [WIP] Fixed the profile.IsPossible detection for NVidia
Still need to fix the non-NVIDIA card deviceidentifier logic
2020-10-06 20:59:59 +13:00
Terry MacDonald
3847bae972 [WIP] DisplayUI works but needs error handling
DisplayUI is mostly working but it needs some work
fixing the error situations when the PathInfo can't be
applied properly. Need a way of setting the Task
result from the Task Action. Don't know how to do that
so something new to learn!
2020-10-05 00:18:22 +13:00
Terry MacDonald
17cc302d17 [WIP] Partial refactor of applying profile display UI 2020-10-04 23:01:03 +13:00
Terry MacDonald
227caa2230 Fixing applying profile console messages 2020-10-02 18:47:39 +13:00
Terry MacDonald
3af60257ce Removing DisplayIndentifier class 2020-10-02 18:39:48 +13:00
Terry MacDonald
77ae3c4789 Basic working code to apply a display profile change
This code makes the display profile change work. There
are a few things broken still.... namely the showing of a
timer when the profile is being applied, the accuracy of
the display detection code, and the correct logic for
determining a profile can be used.
2020-10-02 18:10:34 +13:00
Terry MacDonald
466cdc647e [WIP] Attempt to fix the display detection for checking valid profiles
Initial work in progress profile 'IsPossible' logic update.
2020-09-30 22:49:02 +13:00
Terry MacDonald
9d5a5ebd62 [WIP] Creates different displayIdentifiers for NVIDIA or other
There are different displayIdentifiers created if the video card
is an NVidia card, or if it is anything else. These identifiers
are saved in the display profiles, and that allows us to compare
the display identifiers we currently have with the ones in various
profiles, and then work out which profiles are valid.

This code committed today ensures that the nvidia device
identifier will always use the NVAPIWrapper lib (whether in
surround mode or not) so that the application allows both
surround mode profiles and non-surround mode profiles
to be selected if the same displays are present.

For all other display adapters it just uses the
WindowsDisplayAPI to create a different displayIdentifier
which isn't as smart. It means that if you have an AMD and
use EyeInfinity, then this isn't clever enough to understand
the profiles use the same matching screens. I will have to
fix this eventually when i build in native AMD support in
the future.
2020-09-18 22:52:18 +12:00
Terry MacDonald
f2dca27c02 [WIP] Testing logic for detecting displays
The existing logic for detecting displays connected to
an NVidia device doesn't allow matching for Nvidia
surround and normal surroundless profiles. This means
that you cannot determine which profiles are the valid
for your display setup. This is testing the NVAPIWRapper
scanning and the WindowsDisplayAPI libraries to see what
information will work for tracking the screen in the profiles.
2020-09-18 20:35:49 +12:00
Terry MacDonald
0912ee5896 Added DisplayIdentifiers to Profile storage
DisplayIdentifiers are the minimum GPU/Display
that will allow us to identify whether a profile
will actually work. We look for the same DisplayIdentifiers
or a subset of them to determine whether a profile
will be valid to show. This is different from the data
stored under DisplayTarget, as that is used for detailed
compatibility....
2020-08-19 18:55:50 +12:00
Terry MacDonald
32ad405904 Removed braces from UUID in filenames
Simplified UUID logic by removing braces from the
filenames and within the storage JSON files.
2020-08-19 10:16:04 +12:00
Terry MacDonald
b95e7bbd39 Fixing Repositories to work on first run 2020-08-07 15:59:23 +12:00
terrymacdonald
41c03c30b5 Saving initial MSTest configuration
First part of installing an MSTest suite.
Included some config file to read in
for testing the ShortcutRepository and
the ProfileRepository. Had the data
handy so it made sense to save it :)
2020-07-26 20:52:46 +12:00
terrymacdonald
85de9b0697 [WIP] Partially fixed Profile.IsPossible logic
The IsPossible logic in the ProfileItem incorrectly
uses the ToPathTargetInfo, when a better match is
to look for all the actual displays that are currently
turned on, and then allow all profiles that include
only the displays that are turned on. That involves
1. getting a list of the display devicepaths, and then
2. checking if this profile has all the devicepaths
needed to show the profile. If it does, then it
IsPossible.
2020-07-24 21:46:53 +12:00
terrymacdonald
5004f5f76a Silenced the System.Drawing.Image exceptions
The ProfileAdapter and ShortcutAdapters used
by the ImageListView Control unfortunately
have to access the sizes of the bitmaps being
loaded into the respective imagelistviews. I
can't find anyway of stopping the GDI+
from complaining about the Bitmap being
accessed by multiple different threads (as
ImageListView creates one thread per image.
This will be fixed once I move to this being a
WPF application as we'll use a different control.
2020-07-24 16:51:48 +12:00
terrymacdonald
f23ae340a7 Fixed DisplayProfileForm profile selection logic
Profile selection logic was running functions multiple
times which was resulting in a lot of extra delay
while using the DisplayProfileFOrm. These changes
streamline it and make it work a lot faster!
2020-07-24 13:11:42 +12:00
terrymacdonald
e83a893640 [WIP] Partial cleanup of compiler warnings
Fixed most of the string related compiler
warnings. Still lots to go!
2020-07-24 11:06:33 +12:00
terrymacdonald
c358bc9087 [WIP] Moving Shortcut run logic to repo
Moved the shortcut running logic from the
main Program into the ShortcutRepository
so that it can be used from the
Shortcut Library UI as well as from the
commandline.

It's marked as WIP because I also moved
the ApplyingChangesForm and accompanying
ApplyTopos/ApplyProfiles logic and I broke
it. It needs refactoring and hopefully
simplifying but I need to work on that next!
2020-07-23 18:31:00 +12:00
terrymacdonald
c1ce153c68 Updated Shortcut saving to work with the library
Updated the 'Save To Desktop' button in the
ShortcutLibraryForm to use the CreateShortcut
function in the ShortcutItem, and fixed that so
it now uses the IWshRuntimeLibrary to create
a Windows Script Host that will create the
shortcut.
2020-07-21 19:50:41 +12:00
terrymacdonald
85963b3417 Fixed ShortcutAdaptor errors and Saved prompt
Did a fix for the SHortcutAdaptor doing exceptions
for showing the form before loading all the graphics
but can't really do much about it without adding
background loading to the main form. This is a lot of
work considering we'll be moving from WinForms
to WPF UI in the future.

Also fixed the 'Do you want to save' prompt detection
logic so that it correctly waits until all the loading has
finished before monitoring for users making changes.
Should stop the form incorrectly suggesting you
should save unless they've really made a change.
2020-07-15 20:11:38 +12:00
terrymacdonald
5b396032ff Shortcut names now update if profile name changed
If a shortcut has Autoname turned on, and if the user
changes the name of the profile, then the shortcut will
be renamed to keep pace with the new profile name.
If autoname is NOT turned on, then the shortcut name
will be kept as is, and the user will need to make any
changes. Please note that HeliosPlus will not make
any changes to any desktop shortcuts saved to the PC.
It will only change the name of the shortcut in the
shortcut library within the App.
2020-06-15 21:57:46 +12:00
temacdonald
23e1dbd244 Transitioned Profiles to using ProfileRepository
Moving to using a ProfileRespository will make it
easier when moving to a WPF style app, and it will
allow some freedom if I want to change the storage
to a database or soemthing different.
2020-06-14 16:20:52 +12:00
temacdonald
5bfc01365f Fixed Shortcut icon in ImageListView
Fixed the underlying Shortcut generation process
but still have yet to add it to the Shortcut Icon saved
in the Shortcut library.
2020-06-13 21:06:42 +12:00
temacdonald
e7ad4dc847 [WIP] Fixing Shortcut Bitmap
Partially completed bitmap work.
Need to implement generic bitmap
resizing to work with small and large
icons, and for different sizes for overlay
bitmap.
2020-06-07 20:48:45 +12:00
Terry MacDonald
f59490a1ff [WIP] Improved Shortcut handling
Created ShortcutRepository which handles
the loading/saving and lifecycle management
of shortcuts. There can only be one shortcut
repository at a time, hence it's mainly static
methods.

Also started down the path of troubleshooting
the profileIcon overlays. The ToBitmapOverlay
still isn't working properly, so I need to figure
out how it was working originally, and how I
broke it :). Then I need to unbreak it.
2020-06-01 22:25:52 +12:00
temacdonald
19a2f1543e [WIP] Progressing ShortcutLibrary loading
Still having issues with the shortcutAdaptor for the
Imagelistviewitem loading. Even though it's based
on the same code as the profileAdaptor it's not
reading the Shortcut bitmap properly. Too tired to
figure out why at the moment, so will be trying again
tomorrow. I expect its something to do with the
different Bitmap format for the two options. May
need to revise that to compare image data.
2020-05-19 21:41:26 +12:00
temacdonald
4412a75bd9 [WIP] Finished the draft Shortcut class
Have created the Shortcut class for use within the
ShortcutLibrary. Next step is modifying the
ShortcutForm to generate a Shortcut so that I
can check the loading and saving is working ok.
I won't concentrate on the ShortcutForm redesign
until this bit is tested.
2020-05-16 23:16:46 +12:00
temacdonald
423b3fb656 Working direct Profile to ImageListView
Manged to get the ImageListView working directly
from the Bitmap stored in the Profile. This makes
the refresh of the ILV much faster, and makes it way
easier to use it in other UI forms.
2020-05-16 15:58:59 +12:00
temacdonald
470cba0a1d Renamed the directories to HeliosPlus 2020-05-15 23:25:14 +12:00