Commit Graph

45 Commits (70610afc2f3ab77763168f3b764c12079ff7eb23)

Author SHA1 Message Date
Selva Nair 4acafcf355 Parent status and message box windows in the GUI
- Proper parenting is required for PLAP and cannot
  hurt in general. The parent window in GUI mode
  is the main window. In PLAP it will be the handle
  obtained from LogonUI.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-17 11:05:44 -04:00
Selva Nair e5ab9d74bd Fix potential string mishandling in LocalizedTime
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-08-10 09:22:12 -04:00
Selva Nair 0e76e4b544 Option to disable attaching to persistent connections
Three options are provided to control scanning of persistent
(pre-satrted) connections in config-auto folder, and how they
are attached to.

Auto: Scan and list persistent connections and attach to their
      management i/f automatically at startup, and periodically
      retry on failure to attach.
Manual: Scan and list as above, but do not attach automatically.
      User can attach to such connections by manually clicking
      connect.
Never: Do not scan config-auto folder.

Default is "Auto"

Change of this setting in the settings menu will take full effect
only if none of the connections are in connecting/connected/detached
state so that the connection list can be updated. Otherwise
restart the GUI.

TODO: Copying the settings dialog changes to all languages

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-08-08 10:11:25 -04:00
Selva Nair 05779fbb9b Add LocalizedFileTime function
- refactor LocalizedTime

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-07-19 12:08:02 +02:00
Lev Stipakov d6a622a023 URL profile import: allow specifying owner window of message box
This will be used later when parent window
needs to be disabled when message box is displayed.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-08-23 12:07:18 -04:00
Selva Nair 70b07c82d9 Show a mark against profiles that are in connecting state
Currently we show a check mark on connected profiles with no
indication on profiles that may be in the connecting state.

Change this by adding a mark against connecting/reconnecting
profiles. The yellow connecting state icon is used to generate
this mark although a custom designed check mark may look better.

In case of nested configs, the parent menus are marked with a tick
mark and only the profile is marked with the connecting icon.

No change in behaviour for profiles that are connected or
disconnected.

Trac #1241

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2021-01-02 12:35:48 -05:00
Lev Stipakov 1715746477 Introduce "Always use interactive service" option
We didn't use interactive service when gui was running
under admin because of some privilege escalation vulnerability in Vista.

Apparently this issue doesn't exist on Win7 and newer versions so
it is safe to use iservice on those systems.

Introduce "Always use interactive service" option,
which is "on" by default. This should enable users,
who by various reasons run gui as admin, use Wintun.

When gui is running as admin and interactive service
cannot be started or not installed, warn that wintun will not work.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-09-18 00:03:03 -04:00
Selva Nair 87c5e16723 Fallback to default sublanguage when loading resources
When a resource is not found in user's preferred language, first
try the primary language with SUBLANG set to default before
falling back to English.

See: https://github.com/OpenVPN/openvpn-gui/issues/216

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-03-26 18:05:31 -04:00
Selva Nair 4b716b4666 Fix truncation of usage message shown when --help is used
- Increase the buffer size used to load the usage string to 2048
  chars (defined by USAGE_BUF_SIZE in main.h)
- Make GetGUILanguage() visible outside localization.c

Trac: #833

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2017-01-30 22:30:26 -05:00
Selva Nair 2f2ddbf3a8 Load icons at sizes given by DPI-dependent system metric
- Check system metric for large and small icon sizes and
  try to load the correct size instaed of scaling from one size.

Scaling will still happen if the required size is not available
in the icon resource. As we add more icon sizes they will
get automatically used as needed.

LoadImage scales up from next smallest size available. Revisit this
when LoadIconWithScaleDown (Vista+) becomes available in mingw.

Resolves Trac: #772 (icon scaling issue)

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-12-08 16:01:58 -05:00
Selva Nair 5a47986ccb Make options saved in registry editable by user
Option ediitng dialogs are in two tabs: General and Advanced.
Proxy related options are left in the proxy tab. Options
config_dir, config_ext, log_dir, script timeouts and
service-only flag are in the Advanced tab. All other more commonly
used flags and options are in the General tab.

- As options are editable, save values in registry only when they differ
  from the default values. This leaves the registry clean and makes changing
  options and their defaults during updates easier.

- Entries for config_dir and log_dir must be absolute paths.
  Environemental variables such as %PROFILEDIR% may be used
  to construct these.

- Empty config_dir, config_ext and log_dir entries are silently
  ignored (i.e., the current values are left unchanged).

- Store all numeric and boolean parameters in registry as DWORD instead of
  strings.

- On startup, the default parameters are loaded, then the registry is read
  and finally command-line parameters parsedi.

- Out of range script timeout values in registry truncated with a
  warning instead of fatal error. This allows the user to access the
  settings dialog and make corrections.

- Save proxy and language settings under the same
  HKCU\Software\OpenVPN-GUI key as other options instead of under Nilings.

- Save the current version of the GUI in regsitry so that updates
  can be detected and any needed registry cleanup done.

- If no version info is present in the registry any values in OpenVPN-GUI
  key in HKCU are deleted for a clean start as this is the first version
  to save registry values in HKCU. Language and proxy data if present
  under Nilings is migrated.

Note: new controls in the General tab and newly added Advanced tab dialog
are copied to all language files from the English version. These need to
be translated.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-08-06 11:46:15 -04:00
Leonardo Basilio ece6aef6a6 Launch on startup setting 2016-05-22 22:05:42 -03:00
Ilya Shipitsin 08538280d0 cppcheck cleanup:
[openvpn_config.c:194]: (style) The function 'ConfigFileOptionExist' is never used.
[localization.c:299]: (style) The function 'LocalizedDialogBox' is never used.
[main.c:549]: (style) The function 'PrintErrorDebug' is never used.
[main.c:583]: (style) The function 'init_security_attributes_allow_all' is never used.
[misc.c:180]: (style) The function 'wcseq' is never used.
2015-12-22 23:21:14 +05:00
Ilya Shipitsin bc94c7e951 fix
$ cppcheck .
Checking localization.c...
[localization.c:224]: (error) va_list 'args' was opened but not closed by va_end().
2015-12-15 18:15:42 +05:00
Heiko Hund c00191f51e use UI language set by user for l10n, closes #27 2013-04-15 19:23:24 +02:00
Heiko Hund 3751dbe8f4 convert connection time from UTC to local time 2012-11-06 15:25:14 +01:00
Heiko Hund 2e53dbd254 localize connection time display in tray tooltip 2012-11-06 14:54:53 +01:00
Heiko Hund 56654663f5 fall back to English resource if string is missing 2012-07-26 08:57:27 +02:00
Heiko Hund 82eb645a5e localize buttons in message boxes when possible 2012-07-20 17:44:48 +02:00
Heiko Hund f420d7dcbb use CRT's _countof instead of proprietary _tsizeof 2012-03-29 17:40:34 +02:00
Alon Bar-Lev c9eb68c77f use automake in build
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>

Edited to not use libtool and implicit automake rule to build resource object
2012-03-28 10:59:44 +00:00
Alon Bar-Lev 45421c2514 cleanup: resolve warnings missing malloc include
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2012-03-28 10:44:54 +00:00
Heiko Hund 18376e2f2e tag unused variables to stop compiler warnings 2012-03-28 10:44:51 +00:00
Heiko Hund 54d74f5861 always compile a unicode binary 2011-08-29 13:56:32 +00:00
Heiko Hund 651238c1ef use SetWindowLongPtr() for x64 compatibility 2011-07-26 09:13:07 +02:00
Heiko Hund 697ffc57f9 fix prototype of dlgproc functions 2011-07-26 09:05:16 +02:00
Heiko Hund d46789bc27 fix parameter type in FillLangListProc() 2011-07-20 16:26:27 +02:00
Heiko Hund 92c6bc6276 set gui language for common controls as well 2010-04-15 20:28:11 +02:00
Heiko Hund 223cf23748 use GetSystemDefaultLCID() for determination of the system language 2010-04-15 19:20:26 +02:00
Heiko Hund a6e6d88115 refactor option handling code 2010-04-09 06:18:58 +02:00
Heiko Hund 61cb987f4d make it work when compiled as unicode 2010-03-21 10:07:14 +01:00
Heiko Hund f542c42738 use _tsizeof to get the buffer size 2010-03-13 09:35:33 +01:00
Heiko Hund 6939cb8792 replace GUI_* with PACKAGE_* macros 2010-03-11 22:58:45 +01:00
Heiko Hund 0948302b70 remove execute bits from source files 2010-03-10 10:28:52 +01:00
Heiko Hund ac6c155243 added function CreateLocalizedDialogParam() 2009-02-05 13:52:27 +00:00
Heiko Hund 4003e9bf3a rearranged GetGUILanguage function a bit 2009-02-04 16:39:41 +00:00
Heiko Hund a907b9d877 made it compile again 2009-02-04 15:56:11 +00:00
Heiko Hund 5783d7da94 cleaned up resource IDs 2009-02-04 15:54:37 +00:00
Heiko Hund 35c1bf35c9 removed useless code 2009-02-04 06:29:07 +00:00
Heiko Hund c9edb6f40b fixed recursive call to GetGUILanguage in error case 2009-02-03 12:11:07 +00:00
Heiko Hund 6f37fd999f added support for GUI localization at runtime 2009-02-02 17:27:09 +00:00
Heiko Hund 2f3ca9d6c2 - added API to retrieve localized dialog template
- using instance from global options struct
2009-01-26 21:03:39 +00:00
Heiko Hund 1ea8d5b8f7 added functions for localized dialog, string and icon resources 2009-01-18 20:37:32 +00:00
Heiko Hund d46af68a82 added function to load localized dialog 2009-01-16 22:54:50 +00:00
Heiko Hund 746451bafa added functions to load localized resources 2009-01-16 16:58:03 +00:00