diff --git a/src/main.js b/src/main.js index d4b95c9..36a56a7 100755 --- a/src/main.js +++ b/src/main.js @@ -14,19 +14,21 @@ var Conf = var Locale ={ es: { "Enter a user name": - "Introduce un nombre de usuario" - ,"Enter a password": - "Introduce una contraseña" - ,"Server can't be reached": - "No se ha podido conectar con el servidor" - ,"Updating": - "Actualizando" - ,"Bad login": - "Usuario o contraseña incorrectos" - ,"Loading": - "Cargando" - ,"Error while updating": - "Error al actualizar" + "Introduce un nombre de usuario" + ,"Enter a password": + "Introduce una contraseña" + ,"Server can't be reached": + "No se ha podido conectar con el servidor" + ,"Updating": + "Actualizando" + ,"Bad login": + "Usuario o contraseña incorrectos" + ,"Loading": + "Cargando" + ,"Error while updating": + "Error al actualizar" + ,"Microsoft Access 2003 is not installed": + "Microsoft Access 2003 no está instalado en el sistema" } }; @@ -185,12 +187,10 @@ var App = _onKeyPress: function (e) { - var target = event.target || event.srcElement; - switch (e.keyCode) { case 13: // Enter - this._onEnterPress (target); + this._onEnterPress (e); break; case 27: // Esc window.close (); @@ -198,9 +198,11 @@ var App = } }, - _onEnterPress: function (target) + _onEnterPress: function (event) { - if ( target && target.id == 'user' && this.$('password').value == '') + var target = event.target || event.srcElement; + + if (target && target.id == 'user' && this.$('password').value == '') { this.$('password').focus (); return; @@ -354,7 +356,14 @@ var App = { var remember = this.$('remember').checked ? 1 : 0; this.regWrite (Conf.regPath, 'remember', remember, 'REG_DWORD'); - this.shell.run (this.mdbFile, 0, false); + + var programFiles = this.getEnv ('ProgramFiles'); + var accessBin = programFiles +'\\Microsoft Office\\OFFICE11\\MSACCESS.EXE'; + + if (!this.fso.fileExists (accessBin)) + throw new Error (_('Microsoft Access 2003 is not installed')); + + this.shell.exec ('"'+ accessBin +'" "'+ this.mdbFile +'"'); window.close (); },