-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to .NET Framework Settings System #114
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First iteration of the form, along with translation files (in need of translators!) Also includes a new icon. I like the smooth gradient XP-style of the little orange guy carrying the electrical plug, so I'm standardizing around XP icons.
- Correcting PreRelease build config so that projects are building correctly as needed. - Logger class handles its own directory since the Logging API provides default file locations. - Removing global variables and logic relating to data paths since the only code that really used it was the Logger class. - Specified output path for crashbugs. - Simplified Logger initialization to be more predictable and utilize standard values and paths.
Creating application settings files for later integration.
Merging some changes from upstream, and some automatic VS changes as well.
4 tasks
Upgraded the .NET Framework target version for both client projects. Specified default language, and removed unused settings from Client library.
Tweaking some types in the main Settings file. Adding new resource strings for UpgradePrefsDialog. Removing embedded binary data in main resources file.
Integrate UpgradePrefsDialog helper and Settings migration into WinNUT. ApplicationEvents.vb - Adjust Parameters/Settings portion of crash report generator to support the new Settings system. MultilingualResources: Applied new resource strings, and removal of embedded binary data. WinNUT.vb - Replace parameter init code with new code to check for old preferences data and begin import procedure if necessary. - Remove WinNUT 1.x INI import code Added relevant helper code to Common library. Upgraded Client and main project .Net targets to 4.8.1.
- Refreshed .editorconfig, making sure the only copy is applied solution-wide (no significant changes were actually made to the file) - Application.myapp definition file was automatically updated by the designer (no significant changes)
Removed extra .editorconfig file as well as leftover Ini importing code and duplicate UPS code, relocated prefs-related classes into their own folder & namespace, and moved the SerializedProtectedString file back into the main library/namespace. - SerializedProtectedString: Standardized naming conventions w.r.t protection/encryption. Made two properties to help control serialization (fixes unprotected strings being written to the settings file), added cast operators, and a new constructor to also assist with serialization. - WinNUT_Params: Cleaned up class structure, simplified params loading method, removed param saving method, created param export and deletion methods - UpgradableParams: Corrected reference to Password property, removed public property for the old params, updated how old params are counted, created an upgrade worker arguments subclass.
- Renamed NUT_PasswordEnc setting to NUT_Password - Created Model codefile for UpgradePrefsDialog. Move necessary bacing properties and bound them on the Form. - Updated some strings concerning the form - Added a regedit icon to represent the UpgradePrefsDialog wizard. - Removed excess Imports - Removed much of the logic out of UpgradePrefsDialog.vb and into the model. Also made small changes to the Form and resources. - Removed extraneous WinNUT icon - Some reorganization in WinNUT.vb; adding a Form event handling region, moving old preferences detection code into a later form event so the Form will appear with user-friendly log output displayed. Linked up manual upgrade launch command in the toolstrip menu. Also make sure settings are saved when preferences are changed. - Updated data in Setup project file; updated icon reference, attempted to remove extra references again.
gbakeman
force-pushed
the
100-new-settings
branch
from
November 7, 2023 22:38
44a33da
to
1872adf
Compare
Reverting significant minimum requirements change that was not intended so casually. Also Visual Studio Designer slipping in a random tweak to one of its files.
Miscellaneous changes to Setup project file, and creation of a dedicated PreRelease configuration targeting it.
In the old Registry preferences storage system, the 'frequency in nominal' value was stored as an index of the `Cbx_Freq_Input` combobox control in the `Pref_Gui` preferences form. However, the new Settings system stores the frequency value literally. To work around this, we set the combobox selectedindex value to the first full match with the loaded Settings value. When saving, the value of the selecteditem is read directly into the Settings value.
Prevent auto update check from running before we've had a chance to import the preferences.
- Make sure the registry key root is opened as writable so delete procedure completes without error. - Check for existing registry export file before exporting, to prevent reg.exe from hanging. - Handle any errors produced by reg.exe.
- Corrected Icon property and binding (only using WinNUT icon, to avoid having to convert the registry graphic) - Add reference to parent Form instance - Initialize Form bindings - Move save file dialog for capturing user location preference back into the UI thread. - Support cancelling the background worker (although it should finish very quickly.) - Remove debugging thread sleep statements. - Better handling of upgrade worker completing, including if there was an error. - Move most logic out of primary Form code file.
Retargetting dev-2.3 branch |
The input frequency calibration preference value used to be stored as the index value of the dropdown box in the preferences window; 0 for 50hz, and 1 for 60hz. The new settings system stores the value literally now, although the rest of WinNUT was not updated to reflect this change. - WinNUT.vb now passes the Settings value directly to the `UPS_Device` constructor instead of converting it. - UPS_Device.vb also refers to the value directly when getting parameter info from the UPS. - Prefs upgrade import procedure now has an edge case to convert the old value to the new one.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The primary goal of this PR is to move WinNUT from the custom Registry preferences storage system, to the built-in .NET Framework Settings system. This should make adding or modifying settings easier, as well as migrating them between versions. It will also set the stage for upgrading WinNUT to the ClickOnce deployment scheme.
Changes
SerializedProtectedString
for storing protected data (username, password) in the .Net Application Settings systemCloses #100