From 0c20497abca3964620c0ad84fd572191db8760d9 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 12 Apr 2011 19:29:49 +0000 Subject: [PATCH] =?UTF-8?q?Tarea=20#569=20->=20Revisar=20la=20aplicaci?= =?UTF-8?q?=C3=B3n=20para=20que=20no=20de=20problemas=20con=20Windows=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@1046 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- Source/Base/uDMBase.pas | 46 +++++++++++++++----------------- Source/GUIBase/uViewGridBase.pas | 4 +-- 2 files changed, 24 insertions(+), 26 deletions(-) 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