[Winpt-commits] r349 - trunk/Src
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Dec 1 20:52:32 CET 2011
Author: twoaday
Date: 2011-12-01 20:52:31 +0100 (Thu, 01 Dec 2011)
New Revision: 349
Removed:
trunk/Src/wptGroupManager.cpp
trunk/Src/wptGroupsDlg.cpp
Modified:
trunk/Src/ChangeLog
trunk/Src/Makefile.am
trunk/Src/wptNLS.cpp
Log:
2011-12-01 Timo Schulz <twoaday at gmx.net>
* wptGroupsDlg.cpp: Removed.
* wptGroupManager.cpp: Likewise.
Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog 2011-12-01 19:24:12 UTC (rev 348)
+++ trunk/Src/ChangeLog 2011-12-01 19:52:31 UTC (rev 349)
@@ -1,3 +1,8 @@
+2011-12-01 Timo Schulz <twoaday at gmx.net>
+
+ * wptGroupsDlg.cpp: Removed.
+ * wptGroupManager.cpp: Likewise.
+
2011-11-30 Timo Schulz <twoaday at gmx.net>
* wptKeyEditDlgs.cpp (keyedit_addsubkey_dlg_proc): Adjusted
Modified: trunk/Src/Makefile.am
===================================================================
--- trunk/Src/Makefile.am 2011-12-01 19:24:12 UTC (rev 348)
+++ trunk/Src/Makefile.am 2011-12-01 19:52:31 UTC (rev 349)
@@ -45,7 +45,6 @@
wptFirstRunDlg.cpp \
wptGPGOptDlg.cpp \
wptGPGPrefsDlg.cpp \
- wptGroupsDlg.cpp \
wptKeyCacheDlg.cpp \
wptKeyEditDlgs.cpp \
wptKeyEditOwnertrustDlg.cpp \
Deleted: trunk/Src/wptGroupManager.cpp
===================================================================
--- trunk/Src/wptGroupManager.cpp 2011-12-01 19:24:12 UTC (rev 348)
+++ trunk/Src/wptGroupManager.cpp 2011-12-01 19:52:31 UTC (rev 349)
@@ -1,298 +0,0 @@
-/* wptGroupManager.cpp
- * Copyright (C) 2006 Timo Schulz
- *
- * This file is part of WinPT.
- *
- * WinPT is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * WinPT is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with WinPT; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-#if 0 /* XXX: not yet finished. */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <windows.h>
-#include "wptTypes.h"
-#include "wptCommonCtl.h"
-#include "wptGPG.h"
-#include "wptKeyManager.h"
-#include "wptKeylist.h"
-#include "wptErrors.h"
-
-
-static void
-get_selection (HWND tree, char *text, DWORD tlen)
-{
- TVITEM tvi;
-
- memset (&tvi, 0, sizeof tvi);
- tvi.hItem = TreeView_GetSelection (tree);
- tvi.pszText = text;
- tvi.cchTextMax = tlen;
- tvi.mask = TVIF_TEXT;
- TreeView_GetItem (tree, &tvi);
-}
-
-
-static gpg_optfile_t
-groupdb_open (char **r_cfgfile)
-{
- gpg_optfile_t opt;
- char *optfile;
- int err = 0;
-
- optfile = get_gnupg_cfgfile ();
- if (parse_gpg_options (optfile, &opt))
- err = 1;
- if (r_cfgfile)
- *r_cfgfile = optfile;
- else
- free_if_alloc (optfile);
- return err? NULL : opt;
-}
-
-
-#if 0
-int
-km_groupdb_expand_recipients (const char *name, gpgme_recipients_t rset)
-{
- gpg_keycache_t kc;
- gpgme_key_t pk;
- gpg_optfile_t opt;
- gpg_group_t grp;
- gpg_member_t mbr;
- int no_trust = 0, n;
-
- kc = keycache_get_ctx( 1 );
- if( !kc )
- BUG( NULL );
-
- opt = km_groupdb_open( );
- if( !opt )
- return WPTERR_FILE_OPEN;
-
- grp = find_group( opt, name );
- if( !grp )
- return WPTERR_GENERAL;
-
- /* we are paranoid and check that all group members exist in the
- key cache. there is no need that it is really the real key, but
- an entry should be available. the rest is up to GPG. */
- for( mbr = grp->list; mbr; mbr = mbr->next ) {
- if( gpgme_keycache_find_key( kc, mbr->name, 0, &pk ) )
- BUG( NULL );
- n = count_userids (pk);
- while( n-- ) {
- gpgme_user_id_t u = get_nth_userid (pk, n);
- const char * s = u->uid;
- if( s && stristr( s, mbr->name )
- && u->validity < 3 )
- no_trust++;
- }
- }
-
- gpgme_recipients_add_name( rset, name );
- release_gpg_options( opt );
-
- return no_trust;
-} /* km_groupdb_expand_recipients */
-#endif
-
-
-static HTREEITEM
-km_tv_insert_item (HWND tree, HTREEITEM parent, const char *text)
-{
- TVINSERTSTRUCT tvis;
- HTREEITEM node;
-
- memset (&tvis, 0, sizeof tvis);
- tvis.hParent = parent;
- tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_TEXT;
- tvis.item.pszText = (char *)text;
- node = TreeView_InsertItem (tree, &tvis);
- return node;
-}
-
-
-int
-km_groups_new (km_group_t *r_gc, HWND ctrl)
-{
- km_group_t gc;
-
- gc = new km_group_s;
- if (!gc)
- BUG (NULL);
- memset (gc, 0, sizeof *gc);
- gc->tree = ctrl;
- gc->gh = groupdb_open (&gc->cfgfile);
- *r_gc = gc;
- return 0;
-}
-
-
-void
-km_groups_sync (km_group_t gc)
-{
- commit_gpg_options (gc->cfgfile, gc->gh);
- gc->need_sync = 0;
-}
-
-
-void
-km_groups_release (km_group_t gc)
-{
- if (!gc)
- return;
-
- /* xxx: this reset the default key (sync=1) */
- gc->need_sync=0;
- if (gc->need_sync)
- km_groups_sync (gc);
- if (gc->gh)
- release_gpg_options (gc->gh);
- free_if_alloc (gc->cfgfile);
- gc->gh = NULL;
- gc->tree = NULL;
- gc->need_sync = 0;
- delete gc;
-}
-
-
-int
-km_groups_load (km_group_t gc)
-{
- HTREEITEM n;
- gpg_group_t grp, g;
- gpg_member_t mbr;
- u32 gid = 0;
-
- if (!gc->gh)
- return 0;
- grp = gc->gh->grp;
- if (!grp)
- return 0; /* no groups */
-
- for (g = grp; g; g = g->next) {
- n = km_tv_insert_item (gc->tree, NULL, g->name);
- for (mbr = g->list; mbr; mbr = mbr->next) {
- if (mbr->used && mbr->name)
- km_tv_insert_item (gc->tree, n, mbr->name);
- }
- }
- DragAcceptFiles (gc->tree, TRUE);
- gc->need_sync = 0;
- return 0;
-}
-
-
-int
-km_groups_add (km_group_t gc, listview_ctrl_t lv, int km_index)
-{
- char uid[128], valid[64], text[128];
- int i_valid;
-
- get_selection (gc->tree, text, sizeof (text)-1);
- listview_get_item_text( lv, km_index, KM_COL_UID, uid, sizeof uid -1 );
- listview_get_item_text( lv, km_index, KM_COL_VALID, valid, sizeof valid -1 );
-
- if( strstr( valid, "Ultimate" ) )
- i_valid = 5;
- else if( !strstr( valid, "Full" ) )
- i_valid = 4;
- else if( !strstr( valid, "Marginal" ) )
- i_valid = 3;
- else
- i_valid = 0;
-
- /* we can't add the full name. one way would be to use the first
- text until a space appears.
- group_add_entry(&gc->gh, gid, i_valid, uid);
- treeview_add_item(gc->tree, tvi.hItem, uid);
- */
- gc->need_sync = 1;
-
- return 0;
-} /* km_groups_add */
-
-
-static int
-km_groups_del_main (km_group_t gc)
-{
- char text[128];
- int id;
- TVITEM tvi;
-
- memset (&tvi, 0, sizeof tvi);
- tvi.hItem = TreeView_GetSelection (gc->tree);
- tvi.pszText = text;
- tvi.cchTextMax = sizeof (text)-1;
- tvi.mask = TVIF_TEXT;
- TreeView_GetItem (gc->tree, &tvi);
-
- id = log_box( _("Key Manager"), MB_INFO_ASK,
- _("Do you really want to delete this group?\n\n%s"), text);
- if (id == IDNO)
- return 0;
- delete_group (gc->gh, text);
- TreeView_DeleteItem (gc->tree, &tvi);
- gc->need_sync = 1;
- return 0;
-}
-
-
-static int
-km_groups_del_entry (km_group_t gc)
-{
- TVITEM tvi;
- HTREEITEM root;
- int id;
- char text[128], info[256];
- gpg_group_t grp = NULL;
-
- memset (&tvi, 0, sizeof tvi);
- tvi.hItem = TreeView_GetSelection (gc->tree);
- tvi.pszText = text;
- tvi.cchTextMax = sizeof (text)-1;
- tvi.mask = TVIF_TEXT;
- TreeView_GetItem (gc->tree, &tvi);
-
- _snprintf( info, sizeof info -1,
- _("Do you really want to delete this entry?\n\n%s"), text );
-
- id = msg_box( gc->tree, info, _("Key Manager"), MB_INFO_ASK );
- if( id == IDNO )
- return 0;
-
- root = TreeView_GetParent( gc->tree, tvi.hItem );
- if( root ) {
- }
-
- delete_member( gc->gh, /*fixme*/NULL, text );
- TreeView_DeleteItem( gc->tree, &tvi );
- gc->need_sync = 1;
- return 0;
-} /* km_groups_del_entry */
-
-
-int
-km_groups_del (km_group_t gc)
-{
- if (TreeView_GetParent (gc->tree, TreeView_GetSelection (gc->tree)))
- return km_groups_del_entry( gc );
- else
- return km_groups_del_main( gc );
-}
-#endif
-
Deleted: trunk/Src/wptGroupsDlg.cpp
===================================================================
--- trunk/Src/wptGroupsDlg.cpp 2011-12-01 19:24:12 UTC (rev 348)
+++ trunk/Src/wptGroupsDlg.cpp 2011-12-01 19:52:31 UTC (rev 349)
@@ -1,89 +0,0 @@
-/* wptGroupsDlg.cpp - Group management
- * Copyright (C) 2001, 2002, 2003 Timo Schulz
- *
- * This file is part of WinPT.
- *
- * WinPT is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * WinPT is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with WinPT; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <windows.h>
-#include <commctrl.h>
-#include <stdio.h>
-
-#include "resource.h"
-#include "wptTypes.h"
-#include "wptW32API.h"
-#include "wptErrors.h"
-#include "wptNLS.h"
-#include "wptGPG.h"
-#include "wptCommonCtl.h"
-#include "wptContext.h"
-#include "wptDlgs.h"
-#include "wptKeylist.h"
-#include "wptKeyManager.h"
-
-
-BOOL CALLBACK
-group_manager_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam )
-{
- static km_group_cb_s *ctx;
- char name[256];
-
- switch ( msg ) {
- case WM_INITDIALOG:
- ctx = (km_group_cb_s *)lparam;
- if (!ctx)
- dlg_fatal_error( dlg, "Can't get dialog param" );
-#ifndef LANG_DE
- SetWindowText( dlg, _("New Group") );
-#endif
- SetForegroundWindow( dlg );
- break;
-
- case WM_SYSCOMMAND:
- if( LOWORD(wparam) == SC_CLOSE ) {
- ctx->use_name = 0;
- EndDialog( dlg, TRUE );
- }
- return FALSE;
-
- case WM_COMMAND:
- switch( LOWORD( wparam ) ) {
- case IDOK:
- if( !GetDlgItemText(dlg, IDC_GROUP_EMAIL, name, sizeof name -1 ) ) {
- msg_box( dlg, _("Please enter the email address"), _("Group manager"), MB_ERR );
- return FALSE;
- }
- conf_add_group( ctx->gc->gh, name );
- strcpy( ctx->name, name );
- ctx->use_name = 1;
- EndDialog( dlg, TRUE );
- return TRUE;
-
- case IDCANCEL:
- ctx->use_name = 0;
- EndDialog( dlg, FALSE );
- return FALSE;
- }
- break;
- }
-
- return FALSE;
-}
-
Modified: trunk/Src/wptNLS.cpp
===================================================================
--- trunk/Src/wptNLS.cpp 2011-12-01 19:24:12 UTC (rev 348)
+++ trunk/Src/wptNLS.cpp 2011-12-01 19:52:31 UTC (rev 349)
@@ -82,8 +82,6 @@
{"en", "English", LANG_ENGLISH},
{"de", "German", LANG_GERMAN},
{"ru", "Russian", LANG_RUSSIAN},
- //{"fr", "French", LANG_FRENCH},
- //{"jp", "Japanese",LANG_JAPANESE},
{NULL, NULL, 0}
};
@@ -270,8 +268,8 @@
sprintf (p, "%s.%s", file, lang);
return p;
}
- name = substr(file, 0, p-file);
- ext = substr(file, p-file+1, strlen(file));
+ name = substr (file, 0, p-file);
+ ext = substr (file, p-file+1, strlen(file));
p = get_module_dir (buf, MAX_PATH);
if (!p)
BUG (NULL);
More information about the Winpt-commits
mailing list