/[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 35 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 36 by werner, Thu Oct 27 15:25:13 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 <windows.h>
27  #include "wptW32API.h"  #include <commctrl.h>
28  #include "wptErrors.h"  #include <stdio.h>
29  #include "wptNLS.h"  
30  #include "wptGPG.h"  #include "../resource.h"
31  #include "wptCommonCtl.h"  #include "wptTypes.h"
32  #include "wptContext.h"  #include "wptW32API.h"
33  #include "wptDlgs.h"  #include "wptErrors.h"
34  #include "wptKeyManager.h"  #include "wptNLS.h"
35    #include "wptGPG.h"
36    #include "wptCommonCtl.h"
37  BOOL CALLBACK  #include "wptContext.h"
38  group_manager_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam )  #include "wptDlgs.h"
39  {        #include "wptKeyManager.h"
40      static km_group_cb_s *ctx;  
41      char name[256];  
42        BOOL CALLBACK
43      switch ( msg ) {  group_manager_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam )
44      case WM_INITDIALOG:  {      
45          ctx = (km_group_cb_s *)lparam;      static km_group_cb_s *ctx;
46          if (!ctx)      char name[256];
47              dlg_fatal_error( dlg, "Can't get dialog param" );      
48  #ifndef LANG_DE      switch ( msg ) {
49          SetWindowText( dlg, _("New Group") );      case WM_INITDIALOG:
50  #endif          ctx = (km_group_cb_s *)lparam;
51          SetForegroundWindow( dlg );          if (!ctx)
52          break;              dlg_fatal_error( dlg, "Can't get dialog param" );
53            #ifndef LANG_DE
54      case WM_SYSCOMMAND:          SetWindowText( dlg, _("New Group") );
55          if( LOWORD(wparam) == SC_CLOSE ) {  #endif
56              ctx->use_name = 0;          SetForegroundWindow( dlg );
57              EndDialog( dlg, TRUE );          break;
58          }          
59          return FALSE;      case WM_SYSCOMMAND:
60                    if( LOWORD(wparam) == SC_CLOSE ) {
61      case WM_COMMAND:              ctx->use_name = 0;
62          switch( LOWORD( wparam ) ) {              EndDialog( dlg, TRUE );
63          case IDOK:          }
64              if( !GetDlgItemText(dlg, IDC_GROUP_EMAIL, name, sizeof name -1 ) ) {          return FALSE;
65                  msg_box( dlg, _("Please enter the email address"), _("Group manager"), MB_ERR );          
66                  return FALSE;      case WM_COMMAND:
67              }          switch( LOWORD( wparam ) ) {
68              add_group( ctx->gc->gh, name );          case IDOK:
69              strcpy( ctx->name, name );              if( !GetDlgItemText(dlg, IDC_GROUP_EMAIL, name, sizeof name -1 ) ) {
70              ctx->use_name = 1;                  msg_box( dlg, _("Please enter the email address"), _("Group manager"), MB_ERR );
71              EndDialog( dlg, TRUE );                  return FALSE;
72              return TRUE;              }
73                            add_group( ctx->gc->gh, name );
74          case IDCANCEL:              strcpy( ctx->name, name );
75              ctx->use_name = 0;              ctx->use_name = 1;
76              EndDialog( dlg, FALSE );              EndDialog( dlg, TRUE );
77              return FALSE;              return TRUE;
78          }              
79          break;          case IDCANCEL:
80      }              ctx->use_name = 0;
81                    EndDialog( dlg, FALSE );
82      return FALSE;              return FALSE;
83            }
84            break;
85        }
86        
87        return FALSE;
88  } /* group_manager_dlg_proc */  } /* group_manager_dlg_proc */

Legend:
Removed from v.35  
changed lines
  Added in v.36

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26