diff --git a/main.c b/main.c index 663947d..7f8cb03 100644 --- a/main.c +++ b/main.c @@ -19,6 +19,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define _WIN32_IE 0x0500 #include #include #include @@ -43,6 +44,7 @@ /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK AboutDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +static void ShowSettingsDialog(); void CloseApplication(HWND hwnd); /* Class name and window title */ @@ -235,8 +237,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM ShowChangePassphraseDialog(LOWORD(wParam) - IDM_PASSPHRASEMENU); } #endif - if (LOWORD(wParam) == IDM_PROXY) { - ShowProxySettingsDialog(); + if (LOWORD(wParam) == IDM_SETTINGS) { + ShowSettingsDialog(); } if (LOWORD(wParam) == IDM_ABOUT) { LocalizedDialogBox(IDD_ABOUTDIALOG, AboutDialogFunc); @@ -353,6 +355,35 @@ BOOL CALLBACK AboutDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, UNUSED LPA return FALSE; } + +static void +ShowSettingsDialog() +{ + PROPSHEETPAGE psp[1]; + psp[0].dwSize = sizeof(PROPSHEETPAGE); + psp[0].dwFlags = PSP_DLGINDIRECT; + psp[0].hInstance = o.hInstance; + psp[0].pResource = LocalizedDialogResource(IDD_PROXY); + psp[0].pfnDlgProc = ProxySettingsDialogFunc; + psp[0].lParam = 0; + psp[0].pfnCallback = NULL; + + PROPSHEETHEADER psh; + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_USEHICON | PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW | PSH_NOCONTEXTHELP; + psh.hwndParent = o.hWnd; + psh.hInstance = o.hInstance; + psh.hIcon = LoadLocalizedIcon(APP_ICON); + psh.pszCaption = LoadLocalizedString(IDS_SETTINGS_CAPTION); + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = (LPCPROPSHEETPAGE) &psp; + psh.pfnCallback = NULL; + + PropertySheet(&psh); +} + + void CloseApplication(HWND hwnd) { int i, ask_exit=0; diff --git a/openvpn-gui-res-de.rc b/openvpn-gui-res-de.rc index 63707c8..1742047 100644 --- a/openvpn-gui-res-de.rc +++ b/openvpn-gui-res-de.rc @@ -109,27 +109,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Proxy Einstellungen" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "OpenVPN Konfigurationsdatei verwenden", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Internet Explorer Einstellungen verwenden", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Manuelle Konfiguration", RB_PROXY_USE_MANUAL, 20, 42, 85, 10 - AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Manuelle Konfiguration", RB_PROXY_USE_MANUAL, 13, 42, 85, 10 + AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "SOCKS Proxy", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Adresse:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Adresse:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Port:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 60, 71, 110, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 53, 71, 117, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Beim Verbinden nach Benutzername/Passwort fragen", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Abbrechen", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Beim Verbinden nach Benutzername/Passwort fragen", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -159,7 +157,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nVerbunden seit: " MSG_TIP_ASSIGNED_IP "\nZugewiesene IP: %s" IDM_TEXT_SERVICE "OpenVPN Dienst" - IDM_TEXT_PROXY "Proxy Einstellungen" + IDM_TEXT_SETTINGS "Einstellungen..." IDM_TEXT_ABOUT "Über" IDM_TEXT_CLOSE "Beenden" IDM_TEXT_CONNECT "Verbinden" @@ -311,6 +309,10 @@ BEGIN ERR_CR2STDIN "Fehler bei der Übergabe des CR an stdin." ERR_INVALID_CHARS_IN_PSW "Ihr neues Passwort enthält ungültige Zeichen. " \ "Bitte verwenden Sie ein anderes Passwort." + + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Einstellungen" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "Sie müssen eine HTTP Proxy Adresse definieren." ERR_HTTP_PROXY_PORT "Sie müssen einen HTTP Proxy Port definieren." diff --git a/openvpn-gui-res-en.rc b/openvpn-gui-res-en.rc index b3d6c7a..18bbae1 100644 --- a/openvpn-gui-res-en.rc +++ b/openvpn-gui-res-en.rc @@ -104,27 +104,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Proxy Settings" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Use OpenVPN Config-file Settings", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Use Internet Explorer Settings", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Manual Configuration", RB_PROXY_USE_MANUAL, 20, 42, 79, 10 - AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Manual Configuration", RB_PROXY_USE_MANUAL, 13, 42, 79, 10 + AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "SOCKS Proxy", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Address:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Address:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Port:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 60, 71, 110, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 53, 71, 117, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Prompt for username/password when connecting.", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Cancel", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Prompt for username/password when connecting.", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -154,7 +152,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nConnected since: " MSG_TIP_ASSIGNED_IP "\nAssigned IP: %s" IDM_TEXT_SERVICE "OpenVPN Service" - IDM_TEXT_PROXY "Proxy Settings" + IDM_TEXT_SETTINGS "Settings..." IDM_TEXT_ABOUT "About" IDM_TEXT_CLOSE "Exit" IDM_TEXT_CONNECT "Connect" @@ -306,6 +304,10 @@ BEGIN ERR_CR2STDIN "Error passing CR to stdin." ERR_INVALID_CHARS_IN_PSW "Your new password contains non-valid characters. " \ "Please choose another one." + + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Settings" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "You must specify a HTTP proxy address." ERR_HTTP_PROXY_PORT "You must specify a HTTP proxy port." diff --git a/openvpn-gui-res-es.rc b/openvpn-gui-res-es.rc index 20e5fb9..240709f 100644 --- a/openvpn-gui-res-es.rc +++ b/openvpn-gui-res-es.rc @@ -103,27 +103,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Configuración del Proxy" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Usar opciones del fichero de configuración de OpenVPN", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Usar las opciones del Internet Explorer", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Configuración Manual", RB_PROXY_USE_MANUAL, 20, 42, 82, 10 - AUTORADIOBUTTON "Proxy HTTP", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Configuración Manual", RB_PROXY_USE_MANUAL, 13, 42, 82, 10 + AUTORADIOBUTTON "Proxy HTTP", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Proxy SOCKS", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Host:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Host:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Puerto:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 49, 71, 112, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 42, 71, 119, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Pedir usuario/clave al conectar.", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Cancelar", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Pedir usuario/clave al conectar.", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -153,7 +151,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nConectado desde: " MSG_TIP_ASSIGNED_IP "\nIP asignada: %s" IDM_TEXT_SERVICE "Servicio OpenVPN" - IDM_TEXT_PROXY "Opciones del Proxy" + IDM_TEXT_SETTINGS "Opciones..." IDM_TEXT_ABOUT "Acerca de" IDM_TEXT_CLOSE "Salir" IDM_TEXT_CONNECT "Conectar" @@ -305,6 +303,10 @@ BEGIN ERR_CR2STDIN "Error al pasar el CR hacia stdin." ERR_INVALID_CHARS_IN_PSW "La nueva clave contiene caracteres no válidos. " \ "Por favor elija otra." + + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Configuración" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "Debe especificarse una dirección para el proxy HTTP." ERR_HTTP_PROXY_PORT "Debe especificarse un puerto para el proxy HTTP." diff --git a/openvpn-gui-res-fr.rc b/openvpn-gui-res-fr.rc index 66ae5ce..fda8a80 100644 --- a/openvpn-gui-res-fr.rc +++ b/openvpn-gui-res-fr.rc @@ -102,27 +102,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Configuration Proxy" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Utiliser les valeurs du fichier de configuration", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Utiliser la configuration d'Internet Explorer", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Configuration Manuelle", RB_PROXY_USE_MANUAL, 20, 42, 84, 10 - AUTORADIOBUTTON "Proxy HTTP", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Configuration Manuelle", RB_PROXY_USE_MANUAL, 13, 42, 84, 10 + AUTORADIOBUTTON "Proxy HTTP", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Proxy SOCKS", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Addresse:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Addresse:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Port:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 64, 71, 106, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 57, 71, 113, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Demande de Utilisateur/Mot de passe à la connexion.", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Annuler", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Demande de Utilisateur/Mot de passe à la connexion.", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -152,7 +150,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nConnecté depuis: " MSG_TIP_ASSIGNED_IP "\nIP Assignée: %s" IDM_TEXT_SERVICE "OpenVPN Service" - IDM_TEXT_PROXY "Configuration Proxy" + IDM_TEXT_SETTINGS "Configuration..." IDM_TEXT_ABOUT "A Propos..." IDM_TEXT_CLOSE "Quitter" IDM_TEXT_CONNECT "Connecter" @@ -304,6 +302,10 @@ BEGIN ERR_CR2STDIN "Erreur d'envoi du CR vers stdin." ERR_INVALID_CHARS_IN_PSW "Votre nouveau Mot de passe ne contient aucun caractère valide. " \ "Choisissez en un autre SVP." + + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Configuration" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "Vous devez spécifier une adresse Proxy HTTP." ERR_HTTP_PROXY_PORT "Vous devez spécifier un port Proxy HTTP." diff --git a/openvpn-gui-res-it.rc b/openvpn-gui-res-it.rc index ff4fe57..52b77a5 100644 --- a/openvpn-gui-res-it.rc +++ b/openvpn-gui-res-it.rc @@ -102,27 +102,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Configurazione del Proxy" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Utilizza il file di configurazione di OpenVPN", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Usa la configurazione di Internet Explorer", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Configurazione manuale", RB_PROXY_USE_MANUAL, 20, 42, 88, 10 - AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Configurazione manuale", RB_PROXY_USE_MANUAL, 13, 42, 88, 10 + AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "SOCKS Proxy", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Indirizzo:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Indirizzo:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Porta:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 60, 71, 106, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 53, 71, 113, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Richiesta di Nome utente/Password per la connessione.", CHECKB_PROXY_AUTH, 27, 88, 195, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Annulla", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Richiesta di Nome utente/Password per la connessione.", CHECKB_PROXY_AUTH, 13, 103, 195, 10 END /* Proxy Authentication Dialog */ @@ -152,7 +150,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nConnesso da: " MSG_TIP_ASSIGNED_IP "\nIP assegnato: %s" IDM_TEXT_SERVICE "Servizio di OpenVPN" - IDM_TEXT_PROXY "Configurazione Proxy" + IDM_TEXT_SETTINGS "Configurazione..." IDM_TEXT_ABOUT "Informazioni" IDM_TEXT_CLOSE "Esci" IDM_TEXT_CONNECT "Connetti" @@ -303,6 +301,10 @@ BEGIN ERR_CR2STDIN "Errore nel trasmettere CR a stdin." ERR_INVALID_CHARS_IN_PSW "La tua nuova password contiene caratteri non validi. " \ "Per favore scegline un'altra." + + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Configurazione" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "Devi specificare un indirizzo per il HTTP proxy." ERR_HTTP_PROXY_PORT "Devi specificare una porta per il HTTP proxy." diff --git a/openvpn-gui-res-nl.rc b/openvpn-gui-res-nl.rc index bfd6060..36d4d56 100644 --- a/openvpn-gui-res-nl.rc +++ b/openvpn-gui-res-nl.rc @@ -102,27 +102,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Proxy Instellingen" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Gebruik OpenVPN instellingen", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Gebruik Internet Explorer Instellingen", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Handmatige Configuratie", RB_PROXY_USE_MANUAL, 20, 42, 90, 10 - AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Handmatige Configuratie", RB_PROXY_USE_MANUAL, 13, 42, 90, 10 + AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "SOCKS Proxy", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Adres:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Adres:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Poort:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 52, 71, 114, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 45, 71, 121, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Vraag gebruikersnaam/wachtwoord tijdens verbinden.", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Annuleren", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Vraag gebruikersnaam/wachtwoord tijdens verbinden.", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -152,7 +150,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nVerbonden sinds: " MSG_TIP_ASSIGNED_IP "\nToegewezen IP: %s" IDM_TEXT_SERVICE "OpenVPN Service" - IDM_TEXT_PROXY "Proxy Instellingen" + IDM_TEXT_SETTINGS "Instellingen..." IDM_TEXT_ABOUT "Info" IDM_TEXT_CLOSE "Afsluiten" IDM_TEXT_CONNECT "Verbind" @@ -304,6 +302,10 @@ BEGIN ERR_CR2STDIN "Fout bij doorgeven CR aan stdin." ERR_INVALID_CHARS_IN_PSW "Het nieuwe wachtwoord bevat niet toegestande tekens. " \ "Kies een nieuw wachtwoord." + + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Instellingen" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "Er moet een HTTP proxy adres opgegeven worden." ERR_HTTP_PROXY_PORT "Er moet een HTTP proxy poort opgegeven worden." diff --git a/openvpn-gui-res-no.rc b/openvpn-gui-res-no.rc index f5501b5..fd8d042 100644 --- a/openvpn-gui-res-no.rc +++ b/openvpn-gui-res-no.rc @@ -107,27 +107,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Proxy Inställningar" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Bruk innstillinger fra OpenVPNs konfig-fil", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Bruk innstillinger fra Internet Explorer", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Manuell Konfigurering", RB_PROXY_USE_MANUAL, 20, 42, 81, 10 - AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Manuell Konfigurering", RB_PROXY_USE_MANUAL, 13, 42, 81, 10 + AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "SOCKS Proxy", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Adresse:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Adresse:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Port:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 60, 71, 110, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 53, 71, 117, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Be om brukernavn ved tilkobling.", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Avbryt", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Be om brukernavn ved tilkobling.", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -157,7 +155,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nTilkoblet siden: " MSG_TIP_ASSIGNED_IP "\nTildelt IP: %s" IDM_TEXT_SERVICE "OpenVPN Service" - IDM_TEXT_PROXY "Proxy Innstillinger" + IDM_TEXT_SETTINGS "Innstillinger..." IDM_TEXT_ABOUT "Om" IDM_TEXT_CLOSE "Avslutte" IDM_TEXT_CONNECT "Koble til" @@ -307,6 +305,9 @@ BEGIN ERR_INVALID_CHARS_IN_PSW "Nytt passord inneholder tegn som ikke er tillatt. " \ "Forsøk igjen." + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Inställningar" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "HTTP proxy addresse må oppgis." ERR_HTTP_PROXY_PORT "HTTP proxy port må oppgis." diff --git a/openvpn-gui-res-pt.rc b/openvpn-gui-res-pt.rc index 972cd8b..e2d948d 100644 --- a/openvpn-gui-res-pt.rc +++ b/openvpn-gui-res-pt.rc @@ -103,27 +103,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Configurações de proxy" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Usar aquivo de configuração do OpenVPN", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Usar configurações do Internet Explorer", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Configuração manual", RB_PROXY_USE_MANUAL, 20, 42, 80, 10 - AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Configuração manual", RB_PROXY_USE_MANUAL, 13, 42, 80, 10 + AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "SOCKS Proxy", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Endereço:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Endereço:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Porta:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 65, 71, 101, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 58, 71, 108, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Perguntar usuário/senha quando estiver conectando.", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Cancelar", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Perguntar usuário/senha quando estiver conectando.", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -153,7 +151,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nConectado desde: " MSG_TIP_ASSIGNED_IP "\nIP atribuído: %s" IDM_TEXT_SERVICE "Serviço OpenVPN" - IDM_TEXT_PROXY "Configurações de Proxy" + IDM_TEXT_SETTINGS "Configurações..." IDM_TEXT_ABOUT "Sobre" IDM_TEXT_CLOSE "Sair" IDM_TEXT_CONNECT "Conectar" @@ -305,6 +303,10 @@ BEGIN ERR_CR2STDIN "Erro passando CR to stdin." ERR_INVALID_CHARS_IN_PSW "A nova senha contém caracteres inválidos. " \ "Por favor escolha outra." + + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Configurações" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "Você precisa especificar o endereço de proxy HTTP." ERR_HTTP_PROXY_PORT "Você precisa especificar a porta para proxy HTTP." diff --git a/openvpn-gui-res-se.rc b/openvpn-gui-res-se.rc index d690aaa..2f79c9e 100644 --- a/openvpn-gui-res-se.rc +++ b/openvpn-gui-res-se.rc @@ -108,27 +108,25 @@ BEGIN END /* Proxy Settings Dialog */ -IDD_PROXY DIALOG 6, 18, 255, 143 +IDD_PROXY DIALOG 6, 18, 249, 124 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER -CAPTION "OpenVPN - Proxy Inställningar" +CAPTION "Proxy" FONT 8, "Microsoft Sans Serif" LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL BEGIN - GROUPBOX " ", 201, 13, 42, 228, 67 + GROUPBOX " ", 201, 6, 42, 235, 52 AUTORADIOBUTTON "Använd inställningar från OpenVPNs konfigurations fil", RB_PROXY_USE_OPENVPN, \ - 20, 12, 200, 10, WS_GROUP | WS_TABSTOP + 13, 12, 200, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Använd inställningar från Internet Explorer", \ - RB_PROXY_USE_IE, 20, 27, 200, 10 - AUTORADIOBUTTON "Manuell Konfigurering", RB_PROXY_USE_MANUAL, 20, 42, 81, 10 - AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 27, 58, 90, 10, WS_GROUP | WS_TABSTOP + RB_PROXY_USE_IE, 13, 27, 200, 10 + AUTORADIOBUTTON "Manuell Konfigurering", RB_PROXY_USE_MANUAL, 13, 42, 81, 10 + AUTORADIOBUTTON "HTTP Proxy", RB_PROXY_HTTP, 20, 58, 90, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "SOCKS Proxy", RB_PROXY_SOCKS, 120, 58, 90, 10 - LTEXT "Adress:", TEXT_PROXY_ADDRESS, 27, 73, 41, 10 + LTEXT "Adress:", TEXT_PROXY_ADDRESS, 20, 73, 41, 10 RTEXT "Port:", TEXT_PROXY_PORT, 166, 73, 25, 10 - EDITTEXT EDIT_PROXY_ADDRESS, 56, 71, 114, 12, ES_AUTOHSCROLL + EDITTEXT EDIT_PROXY_ADDRESS, 49, 71, 121, 12, ES_AUTOHSCROLL EDITTEXT EDIT_PROXY_PORT, 196, 71, 30, 12, ES_AUTOHSCROLL - AUTOCHECKBOX "Fråga efter användarnamn/lösenord vid uppkoppling.", CHECKB_PROXY_AUTH, 27, 88, 183, 10 - PUSHBUTTON "OK", IDOK, 52, 120, 50, 14 - PUSHBUTTON "Avbryt", IDCANCEL, 153, 120, 50, 14 + AUTOCHECKBOX "Fråga efter användarnamn/lösenord vid uppkoppling.", CHECKB_PROXY_AUTH, 13, 103, 183, 10 END /* Proxy Authentication Dialog */ @@ -158,7 +156,7 @@ BEGIN MSG_TIP_CONNECTED_SINCE "\nAnsluten sedan: " MSG_TIP_ASSIGNED_IP "\nTilldelad IP: %s" IDM_TEXT_SERVICE "OpenVPN Service" - IDM_TEXT_PROXY "Proxy Inställningar" + IDM_TEXT_SETTINGS "Inställningar..." IDM_TEXT_ABOUT "Om" IDM_TEXT_CLOSE "Avsluta" IDM_TEXT_CONNECT "Anslut" @@ -308,6 +306,9 @@ BEGIN ERR_INVALID_CHARS_IN_PSW "Ditt nya lösenord innehåller otillåtna tecken. " \ "Välj ett nytt." + /* settings */ + IDS_SETTINGS_CAPTION "OpenVPN - Inställningar" + /* proxy */ ERR_HTTP_PROXY_ADDRESS "Du måste ange en HTTP proxy adress." ERR_HTTP_PROXY_PORT "Du måste ange en HTTP proxy port." diff --git a/openvpn-gui-res.h b/openvpn-gui-res.h index 1feb365..ff953fa 100644 --- a/openvpn-gui-res.h +++ b/openvpn-gui-res.h @@ -60,6 +60,9 @@ #define EDIT_AUTH_USERNAME 181 #define EDIT_AUTH_PASSWORD 182 +/* Settings Dialog*/ +#define IDS_SETTINGS_CAPTION 190 + /* Proxy Settings Dialog */ #define IDD_PROXY 200 #define RB_PROXY_USE_OPENVPN 210 @@ -85,7 +88,7 @@ #define MSG_TIP_CONNECTED_SINCE 1004 #define MSG_TIP_ASSIGNED_IP 1005 #define IDM_TEXT_SERVICE 1006 -#define IDM_TEXT_PROXY 1007 +#define IDM_TEXT_SETTINGS 1007 #define IDM_TEXT_ABOUT 1008 #define IDM_TEXT_CLOSE 1009 #define IDM_TEXT_CONNECT 1010 diff --git a/proxy.c b/proxy.c index 7fb0267..7dd207b 100644 --- a/proxy.c +++ b/proxy.c @@ -21,6 +21,7 @@ */ #include +#include #include #include "main.h" #include "options.h" @@ -32,14 +33,10 @@ extern struct options o; -void ShowProxySettingsDialog() -{ - LocalizedDialogBox(IDD_PROXY, ProxySettingsDialogFunc); -} - -BOOL CALLBACK ProxySettingsDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, UNUSED LPARAM lParam) +bool CALLBACK ProxySettingsDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, UNUSED LPARAM lParam) { HICON hIcon; + LPPSHNOTIFY psn; switch (msg) { @@ -59,19 +56,6 @@ BOOL CALLBACK ProxySettingsDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, UN case WM_COMMAND: switch (LOWORD(wParam)) { - case IDOK: - if (CheckProxySettings(hwndDlg)) - { - SaveProxySettings(hwndDlg); - EndDialog(hwndDlg, LOWORD(wParam)); - return TRUE; - } - return FALSE; - - case IDCANCEL: - EndDialog(hwndDlg, LOWORD(wParam)); - return TRUE; - case RB_PROXY_USE_OPENVPN: if (HIWORD(wParam) == BN_CLICKED) { @@ -132,6 +116,22 @@ BOOL CALLBACK ProxySettingsDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, UN } break; + case WM_NOTIFY: + psn = (LPPSHNOTIFY) lParam; + if (psn->hdr.code == (UINT) PSN_KILLACTIVE) + { + SetWindowLong(hwndDlg, DWL_MSGRESULT, + ( CheckProxySettings(hwndDlg) ? FALSE : TRUE )); + return TRUE; + } + else if (psn->hdr.code == (UINT) PSN_APPLY) + { + SaveProxySettings(hwndDlg); + SetWindowLong(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); + return TRUE; + } + break; + case WM_CLOSE: EndDialog(hwndDlg, LOWORD(wParam)); return TRUE; diff --git a/proxy.h b/proxy.h index 3a1e811..d4d62ca 100644 --- a/proxy.h +++ b/proxy.h @@ -27,7 +27,6 @@ #define PROXY_HTTP_NO_AUTH 0 #define PROXY_HTTP_ASK_AUTH 1 -void ShowProxySettingsDialog(); BOOL CALLBACK ProxySettingsDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); int CheckProxySettings(HWND hwndDlg); void LoadProxySettings(HWND hwndDlg); diff --git a/tray.c b/tray.c index 7017607..34d3788 100644 --- a/tray.c +++ b/tray.c @@ -222,11 +222,8 @@ void CreateItemList() AppendMenu(hMenu,MF_POPUP,(UINT) hMenuService, LoadLocalizedString(IDM_TEXT_SERVICE)); AppendMenu(hMenu,MF_SEPARATOR,0,0); } - if (o.allow_proxy[0]=='1' && o.service_only[0]=='0') - { - AppendMenu(hMenu,MF_STRING ,IDM_PROXY, LoadLocalizedString(IDM_TEXT_PROXY)); - AppendMenu(hMenu,MF_SEPARATOR,0,0); - } +//TODO: if (o.allow_proxy[0]=='1' && o.service_only[0]=='0') + AppendMenu(hMenu,MF_STRING ,IDM_SETTINGS, LoadLocalizedString(IDM_TEXT_SETTINGS)); AppendMenu(hMenu,MF_STRING ,IDM_ABOUT, LoadLocalizedString(IDM_TEXT_ABOUT)); AppendMenu(hMenu,MF_STRING ,IDM_CLOSE, LoadLocalizedString(IDM_TEXT_CLOSE)); @@ -252,11 +249,8 @@ void CreateItemList() AppendMenu(hMenu,MF_STRING, IDM_SERVICE_RESTART, LoadLocalizedString(IDM_TEXT_SERVICEONLY_RESTART)); AppendMenu(hMenu,MF_SEPARATOR,0,0); } - if (o.allow_proxy[0]=='1' && o.service_only[0]=='0') - { - AppendMenu(hMenu,MF_STRING ,IDM_PROXY, LoadLocalizedString(IDM_TEXT_PROXY)); - AppendMenu(hMenu,MF_SEPARATOR,0,0); - } +//TODO: if (o.allow_proxy[0]=='1' && o.service_only[0]=='0') + AppendMenu(hMenu,MF_STRING ,IDM_SETTINGS, LoadLocalizedString(IDM_TEXT_SETTINGS)); AppendMenu(hMenu,MF_STRING ,IDM_ABOUT, LoadLocalizedString(IDM_TEXT_ABOUT)); AppendMenu(hMenu,MF_STRING ,IDM_CLOSE, LoadLocalizedString(IDM_TEXT_CLOSE)); diff --git a/tray.h b/tray.h index 9bb98e0..2885f81 100644 --- a/tray.h +++ b/tray.h @@ -23,7 +23,7 @@ //Popup Menu items -#define IDM_PROXY 221 +#define IDM_SETTINGS 221 #define IDM_ABOUT 222 #define IDM_CLOSE 223