/[winpt]/trunk/Src/wptGroupsDlg.cpp
ViewVC logotype

Diff of /trunk/Src/wptGroupsDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC
# Line 1  Line 1 
1  /* wptGroupsDlg.cpp - Group management  /* wptGroupsDlg.cpp - Group management
2   *      Copyright (C) 2001, 2002, 2003 Timo Schulz   *      Copyright (C) 2001, 2002, 2003 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
6   * WinPT is free software; you can redistribute it and/or modify   * WinPT is free software; you can redistribute it and/or modify
7   * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
8   * the Free Software Foundation; either version 2 of the License, or   * the Free Software Foundation; either version 2 of the License, or
9   * (at your option) any later version.   * (at your option) any later version.
10   *   *
11   * WinPT is distributed in the hope that it will be useful,   * WinPT is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.   * GNU General Public License for more details.
15   *   *
16   * You should have received a copy of the GNU General Public License   * You should have received a copy of the GNU General Public License
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19   */   */
20    
21  #include <windows.h>  #ifdef HAVE_CONFIG_H
22  #include <commctrl.h>  #include <config.h>
23  #include <stdio.h>  #endif
24    
25  #include "../resource.h"  #include <windows.h>
26  #include "wptTypes.h"  #include <commctrl.h>
27  #include "wptW32API.h"  #include <stdio.h>
28  #include "wptErrors.h"  
29  #include "wptNLS.h"  #include "resource.h"
30  #include "wptGPG.h"  #include "wptTypes.h"
31  #include "wptCommonCtl.h"  #include "wptW32API.h"
32  #include "wptContext.h"  #include "wptErrors.h"
33  #include "wptDlgs.h"  #include "wptNLS.h"
34  #include "wptKeyManager.h"  #include "wptGPG.h"
35    #include "wptCommonCtl.h"
36    #include "wptContext.h"
37  BOOL CALLBACK  #include "wptDlgs.h"
38  group_manager_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam )  #include "wptKeyManager.h"
39  {        
40      static km_group_cb_s *ctx;  
41      char name[256];  BOOL CALLBACK
42        group_manager_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam )
43      switch ( msg ) {  {      
44      case WM_INITDIALOG:      static km_group_cb_s *ctx;
45          ctx = (km_group_cb_s *)lparam;      char name[256];
46          if (!ctx)      
47              dlg_fatal_error( dlg, "Can't get dialog param" );      switch ( msg ) {
48  #ifndef LANG_DE      case WM_INITDIALOG:
49          SetWindowText( dlg, _("New Group") );          ctx = (km_group_cb_s *)lparam;
50  #endif          if (!ctx)
51          SetForegroundWindow( dlg );              dlg_fatal_error( dlg, "Can't get dialog param" );
52          break;  #ifndef LANG_DE
53                    SetWindowText( dlg, _("New Group") );
54      case WM_SYSCOMMAND:  #endif
55          if( LOWORD(wparam) == SC_CLOSE ) {          SetForegroundWindow( dlg );
56              ctx->use_name = 0;          break;
57              EndDialog( dlg, TRUE );          
58          }      case WM_SYSCOMMAND:
59          return FALSE;          if( LOWORD(wparam) == SC_CLOSE ) {
60                        ctx->use_name = 0;
61      case WM_COMMAND:              EndDialog( dlg, TRUE );
62          switch( LOWORD( wparam ) ) {          }
63          case IDOK:          return FALSE;
64              if( !GetDlgItemText(dlg, IDC_GROUP_EMAIL, name, sizeof name -1 ) ) {          
65                  msg_box( dlg, _("Please enter the email address"), _("Group manager"), MB_ERR );      case WM_COMMAND:
66                  return FALSE;          switch( LOWORD( wparam ) ) {
67              }          case IDOK:
68              add_group( ctx->gc->gh, name );              if( !GetDlgItemText(dlg, IDC_GROUP_EMAIL, name, sizeof name -1 ) ) {
69              strcpy( ctx->name, name );                  msg_box( dlg, _("Please enter the email address"), _("Group manager"), MB_ERR );
70              ctx->use_name = 1;                  return FALSE;
71              EndDialog( dlg, TRUE );              }
72              return TRUE;              add_group( ctx->gc->gh, name );
73                            strcpy( ctx->name, name );
74          case IDCANCEL:              ctx->use_name = 1;
75              ctx->use_name = 0;              EndDialog( dlg, TRUE );
76              EndDialog( dlg, FALSE );              return TRUE;
77              return FALSE;              
78          }          case IDCANCEL:
79          break;              ctx->use_name = 0;
80      }              EndDialog( dlg, FALSE );
81                    return FALSE;
82      return FALSE;          }
83            break;
84        }
85        
86        return FALSE;
87  } /* group_manager_dlg_proc */  } /* group_manager_dlg_proc */

Legend:
Removed from v.2  
changed lines
  Added in v.48

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26