From 6981bcafbb75ecedf8327238d036d094aba1642f Mon Sep 17 00:00:00 2001 From: NicolaP Date: Fri, 8 Apr 2022 12:45:02 +0200 Subject: [PATCH] Opzione ReadOnly gestita da chiave di protezione --- IniFile.vb | 2 ++ MainWindow/MainWindowModel.vb | 4 ++-- My Project/AssemblyInfo.vb | 4 ++-- OptionsWindow/OptionModule.vb | 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/IniFile.vb b/IniFile.vb index b1ce4e7..5e4f4c2 100644 --- a/IniFile.vb +++ b/IniFile.vb @@ -25,6 +25,8 @@ Friend Module IniFile DOORS = 2 DOORCREATOR = 8 JAMBS = 32 + STEELDOOR = 256 + READ_ONLY = 512 End Enum ' Path cartella Data diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb index 6ef8c24..5991d63 100644 --- a/MainWindow/MainWindowModel.vb +++ b/MainWindow/MainWindowModel.vb @@ -57,8 +57,8 @@ Friend Class MainWindowModel EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile) EgtSetKey(sKey) ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(3279, 2403, 1, IniFile.m_nKeyLevel) And - EgtGetKeyOptions(3279, 2403, 1, IniFile.m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(3279, 2404, 1, IniFile.m_nKeyLevel) And + EgtGetKeyOptions(3279, 2404, 1, IniFile.m_nKeyOptions) 'Inizializzazione generale di EgtInterface m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 4e564d3..0fa2876 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 67ba164..eda57d7 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -219,7 +219,9 @@ Friend Module OptionModule End If ' verifico se il programma è in modalità di sola lettura DDF - If GetMainPrivateProfileInt(S_GENERAL, "ReadOnly", 0) <> 0 Then + If (IniFile.m_nKeyOptions And KEY_OPT.READ_ONLY) <> 0 Then + OptionModule.ReadOnlyDDF = True + ElseIf GetMainPrivateProfileInt(S_GENERAL, "ReadOnly", 0) <> 0 Then OptionModule.ReadOnlyDDF = True Else OptionModule.ReadOnlyDDF = False