[Winpt-commits] r338 - trunk/Src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Nov 27 13:44:54 CET 2011


Author: twoaday
Date: 2011-11-27 13:44:54 +0100 (Sun, 27 Nov 2011)
New Revision: 338

Modified:
   trunk/Src/wptMainProc.cpp
Log:


Modified: trunk/Src/wptMainProc.cpp
===================================================================
--- trunk/Src/wptMainProc.cpp	2011-11-27 12:38:43 UTC (rev 337)
+++ trunk/Src/wptMainProc.cpp	2011-11-27 12:44:54 UTC (rev 338)
@@ -1,5 +1,5 @@
 /* wptMainProc.cpp - Main window procedure
- *	Copyright (C) 2000-2009 Timo Schulz
+ *	Copyright (C) 2000-2009, 2011 Timo Schulz
  *
  * This file is part of WinPT.
  *
@@ -20,7 +20,7 @@
 
 /* Only define the constant if needed. */
 #ifndef _WIN32_IE
-#define _WIN32_IE 0x0600
+#define _WIN32_IE 0x0700
 #endif
 
 #include <windows.h>
@@ -151,8 +151,7 @@
 	   text will be pasted directly into the window. */
 	disable_viewer = 1;
     }
-    if ((id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT)
-	&& gnupg_access_keyring (0)) {
+    if ((id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT) && gnupg_access_keyring (0)) {
 	msg_box (hwnd, _("Could not access secret keyring."), _("Sign"), MB_ERR);
 	return;
     }
@@ -168,22 +167,19 @@
     case ID_WINPT_ENCRYPT:
     case ID_WINPT_CURRWND_ENCRYPT:
         dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd, 
-                          clip_encrypt_dlg_proc, 0,
-                          _("Encryption"), IDS_WINPT_ENCRYPT);
+                          clip_encrypt_dlg_proc, 0, _("Encryption"), IDS_WINPT_ENCRYPT);
         break;
         
     case ID_WINPT_SIGN:
     case ID_WINPT_CURRWND_SIGN:
         dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd, 
-                          clip_sign_dlg_proc, 0, 
-                          _("Signing"), IDS_WINPT_SIGN);
+                          clip_sign_dlg_proc, 0, _("Signing"), IDS_WINPT_SIGN);
         break;
         
     case ID_WINPT_SIGNENCRYPT:
     case ID_WINPT_CURRWND_SIGNENCRYPT:
         dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd, 
-                          clip_signenc_dlg_proc, 0, 
-                          _("Sign & Encrypt"), IDS_WINPT_SIGNENC);
+                          clip_signenc_dlg_proc, 0, _("Sign & Encrypt"), IDS_WINPT_SIGNENC);
         break;
         
     case ID_WINPT_DECRYPT_VERIFY:
@@ -196,8 +192,7 @@
 	    break;
 	}
         if ((type & PGP_MESSAGE) && !(type & PGP_CLEARSIG))
-            err = clip_decrypt_dlg (hwnd, disable_viewer? 
-					  0 : reg_prefs.use_viewer);
+            err = clip_decrypt_dlg (hwnd, disable_viewer? 0 : reg_prefs.use_viewer);
         else if ((type & PGP_SIG) && !(type & PGP_CLEARSIG)) {
             text_input_s input;
             gpgme_data_t sig;
@@ -215,7 +210,7 @@
                               text_input_dlg_proc, (LPARAM)&input, 
                               _("Text Input"), IDS_WINPT_TEXT);
 	    
-	    /* the dialog might have changed the clipboard, so we restore
+	    /* The dialog might have changed the clipboard, so we restore
 	       the original state (again). */
             gpg_data_release_to_clipboard (sig, 0);
             if (input.length > 0) {
@@ -319,7 +314,6 @@
 winpt_main_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 {		
     static NOTIFYICONDATA NID;
-    static DWORD cookie;
     static int use_hotkey = 0;
     static int manual_shutdown = 0;
     HWND wnd, cw_main, cw_focus;
@@ -341,11 +335,9 @@
         }
         rc = PTD_initialize ();
         if (!rc)
-            msg_box (hwnd, _("Could not set current window mode hooks."), 
-		     _("WinPT Error"), MB_OK);
+            msg_box (hwnd, _("Could not set current window mode hooks."), _("WinPT Error"), MB_OK);
 	mapi_init ();
 	init_common_controls ();
-	//html_help_init (&cookie);
 	LoadLibrary ("RichEd32.Dll");
 	manual_shutdown = 0;
         break;
@@ -370,9 +362,8 @@
         wipe_clipboard (manual_shutdown);
 	gettext_free_current_domain ();
         hotkeys_unregister (hwnd);
-        PTD_delete ();
+        PTD_delete_hook ();
 	agent_flush_cache ();
-	//html_help_deinit (cookie);	
 	debug_end ();
         Shell_NotifyIcon (NIM_DELETE, &NID);
         PostQuitMessage (0);
@@ -419,7 +410,7 @@
 		set_menu_state (popup, ID_WINPT_SIGNENCRYPT, MF_DISABLED|MF_GRAYED);
 		set_menu_state (popup, ID_WINPT_CURRWND_SIGNENCRYPT, MF_DISABLED|MF_GRAYED);
 	    }
-	    /* change popup texts */	  
+	    /* FIXME: we have to change popup texts */	  
 	    set_menu_text_bypos (popup, 3, _("Clipboard"));
 	    set_menu_text_bypos (popup, 4, _("Current Window"));
 	    set_menu_text_bypos (popup, 6, _("Preferences"));
@@ -438,39 +429,39 @@
         cmd = 0;
         switch (wparam) {
         case WPT_CLIP_ENCRYPT_ID:			
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_ENCRYPT, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_ENCRYPT, 0);
             break;
             
         case WPT_CLIP_DECRYPT_VERIFY_ID:
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_DECRYPT_VERIFY, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_DECRYPT_VERIFY, 0);
             break;
             
         case WPT_CLIP_SIGN_ID:
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_SIGN, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_SIGN, 0);
             break;
             
         case WPT_CLIP_SIGN_ENCRYPT_ID:
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_SIGNENCRYPT, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_SIGNENCRYPT, 0);
             break;
             
         case WPT_CURRWND_ENCRYPT_ID:
             use_hotkey = 1;
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_ENCRYPT, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_CURRWND_ENCRYPT, 0);
             break;				
             
         case WPT_CURRWND_SIGN_ID:
             use_hotkey = 1;
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGN, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGN, 0);
             break;
             
         case WPT_CURRWND_SIGN_ENCRYPT_ID:
 	    use_hotkey = 1;
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGNENCRYPT, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGNENCRYPT, 0 );
             break;
             
         case WPT_CURRWND_DECRYPT_VERIFY_ID:
             use_hotkey = 1;
-            SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_DECRYPT_VERIFY, 0 );
+            SendMessage (hwnd, WM_COMMAND, ID_WINPT_CURRWND_DECRYPT_VERIFY, 0);
             break;
             
         case WPT_AGENT_FORGET_ID:
@@ -479,7 +470,7 @@
             if (rc == IDYES)
                 agent_flush_cache ();
             break;
-        }		
+        }
         break;
         
     case WM_COMMAND:



More information about the Winpt-commits mailing list