diff --git a/Source/Base/uDMBase.pas b/Source/Base/uDMBase.pas index 50dc4af9..9919d145 100644 --- a/Source/Base/uDMBase.pas +++ b/Source/Base/uDMBase.pas @@ -24,13 +24,13 @@ type private FOnThemeChange: TNotifyEvent; FEscribirLog : TCriticalSection; - {procedure IniciarLog; - procedure DetenerLog;} + procedure IniciarLog; + procedure DetenerLog; procedure InitStyleManager; procedure OnTBXThemeChange(Sender: TObject); procedure LeerConfiguracion; public - {procedure EscribirLog(const AMensaje : String);} + procedure EscribirLog(const AMensaje : String); procedure SalvarConfiguracion; property OnThemeChange: TNotifyEvent read FOnThemeChange write FOnThemeChange; @@ -53,7 +53,7 @@ uses } procedure TdmBase.DAClientDataModuleCreate(Sender: TObject); begin - //IniciarLog; <- NO SE USA + IniciarLog; TBXSwitcher.OnThemeChange := OnTBXThemeChange; TBXSetTheme('Office2003'); @@ -61,25 +61,25 @@ begin LeerConfiguracion; end; -{procedure TdmBase.IniciarLog; +procedure TdmBase.IniciarLog; var - AIniFile : String; + ALogFileName : String; begin - inherited; FEscribirLog := TCriticalSection.Create; - AIniFile := GetSpecialFolderPath(CSIDL_LOCAL_APPDATA); //[All Users]\Application Data - AIniFile := AIniFile + PathDelim + GetAppName + PathDelim; - - if not DirectoryExists(AIniFile) then - CreateDir(AIniFile); - - JvLogFile.Active := False; - JvLogFile.FileName := AIniFile + 'ClientLog.txt'; - JvLogFile.AutoSave := True; - JvLogFile.Active := True; - JvLogFile.Clear; -end;} + ALogFileName := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data + ALogFileName := ALogFileName + PathDelim + 'Rodax Software' + PathDelim + 'FactuGES' + PathDelim; + if SysUtils.ForceDirectories(ALogFileName) then + begin + JvLogFile.Active := False; + JvLogFile.FileName := ALogFileName + 'ClientLog.txt'; + JvLogFile.AutoSave := True; + JvLogFile.Active := True; + JvLogFile.Clear; + end + else + raise Exception.Create('Error al crear directorio para Log: ' + IntToStr(GetLastError)); +end; procedure TdmBase.InitStyleManager; @@ -128,24 +128,22 @@ end; procedure TdmBase.DataModuleDestroy(Sender: TObject); begin - // DetenerLog; <- NO SE USA + DetenerLog; end; -{procedure TdmBase.DetenerLog; +procedure TdmBase.DetenerLog; begin FreeAndNIL(FEscribirLog); end; procedure TdmBase.EscribirLog(const AMensaje: String); begin -// dxPrintStyleManager1Style1.PrinterPage.PageFooter.LeftTitle.Add(FEmpresaInformesBase); - FEscribirLog.Acquire; try JvLogFile.Add(AMensaje); finally FEscribirLog.Release; end; -end;} +end; end. diff --git a/Source/GUIBase/uViewGridBase.pas b/Source/GUIBase/uViewGridBase.pas index 1f32fab4..4aa14afb 100644 --- a/Source/GUIBase/uViewGridBase.pas +++ b/Source/GUIBase/uViewGridBase.pas @@ -435,7 +435,7 @@ begin if Assigned(_FocusedView) then begin - AIniFile := GetSpecialFolderPath(CSIDL_COMMON_APPDATA); //[All Users]\Application Data + AIniFile := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim; if not DirectoryExists(AIniFile) then @@ -458,7 +458,7 @@ begin if Assigned(_FocusedView) then begin - AIniFile := GetSpecialFolderPath(CSIDL_COMMON_APPDATA); //[All Users]\Application Data + AIniFile := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim; if not DirectoryExists(AIniFile) then