From 703c860436ec952f3557bbcf56b07d593cf3956c Mon Sep 17 00:00:00 2001 From: david Date: Mon, 11 Jun 2012 14:31:03 +0000 Subject: [PATCH] =?UTF-8?q?Ticket=20#900=20->=20Poder=20eledir=20la=20cone?= =?UTF-8?q?xi=C3=B3n=20en=20la=20pantalla=20de=20login?= 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@1061 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- Build/Build.fbpInf | 2 +- Source/ApplicationBase/ApplicationBase.dpk | 2 +- Source/ApplicationBase/ApplicationBase.dproj | 9 +- .../Usuarios/Views/uEditorLogin.dfm | 72 ++++--- .../Usuarios/Views/uEditorLogin.pas | 48 ++++- Source/Base/Base.dpk | 3 +- Source/Base/Base.dproj | 106 ++++++----- Source/Base/Conexion/uConfigurarConexion.pas | 5 +- Source/Base/Conexion/uDataModuleConexion.pas | 52 ++++-- Source/Base/Conexion/uEditorConexiones.dfm | 119 ++++++++++++ Source/Base/Conexion/uEditorConexiones.pas | 175 ++++++++++++++++++ .../uDataModuleConfiguracion.pas | 26 ++- Source/Cliente/FactuGES.dpr | 2 +- Source/Cliente/FactuGES.dproj | 2 +- Source/Cliente/FactuGES.rc | 10 +- Source/Cliente/FactuGES.res | Bin 171984 -> 171984 bytes Source/Servidor/FactuGES_Server.RES | Bin 23204 -> 23200 bytes Source/Servidor/FactuGES_Server.rc | 4 +- 18 files changed, 513 insertions(+), 124 deletions(-) create mode 100644 Source/Base/Conexion/uEditorConexiones.dfm create mode 100644 Source/Base/Conexion/uEditorConexiones.pas diff --git a/Build/Build.fbpInf b/Build/Build.fbpInf index 5b7ef20b..1a0b5bc5 100644 --- a/Build/Build.fbpInf +++ b/Build/Build.fbpInf @@ -6,7 +6,7 @@ - + diff --git a/Source/ApplicationBase/ApplicationBase.dpk b/Source/ApplicationBase/ApplicationBase.dpk index c17b8d7e..cdcb891e 100644 --- a/Source/ApplicationBase/ApplicationBase.dpk +++ b/Source/ApplicationBase/ApplicationBase.dpk @@ -68,7 +68,7 @@ contains uViewPerfilUsuario in 'Usuarios\Views\uViewPerfilUsuario.pas' {frViewPerfilUsuario: TFrame}, uIEditorPerfilesUsuario in 'Usuarios\Controller\View\uIEditorPerfilesUsuario.pas', uIEditorPerfilUsuario in 'Usuarios\Controller\View\uIEditorPerfilUsuario.pas', - uEditorUsuarios in 'Usuarios\Views\uEditorUsuarios.pas' {fEditorUsuarios: TForm}, + uEditorUsuarios in 'Usuarios\Views\uEditorUsuarios.pas' {fEditorUsuarios: T}, uViewUsuarios in 'Usuarios\Views\uViewUsuarios.pas' {frViewUsuarios: TFrame}, uEditorUsuario in 'Usuarios\Views\uEditorUsuario.pas' {fEditorUsuario: TFrame}, uViewUsuario in 'Usuarios\Views\uViewUsuario.pas' {frViewUsuario: TFrame}, diff --git a/Source/ApplicationBase/ApplicationBase.dproj b/Source/ApplicationBase/ApplicationBase.dproj index 7f62faa8..ce679d93 100644 --- a/Source/ApplicationBase/ApplicationBase.dproj +++ b/Source/ApplicationBase/ApplicationBase.dproj @@ -55,11 +55,10 @@ MainSource - - - - - + + + + diff --git a/Source/ApplicationBase/Usuarios/Views/uEditorLogin.dfm b/Source/ApplicationBase/Usuarios/Views/uEditorLogin.dfm index 38db70d8..f5486667 100644 --- a/Source/ApplicationBase/Usuarios/Views/uEditorLogin.dfm +++ b/Source/ApplicationBase/Usuarios/Views/uEditorLogin.dfm @@ -5,7 +5,7 @@ object fEditorLogin: TfEditorLogin BorderStyle = bsDialog Caption = 'FactuGES' ClientHeight = 241 - ClientWidth = 385 + ClientWidth = 392 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -20,16 +20,16 @@ object fEditorLogin: TfEditorLogin PixelsPerInch = 96 TextHeight = 13 object Label3: TLabel - Left = 24 - Top = 108 + Left = 27 + Top = 132 Width = 39 Height = 13 Caption = 'Usuario:' Transparent = False end object Label4: TLabel - Left = 24 - Top = 138 + Left = 27 + Top = 162 Width = 57 Height = 13 Caption = 'Contrase'#241'a:' @@ -42,7 +42,7 @@ object fEditorLogin: TfEditorLogin Height = 13 Caption = 'Inicio de sesi'#243'n:' Font.Charset = DEFAULT_CHARSET - Font.Color = clMenuHighlight + Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] @@ -51,16 +51,25 @@ object fEditorLogin: TfEditorLogin object JvGradient1: TJvGradient Left = 0 Top = 57 - Width = 385 + Width = 392 Height = 4 Align = alTop StartColor = 2971346 EndColor = 4828405 + ExplicitWidth = 385 + end + object Label2: TLabel + Left = 27 + Top = 105 + Width = 47 + Height = 13 + Caption = 'Conexi'#243'n:' + Transparent = False end object Panel1: TPanel Left = 0 Top = 0 - Width = 385 + Width = 392 Height = 57 Align = alTop BevelOuter = bvNone @@ -69,7 +78,7 @@ object fEditorLogin: TfEditorLogin object Image1: TImage Left = 0 Top = 0 - Width = 385 + Width = 392 Height = 57 Align = alClient Center = True @@ -1023,8 +1032,8 @@ object fEditorLogin: TfEditorLogin end end object edtPassword: TEdit - Left = 96 - Top = 132 + Left = 99 + Top = 156 Width = 278 Height = 21 PasswordChar = '*' @@ -1035,10 +1044,9 @@ object fEditorLogin: TfEditorLogin Top = 203 Width = 75 Height = 25 - Caption = '&Aceptar' + Action = actAceptar Default = True TabOrder = 3 - OnClick = bAceptarClick end object bCancelar: TButton Left = 296 @@ -1051,8 +1059,8 @@ object fEditorLogin: TfEditorLogin TabOrder = 4 end object edtUser: TEdit - Left = 96 - Top = 104 + Left = 99 + Top = 129 Width = 278 Height = 21 TabOrder = 1 @@ -1063,16 +1071,29 @@ object fEditorLogin: TfEditorLogin Top = 203 Width = 129 Height = 25 - Caption = 'C&onfigurar conexi'#243'n...' + Caption = 'C&onfigurar conexiones...' TabOrder = 5 OnClick = ToolButton4Click end + object cbConexiones: TComboBox + Left = 99 + Top = 102 + Width = 278 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + ItemIndex = 0 + TabOrder = 6 + Text = '' + Items.Strings = ( + '') + end object Timer1: TTimer Enabled = False Interval = 5000 OnTimer = Timer1Timer Left = 344 - Top = 64 + Top = 8 end object JvAppRegistryStorage1: TJvAppRegistryStorage StorageOptions.BooleanStringTrueValues = 'TRUE, YES, Y' @@ -1080,8 +1101,8 @@ object fEditorLogin: TfEditorLogin StorageOptions.BooleanAsString = False Root = 'Software\%APPL_NAME%' SubStorages = <> - Left = 14 - Top = 168 + Left = 278 + Top = 8 end object JvFormStorage1: TJvFormStorage AppStorage = JvAppRegistryStorage1 @@ -1095,7 +1116,16 @@ object fEditorLogin: TfEditorLogin Name = 'Ruta' Value = '' end> - Left = 48 - Top = 168 + Left = 312 + Top = 8 + end + object ActionList1: TActionList + Left = 248 + Top = 8 + object actAceptar: TAction + Caption = '&Aceptar' + OnExecute = actAceptarExecute + OnUpdate = actAceptarUpdate + end end end diff --git a/Source/ApplicationBase/Usuarios/Views/uEditorLogin.pas b/Source/ApplicationBase/Usuarios/Views/uEditorLogin.pas index c7d030e9..beff2432 100644 --- a/Source/ApplicationBase/Usuarios/Views/uEditorLogin.pas +++ b/Source/ApplicationBase/Usuarios/Views/uEditorLogin.pas @@ -8,7 +8,8 @@ uses cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxImageComboBox, ImgList, PngImageList, pngimage, ToolWin, JvExControls, JvComponent, JvGradient, JvGIF, JvComponentBase, JvFormPlacement, - JvAppStorage, JvAppRegistryStorage, uIEditorLogin, uUsuariosController; + JvAppStorage, JvAppRegistryStorage, uIEditorLogin, uUsuariosController, + ActnList; type TfEditorLogin = class(TForm, IEditorLogin) @@ -26,18 +27,24 @@ type JvAppRegistryStorage1: TJvAppRegistryStorage; JvFormStorage1: TJvFormStorage; Image1: TImage; - procedure bAceptarClick(Sender: TObject); + cbConexiones: TComboBox; + Label2: TLabel; + ActionList1: TActionList; + actAceptar: TAction; procedure ToolButton4Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure edtUserKeyPress(Sender: TObject; var Key: Char); + procedure actAceptarExecute(Sender: TObject); + procedure actAceptarUpdate(Sender: TObject); private FController : IUsuariosController; FIntentos : Integer; function GetController : IUsuariosController; procedure SetController (const AValue : IUsuariosController); + procedure RellenarConexiones; published property Controller : IUsuariosController read GetController write SetController; end; @@ -50,15 +57,18 @@ uses {$R *.dfm} +const + NO_CONEXIONES = ''; + { ********************************* TfEditorLogin ********************************** } -procedure TfEditorLogin.bAceptarClick(Sender: TObject); +procedure TfEditorLogin.actAceptarExecute(Sender: TObject); var bOk : Boolean; begin Timer1.Enabled := False; - + ShowHourglassCursor; try bOK := FController.ComprobarUsuario(edtUser.Text, edtPassword.Text); @@ -77,21 +87,27 @@ begin end; end; +procedure TfEditorLogin.actAceptarUpdate(Sender: TObject); +begin + (Sender as TAction).Enabled := (cbConexiones.Items.IndexOf(NO_CONEXIONES) = -1); +end; + procedure TfEditorLogin.ToolButton4Click(Sender: TObject); var ATimer : Boolean; begin - ATimer := False; + {*ATimer := False; if Timer1.Enabled then begin ATimer := True; Timer1.Enabled := False; - end; + end;*} dmConexion.ConfigurarConexion; + RellenarConexiones; - if ATimer then - Timer1.Enabled := True; + {*if ATimer then + Timer1.Enabled := True;*} end; procedure TfEditorLogin.edtUserKeyPress(Sender: TObject; var Key: Char); @@ -114,10 +130,11 @@ procedure TfEditorLogin.FormShow(Sender: TObject); begin Self.Caption := AppFactuGES.AppFullName; JvFormStorage1.RestoreFormPlacement; + RellenarConexiones; // Hacer login automática si hay usuario/password y no hay más de una base // de datos como opción para conectarse. - if ((Length(edtUser.Text) > 0) and (Length(edtPassword.Text) > 0)) then + if ((cbConexiones.Items.Count > 0) and (Length(edtUser.Text) > 0) and (Length(edtPassword.Text) > 0)) then Timer1.Enabled := True; end; @@ -126,6 +143,19 @@ begin Result := FController; end; +procedure TfEditorLogin.RellenarConexiones; +begin + cbConexiones.Clear; + cbConexiones.Items := dmConexion.ListaConexiones; + + if cbConexiones.Items.Count > 0 then + cbConexiones.ItemIndex := 0 + else begin + cbConexiones.Items.Add(NO_CONEXIONES); + cbConexiones.ItemIndex := 0 + end; +end; + procedure TfEditorLogin.SetController(const AValue: IUsuariosController); begin FController := AValue; diff --git a/Source/Base/Base.dpk b/Source/Base/Base.dpk index 50cf0f2b..34ea781c 100644 --- a/Source/Base/Base.dpk +++ b/Source/Base/Base.dpk @@ -114,6 +114,7 @@ contains uReferenciasUtils in 'Utiles\uReferenciasUtils.pas', uEMailUtils in 'Utiles\uEMailUtils.pas', uSaveClipboard in 'Utiles\uSaveClipboard.pas', - MidasSpeedFix in 'Utiles\MidasSpeedFix.pas'; + MidasSpeedFix in 'Utiles\MidasSpeedFix.pas', + uEditorConexiones in 'Conexion\uEditorConexiones.pas' {fEditorConexiones: TfEditorConexiones}; end. diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 1d5829f9..6f3df86b 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -56,58 +56,51 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fConfigurarConexion
TForm @@ -116,6 +109,17 @@
dmConexion
TDataModule
+ +
fEditorConexiones
+ TfEditorConexiones +
+ + + + + + +
dmConfiguracion
TDataModule diff --git a/Source/Base/Conexion/uConfigurarConexion.pas b/Source/Base/Conexion/uConfigurarConexion.pas index 9c3cd55a..8575a1e8 100644 --- a/Source/Base/Conexion/uConfigurarConexion.pas +++ b/Source/Base/Conexion/uConfigurarConexion.pas @@ -53,7 +53,10 @@ begin s := StrAfter(edtServer.Text + ':', Value); s := StrBefore('/bin', s); - edtPort.Text := s; + + if s = '' then + s := '8099'; + edtPort.Text := s end; procedure TfConfigurarConexion.bProbarClick(Sender: TObject); diff --git a/Source/Base/Conexion/uDataModuleConexion.pas b/Source/Base/Conexion/uDataModuleConexion.pas index 3db1b20b..b479d384 100644 --- a/Source/Base/Conexion/uDataModuleConexion.pas +++ b/Source/Base/Conexion/uDataModuleConexion.pas @@ -7,9 +7,6 @@ uses uDABINAdapter, uROClient, uROBinMessage, uDADataStreamer, uROWinInetHttpChannel; -const - SERVER_URL = 'http://localhost:8099/bin'; // Dirección por defecto del servidor - type TdmConexion = class(TDataModule) ROMessage: TROBinMessage; @@ -19,11 +16,14 @@ type anException: Exception; var aRetry: Boolean); procedure DataModuleCreate(Sender: TObject); private + FListaConexiones : TStringList; function GetChannel: TROTransportChannel; function GetMessage: TROBinMessage; function GetTargetURL: String; procedure SetTargetURL(const Value: String); procedure ConfigurarEncriptacionConexion; + function GetListaConexiones: TStringList; + procedure SetListaConexiones(const Value: TStringList); public function HayConexion : Boolean; function ProbarConexion(const ATargetURL : String): Boolean; @@ -31,6 +31,7 @@ type property TargetURL : String read GetTargetURL write SetTargetURL; property Channel: TROTransportChannel read GetChannel; property Message: TROBinMessage read GetMessage; + property ListaConexiones : TStringList read GetListaConexiones write SetListaConexiones; end; var @@ -42,7 +43,7 @@ implementation uses uROEncryption, Windows, WinInet, cxControls, uConfigurarConexion, Dialogs, Controls, - uDMBase, FactuGES_Intf, uDialogUtils; + uDMBase, FactuGES_Intf, uDialogUtils, uEditorConexiones; const IE_OFFLINE_ERROR = 'Unexpected error in WinInet HTTP Channel (2)'; @@ -60,20 +61,22 @@ begin end; procedure TdmConexion.ConfigurarConexion; +var + AEditor : TfEditorConexiones; begin - with TfConfigurarConexion.Create(NIL) do - try - TargetURL := ROChannel.TargetURL; - if ShowModal = mrOk then - begin - ROChannel.TargetURL := TargetURL; - ROChannel.Connected := False; - ROChannel.Connected := True; - dmBase.SalvarConfiguracion; - end; - finally - Free; + AEditor := TfEditorConexiones.Create(NIL); + try + AEditor.ListaConexiones := FListaConexiones; + if AEditor.ShowModal = mrOk then + begin + Self.ListaConexiones := AEditor.ListaConexiones; + dmBase.SalvarConfiguracion; end; + + finally + AEditor.Release; + AEditor := NIL; + end; end; procedure TdmConexion.ConfigurarEncriptacionConexion; @@ -91,6 +94,7 @@ end; procedure TdmConexion.DataModuleCreate(Sender: TObject); begin + FListaConexiones := TStringList.Create; ConfigurarEncriptacionConexion; { @@ -106,8 +110,9 @@ end; procedure TdmConexion.DataModuleDestroy(Sender: TObject); begin - if ROChannel.Connected then - ROChannel.Connected := False; +{* if ROChannel.Connected then + ROChannel.Connected := False;*} + FreeAndNil(FListaConexiones); end; function TdmConexion.GetChannel: TROTransportChannel; @@ -115,6 +120,11 @@ begin Result := ROChannel; end; +function TdmConexion.GetListaConexiones: TStringList; +begin + Result := FListaConexiones; +end; + function TdmConexion.GetMessage: TROBinMessage; begin Result := ROMessage; @@ -210,6 +220,12 @@ begin end; end; +procedure TdmConexion.SetListaConexiones(const Value: TStringList); +begin + FListaConexiones.Clear; + FListaConexiones.AddStrings(Value); +end; + procedure TdmConexion.SetTargetURL(const Value: String); begin ROChannel.TargetURL := Value; diff --git a/Source/Base/Conexion/uEditorConexiones.dfm b/Source/Base/Conexion/uEditorConexiones.dfm new file mode 100644 index 00000000..f2473545 --- /dev/null +++ b/Source/Base/Conexion/uEditorConexiones.dfm @@ -0,0 +1,119 @@ +object fEditorConexiones: TfEditorConexiones + Left = 453 + Top = 234 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'Lista de conexiones' + ClientHeight = 406 + ClientWidth = 404 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object bAceptar: TButton + Left = 236 + Top = 373 + Width = 75 + Height = 23 + Action = actAceptar + Default = True + ModalResult = 1 + TabOrder = 1 + end + object bCancelar: TButton + Left = 321 + Top = 373 + Width = 75 + Height = 23 + Action = actCancelar + Cancel = True + ModalResult = 2 + TabOrder = 2 + end + object PageControl1: TPageControl + Left = 6 + Top = 8 + Width = 390 + Height = 356 + ActivePage = TabSheet1 + TabOrder = 0 + object TabSheet1: TTabSheet + Caption = 'Lista de conexiones' + object Label1: TLabel + Left = 6 + Top = 12 + Width = 149 + Height = 13 + Caption = 'Lista de conexiones disponibles' + end + object bEliminar: TButton + Left = 284 + Top = 90 + Width = 95 + Height = 23 + Action = actEliminar + TabOrder = 0 + end + object bAnadir: TButton + Left = 284 + Top = 31 + Width = 95 + Height = 23 + Action = actAnadir + TabOrder = 1 + end + object Button1: TButton + Left = 284 + Top = 61 + Width = 95 + Height = 23 + Action = actModificar + TabOrder = 2 + end + end + end + object ListBox1: TListBox + Left = 16 + Top = 63 + Width = 272 + Height = 290 + ItemHeight = 13 + TabOrder = 3 + end + object ActionList1: TActionList + Left = 144 + Top = 16 + object actAnadir: TAction + Caption = '&A'#241'adir...' + OnExecute = actAnadirExecute + end + object actEliminar: TAction + Caption = '&Eliminar' + OnExecute = actEliminarExecute + OnUpdate = actEliminarUpdate + end + object actAceptar: TAction + Caption = 'A&ceptar' + OnExecute = actAceptarExecute + end + object actCancelar: TAction + Caption = '&Cancelar' + OnExecute = actCancelarExecute + end + object actModificar: TAction + Caption = '&Modificar...' + OnExecute = actModificarExecute + OnUpdate = actModificarUpdate + end + end + object dsFormasPago: TDADataSource + Left = 168 + Top = 16 + end +end diff --git a/Source/Base/Conexion/uEditorConexiones.pas b/Source/Base/Conexion/uEditorConexiones.pas new file mode 100644 index 00000000..e687e7f3 --- /dev/null +++ b/Source/Base/Conexion/uEditorConexiones.pas @@ -0,0 +1,175 @@ +{ +=============================================================================== + Copyright (©) 2006. Rodax Software. +=============================================================================== + Los contenidos de este fichero son propiedad de Rodax Software titular del + copyright. Este fichero sólo podrá ser copiado, distribuido y utilizado, + en su totalidad o en parte, con el permiso escrito de Rodax Software, o de + acuerdo con los términos y condiciones establecidas en el acuerdo/contrato + bajo el que se suministra. + ----------------------------------------------------------------------------- + Web: www.rodax-software.com +=============================================================================== + Fecha primera versión: 22-05-2006 + Versión actual: 1.0.0 + Fecha versión actual: 22-05-2006 +=============================================================================== + Modificaciones: + + Fecha Comentarios + --------------------------------------------------------------------------- +=============================================================================== +} + +unit uEditorConexiones; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + DB, uDADataTable, + ActnList, Grids, DBGrids, StdCtrls, ComCtrls, uDAInterfaces, Mask, DBCtrls; + +type + TfEditorConexiones = class(TForm) + ActionList1: TActionList; + dsFormasPago: TDADataSource; + actAnadir: TAction; + actEliminar: TAction; + bEliminar: TButton; + actAceptar: TAction; + actCancelar: TAction; + bAceptar: TButton; + bCancelar: TButton; + PageControl1: TPageControl; + TabSheet1: TTabSheet; + Label1: TLabel; + bAnadir: TButton; + actModificar: TAction; + Button1: TButton; + ListBox1: TListBox; + procedure actCancelarExecute(Sender: TObject); + procedure actAceptarExecute(Sender: TObject); + procedure actModificarExecute(Sender: TObject); + procedure actAnadirExecute(Sender: TObject); + procedure actEliminarExecute(Sender: TObject); + procedure actModificarUpdate(Sender: TObject); + procedure actEliminarUpdate(Sender: TObject); + private + FListaConexiones : TStringList; + function GetListaConexiones: TStringList; + procedure SetListaConexiones(const Value: TStringList); + procedure RellenarLista; + procedure GuardarLista; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ListaConexiones : TStringList read GetListaConexiones write SetListaConexiones; + end; + + +implementation +{$R *.dfm} + +{ TfEditorConexiones } + +uses + uDialogUtils, uConfigurarConexion; + +procedure TfEditorConexiones.actAceptarExecute(Sender: TObject); +begin + GuardarLista; + ModalResult := mrOk; +end; + +procedure TfEditorConexiones.actAnadirExecute(Sender: TObject); +begin + with TfConfigurarConexion.Create(NIL) do + begin + try + TargetURL := ''; + if ShowModal = mrOk then + ListBox1.Items.Add(TargetURL); + finally + Release; + end; + end; +end; + +procedure TfEditorConexiones.actCancelarExecute(Sender: TObject); +begin + ModalResult := mrCancel; +end; + +procedure TfEditorConexiones.actEliminarExecute(Sender: TObject); +begin + ListBox1.Items.Delete(ListBox1.ItemIndex); +end; + +procedure TfEditorConexiones.actEliminarUpdate(Sender: TObject); +begin + (Sender as TAction).Enabled := (ListBox1.ItemIndex >= 0) +end; + +procedure TfEditorConexiones.actModificarExecute(Sender: TObject); +begin + with TfConfigurarConexion.Create(NIL) do + begin + try + TargetURL := ListBox1.Items[ListBox1.ItemIndex]; + if ShowModal = mrOk then + ListBox1.Items[ListBox1.ItemIndex] := TargetURL; + finally + Release; + end; + end; +end; + +procedure TfEditorConexiones.actModificarUpdate(Sender: TObject); +begin + (Sender as TAction).Enabled := (ListBox1.ItemIndex >= 0) +end; + +constructor TfEditorConexiones.Create(AOwner: TComponent); +begin + inherited; + FListaConexiones := TStringList.Create; +end; + +destructor TfEditorConexiones.Destroy; +begin + FreeAndNil(FListaConexiones); + inherited; +end; + +function TfEditorConexiones.GetListaConexiones: TStringList; +begin + Result := FListaConexiones; +end; + +procedure TfEditorConexiones.GuardarLista; +var + i : integer; +begin + FListaConexiones.Clear; + for i := 0 to ListBox1.Count - 1 do + FListaConexiones.Add(ListBox1.Items[i]); +end; + +procedure TfEditorConexiones.RellenarLista; +begin + with ListBox1 do + begin + Clear; + Items.AddStrings(FListaConexiones); + end; +end; + +procedure TfEditorConexiones.SetListaConexiones(const Value: TStringList); +begin + FListaConexiones.Clear; + FListaConexiones.AddStrings(Value); + RellenarLista; +end; + +end. diff --git a/Source/Base/Configuracion/uDataModuleConfiguracion.pas b/Source/Base/Configuracion/uDataModuleConfiguracion.pas index 1ba6b9fd..e8304b8f 100644 --- a/Source/Base/Configuracion/uDataModuleConfiguracion.pas +++ b/Source/Base/Configuracion/uDataModuleConfiguracion.pas @@ -7,9 +7,6 @@ uses uDABINAdapter, uROClient, IniFiles, uDADataStreamer; -const - SERVER_URL = 'http://localhost:8099/bin'; - type TdmConfiguracion = class(TDataModule) RORemoteService: TRORemoteService; @@ -67,15 +64,30 @@ begin end; procedure TdmConfiguracion.LeerConfiguracion; +var + AStream : TMemoryStream; begin - with FIniFile do - dmConexion.TargetURL := ReadString('Server', 'URL', SERVER_URL); + AStream := TMemoryStream.Create(); + try + if (FIniFile.ReadBinaryStream('Server', 'URLs', AStream) > 0) then + dmConexion.ListaConexiones.LoadFromStream(AStream); + finally + FreeAndNIL(AStream); + end; end; procedure TdmConfiguracion.SalvarConfiguracion; +var + AStream : TMemoryStream; begin - with FIniFile do - WriteString('Server', 'URL', dmConexion.TargetURL); + AStream := TMemoryStream.Create(); + try + dmConexion.ListaConexiones.SaveToStream(AStream); + AStream.Position := 0; + FIniFile.WriteBinaryStream('Server', 'URLs', AStream); + finally + FreeAndNil(AStream); + end; end; end. diff --git a/Source/Cliente/FactuGES.dpr b/Source/Cliente/FactuGES.dpr index b105df38..7bce4acf 100644 --- a/Source/Cliente/FactuGES.dpr +++ b/Source/Cliente/FactuGES.dpr @@ -32,6 +32,6 @@ begin uBootStrap.Run; // <- Aquí dentro está Application.Run uBootStrap.Terminate; - Application.Terminate; //<- No descomentar para así ver los Memory Leaks + //Application.Terminate; //<- No descomentar para así ver los Memory Leaks end. diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 622d924d..a940aadb 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -53,7 +53,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1940FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.9.4.0FactuGESFactuGES1.9.4.0FactuGES.dprFalse +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1950FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.9.5.0FactuGESFactuGES1.9.5.0FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index eadbcda7..83bfc2d9 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ -MAINICON ICON "C:\Codigo tecsitel\Resources\Iconos\Factuges.ico" +MAINICON ICON "C:\Codigo Tecsitel\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 1,9,4,0 -PRODUCTVERSION 1,9,4,0 +FILEVERSION 1,9,5,0 +PRODUCTVERSION 1,9,5,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "1.9.4.0\0" + VALUE "FileVersion", "1.9.5.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "1.9.4.0\0" + VALUE "ProductVersion", "1.9.5.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index 1d70b45caddc4cb7c82cfc874de2d59bb2bd0195..6ded508bf328a7d091075ec3319db7ef74daa608 100644 GIT binary patch delta 42 xcmcbxpXs~&43lG{+yTwR8YTb$ delta 115 zcmZ3mm2t^d#tnBO7*|Zb8zB!Q|3*YJa!ihlRAziKxi+$zIfFrE^6yAl*DQuohE#?! zATDOmVNhT&WH1AgDL}pgLmH4wVkiQVMGX0HQ6mNepeiG~1``I;$&pd+04CoY A+yDRo diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index 82641447..cddb4ee6 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -1,4 +1,4 @@ -MAINICON ICON "C:\Codigo tecsitel\Resources\Iconos\Servidor.ico" +MAINICON ICON "C:\Codigo Tecsitel\Resources\Iconos\Servidor.ico" 1 VERSIONINFO FILEVERSION 1,9,4,0 PRODUCTVERSION 1,9,4,0 @@ -14,7 +14,7 @@ BEGIN BEGIN VALUE "FileVersion", "1.9.4.0\0" VALUE "ProductVersion", "1.9.4.0\0" - VALUE "CompileDate", "jueves, 16 de febrero de 2012 17:45\0" + VALUE "CompileDate", "lunes, 11 de junio de 2012 16:21\0" END END BLOCK "VarFileInfo"