Commit b883c90ea695a0b474375446d0c4c3f9b39cba1c

Authored by Perry Werneck
1 parent f9aaba9d
Exists in v5.2

Loading terminal settings using the new standard methods (Windows

version).
Showing 2 changed files with 59 additions and 0 deletions   Show diff stats
pw3270.cbp
... ... @@ -239,6 +239,9 @@
239 239 <Option compilerVar="CC" />
240 240 </Unit>
241 241 <Unit filename="src/pw3270/windows/resources.rc.in" />
  242 + <Unit filename="src/pw3270/windows/settings.c">
  243 + <Option compilerVar="CC" />
  244 + </Unit>
242 245 <Unit filename="src/sample/Makefile.in" />
243 246 <Unit filename="src/sample/connect.c">
244 247 <Option compilerVar="CC" />
... ...
src/pw3270/windows/settings.c 0 → 100644
... ... @@ -0,0 +1,56 @@
  1 +/*
  2 + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 + * aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 + *
  6 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  7 + *
  8 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 + * Free Software Foundation.
  11 + *
  12 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 + * obter mais detalhes.
  16 + *
  17 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  19 + * St, Fifth Floor, Boston, MA 02110-1301 USA
  20 + *
  21 + * Este programa está nomeado como - e possui - linhas de código.
  22 + *
  23 + * Contatos:
  24 + *
  25 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  26 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  27 + *
  28 + */
  29 +
  30 + #include <config.h>
  31 + #include "../private.h"
  32 + #include <v3270/settings.h>
  33 + #include <lib3270/log.h>
  34 +
  35 +/*--[ Implement ]------------------------------------------------------------------------------------*/
  36 +
  37 + void load_terminal_settings(GtkWidget *widget)
  38 + {
  39 + static HKEY predefined[] = { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER };
  40 + g_autofree gchar * path = g_strdup_printf("SOFTWARE\\%s",g_get_application_name());
  41 +
  42 + size_t ix;
  43 +
  44 + for(ix=0;ix < G_N_ELEMENTS(predefined); ix++)
  45 + {
  46 + HKEY hKey;
  47 + if(RegOpenKeyEx(predefined[ix],path,0,KEY_READ,&hKey) == ERROR_SUCCESS)
  48 + {
  49 + v3270_load_registry(widget,hKey,"terminal");
  50 + RegCloseKey(hKey);
  51 + }
  52 + }
  53 +
  54 +
  55 + }
  56 +
... ...