gqclient-commit Mailing List for GQ LDAP client (Page 12)
Status: Beta
Brought to you by:
sur5r
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
(14) |
Jul
(38) |
Aug
(5) |
Sep
(29) |
Oct
(30) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(30) |
Oct
(217) |
Nov
(24) |
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(53) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <bi...@us...> - 2003-10-04 10:12:10
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv7771
Modified Files:
mainwin.c search.c
Log Message:
fixed focus handling of search mode entry box
Index: mainwin.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/mainwin.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** mainwin.c 4 Oct 2003 09:59:09 -0000 1.34
--- mainwin.c 4 Oct 2003 10:12:02 -0000 1.35
***************
*** 470,474 ****
if(focusbox) {
gtk_widget_grab_focus(focusbox);
- gtk_widget_grab_default(focusbox);
gtk_editable_select_region(GTK_EDITABLE(focusbox), 0, -1);
}
--- 470,473 ----
Index: search.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** search.c 4 Oct 2003 10:03:50 -0000 1.38
--- search.c 4 Oct 2003 10:12:02 -0000 1.39
***************
*** 82,87 ****
gtk_combo_set_popdown_strings(GTK_COMBO(searchcombo), searchhist);
gtk_widget_show(searchcombo);
! GTK_WIDGET_SET_FLAGS(searchcombo, GTK_CAN_FOCUS);
! GTK_WIDGET_SET_FLAGS(searchcombo, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start(GTK_BOX(hbox1), searchcombo, TRUE, TRUE, 6);
gtk_signal_connect_object(GTK_OBJECT(GTK_COMBO(searchcombo)->entry), "activate",
--- 82,87 ----
gtk_combo_set_popdown_strings(GTK_COMBO(searchcombo), searchhist);
gtk_widget_show(searchcombo);
! GTK_WIDGET_SET_FLAGS(GTK_COMBO(searchcombo)->entry, GTK_CAN_FOCUS);
! GTK_WIDGET_SET_FLAGS(GTK_COMBO(searchcombo)->entry, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start(GTK_BOX(hbox1), searchcombo, TRUE, TRUE, 6);
gtk_signal_connect_object(GTK_OBJECT(GTK_COMBO(searchcombo)->entry), "activate",
|
|
From: <sta...@us...> - 2003-10-04 10:10:55
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv7644 Modified Files: Makefile.am Log Message: * Added new source files * Added a test to check if header files are self-contained Index: Makefile.am =================================================================== RCS file: /cvsroot/gqclient/gq/src/Makefile.am,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Makefile.am 30 Sep 2003 17:20:25 -0000 1.25 --- Makefile.am 4 Oct 2003 10:10:47 -0000 1.26 *************** *** 40,44 **** tdefault.c \ browse-dnd.c \ ! i18n.c gq_LDADD = COPYING.o --- 40,46 ---- tdefault.c \ browse-dnd.c \ ! i18n.c \ ! gq-xml.c \ ! xmlparse.c gq_LDADD = COPYING.o *************** *** 81,84 **** --- 83,89 ---- browse-dnd.h \ i18n.h \ + utf8-compat.h \ + xmlparse.h \ + gq-xml.h \ COPYING.h |
|
From: <sta...@us...> - 2003-10-04 10:09:51
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv6111
Modified Files:
schemabrowse.c
Log Message:
* Got rid of global struct gq_config object - use pointer now
Index: schemabrowse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/schemabrowse.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** schemabrowse.c 29 Sep 2003 19:24:17 -0000 1.16
--- schemabrowse.c 4 Oct 2003 10:09:39 -0000 1.17
***************
*** 115,119 ****
server_cnt = 0;
! for (server = config.ldapservers ; server ; server = server->next) {
add_single_schema_server(tab, server);
server_cnt++;
--- 115,119 ----
server_cnt = 0;
! for (server = config->ldapservers ; server ; server = server->next) {
add_single_schema_server(tab, server);
server_cnt++;
|
|
From: <sta...@us...> - 2003-10-04 10:09:08
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4660
Modified Files:
xmlparse.c
Log Message:
* Properly use g_utf8_* for walking an UTF-8 string
* Fixed a nasty character handler bug
* in gtk2: use another parser interface allowing to change
character encodings
* Added heuristics to decide which encoding to use based on
the first line of a .gq - EXTREMELY UGLY
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/xmlparse.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** xmlparse.c 4 Oct 2003 06:57:03 -0000 1.1
--- xmlparse.c 4 Oct 2003 10:09:02 -0000 1.2
***************
*** 31,35 ****
#include "xmlparse.h"
-
#define malloc g_malloc
#define malloc0 g_malloc0
--- 31,34 ----
***************
*** 229,233 ****
xmlChar *p = e->cdata, *n = NULL;
! for(c = g_utf8_get_char(p) ; c ; c = g_utf8_next_char(p)) {
if (!g_unichar_isspace(c)) {
memmove(e->cdata, p, e->len - (p - e->cdata) + 1);
--- 228,232 ----
xmlChar *p = e->cdata, *n = NULL;
! for(c = g_utf8_get_char(p) ; c ; p = g_utf8_next_char(p), c = *p) {
if (!g_unichar_isspace(c)) {
memmove(e->cdata, p, e->len - (p - e->cdata) + 1);
***************
*** 237,241 ****
p = e->cdata;
! for(c = g_utf8_get_char(p) ; c ; c = g_utf8_next_char(p)) {
if (g_unichar_isspace(c)) {
if (n == NULL) n = p;
--- 236,240 ----
p = e->cdata;
! for(c = g_utf8_get_char(p) ; c ; p = g_utf8_next_char(p), c = *p) {
if (g_unichar_isspace(c)) {
if (n == NULL) n = p;
***************
*** 264,267 ****
--- 263,270 ----
if (e->skip) return;
+
+
+
+
if (e->cdata) {
e->len += len;
***************
*** 274,280 ****
strncat(e->cdata, ch, len);
! e->cdata[len] = 0;
}
int XMLparse(struct xml_tag *tags,
xmlSAXHandler *handler,
--- 277,303 ----
strncat(e->cdata, ch, len);
! e->cdata[e->len] = 0;
}
+ #if GTK_MAJOR >= 2
+ static int inputReadCallback(FILE *context,
+ char *buffer,
+ int len)
+ {
+ int rc = fread(buffer, 1, len, context);
+ if (rc == 0) {
+ if (ferror(context)) return -1;
+ }
+ return rc;
+ }
+
+ static int inputCloseCallback(FILE *context)
+ {
+ int rc = fclose(context);
+ if (rc != 0) return -1;
+ return rc;
+ }
+ #endif
+
int XMLparse(struct xml_tag *tags,
xmlSAXHandler *handler,
***************
*** 285,289 ****
int rc;
int handler_is_local = 0;
!
if (handler == NULL) {
handler = calloc(1, sizeof(xmlSAXHandler));
--- 308,314 ----
int rc;
int handler_is_local = 0;
! #if GTK_MAJOR >= 2
! FILE *fp;
! #endif
if (handler == NULL) {
handler = calloc(1, sizeof(xmlSAXHandler));
***************
*** 306,310 ****
--- 331,366 ----
ctx.XMLhandler = handler;
+ #ifdef HAVE_LIBXML2
+ fp = fopen(file, "r");
+ if (fp) {
+ /* nasty heuristics, but the interface does not allow to do it
+ differently */
+
+ char firstline[255];
+ fgets(firstline, sizeof(firstline) - 1, fp);
+
+ rewind(fp);
+
+ xmlParserCtxtPtr parser = xmlCreateIOParserCtxt(handler,
+ &ctx,
+ (xmlInputReadCallback) inputReadCallback,
+ (xmlInputCloseCallback) inputCloseCallback,
+ fp, 0);
+
+ if (strstr(firstline, "encoding=") == NULL ) {
+ /* no encoding specified, heuristics needed */
+ extern const char *gq_codeset;
+ xmlSwitchEncoding(parser, xmlParseCharEncoding(gq_codeset));
+ }
+
+ rc = xmlParseDocument(parser);
+ xmlFreeParserCtxt(parser);
+ } else {
+ XMLhandleFatalError(&ctx, "Cannot open file");
+ rc = -1;
+ }
+ #else
rc = xmlSAXUserParseFile(handler, &ctx, file);
+ #endif
free_tagstack(stack);
|
|
From: <sta...@us...> - 2003-10-04 10:06:55
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4253
Added Files:
utf8-compat.h
Log Message:
* A file to help with the transition to proper UTF-8 everywhere
The policy is: Only use gtk2 functions whenever there are string operations
AND provide a gtk1 compatible macro in utf8-compat.h
--- NEW FILE: utf8-compat.h ---
/*
GQ -- a GTK-based LDAP client
Copyright (C) 1998-2003 Bert Vermeulen
Copyright (C) 2002-2003 by Peter Stamfest
This program is released under the Gnu General Public License with
the additional exemption that compiling, linking, and/or using
OpenSSL is allowed.
This program 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.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Id: utf8-compat.h,v 1.1 2003/10/04 10:06:44 stamfest Exp $ */
#ifndef GQ_UTF8_COMPAT_H_INCLUDED
#define GQ_UTF8_COMPAT_H_INCLUDED
#include "config.h"
#include <glib.h>
#include <gtk/gtk.h>
#ifndef HAVE_GUNICHAR
typedef char gunichar;
# define g_utf8_get_char(p) (*(p))
# define g_utf8_next_char(p) (((char*)(p))+1)
#else
# include <glib/gunicode.h>
#endif
#ifndef HAVE_G_UNICHAR_ISSPACE
# include <ctype.h>
# define g_unichar_isspace isspace
# define g_unichar_isdigit isdigit
#endif
#endif
/*
Local Variables:
c-basic-offset: 4
End:
*/
|
|
From: <sta...@us...> - 2003-10-04 10:05:33
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4234
Modified Files:
xmlparse.h
Log Message:
* Fixed a macro-bug - forgot to properly add parens
* Added an include needed to support encoding tricks during upgrading
a .gq
Index: xmlparse.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/xmlparse.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** xmlparse.h 4 Oct 2003 06:57:03 -0000 1.1
--- xmlparse.h 4 Oct 2003 10:05:26 -0000 1.2
***************
*** 32,35 ****
--- 32,36 ----
#ifdef HAVE_LIBXML2
# include <libxml/SAX.h>
+ # include <libxml/parserInternals.h>
#elif defined(HAVE_LIBXML)
# include <gnome-xml/SAX.h>
***************
*** 98,103 ****
#define XMLhandleFatalError(ctx, ...) \
! if (ctx->XMLhandler->fatalError) { \
! ctx->XMLhandler->fatalError(ctx, __VA_ARGS__); \
} else { \
fprintf(stderr, "Unhandled fatal error: "); fprintf(stderr, __VA_ARGS__); \
--- 99,104 ----
#define XMLhandleFatalError(ctx, ...) \
! if ((ctx)->XMLhandler->fatalError) { \
! (ctx)->XMLhandler->fatalError((ctx), __VA_ARGS__); \
} else { \
fprintf(stderr, "Unhandled fatal error: "); fprintf(stderr, __VA_ARGS__); \
***************
*** 106,111 ****
#define XMLhandleError(ctx, ...) \
! if (ctx->XMLhandler->error) { \
! ctx->XMLhandler->error(ctx, __VA_ARGS__); \
} else { \
fprintf(stderr, "Unhandled error: "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); \
--- 107,112 ----
#define XMLhandleError(ctx, ...) \
! if ((ctx)->XMLhandler->error) { \
! (ctx)->XMLhandler->error(ctx, __VA_ARGS__); \
} else { \
fprintf(stderr, "Unhandled error: "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); \
|
|
From: <sta...@us...> - 2003-10-04 10:03:55
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4011
Modified Files:
search.c
Log Message:
* Undid one very stupid check-in (not mentioning which one)
* Got rid of global struct gq_config object - use pointer now
Index: search.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** search.c 4 Oct 2003 09:08:32 -0000 1.37
--- search.c 4 Oct 2003 10:03:50 -0000 1.38
***************
*** 108,113 ****
searchbase_combo = gtk_combo_new();
! if(config.ldapservers)
! gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(searchbase_combo)->entry), config.ldapservers->basedn);
gtk_box_pack_start(GTK_BOX(hbox1), searchbase_combo, FALSE, TRUE, 0);
--- 108,113 ----
searchbase_combo = gtk_combo_new();
! if(config->ldapservers)
! gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(searchbase_combo)->entry), config->ldapservers->basedn);
gtk_box_pack_start(GTK_BOX(hbox1), searchbase_combo, FALSE, TRUE, 0);
***************
*** 363,367 ****
}
else {
! switch(config.search_argument) {
case SEARCHARG_BEGINS_WITH:
snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s*)", server->searchattr, querystring);
--- 363,367 ----
}
else {
! switch(config->search_argument) {
case SEARCHARG_BEGINS_WITH:
snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s*)", server->searchattr, querystring);
***************
*** 468,472 ****
enc_searchbase = encoded_string(cur_searchbase);
! if(config.sort_search)
msg = ldap_search_s(ld, enc_searchbase, LDAP_SCOPE_SUBTREE,
filter, NULL, 0, &res);
--- 468,472 ----
enc_searchbase = encoded_string(cur_searchbase);
! if(config->sort_search)
msg = ldap_search_s(ld, enc_searchbase, LDAP_SCOPE_SUBTREE,
filter, NULL, 0, &res);
***************
*** 478,483 ****
free(filter);
! if((config.sort_search && msg != LDAP_SUCCESS) || msg == -1) {
! if (config.sort_search && msg != LDAP_SERVER_DOWN) {
server->server_down++;
}
--- 478,483 ----
free(filter);
! if((config->sort_search && msg != LDAP_SUCCESS) || msg == -1) {
! if (config->sort_search && msg != LDAP_SERVER_DOWN) {
server->server_down++;
}
***************
*** 524,528 ****
/* reserve columns 0 & 1 for DN and objectClass, respectively */
! if(config.showdn) {
column_by_attr(&attrlist, "DN");
gtk_clist_set_column_title(GTK_CLIST(new_main_clist), 0, "DN");
--- 524,528 ----
/* reserve columns 0 & 1 for DN and objectClass, respectively */
! if(config->showdn) {
column_by_attr(&attrlist, "DN");
gtk_clist_set_column_title(GTK_CLIST(new_main_clist), 0, "DN");
***************
*** 533,541 ****
gtk_clist_set_column_width(GTK_CLIST(new_main_clist), oc_col, 120);
columns_done[oc_col] = 1;
! if(config.showoc == 0)
gtk_clist_set_column_visibility(GTK_CLIST(new_main_clist), oc_col, 0);
row = 0;
! if(!config.sort_search)
rc = (ldap_result(ld, msg, 0, NULL, &res) == LDAP_RES_SEARCH_ENTRY);
else
--- 533,541 ----
gtk_clist_set_column_width(GTK_CLIST(new_main_clist), oc_col, 120);
columns_done[oc_col] = 1;
! if(config->showoc == 0)
gtk_clist_set_column_visibility(GTK_CLIST(new_main_clist), oc_col, 0);
row = 0;
! if(!config->sort_search)
rc = (ldap_result(ld, msg, 0, NULL, &res) == LDAP_RES_SEARCH_ENTRY);
else
***************
*** 558,562 ****
strncpy(set->dn, dn, MAX_DN_LEN);
! if(config.showdn) {
#if GTK_MAJOR >= 2
strcpy(tolist[0], dn);
--- 558,562 ----
strncpy(set->dn, dn, MAX_DN_LEN);
! if(config->showdn) {
#if GTK_MAJOR >= 2
strcpy(tolist[0], dn);
***************
*** 576,579 ****
--- 576,585 ----
for(attr = ldap_first_attribute(ld, e, &berptr); attr != NULL;
attr = ldap_next_attribute(ld, e, berptr)) {
+ /*
+ struct syntax_handler *handler =
+ get_syntax_handler_of_attr(server, attr, NULL);
+ */
+
+
/* This should now work for ;binary as well */
cur_col = column_by_attr(&attrlist, attr);
***************
*** 594,599 ****
if(vals) {
for(i = 0; vals[i] != NULL; i++) {
- /* that's an awful lot of mallocs in the innermost loop,
- but then we don't want to count on max valuelen either */
#if GTK_MAJOR >= 2
if(i == 0)
--- 600,603 ----
***************
*** 630,634 ****
}
! if(config.sort_search)
rc = 0;
else
--- 634,638 ----
}
! if(config->sort_search)
rc = 0;
else
***************
*** 647,651 ****
else {
snprintf(message, sizeof(message),
! ngettext(_("One entry found"), _("%d entries found"), row),
row);
statusbar_msg(message);
--- 651,655 ----
else {
snprintf(message, sizeof(message),
! ngettext("One entry found", "%d entries found", row),
row);
statusbar_msg(message);
|
|
From: <sta...@us...> - 2003-10-04 09:59:14
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv3066
Modified Files:
browse.c debug.c filter.c mainwin.c prefs.c schema.c
template.c
Log Message:
* Got rid of global struct gq_config object - use pointer now
Index: browse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/browse.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** browse.c 2 Oct 2003 16:16:25 -0000 1.70
--- browse.c 4 Oct 2003 09:59:09 -0000 1.71
***************
*** 105,109 ****
ctx = error_new_context(_("Exploding DN"));
! if (config.show_rdn_only) {
/* explode DN */
exploded_dn = gq_ldap_explode_dn(dn, FALSE);
--- 105,109 ----
ctx = error_new_context(_("Exploding DN"));
! if (config->show_rdn_only) {
/* explode DN */
exploded_dn = gq_ldap_explode_dn(dn, FALSE);
***************
*** 1007,1011 ****
char message[128];
! for(server = config.ldapservers ; server ; server = server->next) {
add_single_server_internal(ctree, server);
server_cnt++;
--- 1007,1011 ----
char message[128];
! for(server = config->ldapservers ; server ; server = server->next) {
add_single_server_internal(ctree, server);
server_cnt++;
***************
*** 1233,1237 ****
gtk_clist_set_selection_mode(GTK_CLIST(ctreeroot), GTK_SELECTION_BROWSE);
gtk_clist_set_column_auto_resize(GTK_CLIST(ctreeroot), 0, TRUE);
! if (config.sort_browse) {
gtk_clist_set_auto_sort(GTK_CLIST(ctreeroot), TRUE);
}
--- 1233,1237 ----
gtk_clist_set_selection_mode(GTK_CLIST(ctreeroot), GTK_SELECTION_BROWSE);
gtk_clist_set_column_auto_resize(GTK_CLIST(ctreeroot), 0, TRUE);
! if (config->sort_browse) {
gtk_clist_set_auto_sort(GTK_CLIST(ctreeroot), TRUE);
}
***************
*** 1777,1781 ****
/* AFAIK, the UMich LDIF format doesn't take comments or a
version string */
! if (config.ldifformat != LDIF_UMICH) {
g_string_truncate(out, 0);
--- 1777,1781 ----
/* AFAIK, the UMich LDIF format doesn't take comments or a
version string */
! if (config->ldifformat != LDIF_UMICH) {
g_string_truncate(out, 0);
***************
*** 1785,1789 ****
if(written != out->len) {
snprintf(message, sizeof(message),
! _("Save failed: Only %d of %d bytes written"),
written, out->len);
error_push(ctx, message);
--- 1785,1789 ----
if(written != out->len) {
snprintf(message, sizeof(message),
! _("Save failed: Only %1$d of %2$d bytes written"),
written, out->len);
error_push(ctx, message);
***************
*** 1815,1819 ****
if(written != out->len) {
snprintf(message, sizeof(message),
! _("%d of %d bytes written"),
written, out->len);
error_popup(_("Save failed"), message);
--- 1815,1819 ----
if(written != out->len) {
snprintf(message, sizeof(message),
! _("%1$d of %2$d bytes written"),
written, out->len);
error_popup(_("Save failed"), message);
***************
*** 2075,2079 ****
#ifdef HAVE_LDAP_STR2OBJECTCLASS
! templatelist = config.templates;
while(templatelist) {
template = (struct gq_template *) templatelist->data;
--- 2075,2079 ----
#ifdef HAVE_LDAP_STR2OBJECTCLASS
! templatelist = config->templates;
while(templatelist) {
template = (struct gq_template *) templatelist->data;
***************
*** 2255,2259 ****
ctree = BROWSETAB(tab)->ctreeroot;
/* walk the list of ldapservers, add any not yet in the show list */
! for (server = config.ldapservers ; server ; server = server->next) {
if (server_node_from_server(ctree, server) == NULL)
add_single_server_internal(ctree, server);
--- 2255,2259 ----
ctree = BROWSETAB(tab)->ctreeroot;
/* walk the list of ldapservers, add any not yet in the show list */
! for (server = config->ldapservers ; server ; server = server->next) {
if (server_node_from_server(ctree, server) == NULL)
add_single_server_internal(ctree, server);
***************
*** 2275,2279 ****
/* is this server still in the list of configured servers? */
struct ldapserver *server;
! for (server = config.ldapservers ; server ; server = server->next) {
if (thisserver == server) {
found = 1;
--- 2275,2279 ----
/* is this server still in the list of configured servers? */
struct ldapserver *server;
! for (server = config->ldapservers ; server ; server = server->next) {
if (thisserver == server) {
found = 1;
Index: debug.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/debug.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** debug.c 15 Jul 2002 18:36:51 -0000 1.5
--- debug.c 4 Oct 2003 09:59:09 -0000 1.6
***************
*** 86,90 ****
i = 1;
! server = config.ldapservers;
while(server) {
printf("server %d: %s\n", i, server->name);
--- 86,90 ----
i = 1;
! server = config->ldapservers;
while(server) {
printf("server %d: %s\n", i, server->name);
Index: filter.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/filter.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** filter.c 30 Sep 2003 22:34:49 -0000 1.18
--- filter.c 4 Oct 2003 09:59:09 -0000 1.19
***************
*** 56,60 ****
struct gq_filter *filter;
! filterlist = config.filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
--- 56,60 ----
struct gq_filter *filter;
! filterlist = config->filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
***************
*** 121,125 ****
/* check if name already exists */
! filterlist = config.filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
--- 121,125 ----
/* check if name already exists */
! filterlist = config->filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
***************
*** 154,158 ****
/* and add it in */
! config.filters = g_list_append(config.filters, filter);
/* and add it to the Filters menu */
--- 154,158 ----
/* and add it in */
! config->filters = g_list_append(config->filters, filter);
/* and add it to the Filters menu */
***************
*** 358,362 ****
gtk_clist_freeze(GTK_CLIST(filter_clist));
! filterlist = config.filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
--- 358,362 ----
gtk_clist_freeze(GTK_CLIST(filter_clist));
! filterlist = config->filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
***************
*** 461,465 ****
/* delete from internal filterlist */
! config.filters = g_list_remove(config.filters, filter);
FREE(filter, "struct gq_filter");
--- 461,465 ----
/* delete from internal filterlist */
! config->filters = g_list_remove(config->filters, filter);
FREE(filter, "struct gq_filter");
***************
*** 718,722 ****
while it was being edited, which would cause a segfault here */
if(filter) {
! filterlist = config.filters;
while(filterlist) {
if(filterlist->data == filter)
--- 718,722 ----
while it was being edited, which would cause a segfault here */
if(filter) {
! filterlist = config->filters;
while(filterlist) {
if(filterlist->data == filter)
***************
*** 790,794 ****
/* add the new filter to the internal filter list */
! config.filters = g_list_append(config.filters, filter);
/* populate internal struct */
--- 790,794 ----
/* add the new filter to the internal filter list */
! config->filters = g_list_append(config->filters, filter);
/* populate internal struct */
Index: mainwin.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/mainwin.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** mainwin.c 30 Sep 2003 17:20:25 -0000 1.33
--- mainwin.c 4 Oct 2003 09:59:09 -0000 1.34
***************
*** 98,102 ****
serverlist = NULL;
! server = config.ldapservers;
while(server) {
serverlist = g_list_append(serverlist, server->name);
--- 98,102 ----
serverlist = NULL;
! server = config->ldapservers;
while(server) {
serverlist = g_list_append(serverlist, server->name);
***************
*** 345,349 ****
/* Filters | list of filters */
! filterlist = config.filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
--- 345,349 ----
/* Filters | list of filters */
! filterlist = config->filters;
while(filterlist) {
filter = (struct gq_filter *) filterlist->data;
Index: prefs.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/prefs.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** prefs.c 30 Sep 2003 17:20:25 -0000 1.32
--- prefs.c 4 Oct 2003 09:59:09 -0000 1.33
***************
*** 140,144 ****
/* make sure server name is unique */
! servers = config.ldapservers;
while(servers->next) {
if(server != servers) {
--- 140,144 ----
/* make sure server name is unique */
! servers = config->ldapservers;
while(servers->next) {
if(server != servers) {
***************
*** 335,339 ****
if(server == NULL) {
! server = new_ldapserver();
init_ldapserver(server);
}
--- 335,339 ----
if(server == NULL) {
! server = new_ldapserver(config);
init_ldapserver(server);
}
***************
*** 993,997 ****
row = 0;
! server = config.ldapservers;
while(server) {
serverlist[0] = server->name;
--- 993,997 ----
row = 0;
! server = config->ldapservers;
while(server) {
serverlist[0] = server->name;
***************
*** 1031,1055 ****
break;
}
! config.search_argument = type;
/* Show DN */
widget = gtk_object_get_data(GTK_OBJECT(this), "showdn");
! config.showdn = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Show OC */
widget = gtk_object_get_data(GTK_OBJECT(this), "showoc");
! config.showoc = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Show RDN only */
widget = gtk_object_get_data(GTK_OBJECT(this), "show_rdn_only");
! config.show_rdn_only = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Sorting: search mode */
widget = gtk_object_get_data(GTK_OBJECT(this), "sort_search");
! config.sort_search = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Sorting: browse mode */
widget = gtk_object_get_data(GTK_OBJECT(this), "sort_browse");
! config.sort_browse = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* LDIF: format */
--- 1031,1055 ----
break;
}
! config->search_argument = type;
/* Show DN */
widget = gtk_object_get_data(GTK_OBJECT(this), "showdn");
! config->showdn = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Show OC */
widget = gtk_object_get_data(GTK_OBJECT(this), "showoc");
! config->showoc = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Show RDN only */
widget = gtk_object_get_data(GTK_OBJECT(this), "show_rdn_only");
! config->show_rdn_only = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Sorting: search mode */
widget = gtk_object_get_data(GTK_OBJECT(this), "sort_search");
! config->sort_search = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* Sorting: browse mode */
widget = gtk_object_get_data(GTK_OBJECT(this), "sort_browse");
! config->sort_browse = GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
/* LDIF: format */
***************
*** 1059,1067 ****
break;
}
! config.ldifformat = type;
combo = gtk_object_get_data(GTK_OBJECT(this), "schemaserver");
if(combo)
! strncpy(config.schemaserver, gtk_entry_get_text(GTK_ENTRY(combo->entry)), MAX_SERVERNAME_LEN);
save_config();
--- 1059,1067 ----
break;
}
! config->ldifformat = type;
combo = gtk_object_get_data(GTK_OBJECT(this), "schemaserver");
if(combo)
! strncpy(config->schemaserver, gtk_entry_get_text(GTK_ENTRY(combo->entry)), MAX_SERVERNAME_LEN);
save_config();
***************
*** 1300,1305 ****
#endif
fill_serverlist_combo(combo);
! if(strlen(config.schemaserver))
! gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), config.schemaserver);
gtk_widget_show(combo);
gtk_box_pack_start(GTK_BOX(hbox1), combo, FALSE, FALSE, 0);
--- 1300,1305 ----
#endif
fill_serverlist_combo(combo);
! if(strlen(config->schemaserver))
! gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), config->schemaserver);
gtk_widget_show(combo);
gtk_box_pack_start(GTK_BOX(hbox1), combo, FALSE, FALSE, 0);
***************
*** 1403,1407 ****
stradiobutton = gq_radio_button_new_with_label(NULL, _("_Begins with"));
! if(config.search_argument == SEARCHARG_BEGINS_WITH)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1403,1407 ----
stradiobutton = gq_radio_button_new_with_label(NULL, _("_Begins with"));
! if(config->search_argument == SEARCHARG_BEGINS_WITH)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1414,1418 ****
stgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(stradiobutton));
stradiobutton = gq_radio_button_new_with_label(stgroup, _("_Ends with"));
! if(config.search_argument == SEARCHARG_ENDS_WITH)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1414,1418 ----
stgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(stradiobutton));
stradiobutton = gq_radio_button_new_with_label(stgroup, _("_Ends with"));
! if(config->search_argument == SEARCHARG_ENDS_WITH)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1425,1429 ****
stgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(stradiobutton));
stradiobutton = gq_radio_button_new_with_label(stgroup, _("_Contains"));
! if(config.search_argument == SEARCHARG_CONTAINS)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1425,1429 ----
stgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(stradiobutton));
stradiobutton = gq_radio_button_new_with_label(stgroup, _("_Contains"));
! if(config->search_argument == SEARCHARG_CONTAINS)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1436,1440 ****
stgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(stradiobutton));
stradiobutton = gq_radio_button_new_with_label(stgroup, _("E_quals"));
! if(config.search_argument == SEARCHARG_EQUALS)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1436,1440 ----
stgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(stradiobutton));
stradiobutton = gq_radio_button_new_with_label(stgroup, _("E_quals"));
! if(config->search_argument == SEARCHARG_EQUALS)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(stradiobutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1459,1463 ****
sort_search_button = gq_check_button_new_with_label(_("_Search mode"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "sort_search", sort_search_button);
! if(config.sort_search)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sort_search_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1459,1463 ----
sort_search_button = gq_check_button_new_with_label(_("_Search mode"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "sort_search", sort_search_button);
! if(config->sort_search)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sort_search_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1470,1474 ****
viewframe = gtk_frame_new(_("View"));
gtk_widget_show(viewframe);
! gtk_box_pack_start(GTK_BOX(target), viewframe, TRUE, TRUE, 5);
vbox_view = gtk_vbox_new(TRUE, 0);
gtk_container_border_width(GTK_CONTAINER(vbox_view),
--- 1470,1474 ----
viewframe = gtk_frame_new(_("View"));
gtk_widget_show(viewframe);
! gtk_box_pack_start(GTK_BOX(target), viewframe, FALSE, TRUE, 5);
vbox_view = gtk_vbox_new(TRUE, 0);
gtk_container_border_width(GTK_CONTAINER(vbox_view),
***************
*** 1480,1484 ****
dnbutton = gq_check_button_new_with_label(_("Show _Distinguished Name"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "showdn", dnbutton);
! if(config.showdn)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(dnbutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1480,1484 ----
dnbutton = gq_check_button_new_with_label(_("Show _Distinguished Name"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "showdn", dnbutton);
! if(config->showdn)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(dnbutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1491,1495 ****
ocbutton = gq_check_button_new_with_label(_("Show O_bjectclass"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "showoc", ocbutton);
! if(config.showoc)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(ocbutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1491,1495 ----
ocbutton = gq_check_button_new_with_label(_("Show O_bjectclass"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "showoc", ocbutton);
! if(config->showoc)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(ocbutton), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1502,1506 ****
sort_search_button = gq_check_button_new_with_label(_("Sort _results"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "sort_search", sort_search_button);
! if(config.sort_search)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sort_search_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1502,1506 ----
sort_search_button = gq_check_button_new_with_label(_("Sort _results"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "sort_search", sort_search_button);
! if(config->sort_search)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sort_search_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1521,1525 ****
/* View frame in Options tab */
! viewframe = gtk_frame_new(_(" View "));
gtk_widget_show(viewframe);
gtk_box_pack_start(GTK_BOX(target), viewframe, FALSE, TRUE, 5);
--- 1521,1525 ----
/* View frame in Options tab */
! viewframe = gtk_frame_new(_("View"));
gtk_widget_show(viewframe);
gtk_box_pack_start(GTK_BOX(target), viewframe, FALSE, TRUE, 5);
***************
*** 1533,1537 ****
show_rdn_only_button = gq_check_button_new_with_label(_("Show Relative _Distinguished Name only"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "show_rdn_only", show_rdn_only_button);
! if(config.show_rdn_only)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(show_rdn_only_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1533,1537 ----
show_rdn_only_button = gq_check_button_new_with_label(_("Show Relative _Distinguished Name only"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "show_rdn_only", show_rdn_only_button);
! if(config->show_rdn_only)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(show_rdn_only_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1550,1554 ****
sort_browse_button = gq_check_button_new_with_label(_("Sort _results"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "sort_browse", sort_browse_button);
! if(config.sort_browse)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sort_browse_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1550,1554 ----
sort_browse_button = gq_check_button_new_with_label(_("Sort _results"));
gtk_object_set_data(GTK_OBJECT(targetwindow), "sort_browse", sort_browse_button);
! if(config->sort_browse)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sort_browse_button), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1588,1592 ****
formatradio = gq_radio_button_new_with_label(NULL, _("_UMich/OpenLDAP style (no comments/version)"));
! if(config.ldifformat == LDIF_UMICH)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(formatradio), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1588,1592 ----
formatradio = gq_radio_button_new_with_label(NULL, _("_UMich/OpenLDAP style (no comments/version)"));
! if(config->ldifformat == LDIF_UMICH)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(formatradio), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1599,1603 ****
formatgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(formatradio));
formatradio = gq_radio_button_new_with_label(formatgroup, _("LDIF Version _1 (RFC2849)"));
! if(config.ldifformat == LDIF_V1)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(formatradio), TRUE);
#ifdef OLD_FOCUS_HANDLING
--- 1599,1603 ----
formatgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(formatradio));
formatradio = gq_radio_button_new_with_label(formatgroup, _("LDIF Version _1 (RFC2849)"));
! if(config->ldifformat == LDIF_V1)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(formatradio), TRUE);
#ifdef OLD_FOCUS_HANDLING
***************
*** 1682,1686 ****
if( (tmpl = find_template_by_name(templatename))) {
! config.templates = g_list_remove(config.templates, tmpl);
}
--- 1682,1686 ----
if( (tmpl = find_template_by_name(templatename))) {
! config->templates = g_list_remove(config->templates, tmpl);
}
Index: schema.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/schema.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** schema.c 12 Oct 2002 12:31:34 -0000 1.17
--- schema.c 4 Oct 2003 09:59:09 -0000 1.18
***************
*** 64,68 ****
/* server didn't publish a schema, try the last resort schemaserver */
! server = server_by_name(config.schemaserver);
if(server == NULL) {
set_normalcursor();
--- 64,68 ----
/* server didn't publish a schema, try the last resort schemaserver */
! server = server_by_name(config->schemaserver);
if(server == NULL) {
set_normalcursor();
Index: template.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/template.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** template.c 29 Sep 2003 19:24:17 -0000 1.9
--- template.c 4 Oct 2003 09:59:09 -0000 1.10
***************
*** 538,542 ****
/* add new template to list, but make sure the template name is unique */
if( (find_template_by_name(tmpl->name)) == NULL) {
! config.templates = g_list_append(config.templates, tmpl);
}
else {
--- 538,542 ----
/* add new template to list, but make sure the template name is unique */
if( (find_template_by_name(tmpl->name)) == NULL) {
! config->templates = g_list_append(config->templates, tmpl);
}
else {
***************
*** 568,572 ****
else {
/* hmmmm... template was deleted while editing it. Just add it in then */
! config.templates = g_list_append(config.templates, tmpl);
}
--- 568,572 ----
else {
/* hmmmm... template was deleted while editing it. Just add it in then */
! config->templates = g_list_append(config->templates, tmpl);
}
***************
*** 629,633 ****
gtk_clist_clear(GTK_CLIST(clist));
! list = config.templates;
while(list) {
if( (tmpl = (struct gq_template *) list->data)) {
--- 629,633 ----
gtk_clist_clear(GTK_CLIST(clist));
! list = config->templates;
while(list) {
if( (tmpl = (struct gq_template *) list->data)) {
|
|
From: <sta...@us...> - 2003-10-04 09:57:01
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2786
Modified Files:
input.c
Log Message:
* Got rid of global struct gq_config object - use pointer now
* Changed some error messages to not ask to mail be...@bi...
Index: input.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/input.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** input.c 2 Oct 2003 16:16:26 -0000 1.58
--- input.c 4 Oct 2003 09:56:54 -0000 1.59
***************
*** 416,425 ****
gpointer val;
! config.changed = 1;
! if (g_hash_table_lookup_extended(config.defaultDT,
form->attrname,
&okey, &val)) {
! g_hash_table_remove(config.defaultDT, form->attrname);
if (okey) g_free(okey);
if (val) g_free(val);
--- 416,425 ----
gpointer val;
! config->changed = 1;
! if (g_hash_table_lookup_extended(config->defaultDT,
form->attrname,
&okey, &val)) {
! g_hash_table_remove(config->defaultDT, form->attrname);
if (okey) g_free(okey);
if (val) g_free(val);
***************
*** 431,435 ****
int dt;
! config.changed = 1;
/* first remove, in case one has been set before */
--- 431,435 ----
int dt;
! config->changed = 1;
/* first remove, in case one has been set before */
***************
*** 440,444 ****
int *p = (int *) g_malloc(sizeof(int));
*p = dt;
! g_hash_table_insert(config.defaultDT,
g_strdup(form->attrname),
p);
--- 440,444 ----
int *p = (int *) g_malloc(sizeof(int));
*p = dt;
! g_hash_table_insert(config->defaultDT,
g_strdup(form->attrname),
p);
***************
*** 535,539 ****
gtk_widget_set_sensitive(menu_item,
! g_hash_table_lookup(config.defaultDT,
form->attrname) != NULL);
--- 535,539 ----
gtk_widget_set_sensitive(menu_item,
! g_hash_table_lookup(config->defaultDT,
form->attrname) != NULL);
***************
*** 1112,1117 ****
if(!formlist) {
error_push(add_context,
! "Hmmm, no formlist to build entry! "
! "Please notify be...@bi...");
error_flush(add_context);
return 0;
--- 1112,1116 ----
if(!formlist) {
error_push(add_context,
! "Hmmm, no formlist to build entry!");
error_flush(add_context);
return 0;
***************
*** 1122,1126 ****
if(!server) {
error_push(add_context,
! "Hmmm, no server! Please notify be...@bi...");
error_flush(add_context);
return 0;
--- 1121,1125 ----
if(!server) {
error_push(add_context,
! "Hmmm, no server!");
error_flush(add_context);
return 0;
|
|
From: <sta...@us...> - 2003-10-04 09:54:37
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2513
Modified Files:
errorchain.c
Log Message:
* abort() not exit() for better debugging
* do utf-8 decoding for error messages (may contain LDAP
messages). Hopefully this is done correctly.
Index: errorchain.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/errorchain.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** errorchain.c 2 Oct 2003 16:16:26 -0000 1.12
--- errorchain.c 4 Oct 2003 09:54:33 -0000 1.13
***************
*** 135,139 ****
if(!chain) {
fprintf(stderr, _("Oops! errorchain lookup error. Exiting...\n"));
! exit(1);
}
--- 135,139 ----
if(!chain) {
fprintf(stderr, _("Oops! errorchain lookup error. Exiting...\n"));
! abort();
}
***************
*** 177,181 ****
else {
fprintf(stderr, _("Oops! errorchain free error. Exiting...\n"));
! exit(1);
}
--- 177,181 ----
else {
fprintf(stderr, _("Oops! errorchain free error. Exiting...\n"));
! abort();
}
|
|
From: <sta...@us...> - 2003-10-04 09:52:29
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv2258 Modified Files: encode.c encode.h Log Message: * Made gq_codeset const Index: encode.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/encode.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** encode.c 2 Oct 2003 16:16:26 -0000 1.21 --- encode.c 4 Oct 2003 09:52:24 -0000 1.22 *************** *** 48,52 **** #include "debug.h" ! char *gq_codeset = GQ_CODESET; const char *decode_string(char *native_string, const gchar *ldap_string, --- 48,52 ---- #include "debug.h" ! const char *gq_codeset = GQ_CODESET; const char *decode_string(char *native_string, const gchar *ldap_string, Index: encode.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/encode.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** encode.h 28 Sep 2003 03:26:25 -0000 1.9 --- encode.h 4 Oct 2003 09:52:24 -0000 1.10 *************** *** 47,51 **** ! extern char *gq_codeset; #ifdef HAVE_LIBCRYPTO --- 47,51 ---- ! extern const char *gq_codeset; #ifdef HAVE_LIBCRYPTO |
|
From: <sta...@us...> - 2003-10-04 09:45:52
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1404
Modified Files:
gq-xml.c
Log Message:
* #ifdef'd out the test main function
Index: gq-xml.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/gq-xml.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** gq-xml.c 4 Oct 2003 06:57:03 -0000 1.1
--- gq-xml.c 4 Oct 2003 09:45:45 -0000 1.2
***************
*** 883,891 ****
}
-
- printf("filen = %s config1 = %08lx\n", filename, comm.config);
return comm.config;
}
int main_test(int argc, char **argv) {
--- 883,890 ----
}
return comm.config;
}
+ #ifdef TEST_MAIN
int main_test(int argc, char **argv) {
***************
*** 909,910 ****
--- 908,910 ----
}
+ #endif
|
|
From: <bi...@us...> - 2003-10-04 09:08:37
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28023
Modified Files:
search.c
Log Message:
don't use g_list_insert_before() (not glib-1.x compatible)
properly free history stuff during search mode cleanup
Index: search.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** search.c 4 Oct 2003 00:58:44 -0000 1.36
--- search.c 4 Oct 2003 09:08:32 -0000 1.37
***************
*** 395,399 ****
}
else {
! list = g_list_insert_before(list, list, searchterm);
if(g_list_length(list) > MAX_SEARCH_HISTORY_LENGTH) {
last = g_list_last(list);
--- 395,399 ----
}
else {
! list = g_list_insert(list, searchterm, 0);
if(g_list_length(list) > MAX_SEARCH_HISTORY_LENGTH) {
last = g_list_last(list);
***************
*** 929,932 ****
--- 929,933 ----
{
GtkWidget *main_clist;
+ GList *list;
struct resultset *cur_resultset;
***************
*** 940,943 ****
--- 941,955 ----
gtk_clist_clear(GTK_CLIST(main_clist));
gtk_widget_destroy(main_clist);
+ }
+
+ /* FIXME save history into permanent session thingie */
+
+ list = SEARCHTAB(tab)->history;
+ if(list) {
+ while(list) {
+ g_free(list->data);
+ list = list->next;
+ }
+ g_list_free(SEARCHTAB(tab)->history);
}
|
|
From: <sta...@us...> - 2003-10-04 06:57:13
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv13663
Added Files:
xmlparse.c xmlparse.h gq-xml.c gq-xml.h
Log Message:
* First check-in of a libxml based configuration file parser. The parser uses
the SAX interface and can be easily extended. It can also be extended easily
to other XML files
* As noted: Requires libxml or libxml2
* The parser is driven by a data structure pointing to start and end
element headers for the used tags. Those handlers can be context
sensitive
--- NEW FILE: xmlparse.c ---
/*
GQ -- a GTK-based LDAP client is
Copyright (C) 1998-2003 Bert Vermeulen
Copyright (C) 2002-2003 Peter Stamfest
This file is
Copyright (c) 2003 by Peter Stamfest <pe...@st...>
This program is released under the Gnu General Public License with
the additional exemption that compiling, linking, and/or using
OpenSSL is allowed.
This program 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.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#include <gtk/gtk.h>
#include "xmlparse.h"
#define malloc g_malloc
#define malloc0 g_malloc0
#define calloc(n,s) g_malloc0(n * s)
#define TAGSTACK_INCR 20
#if 0
void free_tagstack_entry(struct tagstack_entry *e);
struct tagstack *new_tagstack();
void free_tagstack(struct tagstack *stack);
struct tagstack_entry *push_tag(struct tagstack *stack,
const xmlChar *tag, const xmlChar **attrs);
void pop_tag(struct tagstack *stack);
/* retrieve the n-th tagstack entry. 0 = the top entry, 1 = the
next-to-top entry, etc... */
#endif
static void free_tagstack_entry(struct tagstack_entry *e)
{
int i;
if (e->tag) free(e->tag);
e->tag = NULL;
if (e->cdata) free(e->cdata);
e->cdata = NULL;
if (e->free_data) e->free_data(e->data);
e->data = NULL;
e->free_data = NULL;
if (e->attrs) {
for (i = 0 ; e->attrs[i] ; i++) {
free(e->attrs[i]);
e->attrs[i] = NULL;
}
free(e->attrs);
e->attrs = NULL;
}
}
static struct tagstack *new_tagstack()
{
struct tagstack *s = calloc(1, sizeof (struct tagstack));
s->size = TAGSTACK_INCR;
s->entries = calloc(s->size, sizeof(struct tagstack_entry *));
return s;
}
static struct tagstack_entry *push_tag(struct tagstack *stack,
const xmlChar *tag, const xmlChar **attrs)
{
struct tagstack_entry *e = calloc(1, sizeof (struct tagstack_entry));
if (stack->sp >= stack->size) {
stack->size += TAGSTACK_INCR;
stack->entries = realloc(stack->entries,
sizeof(struct tagstack_entry *) * stack->size);
}
stack->entries[stack->sp++] = e;
e->tag = strdup(tag);
return e;
}
static void pop_tag(struct tagstack *stack)
{
if (stack->sp-- > 0) {
struct tagstack_entry *e = stack->entries[stack->sp];
stack->entries[stack->sp] = NULL;
free_tagstack_entry(e);
}
}
static void free_tagstack(struct tagstack *stack)
{
while (stack->sp-- > 0) pop_tag(stack);
}
/* retrieve the n-th tagstack entry. 0 = the top entry, 1 = the
next-to-top entry, etc... */
struct tagstack_entry *peek_tag(struct tagstack *stack, int n)
{
int i = stack->sp - 1 - n;
if (i >= 0) {
return stack->entries[i];
} else {
return NULL;
}
}
static void startElementH(struct parser_context *ctx,
const xmlChar *name,
const xmlChar **attrs)
{
struct tagstack_entry *e;
const struct xml_tag *t;
int i;
#ifdef SKIP_UNKNOWN
int parent_skip;
e = peek_tag(ctx->stack, 0);
parent_skip = e && e->skip;
#endif
e = push_tag(ctx->stack, name, attrs);
#ifdef SKIP_UNKNOWN
if (parent_skip) {
/* we are currently skipping tags recursively */
e->skip = 1;
return;
}
#endif
e->attrs = NULL;
if (attrs) {
for (i = 0 ; attrs[i] ; i++) ;
e->attrs = calloc(i, sizeof(xmlChar *));
for (i = 0 ; attrs[i] ; i++) {
e->attrs[i] = strdup(attrs[i]);
}
}
/* lookup handler */
for (t = ctx->tags ; t->tag ; t++) {
if (strcmp(name, t->tag) == 0) {
/* maybe, maybe, maybe..... (J Joplin) */
int i;
int ok = 1;
/* check context */
for (i = 0 ; i < XML_CONTEXT_SIZE && t->context[i] ; i++) {
struct tagstack_entry *f;
f = peek_tag(ctx->stack, i + 1);
if (!f) {
ok = 0;
break;
}
if (strcmp(f->tag, t->context[i]) != 0) {
ok = 0;
break;
}
}
if (ok) {
/* found handler !!! */
break;
}
}
}
if (t->tag) {
e->handler = t;
if (e->handler->startElement) {
e->handler->startElement(ctx, e);
}
} else {
#ifdef SKIP_UNKNOWN
e->skip = 1;
#else
XMLhandleFatalError(ctx, "Unknown tag '%s'\n", name);
#endif
}
}
static void endElementH(struct parser_context *ctx,
const xmlChar *name)
{
struct tagstack_entry *e = peek_tag(ctx->stack, 0);
if (e->cdata && e->handler && !(e->handler->flags & NO_TRIM_CDATA)) {
gunichar c;
xmlChar *p = e->cdata, *n = NULL;
for(c = g_utf8_get_char(p) ; c ; c = g_utf8_next_char(p)) {
if (!g_unichar_isspace(c)) {
memmove(e->cdata, p, e->len - (p - e->cdata) + 1);
break;
}
}
p = e->cdata;
for(c = g_utf8_get_char(p) ; c ; c = g_utf8_next_char(p)) {
if (g_unichar_isspace(c)) {
if (n == NULL) n = p;
} else {
n = NULL;
}
}
if (n) {
*n = 0;
}
}
if (!e->skip && e->handler) {
if (e->handler->endElement) {
e->handler->endElement(ctx, e);
}
}
pop_tag(ctx->stack);
}
static void charactersH(struct parser_context *ctx,
const xmlChar *ch, int len)
{
struct tagstack_entry *e = peek_tag(ctx->stack, 0);
if (e->skip) return;
if (e->cdata) {
e->len += len;
e->cdata = realloc(e->cdata, e->len + 1);
} else {
e->len += len;
e->cdata = malloc(e->len + 1);
*(e->cdata) = 0;
}
strncat(e->cdata, ch, len);
e->cdata[len] = 0;
}
int XMLparse(struct xml_tag *tags,
xmlSAXHandler *handler,
void *user_data, const char *file)
{
struct parser_context ctx;
struct tagstack *stack = new_tagstack();
int rc;
int handler_is_local = 0;
if (handler == NULL) {
handler = calloc(1, sizeof(xmlSAXHandler));
handler_is_local = 1;
}
if (!handler->startElement) {
handler->startElement = (startElementSAXFunc) startElementH;
}
if (!handler->endElement) {
handler->endElement = (endElementSAXFunc) endElementH;
}
if (!handler->characters) {
handler->characters = (charactersSAXFunc) charactersH;
}
ctx.tags = tags;
ctx.stack = stack;
ctx.user_data = user_data;
ctx.XMLhandler = handler;
rc = xmlSAXUserParseFile(handler, &ctx, file);
free_tagstack(stack);
if (handler_is_local) free(handler);
return rc;
}
--- NEW FILE: xmlparse.h ---
/*
GQ -- a GTK-based LDAP client
Copyright (C) 1998-2003 Bert Vermeulen
Copyright (C) 2002-2003 by Peter Stamfest
This program is released under the Gnu General Public License with
the additional exemption that compiling, linking, and/or using
OpenSSL is allowed.
This program 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.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Id: xmlparse.h,v 1.1 2003/10/04 06:57:03 stamfest Exp $ */
#ifndef GQ_XMLPARSE_H_INCLUDED
#define GQ_XMLPARSE_H_INCLUDED
#include "config.h"
#ifdef HAVE_LIBXML2
# include <libxml/SAX.h>
#elif defined(HAVE_LIBXML)
# include <gnome-xml/SAX.h>
#elif defined(HAVE_EXPAT)
# include <expat.h>
typedef xmlChar XML_Char;
#endif
#include "utf8-compat.h"
#define XML_CONTEXT_SIZE 10
#define NO_TRIM_CDATA 1
struct xml_tag;
typedef void (*free_func)(void *);
struct tagstack_entry {
xmlChar *tag;
xmlChar **attrs;
xmlChar *cdata;
int len;
const struct xml_tag *handler;
/* if skip is set to 1, all tags below will be skipped (no xml_tag
handlers will be called) */
int skip;
void *data;
free_func free_data; /* void (*free_data)(void *); */
};
struct tagstack {
int size;
int sp;
struct tagstack_entry **entries;
};
struct parser_context;
struct xml_tag {
const char *tag;
int flags;
void (*startElement)(struct parser_context *ctx,
struct tagstack_entry *stack);
void (*endElement) (struct parser_context *ctx,
struct tagstack_entry *stack);
const char *context[XML_CONTEXT_SIZE];
};
struct parser_context {
struct tagstack *stack;
const struct xml_tag *tags;
void *user_data;
xmlSAXHandler *XMLhandler;
};
#define XMLhandleFatalError(ctx, ...) \
if (ctx->XMLhandler->fatalError) { \
ctx->XMLhandler->fatalError(ctx, __VA_ARGS__); \
} else { \
fprintf(stderr, "Unhandled fatal error: "); fprintf(stderr, __VA_ARGS__); \
exit(1); \
}
#define XMLhandleError(ctx, ...) \
if (ctx->XMLhandler->error) { \
ctx->XMLhandler->error(ctx, __VA_ARGS__); \
} else { \
fprintf(stderr, "Unhandled error: "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); \
exit(1); \
}
struct tagstack_entry *peek_tag(struct tagstack *stack, int n);
int XMLparse(struct xml_tag *tags,
xmlSAXHandler *handler,
void *user_data, const char *file);
#endif
/*
Local Variables:
c-basic-offset: 4
End:
*/
--- NEW FILE: gq-xml.c ---
/*
GQ -- a GTK-based LDAP client is
Copyright (C) 1998-2003 Bert Vermeulen
Copyright (C) 2002-2003 Peter Stamfest
This file is
Copyright (c) 2003 by Peter Stamfest <pe...@st...>
This program is released under the Gnu General Public License with
the additional exemption that compiling, linking, and/or using
OpenSSL is allowed.
This program 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.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#include <gtk/gtk.h>
#include "gq-xml.h"
#include "xmlparse.h"
#include "configfile.h"
#include "util.h"
#include "i18n.h"
#include "ldif.h"
#include "syntax.h"
#include "filter.h"
#include "template.h"
#include "errorchain.h"
struct cf_comm {
int error_context;
int severity;
struct gq_config *config;
};
static void gq_configS(struct parser_context *ctx,
struct tagstack_entry *e)
{
e->data = calloc(1, sizeof(struct gq_config));
default_config(e->data);
}
static void gq_configE(struct parser_context *ctx,
struct tagstack_entry *e)
{
if (ctx->user_data) {
struct cf_comm *comm = (struct cf_comm *)ctx->user_data;
if (comm->config) {
free_config(comm->config);
}
comm->config = e->data;
e->data = NULL;
}
}
long longCDATA(struct parser_context *ctx,
struct tagstack_entry *e)
{
char *ep;
long l;
l = strtol(e->cdata, &ep, 10);
if ((ep && *ep) || l < 0) {
XMLhandleError(ctx, _("Non-negative integer CDATA expected ('%s')"), e->tag);
return -1;
}
return l;
}
static int booleanCDATA(struct parser_context *ctx,
struct tagstack_entry *e)
{
int b;
if (strcasecmp("true", e->cdata) == 0) {
b = 1;
} else if (strcasecmp("false", e->cdata) == 0) {
b = 0;
} else {
XMLhandleError(ctx, _("Boolean CDATA ('true' or 'false') expected ('%s')"), e->tag);
return -1;
}
return b;
}
static void config_versionE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
long l = longCDATA(ctx, e);
if (l >= 0) c->config_version = l;
}
static void asked_config_versionE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
long l = longCDATA(ctx, e);
if (l >= 0) c->asked_version = l;
}
static void last_askedE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
long l = longCDATA(ctx, e);
if (l >= 0) c->last_asked = l;
}
static void confirm_modE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) c->confirm_mod = b;
}
static void show_dnE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) c->showdn = b;
}
static void show_ocE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) c->showoc = b;
}
static void show_rdn_onlyE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) c->show_rdn_only = b;
}
static void sort_search_modeE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) c->sort_search = b;
}
static void sort_browse_modeE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) c->sort_browse = b;
}
static void ldif_formatE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
int t = tokenize(token_ldifformat, e->cdata);
c->ldifformat = t;
}
static void search_argumentE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
/* compatibility with older versions of gq -- accept
token number as well */
gunichar ch = g_utf8_get_char(e->cdata);
if (g_unichar_isdigit(ch)) {
long l = longCDATA(ctx, e);
if (l >= 0) {
c->search_argument = l;
} else {
XMLhandleError(ctx, _("Invalid token for '%s'"), e->tag);
}
} else {
int t = tokenize(token_searchargument, e->cdata);
c->search_argument = t;
}
}
static void schema_serverE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF-8 safe */
strncpy(c->schemaserver, e->cdata, MAX_SERVERNAME_LEN - 1);
}
static void ldapserverS(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = calloc(1, sizeof(struct ldapserver));
init_ldapserver(server);
e->data = server;
}
static void ldapserverE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
struct ldapserver *server = e->data;
if (strcasecmp(server->pwencoding, "Base64") == 0 && server->bindpw[0]) {
GByteArray *o = g_byte_array_new();
b64_decode(o, server->bindpw, strlen(server->bindpw));
memset(server->bindpw, 0, sizeof(server->bindpw));
strncpy(server->bindpw, o->data, MIN(o->len, sizeof(server->bindpw) - 1));
} else if (server->bindpw[0] && server->pwencoding[0]) {
XMLhandleError(ctx, _("Unsupported password encoding"));
}
if(c->ldapservers) {
server = c->ldapservers;
while(server->next)
server = server->next;
server->next = e->data;
} else {
c->ldapservers = e->data;
}
e->data = NULL;
}
static void ldapserver_nameE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(server->name, e->cdata, sizeof(server->name) - 1);
}
static void ldapserver_ldaphostE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(server->ldaphost, e->cdata,
sizeof(server->ldaphost) - 1);
}
static void ldapserver_ldapportE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
long l = longCDATA(ctx, e);
if (l >= 0) server->ldapport = l;
}
static void ldapserver_basednE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(server->basedn, e->cdata,
sizeof(server->basedn) - 1);
}
static void ldapserver_binddnE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(server->binddn, e->cdata,
sizeof(server->binddn) - 1);
}
static void ldapserver_bindpwE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(server->bindpw, e->cdata,
sizeof(server->bindpw) - 1);
}
static void ldapserver_pw_encodingE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(server->pwencoding, e->cdata,
sizeof(server->pwencoding) - 1);
}
static void ldapserver_bindtypeE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
int t = tokenize(token_bindtype, e->cdata);
server->bindtype = t;
}
static void ldapserver_search_attributeE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(server->searchattr, e->cdata,
sizeof(server->searchattr) - 1);
}
static void ldapserver_ask_pwE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) server->ask_pw = b;
}
static void ldapserver_hide_internalE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) server->hide_internal = b;
}
static void ldapserver_show_refE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) server->show_ref = b;
}
static void ldapserver_enable_tlsE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) server->enabletls = b;
}
static void ldapserver_cache_connectionE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
int b = booleanCDATA(ctx, e);
if (b >= 0) server->cacheconn = b;
}
static void ldapserver_local_cache_timeoutE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
long l = longCDATA(ctx, e);
if (l >= 0) server->local_cache_timeout = l;
}
static void ldapserver_maxentriesE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ldapserver *server = peek_tag(ctx->stack, 1)->data;
long l = longCDATA(ctx, e);
if (l >= 0) server->maxentries = l;
}
static void filterS(struct parser_context *ctx,
struct tagstack_entry *e)
{
e->data = calloc(1, sizeof(struct gq_filter));
e->free_data = free;
}
static void filterE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
c->filters = g_list_append(c->filters, e->data);
e->data = NULL;
e->free_data = NULL;
}
static void filter_nameE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_filter *filter = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(filter->name, e->cdata,
sizeof(filter->name) - 1);
}
static void filter_ldapfilterE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_filter *filter = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(filter->ldapfilter, e->cdata,
sizeof(filter->ldapfilter) - 1);
}
static void filter_servernameE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_filter *filter = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(filter->servername, e->cdata,
sizeof(filter->servername) - 1);
}
static void filter_basednE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_filter *filter = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(filter->basedn, e->cdata,
sizeof(filter->basedn) - 1);
}
static void templateS(struct parser_context *ctx,
struct tagstack_entry *e)
{
e->data = calloc(1, sizeof(struct gq_template));
}
static void templateE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 1)->data;
c->templates = g_list_append(c->templates, e->data);
}
static void template_nameE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_template *t = peek_tag(ctx->stack, 1)->data;
/* FIXME - not UTF8-safe */
strncpy(t->name, e->cdata,
sizeof(t->name) - 1);
}
static void template_objectclassE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_template *t = peek_tag(ctx->stack, 1)->data;
t->objectclasses = g_list_append(t->objectclasses, strdup(e->cdata));
}
struct ddt {
char *attr;
long dt;
};
static void free_ddt(struct ddt *d) {
if (d) {
if (d->attr) free(d->attr);
d->attr = NULL;
free(d);
}
}
static void display_typeS(struct parser_context *ctx,
struct tagstack_entry *e)
{
e->data = calloc(1, sizeof(struct ddt));
e->free_data = (free_func) free_ddt;
}
static void display_typeE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct gq_config *c = peek_tag(ctx->stack, 3)->data;
struct ddt *d = e->data;
if (d->attr) {
if (get_dt_handler(d->dt)) {
int *p = (int *) g_malloc(sizeof(int));
*p = d->dt;
g_hash_table_insert(c->defaultDT,
d->attr,
p);
d->attr = NULL; /* stored in hash table */
}
}
}
static void ldapserver_dt_attributeE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ddt *d = peek_tag(ctx->stack, 1)->data;
if (d->attr) free(d->attr);
d->attr = strdup(e->cdata);
}
static void ldapserver_dt_defaultE(struct parser_context *ctx,
struct tagstack_entry *e)
{
struct ddt *d = peek_tag(ctx->stack, 1)->data;
long l = longCDATA(ctx, e);
if (l >= 0) d->dt = l;
}
struct xml_tag config_tags[] = {
{
"gq-config", 0,
gq_configS, gq_configE,
{ NULL },
},
{
"config-version", 0,
NULL, config_versionE,
{ "gq-config", NULL },
},
{
"asked-config-version", 0,
NULL, asked_config_versionE,
{ "gq-config", NULL },
},
{
"last-asked", 0,
NULL, last_askedE,
{ "gq-config", NULL },
},
{
"confirm-mod", 0,
NULL, confirm_modE,
{ "gq-config", NULL },
},
{
"search-argument", 0,
NULL, search_argumentE,
{ "gq-config", NULL },
},
{
"show-dn", 0,
NULL, show_dnE,
{ "gq-config", NULL },
},
{
"show-oc", 0,
NULL, show_ocE,
{ "gq-config", NULL },
},
{
"show-rdn-only", 0,
NULL, show_rdn_onlyE,
{ "gq-config", NULL },
},
{
"sort-search-mode", 0,
NULL, sort_search_modeE,
{ "gq-config", NULL },
},
{
"sort-browse-mode", 0,
NULL, sort_browse_modeE,
{ "gq-config", NULL },
},
{
"ldif-format", 0,
NULL, ldif_formatE,
{ "gq-config", NULL },
},
{
"schema-server", 0,
NULL, schema_serverE,
{ "gq-config", NULL },
},
/* ldapserver tags */
{
"ldapserver", 0,
ldapserverS, ldapserverE,
{ "gq-config", NULL },
},
{
"name", 0,
NULL, ldapserver_nameE,
{ "ldapserver", NULL },
},
{
"ldaphost", 0,
NULL, ldapserver_ldaphostE,
{ "ldapserver", NULL },
},
{
"ldapport", 0,
NULL, ldapserver_ldapportE,
{ "ldapserver", NULL },
},
{
"basedn", 0,
NULL, ldapserver_basednE,
{ "ldapserver", NULL },
},
{
"binddn", 0,
NULL, ldapserver_binddnE,
{ "ldapserver", NULL },
},
{
"bindpw", 0,
NULL, ldapserver_bindpwE,
{ "ldapserver", NULL },
},
{
"pw-encoding", 0,
NULL, ldapserver_pw_encodingE,
{ "ldapserver", NULL },
},
{
"bindtype", 0,
NULL, ldapserver_bindtypeE,
{ "ldapserver", NULL },
},
{
"search-attribute", 0,
NULL, ldapserver_search_attributeE,
{ "ldapserver", NULL },
},
{
"ask-pw", 0,
NULL, ldapserver_ask_pwE,
{ "ldapserver", NULL },
},
{
"hide-internal", 0,
NULL, ldapserver_hide_internalE,
{ "ldapserver", NULL },
},
{
"show-ref", 0,
NULL, ldapserver_show_refE,
{ "ldapserver", NULL },
},
{
"enable-tls", 0,
NULL, ldapserver_enable_tlsE,
{ "ldapserver", NULL },
},
{
"cache-connection", 0,
NULL, ldapserver_cache_connectionE,
{ "ldapserver", NULL },
},
{
"local-cache-timeout", 0,
NULL, ldapserver_local_cache_timeoutE,
{ "ldapserver", NULL },
},
{
"maxentries", 0,
NULL, ldapserver_maxentriesE,
{ "ldapserver", NULL },
},
/* templates */
{
"template", 0,
templateS, templateE,
{ "gq-config", NULL },
},
{
"name", 0,
NULL, template_nameE,
{ "template", NULL },
},
{
"objectclass", 0,
NULL, template_objectclassE,
{ "template", NULL },
},
/* filter */
{
"filter", 0,
filterS, filterE,
{ "gq-config", NULL },
},
{
"name", 0,
NULL, filter_nameE,
{ "filter", NULL },
},
{
"ldapfilter", 0,
NULL, filter_ldapfilterE,
{ "filter", NULL },
},
{
"servername", 0,
NULL, filter_servernameE,
{ "filter", NULL },
},
{
"basedn", 0,
NULL, filter_basednE,
{ "filter", NULL },
},
/* defaults */
{
"defaults", 0,
NULL, NULL,
{ "gq-config", NULL },
},
/* display-types */
{
"display-types", 0,
NULL, NULL,
{ "defaults", NULL },
},
/* display-type */
{
"display-type", 0,
display_typeS, display_typeE,
{ "display-types", "defaults", "gq-config", NULL },
},
{
"dt-attribute", 0,
NULL, ldapserver_dt_attributeE,
{ "display-type", NULL },
},
{
"dt-default", 0,
NULL, ldapserver_dt_defaultE,
{ "display-type", NULL },
},
{
NULL
},
};
static void XMLmessageHandler(struct parser_context *ctx,
int severity,
const char *type,
const char *format, va_list ap)
{
struct cf_comm *comm = ctx->user_data;
if (comm) {
int len = 1024, pos = 0, i;
char *buf = g_malloc(len);
snprintf(buf, len, "%s: ", type);
i = strlen(buf);
pos += i; /* OK for UTF-8 */
vsnprintf(buf + pos, len - pos, format, ap);
error_push(comm->error_context, buf);
fprintf(stderr, "%s\n", buf);
g_free(buf);
comm->severity = severity;
}
}
static void XMLwarningHandler(struct parser_context *ctx, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
XMLmessageHandler(ctx, 1, _("Warning"), fmt, args);
va_end(args);
}
static void XMLerrorHandler(struct parser_context *ctx, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
XMLmessageHandler(ctx, 2, _("Error"), fmt, args);
va_end(args);
}
static void XMLfatalErrorHandler(struct parser_context *ctx, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
XMLmessageHandler(ctx, 3, _("Fatal Error"), fmt, args);
va_end(args);
}
struct gq_config *process_rcfile_XML(int error_context, const char *filename) {
xmlSAXHandler *handler = g_malloc0(sizeof(xmlSAXHandler));
int rc;
struct cf_comm comm;
comm.error_context = error_context;
comm.config = NULL;
handler->error = (errorSAXFunc) XMLerrorHandler;
handler->fatalError = (fatalErrorSAXFunc) XMLfatalErrorHandler;
handler->warning = (warningSAXFunc) XMLwarningHandler;
rc = XMLparse(config_tags, handler, &comm, filename);
g_free(handler);
if (rc != 0) {
free_config(comm.config);
comm.config = NULL;
}
printf("filen = %s config1 = %08lx\n", filename, comm.config);
return comm.config;
}
int main_test(int argc, char **argv) {
struct gq_config *config = NULL;
int rc = 0;
int load_context, write_context;
init_syntaxes();
load_context = error_new_context(_("Error loading configfile"));
/* rc = XMLparse(config_tags, NULL, &config, argv[1]); */
config = process_rcfile_XML(load_context, argv[1]);
if (config) {
write_context = error_new_context(_("Error writing configfile"));
save_config_internal(write_context, config, "tmp-conf");
}
return rc;
}
--- NEW FILE: gq-xml.h ---
/*
GQ -- a GTK-based LDAP client
Copyright (C) 1998-2003 Bert Vermeulen
Copyright (C) 2002-2003 by Peter Stamfest
This program is released under the Gnu General Public License with
the additional exemption that compiling, linking, and/or using
OpenSSL is allowed.
This program 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.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Id: gq-xml.h,v 1.1 2003/10/04 06:57:03 stamfest Exp $ */
#ifndef GQ_GQ_XML_H_INCLUDED
#define GQ_GQ_XML_H_INCLUDED
#include "config.h"
#include "configfile.h"
struct gq_config *process_rcfile_XML(int error_context,
const char *filename);
#endif
|
|
From: <bi...@us...> - 2003-10-04 00:58:53
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv8840
Modified Files:
common.h search.c search.h
Log Message:
simple version of history on the searchterm entry box in search mode.
This has no autocompletion.
Index: common.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/common.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** common.h 30 Sep 2003 17:20:25 -0000 1.22
--- common.h 4 Oct 2003 00:58:44 -0000 1.23
***************
*** 38,41 ****
--- 38,42 ----
#define MAX_SERVERNAME_LEN 64
#define MAX_HOSTNAME_LEN 1024
+ #define MAX_SEARCH_HISTORY_LENGTH 10
#define MAX_NUM_ATTRIBUTES 256
Index: search.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** search.c 2 Oct 2003 16:16:26 -0000 1.35
--- search.c 4 Oct 2003 00:58:44 -0000 1.36
***************
*** 59,65 ****
{
GtkWidget *main_clist, *searchmode_vbox, *hbox1, *scrwin;
! GtkWidget *stinput;
! GtkWidget *servcombo, *searchbase_combo;
GtkWidget *findbutton;
struct tab_search *modeinfo;
--- 59,65 ----
{
GtkWidget *main_clist, *searchmode_vbox, *hbox1, *scrwin;
! GtkWidget *searchcombo, *servcombo, *searchbase_combo;
GtkWidget *findbutton;
+ GList *searchhist;
struct tab_search *modeinfo;
***************
*** 68,95 ****
searchmode_vbox = gtk_vbox_new(FALSE, 0);
-
hbox1 = gtk_hbox_new(FALSE, 0);
gtk_widget_show(hbox1);
gtk_box_pack_start(GTK_BOX(searchmode_vbox), hbox1, FALSE, FALSE, 3);
! /* searchterm entry box */
! stinput = gtk_entry_new();
! gtk_widget_show(stinput);
! gtk_signal_connect_object(GTK_OBJECT(stinput), "activate",
GTK_SIGNAL_FUNC(findbutton_pressed_callback),
(gpointer) tab);
! gtk_box_pack_start(GTK_BOX(hbox1), stinput, TRUE, TRUE, 6);
! /* GTK_WIDGET_SET_FLAGS(stinput, GTK_CAN_FOCUS); */
! GTK_WIDGET_SET_FLAGS(stinput, GTK_CAN_DEFAULT);
! GTK_WIDGET_SET_FLAGS(stinput, GTK_RECEIVES_DEFAULT);
! /* yields a warning in gtk2 - FIXME, Maybe has to do with
! GtkNotebook being a NO_WINDOW widget */
! /* gtk_widget_grab_default(stinput); */
! tab->focus = stinput;
/* LDAP server combo box */
servcombo = gtk_combo_new();
fill_serverlist_combo(servcombo);
-
gtk_box_pack_start(GTK_BOX(hbox1), servcombo, FALSE, TRUE, 0);
gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(servcombo)->entry), FALSE);
--- 68,96 ----
searchmode_vbox = gtk_vbox_new(FALSE, 0);
hbox1 = gtk_hbox_new(FALSE, 0);
gtk_widget_show(hbox1);
gtk_box_pack_start(GTK_BOX(searchmode_vbox), hbox1, FALSE, FALSE, 3);
! /* FIXME for now, init this to an empty list -- modeinfo->history needs
! to be initialized from the session save facility when it's available */
! searchhist = modeinfo->history;
!
! /* searchterm combo box */
! searchcombo = gtk_combo_new();
! gtk_combo_disable_activate(GTK_COMBO(searchcombo));
! if(searchhist)
! gtk_combo_set_popdown_strings(GTK_COMBO(searchcombo), searchhist);
! gtk_widget_show(searchcombo);
! GTK_WIDGET_SET_FLAGS(searchcombo, GTK_CAN_FOCUS);
! GTK_WIDGET_SET_FLAGS(searchcombo, GTK_RECEIVES_DEFAULT);
! gtk_box_pack_start(GTK_BOX(hbox1), searchcombo, TRUE, TRUE, 6);
! gtk_signal_connect_object(GTK_OBJECT(GTK_COMBO(searchcombo)->entry), "activate",
GTK_SIGNAL_FUNC(findbutton_pressed_callback),
(gpointer) tab);
! tab->focus = GTK_COMBO(searchcombo)->entry;
/* LDAP server combo box */
servcombo = gtk_combo_new();
fill_serverlist_combo(servcombo);
gtk_box_pack_start(GTK_BOX(hbox1), servcombo, FALSE, TRUE, 0);
gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(servcombo)->entry), FALSE);
***************
*** 241,245 ****
focusbox = tab->focus;
gtk_widget_grab_focus(focusbox);
- gtk_widget_grab_default(focusbox);
gtk_editable_select_region(GTK_EDITABLE(focusbox), 0, -1);
--- 242,245 ----
***************
*** 384,387 ****
--- 384,411 ----
+ void add_to_search_history(struct tab *tab)
+ {
+ gchar *searchterm;
+ GList *list, *last;
+
+ list = SEARCHTAB(tab)->history;
+ searchterm = gtk_editable_get_chars(GTK_EDITABLE(tab->focus), 0, -1);
+ if(list && !strcmp(list->data, searchterm)) {
+ g_free(searchterm);
+ }
+ else {
+ list = g_list_insert_before(list, list, searchterm);
+ if(g_list_length(list) > MAX_SEARCH_HISTORY_LENGTH) {
+ last = g_list_last(list);
+ g_free(last->data);
+ list = g_list_remove(list, last->data);
+ }
+ SEARCHTAB(tab)->history = list;
+ gtk_combo_set_popdown_strings(GTK_COMBO(tab->focus->parent), list);
+ }
+
+ }
+
+
void query(struct tab *tab)
{
***************
*** 408,412 ****
searchterm = gtk_editable_get_chars(GTK_EDITABLE(focusbox), 0, -1);
querystring = encoded_string(searchterm);
- g_free(searchterm);
if(querystring[0] == 0) {
--- 432,435 ----
***************
*** 460,465 ****
}
statusbar_msg(ldap_err2string(msg == -1 ? LDAP_OTHER : msg));
! SEARCHTAB(tab)->search_lock = 0;
close_connection(server, FALSE);
return;
}
--- 483,489 ----
}
statusbar_msg(ldap_err2string(msg == -1 ? LDAP_OTHER : msg));
! g_free(searchterm);
close_connection(server, FALSE);
+ SEARCHTAB(tab)->search_lock = 0;
return;
}
***************
*** 632,635 ****
--- 656,662 ----
if (res) ldap_msgfree(res);
+ add_to_search_history(tab);
+
+ g_free(searchterm);
close_connection(server, FALSE);
Index: search.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** search.h 30 Sep 2003 22:34:50 -0000 1.8
--- search.h 4 Oct 2003 00:58:44 -0000 1.9
***************
*** 39,42 ****
--- 39,43 ----
struct ldapserver *cur_resultset_server;
struct resultset *set;
+ GList *history;
};
***************
*** 54,58 ****
struct attrs *next;
};
-
GtkWidget *new_searchmode(struct tab *tab);
--- 55,58 ----
|
|
From: <sta...@us...> - 2003-10-02 16:16:33
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4328
Modified Files:
browse.c dt_entry.c dt_entry.h dt_generic_binary.c
dt_password.c dt_text.c encode.c errorchain.c formfill.c
formfill.h input.c input.h search.c tinput.c tinput.h util.c
util.h
Log Message:
* gtk2 - Switching to UTF-8, probably not complete
* Added some more "const" keywords where appropriate
Index: browse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/browse.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** browse.c 1 Oct 2003 22:31:06 -0000 1.69
--- browse.c 2 Oct 2003 16:16:25 -0000 1.70
***************
*** 93,97 ****
--- 93,101 ----
{
char **exploded_dn = NULL;
+ #if GTK_MAJOR >= 2
+ const char *labels[] = { NULL, NULL };
+ #else
char *labels[] = { NULL, NULL };
+ #endif
char *dummy[] = { "dummy", NULL };
dn_browse_entry *new_entry;
***************
*** 112,118 ****
--- 116,130 ----
goto fail;
}
+ #if GTK_MAJOR >= 2
+ labels[0] = exploded_dn[0];
+ #else
labels[0] = decoded_string(exploded_dn[0]);
+ #endif
} else {
+ #if GTK_MAJOR >= 2
+ labels[0] = dn;
+ #else
labels[0] = decoded_string(dn);
+ #endif
}
***************
*** 140,144 ****
--- 152,158 ----
fail:
+ #if GTK_MAJOR < 2
if (labels[0]) free(labels[0]);
+ #endif
if (exploded_dn) gq_exploded_free(exploded_dn);
***************
*** 187,190 ****
--- 201,205 ----
}
+ #if GTK_MAJOR < 2
snprintf(message, sizeof(message),
_("onelevel search on %s"),
***************
*** 192,196 ****
if (c) free(c);
!
statusbar_msg(message);
--- 207,214 ----
if (c) free(c);
! #else
! snprintf(message, sizeof(message),
! _("onelevel search on %s"), entry->dn);
! #endif
statusbar_msg(message);
***************
*** 425,436 ****
{
char **exploded_dn = gq_ldap_explode_dn(entry->dn, FALSE);
- char *l = decoded_string(exploded_dn[0]);
char *g;
!
! gq_exploded_free(exploded_dn);
/* impedance match -> malloc to g_malloc */
g = g_strdup(l);
free(l);
return g;
}
--- 443,458 ----
{
char **exploded_dn = gq_ldap_explode_dn(entry->dn, FALSE);
char *g;
! #if GTK_MAJOR >= 2
! g = g_strdup(exploded_dn[0]);
! #else
! char *l = decoded_string(exploded_dn[0]);
/* impedance match -> malloc to g_malloc */
g = g_strdup(l);
free(l);
+ #endif
+ gq_exploded_free(exploded_dn);
+
return g;
}
***************
*** 1120,1127 ****
--- 1142,1153 ----
fill_out_search(search_tab, server, NULL);
} else if (IS_DN_ENTRY(e)) {
+ #if GTK_MAJOR >= 2
+ fill_out_search(search_tab, server, ((dn_browse_entry *)e)->dn);
+ #else
char *dn_dec = decoded_string(((dn_browse_entry *)e)->dn);
fill_out_search(search_tab, server, dn_dec);
if (dn_dec)
free(dn_dec);
+ #endif
}
}
***************
*** 1442,1448 ****
}
!
labels[0] = decoded_string(exploded_dn[0]);
!
/* add a new entry - alternatively we could just set
--- 1468,1476 ----
}
! #if GTK_MAJOR >= 2
! labels[0] = exploded_dn[0];
! #else
labels[0] = decoded_string(exploded_dn[0]);
! #endif
/* add a new entry - alternatively we could just set
***************
*** 1462,1467 ****
e,
(GtkDestroyNotify) destroy_browse_entry);
free(labels[0]);
!
/* add dummy node to have something to expand */
labels[0] = "DUMMY";
--- 1490,1496 ----
e,
(GtkDestroyNotify) destroy_browse_entry);
+ #if GTK_MAJOR < 2
free(labels[0]);
! #endif
/* add dummy node to have something to expand */
labels[0] = "DUMMY";
Index: dt_entry.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_entry.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** dt_entry.c 28 Sep 2003 03:26:25 -0000 1.9
--- dt_entry.c 2 Oct 2003 16:16:25 -0000 1.10
***************
*** 61,66 ****
--- 61,72 ----
bervalLDAPMod
},
+ #if GTK_MAJOR < 2
decode_utf8, /* encode method */
encode_utf8, /* decode method */
+ #else
+ /* gtk2 uses UTF-8 natively! Yipieeh */
+ NULL,
+ NULL,
+ #endif
};
***************
*** 100,103 ****
--- 106,110 ----
}
+ #if GTK_MAJOR < 2
GByteArray *decode_utf8(const char *val, int len)
{
***************
*** 128,131 ****
--- 135,139 ----
return gb;
}
+ #endif
/*
Index: dt_entry.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_entry.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** dt_entry.h 28 Sep 2003 03:26:25 -0000 1.5
--- dt_entry.h 2 Oct 2003 16:16:25 -0000 1.6
***************
*** 52,57 ****
--- 52,59 ----
GtkWidget *widget);
+ #if GTK_MAJOR < 2
GByteArray *encode_utf8(const char *val, int len);
GByteArray *decode_utf8(const char *val, int len);
+ #endif
#endif
Index: dt_generic_binary.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_generic_binary.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** dt_generic_binary.c 29 Sep 2003 19:24:16 -0000 1.9
--- dt_generic_binary.c 2 Oct 2003 16:16:25 -0000 1.10
***************
*** 234,238 ****
GtkWidget *data_widget;
struct formfill *form;
! char *selected_filename =
gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selector));
--- 234,238 ----
GtkWidget *data_widget;
struct formfill *form;
! const char *selected_filename =
gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selector));
***************
*** 336,340 ****
{
GtkWidget *hbox = user_data;
! char *selected_filename =
gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selector));
--- 336,340 ----
{
GtkWidget *hbox = user_data;
! const char *selected_filename =
gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selector));
Index: dt_password.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_password.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** dt_password.c 29 Sep 2003 19:24:16 -0000 1.14
--- dt_password.c 2 Oct 2003 16:16:25 -0000 1.15
***************
*** 101,106 ****
--- 101,112 ----
bervalLDAPMod /* reuse method from dt_entry */
},
+ #if GTK_MAJOR < 2
decode_utf8, /* encode method */ /* reuse method from dt_entry */
encode_utf8, /* decode method */ /* reuse method from dt_entry */
+ #else
+ /* gtk2 uses UTF-8 natively! Yipieeh */
+ NULL,
+ NULL,
+ #endif
};
Index: dt_text.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_text.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** dt_text.c 30 Sep 2003 17:20:25 -0000 1.10
--- dt_text.c 2 Oct 2003 16:16:26 -0000 1.11
***************
*** 70,75 ****
--- 70,81 ----
bervalLDAPMod /* reuse method from dt_entry */
},
+ #if GTK_MAJOR < 2
decode_utf8, /* encode method */ /* reuse method from dt_entry */
encode_utf8, /* decode method */ /* reuse method from dt_entry */
+ #else
+ /* gtk2 uses UTF-8 natively! Yipieeh */
+ NULL,
+ NULL,
+ #endif
};
Index: encode.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/encode.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** encode.c 12 Oct 2002 12:17:08 -0000 1.20
--- encode.c 2 Oct 2003 16:16:26 -0000 1.21
***************
*** 80,86 ****
#else /* HAVE_ICONV */
strncpy(native_string, ldap_string, len);
! *(native_string + len) = 0;
#endif /* HAVE_ICONV */
-
#ifdef DEBUG
if (debug & GQ_DEBUG_ENCODE) {
--- 80,85 ----
#else /* HAVE_ICONV */
strncpy(native_string, ldap_string, len);
! *(native_string + len - 1) = 0;
#endif /* HAVE_ICONV */
#ifdef DEBUG
if (debug & GQ_DEBUG_ENCODE) {
***************
*** 142,145 ****
--- 141,146 ----
{
char *native_string;
+ assert(GTK_MAJOR < 2);
+
if (!string) return NULL;
***************
*** 156,159 ****
--- 157,162 ----
{
char *ldap_string;
+ /* assert(GTK_MAJOR < 2); */
+
if (!string) return NULL;
Index: errorchain.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/errorchain.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** errorchain.c 28 Sep 2002 20:04:14 -0000 1.11
--- errorchain.c 2 Oct 2003 16:16:26 -0000 1.12
***************
*** 230,234 ****
--- 230,240 ----
cur_msg = chain->msgs;
while(cur_msg) {
+ #if GTK_MAJOR >= 2
msg_label = gtk_label_new(cur_msg->msg);
+ #else
+ char *c = decoded_string(cur_msg->msg);
+ msg_label = gtk_label_new(c);
+ if (c) free(c);
+ #endif
gtk_label_set_justify(GTK_LABEL(msg_label), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment(GTK_MISC(msg_label), 0, 0.5);
Index: formfill.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/formfill.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** formfill.c 28 Sep 2003 23:10:50 -0000 1.34
--- formfill.c 2 Oct 2003 16:16:26 -0000 1.35
***************
*** 163,167 ****
}
! GList *formlist_from_entry(struct ldapserver *server, char *dn, int ocvalues_only)
{
GList *formlist;
--- 163,167 ----
}
! GList *formlist_from_entry(struct ldapserver *server, const char *dn, int ocvalues_only)
{
GList *formlist;
***************
*** 174,178 ****
char *attr; /* , **vals; */
struct berval **bervals;
- char *c = NULL;
char *attrs[] = { LDAP_ALL_USER_ATTRIBUTES,
LDAP_ALL_OPERATIONAL_ATTRIBUTES,
--- 174,177 ----
***************
*** 184,190 ****
message = g_string_sized_new(128);
g_string_sprintf(message, _("fetching %s from %s"),
! c = decoded_string(dn), server->name);
! if (c) free(c);
statusbar_msg(message->str);
g_string_free(message, TRUE);
--- 183,197 ----
message = g_string_sized_new(128);
+ #if GTK_MAJOR >= 2
g_string_sprintf(message, _("fetching %s from %s"),
! dn, server->name);
! #else
! {
! char *c = NULL;
! g_string_sprintf(message, _("fetching %s from %s"),
! c = decoded_string(dn), server->name);
! if (c) free(c);
! }
! #endif
statusbar_msg(message->str);
g_string_free(message, TRUE);
Index: formfill.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/formfill.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** formfill.h 28 Sep 2003 23:14:52 -0000 1.25
--- formfill.h 2 Oct 2003 16:16:26 -0000 1.26
***************
*** 108,112 ****
void free_formfill_values(struct formfill *form);
GList *formlist_append(GList *formlist, struct formfill *form);
! GList *formlist_from_entry(struct ldapserver *server, char *dn, int ocvalues_only);
GList *dup_formlist(GList *formlist);
void dump_formlist(GList *formlist);
--- 108,112 ----
void free_formfill_values(struct formfill *form);
GList *formlist_append(GList *formlist, struct formfill *form);
! GList *formlist_from_entry(struct ldapserver *server, const char *dn, int ocvalues_only);
GList *dup_formlist(GList *formlist);
void dump_formlist(GList *formlist);
Index: input.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/input.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** input.c 30 Sep 2003 17:20:25 -0000 1.57
--- input.c 2 Oct 2003 16:16:26 -0000 1.58
***************
*** 573,577 ****
--- 573,579 ----
struct formfill *ff;
int row, row_arrow, vcnt, currcnt;
+ #if GTK_MAJOR < 2
char value[MAX_DN_LEN];
+ #endif
char *decode_buf = NULL;
int decode_buf_allocated = 0;
***************
*** 616,622 ****
gtk_signal_connect_object(GTK_OBJECT(inputbox), "activate",
GTK_SIGNAL_FUNC(iform->activate), (gpointer) iform);
! if(iform->dn)
gtk_entry_set_text(GTK_ENTRY(inputbox),
decode_string(value, iform->dn, strlen(iform->dn)));
gtk_signal_connect(GTK_OBJECT(inputbox), "changed",
--- 618,629 ----
gtk_signal_connect_object(GTK_OBJECT(inputbox), "activate",
GTK_SIGNAL_FUNC(iform->activate), (gpointer) iform);
! if(iform->dn) {
! #if GTK_MAJOR >= 2
! gtk_entry_set_text(GTK_ENTRY(inputbox), iform->dn);
! #else
gtk_entry_set_text(GTK_ENTRY(inputbox),
decode_string(value, iform->dn, strlen(iform->dn)));
+ #endif
+ }
gtk_signal_connect(GTK_OBJECT(inputbox), "changed",
***************
*** 818,833 ****
! void edit_entry(struct ldapserver *server, char *dn)
{
GList *oldlist, *newlist;
! GtkWidget *edit_window, *vbox;
! char *name;
struct inputform *iform;
! edit_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
name = decoded_string(dn);
gtk_window_set_title(GTK_WINDOW(edit_window), name);
free(name);
gtk_widget_set_usize(edit_window, 500, 450);
--- 825,844 ----
! void edit_entry(struct ldapserver *server, const char *dn)
{
GList *oldlist, *newlist;
! GtkWidget *vbox;
struct inputform *iform;
+ GtkWidget* edit_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
! #if GTK_MAJOR >= 2
! gtk_window_set_title(GTK_WINDOW(edit_window), dn);
! #else
! char *name;
name = decoded_string(dn);
gtk_window_set_title(GTK_WINDOW(edit_window), name);
free(name);
+ #endif
gtk_widget_set_usize(edit_window, 500, 450);
***************
*** 872,876 ****
! void new_from_entry(struct ldapserver *server, char *dn)
{
GList *formlist;
--- 883,887 ----
! void new_from_entry(struct ldapserver *server, const char *dn)
{
GList *formlist;
***************
*** 1239,1246 ****
--- 1250,1261 ----
/* prepare message with olddn - in case we change the DN */
message = g_string_sized_new(256);
+ #if GTK_MAJOR >= 2
+ g_string_sprintfa(message, _("modified %s"), iform->olddn);
+ #else
c = decoded_string(iform->olddn);
g_string_sprintfa(message, _("modified %s"), c);
if(c)
free(c);
+ #endif
/* obtain all needed stuff from the iform ASAP, as it might be
***************
*** 1374,1379 ****
g_string_sprintf(message,
_("You can only change the RDN of the DN (%s)"),
! c = decoded_string(oldrdn[0]));
! if (c) free(c);
error_push(context, message->str);
error = 1;
--- 1389,1393 ----
g_string_sprintf(message,
_("You can only change the RDN of the DN (%s)"),
! oldrdn[0]);
error_push(context, message->str);
error = 1;
***************
*** 1384,1391 ****
if(!error) {
g_string_sprintfa(message, _("modifying RDN to %s"),
c = decoded_string(rdn[0]));
- statusbar_msg(message->str);
if (c) free(c);
/* check to see if the rdn exists as an attribute. If it
--- 1398,1409 ----
if(!error) {
+ #if GTK_MAJOR >= 2
+ g_string_sprintfa(message, _("modifying RDN to %s"), rdn[0]);
+ #else
g_string_sprintfa(message, _("modifying RDN to %s"),
c = decoded_string(rdn[0]));
if (c) free(c);
+ #endif
+ statusbar_msg(message->str);
/* check to see if the rdn exists as an attribute. If it
Index: input.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/input.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** input.h 30 Sep 2003 17:20:25 -0000 1.13
--- input.h 2 Oct 2003 16:16:26 -0000 1.14
***************
*** 64,69 ****
void build_or_update_inputform(struct inputform *form, gboolean build);
void build_inputform(struct inputform *iform);
! void edit_entry(struct ldapserver *server, char *dn);
! void new_from_entry(struct ldapserver *server, char *dn);
void update_formlist(struct inputform *iform);
void clear_table(struct inputform *iform);
--- 64,69 ----
void build_or_update_inputform(struct inputform *form, gboolean build);
void build_inputform(struct inputform *iform);
! void edit_entry(struct ldapserver *server, const char *dn);
! void new_from_entry(struct ldapserver *server, const char *dn);
void update_formlist(struct inputform *iform);
void clear_table(struct inputform *iform);
Index: search.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** search.c 30 Sep 2003 22:34:49 -0000 1.34
--- search.c 2 Oct 2003 16:16:26 -0000 1.35
***************
*** 535,541 ****
--- 535,545 ----
if(config.showdn) {
+ #if GTK_MAJOR >= 2
+ strcpy(tolist[0], dn);
+ #else
decoded_value = decoded_string(dn);
strcpy(tolist[0], decoded_value);
free(decoded_value);
+ #endif
cl[0] = tolist[0];
}
***************
*** 568,571 ****
--- 572,583 ----
/* that's an awful lot of mallocs in the innermost loop,
but then we don't want to count on max valuelen either */
+ #if GTK_MAJOR >= 2
+ if(i == 0)
+ strcpy(tolist[cur_col], vals[i]);
+ else {
+ strcat(tolist[cur_col], " ");
+ strcat(tolist[cur_col], vals[i]);
+ }
+ #else
decoded_value = decoded_string(vals[i]);
if(i == 0)
***************
*** 576,579 ****
--- 588,592 ----
}
free(decoded_value);
+ #endif
}
ldap_value_free(vals);
Index: tinput.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/tinput.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** tinput.c 13 Jul 2002 16:47:39 -0000 1.39
--- tinput.c 2 Oct 2003 16:16:26 -0000 1.40
***************
*** 92,96 ****
* fetch objectclasses in entry from server and build GList of formfill with it
*/
! GList *formfill_from_entry_objectclass(struct ldapserver *server, char *dn)
{
GList *formlist, *oclist, *tmplist;
--- 92,96 ----
* fetch objectclasses in entry from server and build GList of formfill with it
*/
! GList *formfill_from_entry_objectclass(struct ldapserver *server, const char *dn)
{
GList *formlist, *oclist, *tmplist;
Index: tinput.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/tinput.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** tinput.h 29 Sep 2003 19:24:17 -0000 1.13
--- tinput.h 2 Oct 2003 16:16:26 -0000 1.14
***************
*** 32,36 ****
GList *formfill_from_template(struct ldapserver *schemaserver, struct gq_template *template);
! GList *formfill_from_entry_objectclass(struct ldapserver *server, char *dn);
GList *add_attrs_by_oc(struct ldapserver *server, GList *oclist);
GList *add_schema_attrs(struct ldapserver *server, GList *value_list);
--- 32,36 ----
GList *formfill_from_template(struct ldapserver *schemaserver, struct gq_template *template);
! GList *formfill_from_entry_objectclass(struct ldapserver *server, const char *dn);
GList *add_attrs_by_oc(struct ldapserver *server, GList *oclist);
GList *add_schema_attrs(struct ldapserver *server, GList *value_list);
Index: util.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/util.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** util.c 1 Oct 2003 22:32:34 -0000 1.59
--- util.c 2 Oct 2003 16:16:26 -0000 1.60
***************
*** 723,727 ****
* GTK event queue
*/
! void statusbar_msg(char *message)
{
if(!context)
--- 723,727 ----
* GTK event queue
*/
! void statusbar_msg(const char *message)
{
if(!context)
***************
*** 741,747 ****
* display message in main window's statusbar, and flushes the
* GTK event queue, UTF-8 version
*/
! void statusbar_msg_utf8(char *message)
{
int len = strlen(message);
char *buf = g_malloc(len + 10);
--- 741,751 ----
* display message in main window's statusbar, and flushes the
* GTK event queue, UTF-8 version
+ *
*/
! void statusbar_msg_utf8(const char *message)
{
+ #if GTK_MAJOR >= 2
+ statusbar_msg(message);
+ #else
int len = strlen(message);
char *buf = g_malloc(len + 10);
***************
*** 762,765 ****
--- 766,770 ----
g_free(buf);
+ #endif
}
Index: util.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/util.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** util.h 30 Sep 2003 17:20:26 -0000 1.21
--- util.h 2 Oct 2003 16:16:26 -0000 1.22
***************
*** 66,70 ****
const gpointer detokenize_data(struct tokenlist *list, int token);
char *get_username(void);
! void statusbar_msg(char *message);
struct ldapserver *server_by_name(const char *name);
int is_leaf_entry(struct ldapserver *server, char *dn);
--- 66,70 ----
const gpointer detokenize_data(struct tokenlist *list, int token);
char *get_username(void);
! void statusbar_msg(const char *message);
struct ldapserver *server_by_name(const char *name);
int is_leaf_entry(struct ldapserver *server, char *dn);
|
|
From: <sta...@us...> - 2003-10-01 22:32:38
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv305
Modified Files:
util.c
Log Message:
* Filter out Mnemonics for gtk1
Index: util.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/util.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** util.c 30 Sep 2003 17:20:26 -0000 1.58
--- util.c 1 Oct 2003 22:32:34 -0000 1.59
***************
*** 1626,1631 ****
#else
gchar *text;
gtk_label_get(GTK_LABEL(label), &text);
! gtk_label_parse_uline(GTK_LABEL(label), text);
#endif
return label;
--- 1626,1658 ----
#else
gchar *text;
+ gchar *c, *d, *f;
+ gboolean underscore_seen = FALSE;
+
gtk_label_get(GTK_LABEL(label), &text);
! f = d = g_malloc(strlen(text) + 1);
!
!
! /* PS: AFAIK gtk1 does not support mnemonics out of the
! box. Thus, for the time being, we will filter out the gtk2
! style underline notation from labels used to denote the
! mnemonic */
!
! for (c = text ; *c ; c++) {
! if (underscore_seen) {
! *d++ = *c;
! underscore_seen = FALSE;
! continue;
! } else if (*c == '_') {
! underscore_seen = TRUE;
! continue;
! } else {
! *d++ = *c;
! }
! }
! *d++ = 0;
!
! gtk_label_set(GTK_LABEL(label), f);
! g_free(f);
! /* gtk_label_parse_uline(GTK_LABEL(label), text); */
#endif
return label;
|
|
From: <sta...@us...> - 2003-10-01 22:32:02
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv32699
Modified Files:
gq.c
Log Message:
* Support for transparent conversion of i18n messages to UTF-8
Index: gq.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/gq.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** gq.c 28 Sep 2003 23:10:50 -0000 1.15
--- gq.c 1 Oct 2003 22:31:57 -0000 1.16
***************
*** 82,89 ****
bindtextdomain(PACKAGE, LOCALEDIR);
! /* I think the following will be required for gtk 2 (Isn't UTF-8
! the standard for widget texts there? - this will allow to have
! the messages in UTF-8) */
! /* bind_textdomain_codeset(PACKAGE, LDAP_CODESET); */
gtk_set_locale();
--- 82,89 ----
bindtextdomain(PACKAGE, LOCALEDIR);
!
! #if GTK_MAJOR >= 2
! bind_textdomain_codeset(PACKAGE, "UTF-8");
! #endif
gtk_set_locale();
|
|
From: <sta...@us...> - 2003-10-01 22:31:10
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv32476
Modified Files:
browse.c browse.h
Log Message:
* Added the pane2_vbox to the modeinfo - this was data not even stored
in the modehash, but rather as object data!
Index: browse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/browse.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** browse.c 30 Sep 2003 17:20:25 -0000 1.68
--- browse.c 1 Oct 2003 22:31:06 -0000 1.69
***************
*** 393,397 ****
pane2_vbox = gtk_vbox_new(FALSE, 2);
iform->target_vbox = pane2_vbox;
! gtk_object_set_data(GTK_OBJECT(pane2_scrwin), "vbox", pane2_vbox);
gtk_widget_show(pane2_vbox);
gtk_widget_set_parent_window(pane2_vbox, (GdkWindow *) mainwin);
--- 393,398 ----
pane2_vbox = gtk_vbox_new(FALSE, 2);
iform->target_vbox = pane2_vbox;
! BROWSETAB(tab)->pane2_vbox = pane2_vbox;
!
gtk_widget_show(pane2_vbox);
gtk_widget_set_parent_window(pane2_vbox, (GdkWindow *) mainwin);
***************
*** 554,558 ****
pane2_scrwin = BROWSETAB(tab)->pane2_scrwin;
! pane2_vbox = gtk_object_get_data(GTK_OBJECT(pane2_scrwin), "vbox");
/* gtk_widget_destroy(pane2_vbox); */
/* remove the viewport of the scrolled window. This should
--- 555,560 ----
pane2_scrwin = BROWSETAB(tab)->pane2_scrwin;
! pane2_vbox = BROWSETAB(tab)->pane2_vbox;
!
/* gtk_widget_destroy(pane2_vbox); */
/* remove the viewport of the scrolled window. This should
***************
*** 565,569 ****
pane2_vbox = gtk_vbox_new(FALSE, 2);
! gtk_object_set_data(GTK_OBJECT(pane2_scrwin), "vbox", pane2_vbox);
gtk_widget_show(pane2_vbox);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pane2_scrwin),
--- 567,572 ----
pane2_vbox = gtk_vbox_new(FALSE, 2);
! BROWSETAB(tab)->pane2_vbox = pane2_vbox;
!
gtk_widget_show(pane2_vbox);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pane2_scrwin),
***************
*** 1016,1019 ****
--- 1019,1025 ----
/* avoid recursive calls to this handler - this causes crashes!!! */
+ /* This is a legitimate use of
+ gtk_object_set_data/gtk_object_get_data */
+
if (gtk_object_get_data(GTK_OBJECT(ctree), "in-tree_row_selected")) {
#if GTK_MAJOR >= 2
***************
*** 1240,1244 ****
pane2_vbox = gtk_vbox_new(FALSE, 5);
gtk_widget_show(pane2_vbox);
! gtk_object_set_data(GTK_OBJECT(pane2_scrwin), "vbox", pane2_vbox);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pane2_scrwin), pane2_vbox);
--- 1246,1251 ----
pane2_vbox = gtk_vbox_new(FALSE, 5);
gtk_widget_show(pane2_vbox);
! modeinfo->pane2_vbox = pane2_vbox;
!
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pane2_scrwin), pane2_vbox);
Index: browse.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/browse.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** browse.h 28 Sep 2003 23:39:18 -0000 1.25
--- browse.h 1 Oct 2003 22:31:06 -0000 1.26
***************
*** 35,38 ****
--- 35,39 ----
GtkWidget *ctree_refresh; /* XXX try to get rid of this */
GtkWidget *pane2_scrwin;
+ GtkWidget *pane2_vbox;
GtkCTreeNode *tree_row_selected;
struct inputform *inputform;
|
|
From: <bi...@us...> - 2003-09-30 22:34:58
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv16913/src
Modified Files:
filter.c search.c search.h
Log Message:
- moved filter generation out to a separate function
- when adding new filters from the search bar, non-LDAP-filter queries
are now also transformed into a valid filter, and saved that way
- an '=' anywhere in the search string also is now transformed into a valid
LDAP filter
Index: filter.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/filter.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** filter.c 30 Sep 2003 17:20:25 -0000 1.17
--- filter.c 30 Sep 2003 22:34:49 -0000 1.18
***************
*** 75,81 ****
GList *filterlist;
struct gq_filter *filter;
struct tab *tab;
int tabnum;
! char *searchstring, *servername, *searchbase, msg[192];
const char *filtername;
--- 75,82 ----
GList *filterlist;
struct gq_filter *filter;
+ struct ldapserver *server;
struct tab *tab;
int tabnum;
! char *filterstring, *searchstring, *servername, *searchbase, msg[192];
const char *filtername;
***************
*** 88,91 ****
--- 89,99 ----
return;
+ server_combo = SEARCHTAB(tab)->serverlist_combo;
+ servername = gtk_editable_get_chars(GTK_EDITABLE(GTK_COMBO(server_combo)->entry), 0, -1);
+ if( (server = server_by_name(servername)) == NULL) {
+ g_free(servername);
+ return;
+ }
+
focusbox = tab->focus;
searchstring = gtk_editable_get_chars(GTK_EDITABLE(focusbox), 0, -1);
***************
*** 97,106 ****
}
! /* only accept real filters -- this could be constructed like in search mode though */
! if(searchstring[0] != '(') {
! single_warning_popup(_("You must enter a valid filter"));
! g_free(searchstring);
! return;
! }
if(filternamebox == NULL) {
--- 105,110 ----
}
! filterstring = make_filter(server, searchstring);
! g_free(searchstring);
if(filternamebox == NULL) {
***************
*** 133,145 ****
filter = new_filter();
strncpy(filter->name, filtername, MAX_FILTERNAME_LEN - 1);
! strncpy(filter->ldapfilter, searchstring, MAX_LDAPFILTER_LEN - 1);
! g_free(searchstring);
/* check state of Remember... button, and get servername/basedn if active */
button = gtk_object_get_data(GTK_OBJECT(filternamebox), "saveserver");
if(GTK_TOGGLE_BUTTON(button)->active) {
- server_combo = SEARCHTAB(tab)->serverlist_combo;
- servername = gtk_editable_get_chars(GTK_EDITABLE(GTK_COMBO(server_combo)->entry), 0, -1);
-
searchbase_combo = SEARCHTAB(tab)->searchbase_combo;
searchbase = gtk_editable_get_chars(GTK_EDITABLE(GTK_COMBO(searchbase_combo)->entry), 0, -1);
--- 137,146 ----
filter = new_filter();
strncpy(filter->name, filtername, MAX_FILTERNAME_LEN - 1);
! strncpy(filter->ldapfilter, filterstring, MAX_LDAPFILTER_LEN - 1);
! free(filterstring);
/* check state of Remember... button, and get servername/basedn if active */
button = gtk_object_get_data(GTK_OBJECT(filternamebox), "saveserver");
if(GTK_TOGGLE_BUTTON(button)->active) {
searchbase_combo = SEARCHTAB(tab)->searchbase_combo;
searchbase = gtk_editable_get_chars(GTK_EDITABLE(GTK_COMBO(searchbase_combo)->entry), 0, -1);
Index: search.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** search.c 30 Sep 2003 17:20:25 -0000 1.33
--- search.c 30 Sep 2003 22:34:49 -0000 1.34
***************
*** 350,353 ****
--- 350,387 ----
+ char *make_filter(struct ldapserver *server, char *querystring)
+ {
+ char *filter;
+
+ filter = malloc(MAX_LDAPFILTER_LEN);
+
+ if(querystring[0] == '(') {
+ strncpy(filter, querystring, MAX_LDAPFILTER_LEN - 1);
+ }
+ else if(strchr(querystring, '=')) {
+ snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s)", querystring);
+ }
+ else {
+ switch(config.search_argument) {
+ case SEARCHARG_BEGINS_WITH:
+ snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s*)", server->searchattr, querystring);
+ break;
+ case SEARCHARG_ENDS_WITH:
+ snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=*%s)", server->searchattr, querystring);
+ break;
+ case SEARCHARG_CONTAINS:
+ snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=*%s*)", server->searchattr, querystring);
+ break;
+ case SEARCHARG_EQUALS:
+ snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s)", server->searchattr, querystring);
+ break;
+ };
+ }
+ filter[MAX_LDAPFILTER_LEN - 1] = 0;
+
+ return(filter);
+ }
+
+
void query(struct tab *tab)
{
***************
*** 362,367 ****
gchar *cur_servername, *cur_searchbase, *enc_searchbase, *querystring, *cl[MAX_NUM_ATTRIBUTES];
char tolist[MAX_NUM_ATTRIBUTES][128], message[MAX_LDAPFILTER_LEN + 128];
! char filter[MAX_LDAPFILTER_LEN];
! char *attr, *dn, **vals, *searchterm, *decoded_value;
int msg, rc, i, row;
int cur_col, oc_col, columns_done[MAX_NUM_ATTRIBUTES];
--- 396,400 ----
gchar *cur_servername, *cur_searchbase, *enc_searchbase, *querystring, *cl[MAX_NUM_ATTRIBUTES];
char tolist[MAX_NUM_ATTRIBUTES][128], message[MAX_LDAPFILTER_LEN + 128];
! char *filter, *attr, *dn, **vals, *searchterm, *decoded_value;
int msg, rc, i, row;
int cur_col, oc_col, columns_done[MAX_NUM_ATTRIBUTES];
***************
*** 401,425 ****
}
! /* construct filter */
! if(querystring[0] == '(') {
! strncpy(filter, querystring, MAX_LDAPFILTER_LEN - 1);
! }
! else {
! switch(config.search_argument) {
! case SEARCHARG_BEGINS_WITH:
! snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s*)", server->searchattr, querystring);
! break;
! case SEARCHARG_ENDS_WITH:
! snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=*%s)", server->searchattr, querystring);
! break;
! case SEARCHARG_CONTAINS:
! snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=*%s*)", server->searchattr, querystring);
! break;
! case SEARCHARG_EQUALS:
! snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s)", server->searchattr, querystring);
! break;
! };
! }
!
free(querystring);
--- 434,438 ----
}
! filter = make_filter(server, querystring);
free(querystring);
***************
*** 440,443 ****
--- 453,457 ----
g_free(cur_searchbase);
if (enc_searchbase) free(enc_searchbase);
+ free(filter);
if((config.sort_search && msg != LDAP_SUCCESS) || msg == -1) {
Index: search.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** search.h 29 Sep 2003 17:33:34 -0000 1.7
--- search.h 30 Sep 2003 22:34:50 -0000 1.8
***************
*** 69,72 ****
--- 69,73 ----
void free_cur_attrs(struct attrs *attrlist);
+ char *make_filter(struct ldapserver *server, char *querystring);
void query(struct tab *tab);
|
|
From: <sta...@us...> - 2003-09-30 17:20:34
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11957/src
Modified Files:
COPYING.h Makefile.am browse.c common.h dt_jpeg.c dt_text.c
dt_text.h dtutil.c dtutil.h filter.c input.c input.h mainwin.c
mainwin.h prefs.c search.c util.c util.h
Log Message:
* Fixed many small bugs wrt gtk2, cleanups
* Ported the dt_text to gtk2 and GtkTextView
* Added keyboard mnemonics in a-great-many-places. Needs to be
fixed so that for gtk 1.2 those underlines do not show up
* Fixed the Filter Window
* Almost fixed the License Window (but not quite)
* Changed COPYING.h and introduced COPYING.c
(autogenerated). COPYING.c gets built from the top-level COPYING
file.
Index: COPYING.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/COPYING.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** COPYING.h 29 Sep 2003 19:24:14 -0000 1.6
--- COPYING.h 30 Sep 2003 17:20:25 -0000 1.7
***************
*** 1,350 ****
! char *license = "\n\
! GQ -- a GTK-based LDAP client\n\
! Copyright (C) 1998-2003 Bert Vermeulen\n\
! Parts: Copyright (C) 2002-2003 Peter Stamfest and Bert Vermeulen\n\
! \n\
! This program is released under the Gnu General Public License with\n\
! the additional exemption that compiling, linking, and/or using\n\
! OpenSSL is allowed.\n\
! \n\
! GNU GENERAL PUBLIC LICENSE\n\
! Version 2, June 1991\n\
! \n\
! Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n\
! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\
! Everyone is permitted to copy and distribute verbatim copies\n\
! of this license document, but changing it is not allowed.\n\
! \n\
! Preamble\n\
! \n\
! The licenses for most software are designed to take away your\n\
! freedom to share and change it. By contrast, the GNU General Public\n\
! License is intended to guarantee your freedom to share and change free\n\
! software--to make sure the software is free for all its users. This\n\
! General Public License applies to most of the Free Software\n\
! Foundation's software and to any other program whose authors commit to\n\
! using it. (Some other Free Software Foundation software is covered by\n\
! the GNU Library General Public License instead.) You can apply it to\n\
! your programs, too.\n\
! \n\
! When we speak of free software, we are referring to freedom, not\n\
! price. Our General Public Licenses are designed to make sure that you\n\
! have the freedom to distribute copies of free software (and charge for\n\
! this service if you wish), that you receive source code or can get it\n\
! if you want it, that you can change the software or use pieces of it\n\
! in new free programs; and that you know you can do these things.\n\
! \n\
! To protect your rights, we need to make restrictions that forbid\n\
! anyone to deny you these rights or to ask you to surrender the rights.\n\
! These restrictions translate to certain responsibilities for you if you\n\
! distribute copies of the software, or if you modify it.\n\
! \n\
! For example, if you distribute copies of such a program, whether\n\
! gratis or for a fee, you must give the recipients all the rights that\n\
! you have. You must make sure that they, too, receive or can get the\n\
! source code. And you must show them these terms so they know their\n\
! rights.\n\
! \n\
! We protect your rights with two steps: (1) copyright the software, and\n\
! (2) offer you this license which gives you legal permission to copy,\n\
! distribute and/or modify the software.\n\
! \n\
! Also, for each author's protection and ours, we want to make certain\n\
! that everyone understands that there is no warranty for this free\n\
! software. If the software is modified by someone else and passed on, we\n\
! want its recipients to know that what they have is not the original, so\n\
! that any problems introduced by others will not reflect on the original\n\
! authors' reputations.\n\
! \n\
! Finally, any free program is threatened constantly by software\n\
! patents. We wish to avoid the danger that redistributors of a free\n\
! program will individually obtain patent licenses, in effect making the\n\
! program proprietary. To prevent this, we have made it clear that any\n\
! patent must be licensed for everyone's free use or not licensed at all.\n\
! \n\
! The precise terms and conditions for copying, distribution and\n\
! modification follow.\n\
! \n\
! GNU GENERAL PUBLIC LICENSE\n\
! TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\
! \n\
! 0. This License applies to any program or other work which contains\n\
! a notice placed by the copyright holder saying it may be distributed\n\
! under the terms of this General Public License. The \"Program\", below,\n\
! refers to any such program or work, and a \"work based on the Program\"\n\
! means either the Program or any derivative work under copyright law:\n\
! that is to say, a work containing the Program or a portion of it,\n\
! either verbatim or with modifications and/or translated into another\n\
! language. (Hereinafter, translation is included without limitation in\n\
! the term \"modification\".) Each licensee is addressed as \"you\".\n\
! \n\
! Activities other than copying, distribution and modification are not\n\
! covered by this License; they are outside its scope. The act of\n\
! running the Program is not restricted, and the output from the Program\n\
! is covered only if its contents constitute a work based on the\n\
! Program (independent of having been made by running the Program).\n\
! Whether that is true depends on what the Program does.\n\
! \n\
! 1. You may copy and distribute verbatim copies of the Program's\n\
! source code as you receive it, in any medium, provided that you\n\
! conspicuously and appropriately publish on each copy an appropriate\n\
! copyright notice and disclaimer of warranty; keep intact all the\n\
! notices that refer to this License and to the absence of any warranty;\n\
! and give any other recipients of the Program a copy of this License\n\
! along with the Program.\n\
! \n\
! You may charge a fee for the physical act of transferring a copy, and\n\
! you may at your option offer warranty protection in exchange for a fee.\n\
! \n\
! 2. You may modify your copy or copies of the Program or any portion\n\
! of it, thus forming a work based on the Program, and copy and\n\
! distribute such modifications or work under the terms of Section 1\n\
! above, provided that you also meet all of these conditions:\n\
! \n\
! a) You must cause the modified files to carry prominent notices\n\
! stating that you changed the files and the date of any change.\n\
! \n\
! b) You must cause any work that you distribute or publish, that in\n\
! whole or in part contains or is derived from the Program or any\n\
! part thereof, to be licensed as a whole at no charge to all third\n\
! parties under the terms of this License.\n\
! \n\
! c) If the modified program normally reads commands interactively\n\
! when run, you must cause it, when started running for such\n\
! interactive use in the most ordinary way, to print or display an\n\
! announcement including an appropriate copyright notice and a\n\
! notice that there is no warranty (or else, saying that you provide\n\
! a warranty) and that users may redistribute the program under\n\
! these conditions, and telling the user how to view a copy of this\n\
! License. (Exception: if the Program itself is interactive but\n\
! does not normally print such an announcement, your work based on\n\
! the Program is not required to print an announcement.)\n\
! \n\
! These requirements apply to the modified work as a whole. If\n\
! identifiable sections of that work are not derived from the Program,\n\
! and can be reasonably considered independent and separate works in\n\
! themselves, then this License, and its terms, do not apply to those\n\
! sections when you distribute them as separate works. But when you\n\
! distribute the same sections as part of a whole which is a work based\n\
! on the Program, the distribution of the whole must be on the terms of\n\
! this License, whose permissions for other licensees extend to the\n\
! entire whole, and thus to each and every part regardless of who wrote it.\n\
! \n\
! Thus, it is not the intent of this section to claim rights or contest\n\
! your rights to work written entirely by you; rather, the intent is to\n\
! exercise the right to control the distribution of derivative or\n\
! collective works based on the Program.\n\
! \n\
! In addition, mere aggregation of another work not based on the Program\n\
! with the Program (or with a work based on the Program) on a volume of\n\
! a storage or distribution medium does not bring the other work under\n\
! the scope of this License.\n\
! \n\
! 3. You may copy and distribute the Program (or a work based on it,\n\
! under Section 2) in object code or executable form under the terms of\n\
! Sections 1 and 2 above provided that you also do one of the following:\n\
! \n\
! a) Accompany it with the complete corresponding machine-readable\n\
! source code, which must be distributed under the terms of Sections\n\
! 1 and 2 above on a medium customarily used for software interchange; or,\n\
! \n\
! b) Accompany it with a written offer, valid for at least three\n\
! years, to give any third party, for a charge no more than your\n\
! cost of physically performing source distribution, a complete\n\
! machine-readable copy of the corresponding source code, to be\n\
! distributed under the terms of Sections 1 and 2 above on a medium\n\
! customarily used for software interchange; or,\n\
! \n\
! c) Accompany it with the information you received as to the offer\n\
! to distribute corresponding source code. (This alternative is\n\
! allowed only for noncommercial distribution and only if you\n\
! received the program in object code or executable form with such\n\
! an offer, in accord with Subsection b above.)\n\
! \n\
! The source code for a work means the preferred form of the work for\n\
! making modifications to it. For an executable work, complete source\n\
! code means all the source code for all modules it contains, plus any\n\
! associated interface definition files, plus the scripts used to\n\
! control compilation and installation of the executable. However, as a\n\
! special exception, the source code distributed need not include\n\
! anything that is normally distributed (in either source or binary\n\
! form) with the major components (compiler, kernel, and so on) of the\n\
! operating system on which the executable runs, unless that component\n\
! itself accompanies the executable.\n\
! \n\
! If distribution of executable or object code is made by offering\n\
! access to copy from a designated place, then offering equivalent\n\
! access to copy the source code from the same place counts as\n\
! distribution of the source code, even though third parties are not\n\
! compelled to copy the source along with the object code.\n\
! \n\
! 4. You may not copy, modify, sublicense, or distribute the Program\n\
! except as expressly provided under this License. Any attempt\n\
! otherwise to copy, modify, sublicense or distribute the Program is\n\
! void, and will automatically terminate your rights under this License.\n\
! However, parties who have received copies, or rights, from you under\n\
! this License will not have their licenses terminated so long as such\n\
! parties remain in full compliance.\n\
! \n\
! 5. You are not required to accept this License, since you have not\n\
! signed it. However, nothing else grants you permission to modify or\n\
! distribute the Program or its derivative works. These actions are\n\
! prohibited by law if you do not accept this License. Therefore, by\n\
! modifying or distributing the Program (or any work based on the\n\
! Program), you indicate your acceptance of this License to do so, and\n\
! all its terms and conditions for copying, distributing or modifying\n\
! the Program or works based on it.\n\
! \n\
! 6. Each time you redistribute the Program (or any work based on the\n\
! Program), the recipient automatically receives a license from the\n\
! original licensor to copy, distribute or modify the Program subject to\n\
! these terms and conditions. You may not impose any further\n\
! restrictions on the recipients' exercise of the rights granted herein.\n\
! You are not responsible for enforcing compliance by third parties to\n\
! this License.\n\
! \n\
! 7. If, as a consequence of a court judgment or allegation of patent\n\
! infringement or for any other reason (not limited to patent issues),\n\
! conditions are imposed on you (whether by court order, agreement or\n\
! otherwise) that contradict the conditions of this License, they do not\n\
! excuse you from the conditions of this License. If you cannot\n\
! distribute so as to satisfy simultaneously your obligations under this\n\
! License and any other pertinent obligations, then as a consequence you\n\
! may not distribute the Program at all. For example, if a patent\n\
! license would not permit royalty-free redistribution of the Program by\n\
! all those who receive copies directly or indirectly through you, then\n\
! the only way you could satisfy both it and this License would be to\n\
! refrain entirely from distribution of the Program.\n\
! \n\
! If any portion of this section is held invalid or unenforceable under\n\
! any particular circumstance, the balance of the section is intended to\n\
! apply and the section as a whole is intended to apply in other\n\
! circumstances.\n\
! \n\
! It is not the purpose of this section to induce you to infringe any\n\
! patents or other property right claims or to contest validity of any\n\
! such claims; this section has the sole purpose of protecting the\n\
! integrity of the free software distribution system, which is\n\
! implemented by public license practices. Many people have made\n\
! generous contributions to the wide range of software distributed\n\
! through that system in reliance on consistent application of that\n\
! system; it is up to the author/donor to decide if he or she is willing\n\
! to distribute software through any other system and a licensee cannot\n\
! impose that choice.\n\
! \n\
! This section is intended to make thoroughly clear what is believed to\n\
! be a consequence of the rest of this License.\n\
! \n\
! 8. If the distribution and/or use of the Program is restricted in\n\
! certain countries either by patents or by copyrighted interfaces, the\n\
! original copyright holder who places the Program under this License\n\
! may add an explicit geographical distribution limitation excluding\n\
! those countries, so that distribution is permitted only in or among\n\
! countries not thus excluded. In such case, this License incorporates\n\
! the limitation as if written in the body of this License.\n\
! \n\
! 9. The Free Software Foundation may publish revised and/or new versions\n\
! of the General Public License from time to time. Such new versions will\n\
! be similar in spirit to the present version, but may differ in detail to\n\
! address new problems or concerns.\n\
! \n\
! Each version is given a distinguishing version number. If the Program\n\
! specifies a version number of this License which applies to it and \"any\n\
! later version\", you have the option of following the terms and conditions\n\
! either of that version or of any later version published by the Free\n\
! Software Foundation. If the Program does not specify a version number of\n\
! this License, you may choose any version ever published by the Free Software\n\
! Foundation.\n\
! \n\
! 10. If you wish to incorporate parts of the Program into other free\n\
! programs whose distribution conditions are different, write to the author\n\
! to ask for permission. For software which is copyrighted by the Free\n\
! Software Foundation, write to the Free Software Foundation; we sometimes\n\
! make exceptions for this. Our decision will be guided by the two goals\n\
! of preserving the free status of all derivatives of our free software and\n\
! of promoting the sharing and reuse of software generally.\n\
! \n\
! NO WARRANTY\n\
! \n\
! 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n\
! FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n\
! OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n\
! PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n\
! OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\
! MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n\
! TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n\
! PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n\
! REPAIR OR CORRECTION.\n\
! \n\
! 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n\
! WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n\
! REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n\
! INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n\
! OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n\
! TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n\
! YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n\
! PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n\
! POSSIBILITY OF SUCH DAMAGES.\n\
! \n\
! END OF TERMS AND CONDITIONS\n\
! \n\
! How to Apply These Terms to Your New Programs\n\
! \n\
! If you develop a new program, and you want it to be of the greatest\n\
! possible use to the public, the best way to achieve this is to make it\n\
! free software which everyone can redistribute and change under these terms.\n\
! \n\
! To do so, attach the following notices to the program. It is safest\n\
! to attach them to the start of each source file to most effectively\n\
! convey the exclusion of warranty; and each file should have at least\n\
! the \"copyright\" line and a pointer to where the full notice is found.\n\
! \n\
! <one line to give the program's name and a brief idea of what it does.>\n\
! Copyright (C) 19yy <name of author>\n\
! \n\
! This program is free software; you can redistribute it and/or modify\n\
! it under the terms of the GNU General Public License as published by\n\
! the Free Software Foundation; either version 2 of the License, or\n\
! (at your option) any later version.\n\
! \n\
! This program is distributed in the hope that it will be useful,\n\
! but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
! GNU General Public License for more details.\n\
! \n\
! You should have received a copy of the GNU General Public License\n\
! along with this program; if not, write to the Free Software\n\
! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\
! \n\
! \n\
! Also add information on how to contact you by electronic and paper mail.\n\
! \n\
! If the program is interactive, make it output a short notice like this\n\
! when it starts in an interactive mode:\n\
! \n\
! Gnomovision version 69, Copyright (C) 19yy name of author\n\
! Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n\
! This is free software, and you are welcome to redistribute it\n\
! under certain conditions; type `show c' for details.\n\
! \n\
! The hypothetical commands `show w' and `show c' should show the appropriate\n\
! parts of the General Public License. Of course, the commands you use may\n\
! be called something other than `show w' and `show c'; they could even be\n\
! mouse-clicks or menu items--whatever suits your program.\n\
! \n\
! You should also get your employer (if you work as a programmer) or your\n\
! school, if any, to sign a \"copyright disclaimer\" for the program, if\n\
! necessary. Here is a sample; alter the names:\n\
! \n\
! Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n\
! `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\
! \n\
! <signature of Ty Coon>, 1 April 1989\n\
! Ty Coon, President of Vice\n\
! \n\
! This General Public License does not permit incorporating your program into\n\
! proprietary programs. If your program is a subroutine library, you may\n\
! consider it more useful to permit linking proprietary applications with the\n\
! library. If this is what you want to do, use the GNU Library General\n\
! Public License instead of this License.\n\
! ";
--- 1,32 ----
! /*
! GQ -- a GTK-based LDAP client
! Copyright (C) 1998-2003 Bert Vermeulen
! Copyright (C) 2002-2003 by Peter Stamfest
!
! This program is released under the Gnu General Public License with
! the additional exemption that compiling, linking, and/or using
! OpenSSL is allowed.
!
! This program 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.
!
! This program 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 this program; if not, write to the Free Software
! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! /* $Id$ */
!
! #ifndef DT_COPYING_H_INCLUDED
! #define DT_COPYING_H_INCLUDED
!
! extern const char *license;
!
! #endif /* DT_COPYING_H_INCLUDED */
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gqclient/gq/src/Makefile.am,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** Makefile.am 29 Sep 2003 19:24:15 -0000 1.24
--- Makefile.am 30 Sep 2003 17:20:25 -0000 1.25
***************
*** 42,45 ****
--- 42,47 ----
i18n.c
+ gq_LDADD = COPYING.o
+
noinst_HEADERS = \
mainwin.h \
***************
*** 100,102 ****
test-clean:
! rm -f TEST-*.c TEST-*.o
\ No newline at end of file
--- 102,109 ----
test-clean:
! rm -f TEST-*.c TEST-*.o
!
! COPYING.c: $(top_srcdir)/COPYING
! ( echo "const char *license =" ; \
! sed -e 's/\(["\\]\)/\\\1/g' -e 's/^/ "/' -e 's/$$/\\n"/' < $< ;\
! echo ";" ) > $@
Index: browse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/browse.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** browse.c 29 Sep 2003 19:24:15 -0000 1.67
--- browse.c 30 Sep 2003 17:20:25 -0000 1.68
***************
*** 1017,1022 ****
--- 1017,1027 ----
/* avoid recursive calls to this handler - this causes crashes!!! */
if (gtk_object_get_data(GTK_OBJECT(ctree), "in-tree_row_selected")) {
+ #if GTK_MAJOR >= 2
g_signal_stop_emission_by_name(GTK_OBJECT(ctree),
"tree-select-row");
+ #else
+ gtk_signal_emit_stop_by_name(GTK_OBJECT(ctree),
+ "tree-select-row");
+ #endif
return;
}
***************
*** 1219,1223 ****
GTK_POLICY_AUTOMATIC);
gtk_widget_show(pane1_scrwin);
! gtk_widget_set_usize(pane1_scrwin, 300, -1);
gtk_paned_set_position(GTK_PANED(mainpane), 300);
gtk_paned_add1(GTK_PANED(mainpane), pane1_scrwin);
--- 1224,1230 ----
GTK_POLICY_AUTOMATIC);
gtk_widget_show(pane1_scrwin);
! #if GTK_MAJOR < 2
! gtk_widget_set_usize(pane1_scrwin, 300, -1); /* FIXME: needed in gtk 1.2? */
! #endif
gtk_paned_set_position(GTK_PANED(mainpane), 300);
gtk_paned_add1(GTK_PANED(mainpane), pane1_scrwin);
Index: common.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/common.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** common.h 28 Sep 2003 23:39:18 -0000 1.21
--- common.h 30 Sep 2003 17:20:25 -0000 1.22
***************
*** 56,60 ****
#define LDIF_V1 1
-
struct server_schema {
GList *oc;
--- 56,59 ----
Index: dt_jpeg.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_jpeg.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** dt_jpeg.c 29 Sep 2003 19:24:16 -0000 1.9
--- dt_jpeg.c 30 Sep 2003 17:20:25 -0000 1.10
***************
*** 131,140 ****
GdkBitmap *mask;
- GdkPixbufLoader* loader;
GByteArray *copy;
! GError *error = NULL;
- loader = gdk_pixbuf_loader_new();
#if GTK_MAJOR >= 2
gdk_pixbuf_loader_write(loader, data->data, data->len, &error); /* FIXME - error handling */
if (!error) gdk_pixbuf_loader_close(loader, &error);
--- 131,140 ----
GdkBitmap *mask;
GByteArray *copy;
! GdkPixbufLoader* loader = gdk_pixbuf_loader_new();
#if GTK_MAJOR >= 2
+ GError *error = NULL;
+
gdk_pixbuf_loader_write(loader, data->data, data->len, &error); /* FIXME - error handling */
if (!error) gdk_pixbuf_loader_close(loader, &error);
Index: dt_text.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_text.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** dt_text.c 29 Sep 2003 19:24:16 -0000 1.9
--- dt_text.c 30 Sep 2003 17:20:25 -0000 1.10
***************
*** 51,60 ****
--- 51,71 ----
#include "dt_text.h"
+ #if GTK_MAJOR >= 2
+ static GByteArray *dt_text_get_data(struct formfill *form, GtkWidget *widget);
+ static void dt_text_set_data(struct formfill *form, GByteArray *data,
+ GtkWidget *widget);
+ #endif
+
static dt_text_handler dt_text_handler_vtab = {
{
"Multi-line Text", TRUE,
dt_text_get_widget,
+ #if GTK_MAJOR >= 2
+ dt_text_get_data,
+ dt_text_set_data,
+ #else
dt_entry_get_data, /* reuse method from dt_entry */
dt_entry_set_data,
+ #endif
bervalLDAPMod /* reuse method from dt_entry */
},
***************
*** 74,109 ****
#if GTK_MAJOR >= 2
! inputbox = gtk_entry_new();
! gtk_entry_set_editable(GTK_ENTRY(inputbox), TRUE);
! #warning "GTK2 support does not allow for multiline text right now"
#else
inputbox = gtk_text_new(NULL, NULL);
gtk_text_set_editable(GTK_TEXT(inputbox), TRUE);
- #endif
-
dt_entry_set_data(form, data, inputbox);
return inputbox;
}
! #if 0
! void dt_text_set_data(struct formfill *form, GByteArray *data,
! GtkWidget *widget)
{
! gtk_text_freeze(GTK_TEXT(widget));
! gtk_text_set_point(GTK_TEXT(widget), 0);
! gtk_text_forward_delete(GTK_TEXT(widget),
! gtk_text_get_length(GTK_TEXT(widget)));
! if(data) {
! GByteArray *encoded = DT_TEXT(form->dt_handler)->encode(data->data, data->len);
!
! gtk_text_set_point(GTK_TEXT(widget), 0);
! gtk_text_insert(GTK_TEXT(widget), NULL, NULL, NULL,
! encoded->data, -1);
!
! g_byte_array_free(encoded, TRUE);
! }
! gtk_text_thaw(GTK_TEXT(widget));
}
#endif
--- 85,146 ----
#if GTK_MAJOR >= 2
! GtkWidget *scrolled;
!
! inputbox = gtk_text_view_new();
! gtk_widget_show(inputbox);
!
! scrolled = gtk_scrolled_window_new(NULL, NULL);
! gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
! GTK_POLICY_AUTOMATIC,
! GTK_POLICY_AUTOMATIC);
! gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled),
! GTK_SHADOW_IN);
! gtk_container_add(GTK_CONTAINER(scrolled), inputbox);
! gtk_widget_show(scrolled);
!
! dt_text_set_data(form, data, scrolled);
!
! return scrolled;
#else
inputbox = gtk_text_new(NULL, NULL);
gtk_text_set_editable(GTK_TEXT(inputbox), TRUE);
dt_entry_set_data(form, data, inputbox);
return inputbox;
+ #endif
}
!
! #if GTK_MAJOR >= 2
!
! static GByteArray *dt_text_get_data(struct formfill *form, GtkWidget *widget)
{
! GtkWidget *text = gtk_bin_get_child(GTK_BIN(widget));
! GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
! GtkTextIter s, e;
! gchar *c;
! GByteArray *a = NULL;
!
! gtk_text_buffer_get_start_iter(b, &s);
! gtk_text_buffer_get_end_iter(b, &e);
! c = gtk_text_buffer_get_text(b, &s, &e, TRUE);
!
! if (!c) return NULL;
!
! a = g_byte_array_new();
! g_byte_array_append(a, c, strlen(c));
! g_free(c);
!
! return a;
! }
!
! static void dt_text_set_data(struct formfill *form, GByteArray *data,
! GtkWidget *widget)
! {
! GtkWidget *text = gtk_bin_get_child(GTK_BIN(widget));
! GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
! gtk_text_buffer_set_text(b, (gchar*) data->data, data->len);
}
+
#endif
Index: dt_text.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_text.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** dt_text.h 28 Sep 2003 03:26:25 -0000 1.5
--- dt_text.h 30 Sep 2003 17:20:25 -0000 1.6
***************
*** 41,46 ****
GtkSignalFunc *activatefunc,
gpointer funcdata);
- void dt_text_set_data(struct formfill *form, GByteArray *data,
- GtkWidget *widget);
#endif
--- 41,44 ----
Index: dtutil.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dtutil.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dtutil.c 13 Jul 2002 09:13:34 -0000 1.3
--- dtutil.c 30 Sep 2003 17:20:25 -0000 1.4
***************
*** 34,41 ****
#include "dtutil.h"
! void editable_changed_cb(GtkEditable *editable,
gpointer user_data)
{
! gtk_object_set_data(GTK_OBJECT(editable),
"editable_changed_flag", GINT_TO_POINTER(1));
}
--- 34,41 ----
#include "dtutil.h"
! void editable_changed_cb(GtkWidget *object,
gpointer user_data)
{
! gtk_object_set_data(GTK_OBJECT(object),
"editable_changed_flag", GINT_TO_POINTER(1));
}
Index: dtutil.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dtutil.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** dtutil.h 12 Jul 2002 20:18:59 -0000 1.1
--- dtutil.h 30 Sep 2003 17:20:25 -0000 1.2
***************
*** 33,37 ****
#include "config.h"
! void editable_changed_cb(GtkEditable *editable, gpointer user_data);
void editable_set_text(GtkEditable *entry, GByteArray *data,
GByteArray* (*encode)(const char *val, int len),
--- 33,37 ----
#include "config.h"
! void editable_changed_cb(GtkWidget *object, gpointer user_data);
void editable_set_text(GtkEditable *entry, GByteArray *data,
GByteArray* (*encode)(const char *val, int len),
Index: filter.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/filter.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** filter.c 29 Sep 2003 19:24:16 -0000 1.16
--- filter.c 30 Sep 2003 17:20:25 -0000 1.17
***************
*** 48,51 ****
--- 48,52 ----
#include "debug.h"
#include "i18n.h"
+ #include "input.h"
***************
*** 178,182 ****
window = gtk_dialog_new();
! gtk_container_border_width(GTK_CONTAINER(window), 12);
gtk_window_set_title(GTK_WINDOW(window), _("Filter name"));
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
--- 179,183 ----
window = gtk_dialog_new();
! gtk_container_border_width(GTK_CONTAINER(window), CONTAINER_BORDER_WIDTH);
gtk_window_set_title(GTK_WINDOW(window), _("Filter name"));
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
***************
*** 194,198 ****
gtk_widget_show(vbox1);
! label = gtk_label_new(_("Filter name"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
--- 195,199 ----
gtk_widget_show(vbox1);
! label = gq_label_new(_("Filter _name"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
***************
*** 208,214 ****
/* Save server and base DN */
! button = gtk_check_button_new_with_label(_("Remember server and base DN"));
gtk_object_set_data(GTK_OBJECT(filternamebox), "saveserver", button);
GTK_WIDGET_UNSET_FLAGS(GTK_CHECK_BUTTON(button), GTK_CAN_FOCUS);
gtk_widget_show(button);
gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, TRUE, 10);
--- 209,217 ----
/* Save server and base DN */
! button = gq_check_button_new_with_label(_("Remember server and base DN"));
gtk_object_set_data(GTK_OBJECT(filternamebox), "saveserver", button);
+ #ifdef OLD_FOCUS_HANDLING
GTK_WIDGET_UNSET_FLAGS(GTK_CHECK_BUTTON(button), GTK_CAN_FOCUS);
+ #endif
gtk_widget_show(button);
gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, TRUE, 10);
***************
*** 288,292 ****
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
! gtk_container_border_width(GTK_CONTAINER(window), 12);
gtk_window_set_title(GTK_WINDOW(window), _("Filters"));
gtk_window_set_default_size(GTK_WINDOW(window), 670, 350);
--- 291,295 ----
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
! gtk_container_border_width(GTK_CONTAINER(window), CONTAINER_BORDER_WIDTH);
gtk_window_set_title(GTK_WINDOW(window), _("Filters"));
gtk_window_set_default_size(GTK_WINDOW(window), 670, 350);
***************
*** 312,328 ****
gtk_box_pack_start(GTK_BOX(hbox0), hbox1, FALSE, FALSE, 0);
! new_button = gtk_button_new_with_label(_("New"));
GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_DEFAULT);
GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_FOCUS);
gtk_widget_show(new_button);
gtk_box_pack_start(GTK_BOX(hbox1), new_button, FALSE, FALSE, 0);
! delete_button = gtk_button_new_with_label(_("Delete"));
GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_DEFAULT);
GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_FOCUS);
gtk_widget_show(delete_button);
gtk_box_pack_start(GTK_BOX(hbox1), delete_button, FALSE, FALSE, 5);
! copy_button = gtk_button_new_with_label(_("Copy"));
GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_DEFAULT);
GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_FOCUS);
--- 315,335 ----
gtk_box_pack_start(GTK_BOX(hbox0), hbox1, FALSE, FALSE, 0);
! new_button = gq_button_new_with_label(_("_New"));
GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_DEFAULT);
+ #ifdef OLD_FOCUS_HANDLING
GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_FOCUS);
+ #endif
gtk_widget_show(new_button);
gtk_box_pack_start(GTK_BOX(hbox1), new_button, FALSE, FALSE, 0);
! delete_button = gq_button_new_with_label(_("_Delete"));
GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_DEFAULT);
+ #ifdef OLD_FOCUS_HANDLING
GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_FOCUS);
+ #endif
gtk_widget_show(delete_button);
gtk_box_pack_start(GTK_BOX(hbox1), delete_button, FALSE, FALSE, 5);
! copy_button = gq_button_new_with_label(_("_Copy"));
GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_DEFAULT);
GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_FOCUS);
***************
*** 503,506 ****
--- 510,516 ----
void edit_filter(GtkCList *filter_clist, int is_new_filter, int row, struct gq_filter *filter)
{
+ #if GTK_MAJOR >= 2
+ GtkWidget *scrolled;
+ #endif
GtkWidget *window, *vbox1, *hbox1, *hbox2, *label, *entry;
GtkWidget *table1, *indent, *editbox, *save, *cancel;
***************
*** 514,518 ****
gtk_object_set_data(GTK_OBJECT(window), "filter_row", GINT_TO_POINTER(row));
! gtk_container_border_width(GTK_CONTAINER(window), 12);
gtk_window_set_title(GTK_WINDOW(window), _("Edit filter"));
--- 524,528 ----
gtk_object_set_data(GTK_OBJECT(window), "filter_row", GINT_TO_POINTER(row));
! gtk_container_border_width(GTK_CONTAINER(window), CONTAINER_BORDER_WIDTH);
gtk_window_set_title(GTK_WINDOW(window), _("Edit filter"));
***************
*** 537,541 ****
/* Filter name */
! label = gtk_label_new(_("Filter name"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
--- 547,551 ----
/* Filter name */
! label = gq_label_new(_("Filter _name"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
***************
*** 551,556 ****
GTK_EXPAND | GTK_FILL, 0, 0, 0);
/* Server */
! label = gtk_label_new(_("Server"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
--- 561,570 ----
GTK_EXPAND | GTK_FILL, 0, 0, 0);
+ #if GTK_MAJOR >= 2
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
+ #endif
+
/* Server */
! label = gq_label_new(_("_Server"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
***************
*** 566,571 ****
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
/* Base DN */
! label = gtk_label_new(_("Base DN"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
--- 580,589 ----
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ #if GTK_MAJOR >= 2
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
+ #endif
+
/* Base DN */
! label = gq_label_new(_("_Base DN"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_widget_show(label);
***************
*** 585,601 ****
gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0);
! indent = gtk_toggle_button_new_with_label(_(" Indent "));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(indent), TRUE);
GTK_WIDGET_UNSET_FLAGS(indent, GTK_CAN_FOCUS);
gtk_widget_show(indent);
gtk_box_pack_start(GTK_BOX(hbox1), indent, FALSE, FALSE, 0);
#if GTK_MAJOR >= 2
editbox = gtk_text_view_new();
gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox);
gtk_text_view_set_editable(GTK_TEXT_VIEW(editbox), TRUE);
! gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editbox), GTK_WRAP_NONE);
!
! GTK_WIDGET_SET_FLAGS(editbox, GTK_CAN_FOCUS);
/* populate editbox */
--- 603,632 ----
gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0);
! indent = gq_toggle_button_new_with_label(_("_Indent"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(indent), TRUE);
+ #ifdef OLD_FOCUS_HANDLING
GTK_WIDGET_UNSET_FLAGS(indent, GTK_CAN_FOCUS);
+ #endif
gtk_widget_show(indent);
gtk_box_pack_start(GTK_BOX(hbox1), indent, FALSE, FALSE, 0);
#if GTK_MAJOR >= 2
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
+ #endif
+
+ #if GTK_MAJOR >= 2
+ scrolled = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled),
+ GTK_SHADOW_IN);
+
editbox = gtk_text_view_new();
+ gtk_container_add(GTK_CONTAINER(scrolled), editbox);
+
gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox);
gtk_text_view_set_editable(GTK_TEXT_VIEW(editbox), TRUE);
! gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editbox), GTK_WRAP_CHAR);
/* populate editbox */
***************
*** 609,615 ****
}
! /* gtk_text_set_point(GTK_TEXT(editbox), 0); */ /* FIXME */
#else
editbox = gtk_text_new(NULL, NULL);
gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox);
gtk_text_set_editable(GTK_TEXT(editbox), TRUE);
--- 640,649 ----
}
! gtk_box_pack_start(GTK_BOX(vbox1), scrolled, TRUE, TRUE, 3);
! gtk_widget_show(editbox);
! gtk_widget_show(scrolled);
#else
editbox = gtk_text_new(NULL, NULL);
+
gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox);
gtk_text_set_editable(GTK_TEXT(editbox), TRUE);
***************
*** 617,624 ****
gtk_text_set_line_wrap(GTK_TEXT(editbox), FALSE);
GTK_WIDGET_SET_FLAGS(editbox, GTK_CAN_FOCUS);
- gtk_box_pack_start(GTK_BOX(vbox1), editbox, TRUE, TRUE, 3);
-
- gtk_signal_connect(GTK_OBJECT(indent), "toggled",
- GTK_SIGNAL_FUNC(indent_toggled), (gpointer) editbox);
/* populate editbox */
--- 651,654 ----
***************
*** 634,646 ****
}
gtk_text_set_point(GTK_TEXT(editbox), 0);
#endif
! gtk_widget_show(editbox);
hbox2 = gtk_hbutton_box_new(); /* box_new(FALSE, 0); */
gtk_widget_show(hbox2);
! gtk_box_pack_start(GTK_BOX(vbox1), hbox2, TRUE, TRUE, 10);
! save = gtk_button_new_with_label(_("Save"));
gtk_signal_connect_object(GTK_OBJECT(save), "clicked",
GTK_SIGNAL_FUNC(save_filter), GTK_OBJECT(window));
--- 664,681 ----
}
gtk_text_set_point(GTK_TEXT(editbox), 0);
+ gtk_widget_show(editbox);
+
+ gtk_box_pack_start(GTK_BOX(vbox1), editbox, TRUE, TRUE, 3);
#endif
! gtk_signal_connect(GTK_OBJECT(indent), "toggled",
! GTK_SIGNAL_FUNC(indent_toggled), (gpointer) editbox);
!
hbox2 = gtk_hbutton_box_new(); /* box_new(FALSE, 0); */
gtk_widget_show(hbox2);
! gtk_box_pack_start(GTK_BOX(vbox1), hbox2, FALSE, FALSE, 0);
! save = gq_button_new_with_label(_("_Save"));
gtk_signal_connect_object(GTK_OBJECT(save), "clicked",
GTK_SIGNAL_FUNC(save_filter), GTK_OBJECT(window));
***************
*** 709,713 ****
--- 744,760 ----
text = gtk_object_get_data(GTK_OBJECT(window), "editbox");
+
+ #if GTK_MAJOR >= 2
+ {
+ GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
+ GtkTextIter s, e;
+
+ gtk_text_buffer_get_start_iter(b, &s);
+ gtk_text_buffer_get_end_iter(b, &e);
+ filtertext = gtk_text_buffer_get_text(b, &s, &e, TRUE);
+ }
+ #else
filtertext = gtk_editable_get_chars(GTK_EDITABLE(text), 0, -1);
+ #endif
filter_clist = gtk_object_get_data(GTK_OBJECT(window), "filter_clist");
***************
*** 909,913 ****
unsigned char c, *unindented;
! unindented = malloc(strlen(indented) + 1);
unindented[0] = '\0';
f = s = 0;
--- 956,960 ----
unsigned char c, *unindented;
! unindented = g_malloc(strlen(indented) + 1);
unindented[0] = '\0';
f = s = 0;
***************
*** 952,993 ****
void indent_toggled(GtkToggleButton *indent, gpointer editbox)
{
! char *indented, *unindented;
!
! if(gtk_toggle_button_get_active(indent)) {
! /* indent */
! unindented = gtk_editable_get_chars(GTK_EDITABLE(editbox), 0, -1);
! if(!unindented)
! return;
! indented = indent_filter(unindented);
! g_free(unindented);
#if GTK_MAJOR >= 2
! gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)),
! indented, strlen(indented)); /* FIXME: UTF-8 ?? */
#else
! gtk_text_set_point(GTK_TEXT(editbox), 0);
! gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox)));
! gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, indented, -1);
#endif
! g_free(indented);
! }
! else {
/* unindent */
! indented = gtk_editable_get_chars(GTK_EDITABLE(editbox), 0, -1);
! if(!indented)
! return;
! unindented = unindent_filter(indented);
! g_free(indented);
#if GTK_MAJOR >= 2
! gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)),
! unindented, strlen(unindented)); /* FIXME: UTF-8 ?? */
#else
! gtk_text_set_point(GTK_TEXT(editbox), 0);
! gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox)));
! gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, unindented, -1);
#endif
! g_free(unindented);
! }
}
--- 999,1034 ----
void indent_toggled(GtkToggleButton *indent, gpointer editbox)
{
! char *current, *newtext;
#if GTK_MAJOR >= 2
! GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox));
! GtkTextIter s, e;
!
! gtk_text_buffer_get_start_iter(b, &s);
! gtk_text_buffer_get_end_iter(b, &e);
! current = gtk_text_buffer_get_text(b, &s, &e, TRUE);
#else
! current = gtk_editable_get_chars(GTK_EDITABLE(editbox), 0, -1);
#endif
!
! if(!current) return;
!
! if(gtk_toggle_button_get_active(indent)) {
! /* indent */
! newtext = indent_filter(current);
! } else {
/* unindent */
! newtext = unindent_filter(current);
! }
#if GTK_MAJOR >= 2
! gtk_text_buffer_set_text(b, newtext, strlen(newtext)); /* FIXME: UTF-8 ?? */
#else
! gtk_text_set_point(GTK_TEXT(editbox), 0);
! gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox)));
! gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, newtext, -1);
#endif
! g_free(newtext);
! g_free(current);
}
Index: input.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/input.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** input.c 29 Sep 2003 19:24:16 -0000 1.56
--- input.c 30 Sep 2003 17:20:25 -0000 1.57
***************
*** 64,67 ****
--- 64,70 ----
static void create_new_attr(GtkButton *button, struct inputform *iform);
+ static void change_displaytype(GtkWidget *button,
+ struct inputform *iform,
+ int wanted_dt);
***************
*** 92,95 ****
--- 95,108 ----
}
+ static void linebutton_clicked(GtkWidget *button, struct inputform *iform)
+ {
+ change_displaytype(button, iform, DISPLAYTYPE_ENTRY);
+ }
+
+ static void textareabutton_clicked(GtkWidget *button, struct inputform *iform)
+ {
+ change_displaytype(button, iform, DISPLAYTYPE_TEXT);
+ }
+
void create_form_content(struct inputform *iform)
***************
*** 114,118 ****
/* line button */
linebutton = gtk_button_new();
- gtk_object_set_data(GTK_OBJECT(linebutton), "transform", "make entry");
GTK_WIDGET_UNSET_FLAGS(linebutton, GTK_CAN_FOCUS);
icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window,
--- 127,130 ----
***************
*** 134,138 ****
gtk_box_pack_start(GTK_BOX(hbox1), linebutton, FALSE, FALSE, 5);
gtk_signal_connect(GTK_OBJECT(linebutton), "clicked",
! GTK_SIGNAL_FUNC(change_displaytype),
(gpointer) iform);
--- 146,150 ----
gtk_box_pack_start(GTK_BOX(hbox1), linebutton, FALSE, FALSE, 5);
gtk_signal_connect(GTK_OBJECT(linebutton), "clicked",
! GTK_SIGNAL_FUNC(linebutton_clicked),
(gpointer) iform);
***************
*** 146,150 ****
/* textarea button */
textareabutton = gtk_button_new();
- gtk_object_set_data(GTK_OBJECT(textareabutton), "transform", "make text");
GTK_WIDGET_UNSET_FLAGS(textareabutton, GTK_CAN_FOCUS);
icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window,
--- 158,161 ----
***************
*** 161,165 ****
gtk_box_pack_start(GTK_BOX(hbox1), textareabutton, FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(textareabutton), "clicked",
! GTK_SIGNAL_FUNC(change_displaytype),
(gpointer) iform);
--- 172,176 ----
gtk_box_pack_start(GTK_BOX(hbox1), textareabutton, FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(textareabutton), "clicked",
! GTK_SIGNAL_FUNC(textareabutton_clicked),
(gpointer) iform);
***************
*** 173,177 ****
newattrbutton = gtk_button_new();
- gtk_object_set_data(GTK_OBJECT(newattrbutton), "transform", "make text");
GTK_WIDGET_UNSET_FLAGS(newattrbutton, GTK_CAN_FOCUS);
icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window,
--- 184,187 ----
***************
*** 201,206 ****
/* hide empty attributes button */
hideattrbutton = gtk_toggle_button_new();
-
- gtk_object_set_data(GTK_OBJECT(hideattrbutton), "transform", "make text");
GTK_WIDGET_UNSET_FLAGS(hideattrbutton, GTK_CAN_FOCUS);
icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window,
--- 211,214 ----
***************
*** 258,262 ****
if(iform->edit) {
! button = gtk_button_new_with_label(_("Apply"));
gtk_widget_show(button);
gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0);
--- 266,270 ----
if(iform->edit) {
! button = gq_button_new_with_label(_("_Apply"));
gtk_widget_show(button);
gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0);
***************
*** 268,272 ****
gtk_widget_grab_default(button);
! button = gtk_button_new_with_label(_("Add as new"));
gtk_widget_set_sensitive(button, FALSE);
gtk_widget_show(button);
--- 276,280 ----
gtk_widget_grab_default(button);
! button = gq_button_new_with_label(_("Add as _new"));
gtk_widget_set_sensitive(button, FALSE);
gtk_widget_show(button);
***************
*** 278,282 ****
iform->add_as_new_button = button;
! button = gtk_button_new_with_label(_("Refresh"));
/* gtk_widget_set_sensitive(button, FALSE); */
/* GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); */
--- 286,290 ----
iform->add_as_new_button = button;
! button = gq_button_new_with_label(_("_Refresh"));
/* gtk_widget_set_sensitive(button, FALSE); */
/* GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); */
***************
*** 1702,1705 ****
--- 1710,1720 ----
}
+ static void check_focus(GtkWidget *w, GtkWidget **focus)
+ {
+ if (GTK_WIDGET_HAS_FOCUS(w)) {
+ *focus = w;
+ }
+ }
+
GtkWidget *find_focusbox(GList *formlist)
***************
*** 1720,1723 ****
--- 1735,1747 ----
return GTK_WIDGET(widgets->data);
}
+
+ /* check children as well */
+ if (GTK_IS_CONTAINER(GTK_WIDGET(widgets->data))) {
+ GtkWidget *focus = NULL;
+ gtk_container_foreach(GTK_CONTAINER(GTK_WIDGET(widgets->data)),
+ (GtkCallback) check_focus,
+ &focus);
+ if (focus) return widgets->data;
+ }
}
}
***************
*** 1731,1743 ****
* callback for entry or textbox buttons
*/
! void change_displaytype(GtkWidget *button, struct inputform *iform)
{
GtkWidget *focusbox;
! struct formfill *ff, *focusform;
! char *transformtype;
update_formlist(iform);
focusbox = find_focusbox(iform->formlist);
if(focusbox == NULL)
/* nothing focused */
--- 1755,1768 ----
* callback for entry or textbox buttons
*/
! static void change_displaytype(GtkWidget *button, struct inputform *iform, int wanted_dt)
{
GtkWidget *focusbox;
! struct formfill *ff, *focusform = NULL;
! assert(wanted_dt == DISPLAYTYPE_ENTRY || wanted_dt == DISPLAYTYPE_TEXT);
update_formlist(iform);
focusbox = find_focusbox(iform->formlist);
+
if(focusbox == NULL)
/* nothing focused */
***************
*** 1745,1755 ****
focusform = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox),
! "formfill");
if(focusform == NULL)
/* field can't be resized anyway */
return;
- iform->focusform = focusform;
! transformtype = gtk_object_get_data(GTK_OBJECT(button), "transform");
ff = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox),
--- 1770,1780 ----
focusform = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox),
! "formfill");
!
if(focusform == NULL)
/* field can't be resized anyway */
return;
! iform->focusform = focusform;
ff = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox),
***************
*** 1758,1772 ****
return;
! if(!strcmp(transformtype, "make entry")) {
! if(GTK_IS_ENTRY(focusbox))
! return;
ff->displaytype = DISPLAYTYPE_ENTRY;
ff->dt_handler = get_dt_handler(ff->displaytype);
! } else if(!strcmp(transformtype, "make text")) {
! #if GTK_MAJOR < 2
! if(GTK_IS_TEXT(focusbox))
! return;
! #endif
ff->displaytype = DISPLAYTYPE_TEXT;
--- 1783,1795 ----
return;
! if (wanted_dt == DISPLAYTYPE_ENTRY) {
! /* if(GTK_IS_ENTRY(focusbox)) */
! /* return; */
ff->displaytype = DISPLAYTYPE_ENTRY;
ff->dt_handler = get_dt_handler(ff->displaytype);
! } else if(wanted_dt == DISPLAYTYPE_TEXT) {
! /* if(GTK_IS_TEXT(focusbox)) */
! /* return; */
ff->displaytype = DISPLAYTYPE_TEXT;
***************
*** 1776,1781 ****
/* redraw */
clear_table(iform);
- build_inputform(iform);
}
--- 1799,1806 ----
/* redraw */
clear_table(iform);
+ gtk_widget_hide(iform->table);
+ build_inputform(iform);
+ gtk_widget_show(iform->table);
}
Index: input.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/input.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** input.h 29 Sep 2003 19:24:17 -0000 1.12
--- input.h 30 Sep 2003 17:20:25 -0000 1.13
***************
*** 78,82 ****
GtkWidget *gq_new_arrowbutton(struct inputform *iform);
GtkWidget *find_focusbox(GList *formlist);
- void change_displaytype(GtkWidget *button, struct inputform *form);
void set_hide_empty_attributes(int hidden, struct inputform *form);
--- 78,81 ----
Index: mainwin.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/mainwin.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** mainwin.c 29 Sep 2003 19:24:17 -0000 1.32
--- mainwin.c 30 Sep 2003 17:20:25 -0000 1.33
***************
*** 122,126 ****
}
-
void cleanup(void)
{
--- 122,125 ----
***************
*** 128,131 ****
--- 127,162 ----
}
+ static gboolean ctrl_b_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj)
+ {
+ if(event && event->type == GDK_KEY_PRESS &&
+ event->state & GDK_CONTROL_MASK && event->keyval == GDK_b) {
+ gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate");
+ gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
+ return(TRUE);
+ }
+
+ #if GTK_MAJOR >= 2
+ return(FALSE);
+ #else
+ return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
+ #endif
+ }
+
+
+ static gboolean ctrl_w_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj)
+ {
+ if(event && event->type == GDK_KEY_PRESS &&
+ event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) {
+ gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate");
+ gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
+ return(TRUE);
+ }
+
+ #if GTK_MAJOR >= 2
+ return(FALSE);
+ #else
+ return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
+ #endif
+ }
void create_mainwin(void)
***************
*** 181,185 ****
/* File menu */
! File = gtk_menu_item_new_with_label(_("File"));
gtk_widget_show(File);
gtk_container_add(GTK_CONTAINER(menubar), File);
--- 212,216 ----
/* File menu */
! File = gq_menu_item_new_with_label(_("_File"));
gtk_widget_show(File);
gtk_container_add(GTK_CONTAINER(menubar), File);
***************
*** 189,193 ****
/* File | New */
! New = gtk_menu_item_new_with_label(_("New tab"));
gtk_widget_show(New);
gtk_container_add(GTK_CONTAINER(menuFile), New);
--- 220,224 ----
/* File | New */
! New = gq_menu_item_new_with_label(_("_New tab"));
gtk_widget_show(New);
gtk_container_add(GTK_CONTAINER(menuFile), New);
***************
*** 196,200 ****
/* File | New | Search */
! Search = gtk_menu_item_new_with_label(_("Search"));
gtk_widget_show(Search);
gtk_menu_append(GTK_MENU(submenu), Search);
--- 227,231 ----
/* File | New | Search */
! Search = gq_menu_item_new_with_label(_("_Search"));
gtk_widget_show(Search);
gtk_menu_append(GTK_MENU(submenu), Search);
***************
*** 206,210 ****
/* File | New | Browse */
! Browse = gtk_menu_item_new_with_label(_("Browse"));
gtk_widget_show(Browse);
gtk_menu_append(GTK_MENU(submenu), Browse);
--- 237,241 ----
/* File | New | Browse */
! Browse = gq_menu_item_new_with_label(_("_Browse"));
gtk_widget_show(Browse);
gtk_menu_append(GTK_MENU(submenu), Browse);
***************
*** 221,225 ****
/* File | New | Schema */
! Schema = gtk_menu_item_new_with_label(_("Schema"));
gtk_widget_show(Schema);
gtk_menu_append(GTK_MENU(submenu), Schema);
--- 252,256 ----
/* File | New | Schema */
! Schema = gq_menu_item_new_with_label(_("S_chema"));
gtk_widget_show(Schema);
gtk_menu_append(GTK_MENU(submenu), Schema);
***************
*** 235,239 ****
/* File | Preferences */
! menuitem = gtk_menu_item_new_with_label(_("Preferences"));
gtk_widget_show(menuitem);
gtk_container_add(GTK_CONTAINER(menuFile), menuitem);
--- 266,270 ----
/* File | Preferences */
! menuitem = gq_menu_item_new_with_label(_("_Preferences"));
gtk_widget_show(menuitem);
gtk_container_add(GTK_CONTAINER(menuFile), menuitem);
***************
*** 245,249 ****
/* File | Close */
! Close = gtk_menu_item_new_with_label(_("Close tab"));
gtk_widget_show(Close);
gtk_container_add(GTK_CONTAINER(menuFile), Close);
--- 276,280 ----
/* File | Close */
! Close = gq_menu_item_new_with_label(_("_Close tab"));
gtk_widget_show(Close);
gtk_container_add(GTK_CONTAINER(menuFile), Close);
***************
*** 258,262 ****
/* File | Quit */
! Quit = gtk_menu_item_new_with_label(_("Quit"));
gtk_widget_show(Quit);
gtk_container_add(GTK_CONTAINER(menuFile), Quit);
--- 289,293 ----
/* File | Quit */
! Quit = gq_menu_item_new_with_label(_("_Quit"));
gtk_widget_show(Quit);
gtk_container_add(GTK_CONTAINER(menuFile), Quit);
***************
*** 269,273 ****
/* Filters menu */
! Filters = gtk_menu_item_new_with_label(_("Filters"));
gtk_widget_show(Filters);
gtk_container_add(GTK_CONTAINER(menubar), Filters);
--- 300,304 ----
/* Filters menu */
! Filters = gq_menu_item_new_with_label(_("F_ilters"));
gtk_widget_show(Filters);
gtk_container_add(GTK_CONTAINER(menubar), Filters);
***************
*** 278,282 ****
/* Filters | New */
! New = gtk_menu_item_new_with_label(_("New filter"));
gtk_widget_show(New);
gtk_container_add(GTK_CONTAINER(menuFilters), New);
--- 309,313 ----
/* Filters | New */
! New = gq_menu_item_new_with_label(_("_New filter"));
...
[truncated message content] |
|
From: <sta...@us...> - 2003-09-30 17:20:29
|
Update of /cvsroot/gqclient/gq/po In directory sc8-pr-cvs1:/tmp/cvs-serv11957/po Modified Files: cs.po de.po ja.po zh_CN.po Log Message: * Fixed many small bugs wrt gtk2, cleanups * Ported the dt_text to gtk2 and GtkTextView * Added keyboard mnemonics in a-great-many-places. Needs to be fixed so that for gtk 1.2 those underlines do not show up * Fixed the Filter Window * Almost fixed the License Window (but not quite) * Changed COPYING.h and introduced COPYING.c (autogenerated). COPYING.c gets built from the top-level COPYING file. Index: cs.po =================================================================== RCS file: /cvsroot/gqclient/gq/po/cs.po,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cs.po 29 Sep 2003 19:24:14 -0000 1.4 --- cs.po 30 Sep 2003 17:20:24 -0000 1.5 *************** *** 6,10 **** msgstr "" "Project-Id-Version: gq 0.6.0\n" ! "POT-Creation-Date: 2003-09-29 21:06+0200\n" "PO-Revision-Date: 2002-10-09 14:40+0200\n" "Last-Translator: Tomas Dobrovolny <tom...@at...>\n" --- 6,10 ---- msgstr "" "Project-Id-Version: gq 0.6.0\n" ! "POT-Creation-Date: 2003-09-30 18:54+0200\n" "PO-Revision-Date: 2002-10-09 14:40+0200\n" [...1757 lines suppressed...] #: src/util.c:1426 ! msgid "Yes" msgstr "Ano" #: src/util.c:1435 ! msgid "No" msgstr "Ne" --- 1502,1512 ---- #: src/util.c:1426 ! #, fuzzy ! msgid "_Yes" msgstr "Ano" #: src/util.c:1435 ! #, fuzzy ! msgid "_No" msgstr "Ne" Index: de.po =================================================================== RCS file: /cvsroot/gqclient/gq/po/de.po,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** de.po 29 Sep 2003 19:24:14 -0000 1.17 --- de.po 30 Sep 2003 17:20:24 -0000 1.18 *************** *** 6,11 **** msgstr "" "Project-Id-Version: gq 0.7.0beta2\n" ! "POT-Creation-Date: 2003-09-29 21:06+0200\n" ! "PO-Revision-Date: 2002-04-21 16:10+MEST\n" "Last-Translator: Peter Stamfest <pe...@st...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" --- 6,11 ---- msgstr "" "Project-Id-Version: gq 0.7.0beta2\n" ! "POT-Creation-Date: 2003-09-30 18:54+0200\n" [...1732 lines suppressed...] #: src/util.c:1426 ! msgid "Yes" ! msgstr "Ja" #: src/util.c:1435 ! msgid "No" ! msgstr "Nein" #. try LDAP V3 style config --- 1468,1477 ---- #: src/util.c:1426 ! msgid "_Yes" ! msgstr "_Ja" #: src/util.c:1435 ! msgid "_No" ! msgstr "_Nein" #. try LDAP V3 style config Index: ja.po =================================================================== RCS file: /cvsroot/gqclient/gq/po/ja.po,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ja.po 29 Sep 2003 19:24:14 -0000 1.7 --- ja.po 30 Sep 2003 17:20:25 -0000 1.8 *************** *** 6,10 **** msgstr "" "Project-Id-Version: gq 0.6.0\n" ! "POT-Creation-Date: 2003-09-29 21:06+0200\n" "PO-Revision-Date: 2002-10-13 12:38+0900\n" "Last-Translator: Hatuka*nezumi <ne...@jc...>\n" --- 6,10 ---- msgstr "" "Project-Id-Version: gq 0.6.0\n" ! "POT-Creation-Date: 2003-09-30 18:54+0200\n" "PO-Revision-Date: 2002-10-13 12:38+0900\n" [...1753 lines suppressed...] #: src/util.c:1426 ! msgid "Yes" msgstr "¤Ï¤¤" #: src/util.c:1435 ! msgid "No" msgstr "¤¤¤¤¤¨" --- 1547,1557 ---- #: src/util.c:1426 ! #, fuzzy ! msgid "_Yes" msgstr "¤Ï¤¤" #: src/util.c:1435 ! #, fuzzy ! msgid "_No" msgstr "¤¤¤¤¤¨" Index: zh_CN.po =================================================================== RCS file: /cvsroot/gqclient/gq/po/zh_CN.po,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zh_CN.po 29 Sep 2003 19:24:14 -0000 1.2 --- zh_CN.po 30 Sep 2003 17:20:25 -0000 1.3 *************** *** 6,10 **** msgstr "" "Project-Id-Version: 0.7.0beta2\n" ! "POT-Creation-Date: 2003-09-29 21:06+0200\n" "PO-Revision-Date: 2003-01-04 02:58+0800\n" "Last-Translator: hleil liu <hl...@ya...>\n" --- 6,10 ---- msgstr "" "Project-Id-Version: 0.7.0beta2\n" ! "POT-Creation-Date: 2003-09-30 18:54+0200\n" "PO-Revision-Date: 2003-01-04 02:58+0800\n" [...1752 lines suppressed...] #: src/util.c:1426 ! msgid "Yes" msgstr "ÊÇ" #: src/util.c:1435 ! msgid "No" msgstr "·ñ" --- 1511,1521 ---- #: src/util.c:1426 ! #, fuzzy ! msgid "_Yes" msgstr "ÊÇ" #: src/util.c:1435 ! #, fuzzy ! msgid "_No" msgstr "·ñ" |
|
From: <sta...@us...> - 2003-09-30 17:20:29
|
Update of /cvsroot/gqclient/gq
In directory sc8-pr-cvs1:/tmp/cvs-serv11957
Modified Files:
COPYING ChangeLog Makefile.am README.NLS TODO
Log Message:
* Fixed many small bugs wrt gtk2, cleanups
* Ported the dt_text to gtk2 and GtkTextView
* Added keyboard mnemonics in a-great-many-places. Needs to be
fixed so that for gtk 1.2 those underlines do not show up
* Fixed the Filter Window
* Almost fixed the License Window (but not quite)
* Changed COPYING.h and introduced COPYING.c
(autogenerated). COPYING.c gets built from the top-level COPYING
file.
Index: COPYING
===================================================================
RCS file: /cvsroot/gqclient/gq/COPYING,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** COPYING 25 Mar 2000 14:40:24 -0000 1.1.1.1
--- COPYING 30 Sep 2003 17:20:24 -0000 1.2
***************
*** 1,2 ****
--- 1,10 ----
+ GQ -- a GTK-based LDAP client
+ Copyright (C) 1998-2003 Bert Vermeulen
+ Parts: Copyright (C) 2002-2003 Peter Stamfest and Bert Vermeulen
+
+ This program is released under the Gnu General Public License with
+ the additional exemption that compiling, linking, and/or using
+ OpenSSL is allowed.
+
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gqclient/gq/ChangeLog,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** ChangeLog 28 Sep 2003 23:47:20 -0000 1.40
--- ChangeLog 30 Sep 2003 17:20:24 -0000 1.41
***************
*** 1,2 ****
--- 1,28 ----
+ 2003-09-30 Peter Stamfest <pe...@st...>
+ * Fixed many small bugs wrt gtk2, cleanups
+ * Ported the dt_text to gtk2 and GtkTextView
+ * Added keyboard mnemonics in a-great-many-places. Needs to be
+ fixed so that for gtk 1.2 those underlines do not show up
+ * Fixed the Filter Window
+ * Almost fixed the License Window (but not quite)
+ * Changed COPYING.h and introduced COPYING.c
+ (autogenerated). COPYING.c gets built from the top-level COPYING
+ file.
+ 2003-09-29 Peter Stamfest <pe...@st...>
+ * The GREAT GTK UPGRADE: gtk 1.2 -> gtk 2
+ - A full gtk2 development environment is required from now on,
+ but the distribution should build on gtk 1.2 for the time
+ being. I want to have the next release as a dual gtk1.x/2
+ version. Afterward gtk 1.x support will be dropped.
+ - Many changes to signal handlers due to new signal semantics in gtk2
+ * Many header files: Added $Id$, multiple inclusion protection and
+ copyright notices
+ * Most header files now are self-contained. There is a "test"
+ target in the src Makefile to check this. TODO: structurize and
+ reorganize the header files
+ * A ngettext fix to support languages with different word-orders
+ (Hatuka*nezumi <ne...@jc...>)
+ * Added some const keyword where they were indicated by the gtk2
+ switch.
2003-09-28 Peter Stamfest <pe...@st...>
* Finally added the chinese po file contributed by
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gqclient/gq/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Makefile.am 28 Sep 2003 23:42:36 -0000 1.10
--- Makefile.am 30 Sep 2003 17:20:24 -0000 1.11
***************
*** 24,27 ****
-rm -rf $(LANGPACK) && mkdir $(LANGPACK)
ls -1d po po/*.po langpack $(LANGPACK_DIST) | cpio -p $(LANGPACK)
! GZIP=$(GZIP_ENV) $(TAR) chozf $(LANGPACK).tar.gz $(LANGPACK)
-rm -rf $(LANGPACK)
--- 24,27 ----
-rm -rf $(LANGPACK) && mkdir $(LANGPACK)
ls -1d po po/*.po langpack $(LANGPACK_DIST) | cpio -p $(LANGPACK)
! GZIP=$(GZIP_ENV) tar chozf $(LANGPACK).tar.gz $(LANGPACK)
-rm -rf $(LANGPACK)
Index: README.NLS
===================================================================
RCS file: /cvsroot/gqclient/gq/README.NLS,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** README.NLS 11 Oct 2002 14:11:31 -0000 1.3
--- README.NLS 30 Sep 2003 17:20:24 -0000 1.4
***************
*** 25,29 ****
Translators at this point are not absolutely required to translate
! such messages. If they so, however, they should NOT include the
"tooltip|" prefix in the translation.
--- 25,29 ----
Translators at this point are not absolutely required to translate
! such messages. If they do, however, they should NOT include the
"tooltip|" prefix in the translation.
Index: TODO
===================================================================
RCS file: /cvsroot/gqclient/gq/TODO,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** TODO 28 Sep 2003 23:44:45 -0000 1.30
--- TODO 30 Sep 2003 17:20:24 -0000 1.31
***************
*** 75,81 ****
Wed, 09 Oct 2002 19:40:37 +0200.
- * Better keyboard support (at least for main menu) (peter) - will probably
- have to wait for gtk2
-
* [1.0] never do ldap_add when moving trees. Use triangulation like with the
towers of hanoi
--- 75,78 ----
***************
*** 184,185 ****
--- 181,186 ----
* check for the codeset ISO-8859-1 vs ISO8859-1 to be used for iconv
in configure.in
+
+ * Better keyboard support (at least for main menu) (peter) - will probably
+ have to wait for gtk2 - mostly done
+
|
Update of /cvsroot/gqclient/gq/src
In directory sc8-pr-cvs1:/tmp/cvs-serv16359/src
Modified Files:
COPYING.h Makefile.am browse-dnd.h browse.c configfile.c
configfile.h dt_binary.c dt_cert.c dt_clist.c dt_crl.c
dt_generic_binary.c dt_jpeg.c dt_password.c dt_text.c
dt_time.c filter.c filter.h gq.h input.c input.h ldif.h
mainwin.c mainwin.h prefs.c prefs.h schema.h schemabrowse.c
search.c tdefault.h template.c template.h tinput.h util.c
util.h
Log Message:
* The GREAT GTK UPGRADE: gtk 1.2 -> gtk 2
- A full gtk2 development environment is required from now on, but
the distribution should build on gtk 1.2 for the time being. I want to
have the next release as a dual gtk1.x/2 version. Afterward gtk 1.x
support will be dropped.
- Many changes to signal handlers due to new signal semantics in gtk2
* Many header files: Added $Id$, multiple inclusion protection and
copyright notices
* Most header files now are self-contained. There is a "test" target
in the src Makefile to check this. TODO: structurize and reorganize
the header files
* A ngettext fix to support languages with different word-orders
(Hatuka*nezumi <ne...@jc...>)
* Added some const keyword where they were indicated by the gtk2
switch.
Index: COPYING.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/COPYING.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** COPYING.h 3 Apr 2002 12:42:11 -0000 1.5
--- COPYING.h 29 Sep 2003 19:24:14 -0000 1.6
***************
*** 1,6 ****
char *license = "\n\
GQ -- a GTK-based LDAP client\n\
! Copyright (C) 1998-2002 Bert Vermeulen\n\
! Parts: Copyright (C) 2002 Peter Stamfest and Bert Vermeulen\n\
\n\
This program is released under the Gnu General Public License with\n\
--- 1,6 ----
char *license = "\n\
GQ -- a GTK-based LDAP client\n\
! Copyright (C) 1998-2003 Bert Vermeulen\n\
! Parts: Copyright (C) 2002-2003 Peter Stamfest and Bert Vermeulen\n\
\n\
This program is released under the Gnu General Public License with\n\
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gqclient/gq/src/Makefile.am,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Makefile.am 11 Oct 2002 13:44:19 -0000 1.23
--- Makefile.am 29 Sep 2003 19:24:15 -0000 1.24
***************
*** 86,87 ****
--- 86,102 ----
sysdir = $(datadir)/gnome/apps/Internet
sys_DATA = gq.desktop
+
+
+ test: self-contained-headers
+
+ TEST-%.h.c: %.h
+ echo "#include \"$<\"" > $@
+
+ .PHONY: self-contained-headers
+
+ self-contained-headers: $(addsuffix .o, $(addprefix TEST-, $(noinst_HEADERS)))
+
+ clean: test-clean
+
+ test-clean:
+ rm -f TEST-*.c TEST-*.o
\ No newline at end of file
Index: browse-dnd.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/browse-dnd.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** browse-dnd.h 26 Sep 2003 23:30:28 -0000 1.3
--- browse-dnd.h 29 Sep 2003 19:24:15 -0000 1.4
***************
*** 31,34 ****
--- 31,35 ----
#include <gtk/gtk.h>
+ #include "common.h"
/* Flags used in new_dnd_refresh on top of the options for
Index: browse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/browse.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** browse.c 28 Sep 2003 22:59:39 -0000 1.66
--- browse.c 29 Sep 2003 19:24:15 -0000 1.67
***************
*** 1016,1033 ****
/* avoid recursive calls to this handler - this causes crashes!!! */
! if (gtk_signal_n_emissions_by_name(GTK_OBJECT(ctree),
! "tree-select-row") > 1) {
! gtk_signal_emit_stop_by_name(GTK_OBJECT(ctree),
! "tree-select-row");
return;
}
entry = (browse_entry *) gtk_ctree_node_get_row_data(ctree, node);
! if (!entry) return;
! if (entry->select) {
! entry->select(entry, ctree, node, tab);
}
! BROWSETAB(tab)->tree_row_selected = node;
}
--- 1016,1044 ----
/* avoid recursive calls to this handler - this causes crashes!!! */
! if (gtk_object_get_data(GTK_OBJECT(ctree), "in-tree_row_selected")) {
! g_signal_stop_emission_by_name(GTK_OBJECT(ctree),
! "tree-select-row");
return;
}
+ gtk_object_set_data(GTK_OBJECT(ctree), "in-tree_row_selected", (gpointer) 1);
+
+ /* if (gtk_signal_n_emissions_by_name(GTK_OBJECT(ctree), */
+ /* "tree-select-row") > 1) { */
+ /* g_signal_stop_emission_by_name(GTK_OBJECT(ctree), */
+ /* "tree-select-row"); */
+ /* return; */
+ /* } */
+
entry = (browse_entry *) gtk_ctree_node_get_row_data(ctree, node);
! if (entry) {
! if (entry->select) {
! entry->select(entry, ctree, node, tab);
! }
! BROWSETAB(tab)->tree_row_selected = node;
}
!
! gtk_object_remove_data(GTK_OBJECT(ctree), "in-tree_row_selected");
}
***************
*** 1130,1149 ****
/* free the entry related struct inputform and data it refers to */
void inputform_free(struct inputform *iform)
{
! if(iform->olddn)
! g_free(iform->olddn);
!
! if(iform->dn)
! g_free(iform->dn);
!
! if(iform->oldlist)
! free_formlist(iform->oldlist);
!
! if(iform->formlist)
! free_formlist(iform->formlist);
!
! free(iform);
!
}
--- 1141,1171 ----
/* free the entry related struct inputform and data it refers to */
+ /* gtk2 checked (multiple destroy callbacks safety), confidence 0.95 */
void inputform_free(struct inputform *iform)
{
! assert(iform);
! if (iform) {
! if(iform->olddn) {
! g_free(iform->olddn);
! iform->olddn = NULL;
! }
!
! if(iform->dn) {
! g_free(iform->dn);
! iform->dn = NULL;
! }
!
! if(iform->oldlist) {
! free_formlist(iform->oldlist);
! iform->oldlist = NULL;
! }
!
! if(iform->formlist) {
! free_formlist(iform->formlist);
! iform->formlist = NULL;
! }
!
! free(iform);
! }
}
***************
*** 1666,1670 ****
browse_entry *entry;
int msg, num_entries;
! char *filename;
FILE *outfile = NULL;
GString *out = NULL;
--- 1688,1692 ----
browse_entry *entry;
int msg, num_entries;
! const char *filename;
FILE *outfile = NULL;
GString *out = NULL;
***************
*** 1781,1788 ****
snprintf(message, sizeof(message),
! ngettext("One entry exported to ",
! "%1$d entries exported to ", num_entries),
! num_entries);
! strcat(message, filename);
statusbar_msg(message);
--- 1803,1809 ----
snprintf(message, sizeof(message),
! ngettext("One entry exported to %2$s",
! "%1$d entries exported to %2$s", num_entries),
! num_entries, filename);
statusbar_msg(message);
***************
*** 1809,1815 ****
}
!
void dump_subtree_filesel_destroy(GtkWidget *button, GtkWidget *filesel)
{
gtk_widget_destroy(filesel);
}
--- 1830,1837 ----
}
! /* gtk2 checked (multiple destroy callbacks safety), confidence 0.85 */
void dump_subtree_filesel_destroy(GtkWidget *button, GtkWidget *filesel)
{
+ assert(filesel);
gtk_widget_destroy(filesel);
}
***************
*** 2150,2156 ****
gtk_signal_emit_stop_by_name(GTK_OBJECT(ctreeroot),
"button_press_event");
}
! return(TRUE);
}
--- 2172,2183 ----
gtk_signal_emit_stop_by_name(GTK_OBJECT(ctreeroot),
"button_press_event");
+ return(TRUE);
}
! #if GTK_MAJOR >= 2
! return(FALSE);
! #else
! return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
! #endif
}
Index: configfile.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/configfile.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** configfile.c 28 Sep 2003 23:10:49 -0000 1.30
--- configfile.c 29 Sep 2003 19:24:15 -0000 1.31
***************
*** 741,745 ****
/* just a pretty printer */
! void config_write(struct writeconfig *wc, char *string)
{
int i;
--- 741,745 ----
/* just a pretty printer */
! void config_write(struct writeconfig *wc, const char *string)
{
int i;
***************
*** 753,757 ****
! void config_write_bool(struct writeconfig *wc, int value, char *entity)
{
char outstr[128];
--- 753,757 ----
! void config_write_bool(struct writeconfig *wc, int value, const char *entity)
{
char outstr[128];
***************
*** 764,768 ****
! void config_write_int(struct writeconfig *wc, int value, char *entity)
{
char outstr[128];
--- 764,768 ----
! void config_write_int(struct writeconfig *wc, int value, const char *entity)
{
char outstr[128];
***************
*** 775,779 ****
! void config_write_string(struct writeconfig *wc, char *value, char *entity)
{
int i;
--- 775,779 ----
! void config_write_string(struct writeconfig *wc, const char *value, const char *entity)
{
int i;
***************
*** 796,800 ****
! void config_write_string_ne(struct writeconfig *wc, char *value, char *entity)
{
--- 796,800 ----
! void config_write_string_ne(struct writeconfig *wc, const char *value, const char *entity)
{
Index: configfile.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/configfile.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** configfile.h 28 Sep 2003 23:10:50 -0000 1.21
--- configfile.h 29 Sep 2003 19:24:15 -0000 1.22
***************
*** 222,230 ****
void load_config(void);
! void config_write(struct writeconfig *wc, char *string);
! void config_write_bool(struct writeconfig *wc, int value, char *entity);
! void config_write_int(struct writeconfig *wc, int value, char *entity);
! void config_write_string(struct writeconfig *wc, char *value, char *entity);
! void config_write_string_ne(struct writeconfig *wc, char *value, char *entity);
void save_config(void);
void init_config(void);
--- 222,230 ----
void load_config(void);
! void config_write(struct writeconfig *wc, const char *string);
! void config_write_bool(struct writeconfig *wc, int value, const char *entity);
! void config_write_int(struct writeconfig *wc, int value, const char *entity);
! void config_write_string(struct writeconfig *wc, const char *value, const char *entity);
! void config_write_string_ne(struct writeconfig *wc, const char *value, const char *entity);
void save_config(void);
void init_config(void);
Index: dt_binary.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_binary.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** dt_binary.c 28 Sep 2003 03:26:25 -0000 1.11
--- dt_binary.c 29 Sep 2003 19:24:16 -0000 1.12
***************
*** 37,40 ****
--- 37,41 ----
#include <glib.h>
#include <gdk/gdk.h>
+ #define GTK_ENABLE_BROKEN /* for the text widget - should be replaced - FIXME */
#include <gtk/gtk.h>
***************
*** 320,324 ****
--- 321,329 ----
if (!fixed_style) {
fixed_style = gtk_style_new();
+ #if GTK_MAJOR >= 2
+ gtk_style_set_font(fixed_style, gdk_font_load("fixed"));
+ #else
fixed_style->font = gdk_font_load("fixed");
+ #endif
}
gtk_widget_set_style(widget, fixed_style);
Index: dt_cert.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_cert.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** dt_cert.c 28 Sep 2003 23:16:54 -0000 1.7
--- dt_cert.c 29 Sep 2003 19:24:16 -0000 1.8
***************
*** 40,43 ****
--- 40,44 ----
#include <glib.h>
#include <gdk/gdk.h>
+ #define GTK_ENABLE_BROKEN /* for the text widget - should be replaced - FIXME */
#include <gtk/gtk.h>
Index: dt_clist.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_clist.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dt_clist.c 28 Sep 2003 03:26:25 -0000 1.3
--- dt_clist.c 29 Sep 2003 19:24:16 -0000 1.4
***************
*** 40,43 ****
--- 40,44 ----
#include <glib.h>
#include <gdk/gdk.h>
+ #define GTK_ENABLE_BROKEN /* for the text widget - should be replaced - FIXME */
#include <gtk/gtk.h>
***************
*** 174,177 ****
--- 175,180 ----
gtk_window_set_title(GTK_WINDOW(window), _("Attribute Details"));
gtk_window_set_default_size(GTK_WINDOW(window), 670, 560);
+
+ /* What is this? PS: 20030929 - FIXME */
gtk_signal_connect_object(GTK_OBJECT(window), "destroy",
(GtkSignalFunc) gtk_widget_destroy,
Index: dt_crl.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_crl.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** dt_crl.c 12 Jul 2002 22:29:02 -0000 1.4
--- dt_crl.c 29 Sep 2003 19:24:16 -0000 1.5
***************
*** 40,43 ****
--- 40,44 ----
#include <glib.h>
#include <gdk/gdk.h>
+ #define GTK_ENABLE_BROKEN /* for the text widget - should be replaced - FIXME */
#include <gtk/gtk.h>
Index: dt_generic_binary.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_generic_binary.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** dt_generic_binary.c 28 Sep 2003 03:26:25 -0000 1.8
--- dt_generic_binary.c 29 Sep 2003 19:24:16 -0000 1.9
***************
*** 33,41 ****
#include <unistd.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
! #include <config.h>
#include "common.h"
--- 33,45 ----
#include <unistd.h>
+ #include <config.h>
+
#include <glib.h>
#include <gdk/gdk.h>
+
+ #define GTK_ENABLE_BROKEN /* for the text widget - should be replaced */
#include <gtk/gtk.h>
! #include "dt_generic_binary.h"
#include "common.h"
***************
*** 48,52 ****
#include "encode.h"
#include "ldif.h" /* for b64_decode */
- #include "dt_generic_binary.h"
#include "i18n.h"
--- 52,55 ----
Index: dt_jpeg.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_jpeg.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** dt_jpeg.c 28 Sep 2003 03:26:25 -0000 1.8
--- dt_jpeg.c 29 Sep 2003 19:24:16 -0000 1.9
***************
*** 133,140 ****
--- 133,146 ----
GdkPixbufLoader* loader;
GByteArray *copy;
+ GError *error = NULL;
loader = gdk_pixbuf_loader_new();
+ #if GTK_MAJOR >= 2
+ gdk_pixbuf_loader_write(loader, data->data, data->len, &error); /* FIXME - error handling */
+ if (!error) gdk_pixbuf_loader_close(loader, &error);
+ #else
gdk_pixbuf_loader_write(loader, data->data, data->len);
gdk_pixbuf_loader_close(loader);
+ #endif
pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
Index: dt_password.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_password.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** dt_password.c 28 Sep 2003 23:14:52 -0000 1.13
--- dt_password.c 29 Sep 2003 19:24:16 -0000 1.14
***************
*** 366,370 ****
--- 366,374 ----
for(i = 0 ; cryptmap[i].keyword[0] ; i++) {
+ #if GTK_MAJOR >= 2
+ temp = gdk_string_width(gtk_style_get_font(style), cryptmap[i].keyword);
+ #else
temp = gdk_string_width(style->font, cryptmap[i].keyword);
+ #endif
if (temp > max_width)
max_width = temp;
***************
*** 387,391 ****
GtkWidget *hbox)
{
! char *crypt_type = "Clear";
GList *boxchildren;
GtkWidget *entry, *combo;
--- 391,395 ----
GtkWidget *hbox)
{
! const char *crypt_type = "Clear";
GList *boxchildren;
GtkWidget *entry, *combo;
Index: dt_text.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_text.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** dt_text.c 28 Sep 2003 03:26:25 -0000 1.8
--- dt_text.c 29 Sep 2003 19:24:16 -0000 1.9
***************
*** 73,78 ****
--- 73,85 ----
GtkWidget *inputbox;
+ #if GTK_MAJOR >= 2
+ inputbox = gtk_entry_new();
+ gtk_entry_set_editable(GTK_ENTRY(inputbox), TRUE);
+ #warning "GTK2 support does not allow for multiline text right now"
+ #else
inputbox = gtk_text_new(NULL, NULL);
gtk_text_set_editable(GTK_TEXT(inputbox), TRUE);
+ #endif
+
dt_entry_set_data(form, data, inputbox);
Index: dt_time.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_time.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** dt_time.c 28 Sep 2003 03:26:25 -0000 1.6
--- dt_time.c 29 Sep 2003 19:24:16 -0000 1.7
***************
*** 279,283 ****
--- 279,287 ----
offset = -ofs_sign * (100 * ofs_h + ofs_m);
+ #ifdef GTK_WINDOW_DIALOG
editwindow = gtk_window_new(GTK_WINDOW_DIALOG);
+ #else
+ editwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ #endif
cbd->editwindow = editwindow;
Index: filter.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/filter.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** filter.c 26 Sep 2003 23:30:29 -0000 1.15
--- filter.c 29 Sep 2003 19:24:16 -0000 1.16
***************
*** 50,54 ****
! struct gq_filter *check_filtername(char *filtername)
{
GList *filterlist;
--- 50,54 ----
! struct gq_filter *check_filtername(const char *filtername)
{
GList *filterlist;
***************
*** 76,80 ****
struct tab *tab;
int tabnum;
! char *searchstring, *filtername, *servername, *searchbase, msg[192];
/* find current tab */
--- 76,81 ----
struct tab *tab;
int tabnum;
! char *searchstring, *servername, *searchbase, msg[192];
! const char *filtername;
/* find current tab */
***************
*** 180,186 ****
--- 181,190 ----
gtk_window_set_title(GTK_WINDOW(window), _("Filter name"));
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
+
+ /* What does this mean... (PS: 20030929) */
gtk_signal_connect_object(GTK_OBJECT(window), "destroy",
(GtkSignalFunc) gtk_widget_destroy,
(gpointer) window);
+
gtk_signal_connect_object(GTK_OBJECT(window), "key_press_event",
GTK_SIGNAL_FUNC(close_on_esc),
***************
*** 287,290 ****
--- 291,296 ----
gtk_window_set_title(GTK_WINDOW(window), _("Filters"));
gtk_window_set_default_size(GTK_WINDOW(window), 670, 350);
+
+ /* what does this mean? (PS 20030929) - FIXME */
gtk_signal_connect_object(GTK_OBJECT(window), "destroy",
(GtkSignalFunc) gtk_widget_destroy,
***************
*** 510,513 ****
--- 516,521 ----
gtk_container_border_width(GTK_CONTAINER(window), 12);
gtk_window_set_title(GTK_WINDOW(window), _("Edit filter"));
+
+ /* What does this mean? (PS 20030929) */
gtk_signal_connect_object(GTK_OBJECT(window), "destroy",
(GtkSignalFunc) gtk_widget_destroy,
***************
*** 583,586 ****
--- 591,614 ----
gtk_box_pack_start(GTK_BOX(hbox1), indent, FALSE, FALSE, 0);
+ #if GTK_MAJOR >= 2
+ editbox = gtk_text_view_new();
+ gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox);
+ gtk_text_view_set_editable(GTK_TEXT_VIEW(editbox), TRUE);
+ gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editbox), GTK_WRAP_NONE);
+
+ GTK_WIDGET_SET_FLAGS(editbox, GTK_CAN_FOCUS);
+
+ /* populate editbox */
+ if(filter) {
+ indented = indent_filter(filter->ldapfilter);
+
+ gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)),
+ indented, strlen(indented)); /* FIXME: UTF-8 ?? */
+
+ g_free(indented);
+ }
+
+ /* gtk_text_set_point(GTK_TEXT(editbox), 0); */ /* FIXME */
+ #else
editbox = gtk_text_new(NULL, NULL);
gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox);
***************
*** 606,609 ****
--- 634,638 ----
}
gtk_text_set_point(GTK_TEXT(editbox), 0);
+ #endif
gtk_widget_show(editbox);
***************
*** 645,649 ****
int row, is_a_new_filter;
char msg[192], *clist_content[5], *labeltext;
! char *filtername, *servername, *basedn, *filtertext, *flattened;
filter = (struct gq_filter *) gtk_object_get_data(GTK_OBJECT(window), "filter");
--- 674,679 ----
int row, is_a_new_filter;
char msg[192], *clist_content[5], *labeltext;
! const char *filtername, *servername, *basedn;
! char *filtertext, *flattened;
filter = (struct gq_filter *) gtk_object_get_data(GTK_OBJECT(window), "filter");
***************
*** 932,938 ****
--- 962,973 ----
g_free(unindented);
+ #if GTK_MAJOR >= 2
+ gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)),
+ indented, strlen(indented)); /* FIXME: UTF-8 ?? */
+ #else
gtk_text_set_point(GTK_TEXT(editbox), 0);
gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox)));
gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, indented, -1);
+ #endif
g_free(indented);
}
***************
*** 945,951 ****
--- 980,991 ----
g_free(indented);
+ #if GTK_MAJOR >= 2
+ gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)),
+ unindented, strlen(unindented)); /* FIXME: UTF-8 ?? */
+ #else
gtk_text_set_point(GTK_TEXT(editbox), 0);
gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox)));
gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, unindented, -1);
+ #endif
g_free(unindented);
}
Index: filter.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/filter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** filter.h 18 Mar 2002 23:46:15 -0000 1.2
--- filter.h 29 Sep 2003 19:24:16 -0000 1.3
***************
*** 2,5 ****
--- 2,6 ----
GQ -- a GTK-based LDAP client
Copyright (C) 1998-2002 Bert Vermeulen
+ Copyright (c) 2002-2003 Peter Stamfest <pe...@st...>
This program is released under the Gnu General Public License with
***************
*** 22,25 ****
--- 23,30 ----
*/
+ /* $Id$ */
+
+ #ifndef GQ_FILTER_H_INCLUDED
+ #define GQ_FILTER_H_INCLUDED
#define FILTER_TABSIZE 5
***************
*** 29,32 ****
--- 34,38 ----
#define MAX_LDAPFILTER_LEN 1024
+ #include "common.h"
struct gq_filter {
***************
*** 39,43 ****
! struct gq_filter *check_filtername(char *filtername);
void add_filter(GtkWidget *filternamebox);
void name_popup(void);
--- 45,49 ----
! struct gq_filter *check_filtername(const char *filtername);
void add_filter(GtkWidget *filternamebox);
void name_popup(void);
***************
*** 57,58 ****
--- 63,66 ----
char *unindent_filter(char *indented);
void indent_toggled(GtkToggleButton *indent, gpointer editbox);
+
+ #endif /* GQ_FILTER_H_INCLUDED */
Index: gq.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/gq.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** gq.h 11 Oct 2002 13:50:14 -0000 1.3
--- gq.h 29 Sep 2003 19:24:16 -0000 1.4
***************
*** 29,32 ****
--- 29,35 ----
#define FONT_BIG_FIXED "-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*"
+ #include <glib.h>
+ #include <gtk/gtk.h>
+
extern GdkFont *big_fixed;
void setup_fonts(void);
Index: input.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/input.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** input.c 28 Sep 2003 23:10:50 -0000 1.55
--- input.c 29 Sep 2003 19:24:16 -0000 1.56
***************
*** 1764,1771 ****
ff->displaytype = DISPLAYTYPE_ENTRY;
ff->dt_handler = get_dt_handler(ff->displaytype);
! }
! else if(!strcmp(transformtype, "make text")) {
if(GTK_IS_TEXT(focusbox))
return;
ff->displaytype = DISPLAYTYPE_TEXT;
--- 1764,1772 ----
ff->displaytype = DISPLAYTYPE_ENTRY;
ff->dt_handler = get_dt_handler(ff->displaytype);
! } else if(!strcmp(transformtype, "make text")) {
! #if GTK_MAJOR < 2
if(GTK_IS_TEXT(focusbox))
return;
+ #endif
ff->displaytype = DISPLAYTYPE_TEXT;
***************
*** 1838,1844 ****
}
/* this is really table->vbox->viewport->scrolled_window */
! gtk_container_queue_resize(GTK_CONTAINER(iform->table->parent->parent->parent));
!
}
--- 1839,1846 ----
}
+ #if GTK_MAJOR < 2
/* this is really table->vbox->viewport->scrolled_window */
! gtk_container_queue_resize(GTK_CONTAINER(iform->table->parent->parent->parent)); /* FIXME ? */
! #endif
}
***************
*** 1882,1888 ****
button for extensibleObjects */
static void attr_destroy(GtkWidget *window, attr_dialog_comm *comm) {
! comm->breakloop = 1;
! comm->destroyed = 1;
}
--- 1884,1893 ----
button for extensibleObjects */
+ /* gtk2 checked (multiple destroy callbacks safety), confidence 1 */
static void attr_destroy(GtkWidget *window, attr_dialog_comm *comm) {
! if (comm) {
! comm->breakloop = 1;
! comm->destroyed = 1;
! }
}
Index: input.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/input.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** input.h 28 Sep 2003 15:26:59 -0000 1.11
--- input.h 29 Sep 2003 19:24:17 -0000 1.12
***************
*** 25,28 ****
--- 25,32 ----
#define GQ_INPUT_H_INCLUDED
+ #include <glib.h>
+ #include <gtk/gtk.h>
+ #include "common.h"
+
struct inputform {
GtkWidget *parent_window;
Index: ldif.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/ldif.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ldif.h 2 Aug 2002 06:08:00 -0000 1.5
--- ldif.h 29 Sep 2003 19:24:17 -0000 1.6
***************
*** 25,28 ****
--- 25,33 ----
#define GQ_LDIF_H_INCLUDED
+ #include <glib.h>
+ #include <gtk/gtk.h>
+
+ #include "common.h"
+
void prepend_ldif_header(GString *out, struct ldapserver *server,
GList *bases);
Index: mainwin.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/mainwin.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** mainwin.c 28 Sep 2003 23:10:50 -0000 1.31
--- mainwin.c 29 Sep 2003 19:24:17 -0000 1.32
***************
*** 114,118 ****
}
!
void gq_exit(GtkWidget *widget, gpointer *data)
{
--- 114,119 ----
}
! /* gtk2 checked (multiple destroy callbacks safety), confidence 0.7:
! cleanup_all_tabs semantics? */
void gq_exit(GtkWidget *widget, gpointer *data)
{
***************
*** 149,152 ****
--- 150,155 ----
gtk_window_set_policy(GTK_WINDOW(mainwin), FALSE, TRUE, FALSE);
+
+
outer_vbox = gtk_vbox_new(FALSE, 2);
gtk_container_border_width(GTK_CONTAINER(outer_vbox), 0);
***************
*** 161,165 ****
--- 164,174 ----
accel_group = gtk_accel_group_new();
+
+ #if GTK_MAJOR < 2
gtk_accel_group_attach(accel_group, GTK_OBJECT(mainwin));
+ #else
+ gtk_window_add_accel_group(GTK_WINDOW(mainwin), accel_group);
+ #endif
+
handlebox = gtk_handle_box_new();
***************
*** 344,348 ****
mainbook = gtk_notebook_new();
gtk_widget_show(mainbook);
! GTK_WIDGET_UNSET_FLAGS(GTK_NOTEBOOK(mainbook), GTK_CAN_FOCUS);
gtk_box_pack_start(GTK_BOX(main_vbox), mainbook, TRUE, TRUE, 0);
--- 353,357 ----
mainbook = gtk_notebook_new();
gtk_widget_show(mainbook);
! /* GTK_WIDGET_UNSET_FLAGS(GTK_NOTEBOOK(mainbook), GTK_CAN_FOCUS); */
gtk_box_pack_start(GTK_BOX(main_vbox), mainbook, TRUE, TRUE, 0);
***************
*** 545,548 ****
--- 554,558 ----
GtkWidget *vscroll, *ok_button;
GtkStyle *license_style;
+ PangoFontDescription *font_desc;
window = gtk_dialog_new();
***************
*** 561,570 ****
gtk_box_pack_start(GTK_BOX(vbox1), hbox, TRUE, TRUE, 0);
license_style = gtk_style_new();
license_style->font = gdk_font_load("fixed");
- gtk_object_set_data(GTK_OBJECT(window), "style", license_style);
text = gtk_text_new(NULL, NULL);
gtk_widget_set_style(text, license_style);
gtk_text_set_point(GTK_TEXT(text), 0);
gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
--- 571,582 ----
gtk_box_pack_start(GTK_BOX(vbox1), hbox, TRUE, TRUE, 0);
+ #if GTK_MAJOR < 2
license_style = gtk_style_new();
license_style->font = gdk_font_load("fixed");
text = gtk_text_new(NULL, NULL);
gtk_widget_set_style(text, license_style);
+ gtk_style_unref(license_style);
+
gtk_text_set_point(GTK_TEXT(text), 0);
gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
***************
*** 572,580 ****
--- 584,609 ----
gtk_widget_show(text);
gtk_text_set_editable(GTK_TEXT(text), FALSE);
+ #else
+ text = gtk_text_view_new();
+ /* Change default font throughout the widget */
+ font_desc = pango_font_description_from_string("Monospace");
+ gtk_widget_modify_font(text, font_desc);
+ pango_font_description_free (font_desc);
+
+ gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)),
+ license, strlen(license));
+
+ gtk_widget_show(text);
+
+ #endif
gtk_box_pack_start(GTK_BOX(hbox), text, TRUE, TRUE, 0);
+ #if GTK_MAJOR < 2
vscroll = gtk_vscrollbar_new(GTK_TEXT(text)->vadj);
gtk_box_pack_start(GTK_BOX(hbox), vscroll, FALSE, FALSE, 0);
gtk_widget_show(vscroll);
+ #else
+ #warning "Add vertical scrollbar here"
+ #endif
vbox2 = GTK_DIALOG(window)->action_area;
***************
*** 608,617 ****
void close_license_window(GtkWidget *window)
{
- GtkStyle *style;
-
- style = gtk_object_get_data(GTK_OBJECT(window), "style");
- gtk_style_unref(style);
gtk_widget_destroy(window);
-
}
--- 637,641 ----
***************
*** 654,657 ****
--- 678,682 ----
"GQ %s\n\n\n%s", VERSION, about_blurb);
about_label = gtk_label_new(about_text);
+ gtk_label_set_justify(GTK_LABEL(about_label), GTK_JUSTIFY_CENTER);
gtk_widget_show(about_label);
gtk_box_pack_start(GTK_BOX(hbox), about_label, FALSE, FALSE, 4);
***************
*** 689,700 ****
gboolean ctrl_b_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj)
{
-
if(event && event->type == GDK_KEY_PRESS &&
event->state & GDK_CONTROL_MASK && event->keyval == GDK_b) {
gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate");
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
}
! return(TRUE);
}
--- 714,729 ----
gboolean ctrl_b_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj)
{
if(event && event->type == GDK_KEY_PRESS &&
event->state & GDK_CONTROL_MASK && event->keyval == GDK_b) {
gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate");
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
+ return(TRUE);
}
! #if GTK_MAJOR >= 2
! return(FALSE);
! #else
! return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
! #endif
}
***************
*** 702,713 ****
gboolean ctrl_w_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj)
{
-
if(event && event->type == GDK_KEY_PRESS &&
event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) {
gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate");
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
}
! return(TRUE);
}
--- 731,746 ----
gboolean ctrl_w_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj)
{
if(event && event->type == GDK_KEY_PRESS &&
event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) {
gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate");
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
+ return(TRUE);
}
! #if GTK_MAJOR >= 2
! return(FALSE);
! #else
! return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
! #endif
}
Index: mainwin.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/mainwin.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** mainwin.h 28 Sep 2003 23:39:18 -0000 1.15
--- mainwin.h 29 Sep 2003 19:24:17 -0000 1.16
***************
*** 34,40 ****
#define PACKAGEVERSION PACKAGE " " VERSION
#define about_blurb "The gentleman's LDAP client" \
! "\n\n(C) 1998-2002 Bert Vermeulen <be...@bi...>" \
"\nand" \
! "\n(C) 2002 Peter Stamfest <pe...@st...>" \
"\n\nhttp://biot.com/gq/"
--- 34,40 ----
#define PACKAGEVERSION PACKAGE " " VERSION
#define about_blurb "The gentleman's LDAP client" \
! "\n\n(c) 1998-2003 Bert Vermeulen <be...@bi...>" \
"\nand" \
! "\n(c) 2002-2003 Peter Stamfest <pe...@st...>" \
"\n\nhttp://biot.com/gq/"
Index: prefs.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/prefs.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** prefs.c 12 Oct 2002 12:29:45 -0000 1.30
--- prefs.c 29 Sep 2003 19:24:17 -0000 1.31
***************
*** 85,89 ****
struct ldapserver *server, *servers;
int server_name_changed;
! char *text, *passwdtext, *passwdtext2;
gboolean passwdmatch;
char *ep = NULL;
--- 85,89 ----
struct ldapserver *server, *servers;
int server_name_changed;
! const char *text, *passwdtext, *passwdtext2;
gboolean passwdmatch;
char *ep = NULL;
***************
*** 235,239 ****
/* Bind type */
! text = (char *) get_widget(window, "bindtype");
server->bindtype = tokenize(token_bindtype, text);
--- 235,240 ----
/* Bind type */
! text = (const char *) gtk_object_get_data(GTK_OBJECT(window),
! "bindtype");
server->bindtype = tokenize(token_bindtype, text);
***************
*** 273,292 ****
static void destroy_edit_server_window(GtkWidget *this, gpointer data)
{
-
gtk_widget_destroy(current_edit_server_window);
current_edit_server_window = NULL;
-
}
-
static gboolean destroy_edit_server_window_on_esc(GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
!
! if(event && event->type == GDK_KEY_PRESS && event->keyval == GDK_Escape)
destroy_edit_server_window(NULL, NULL);
! return(TRUE);
}
--- 274,295 ----
static void destroy_edit_server_window(GtkWidget *this, gpointer data)
{
gtk_widget_destroy(current_edit_server_window);
current_edit_server_window = NULL;
}
static gboolean destroy_edit_server_window_on_esc(GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
! if(event && event->type == GDK_KEY_PRESS && event->keyval == GDK_Escape) {
destroy_edit_server_window(NULL, NULL);
+ return(TRUE);
+ }
! #if GTK_MAJOR >= 2
! return(FALSE);
! #else
! return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
! #endif
}
***************
*** 294,298 ****
{
gtk_object_set_data(GTK_OBJECT(window), "bindtype",
! gtk_entry_get_text(entry));
}
--- 297,301 ----
{
gtk_object_set_data(GTK_OBJECT(window), "bindtype",
! (gpointer) gtk_entry_get_text(entry)); /* ATTN: actually const */
}
***************
*** 338,342 ****
--- 341,349 ----
cb_data->server = server;
+ #if GTK_MAJOR < 2
editwindow = gtk_window_new(GTK_WINDOW_DIALOG);
+ #else
+ editwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ #endif
current_edit_server_window = editwindow;
gtk_object_set_data_full(GTK_OBJECT(editwindow),
***************
*** 419,422 ****
--- 426,430 ----
gtk_object_set_data(GTK_OBJECT(editwindow), "ldaphost", entry);
gtk_entry_set_text(GTK_ENTRY(entry), server->ldaphost);
+
gtk_widget_show(entry);
gtk_signal_connect(GTK_OBJECT(entry), "activate",
***************
*** 434,437 ****
--- 442,450 ----
);
+ /* Callback on HOST to enable/disable port if user enters a colon... */
+
+ gtk_signal_connect(GTK_OBJECT(host), "changed",
+ GTK_SIGNAL_FUNC(host_changed_callback), entry);
+
/* Port */
label = gtk_label_new(_("LDAP Port"));
***************
*** 462,472 ****
);
! /* Callback on HOST to enable/disable port if user enters a colon... */
!
! gtk_signal_connect(GTK_OBJECT(host), "changed",
! GTK_SIGNAL_FUNC(host_changed_callback), entry);
gtk_editable_changed(GTK_EDITABLE(host)); /* use callback to set
selectable state of
port entry */
/* Base DN */
--- 475,485 ----
);
! #if GTK_MAJOR >= 2
! g_signal_emit_by_name(host, "changed", NULL, NULL);
! #else
gtk_editable_changed(GTK_EDITABLE(host)); /* use callback to set
selectable state of
port entry */
+ #endif
/* Base DN */
***************
*** 617,628 ****
bindtype = gtk_combo_new();
! bindtypes = g_list_append(NULL, detokenize(token_bindtype,
! BINDTYPE_SIMPLE));
! bindtypes = g_list_append(bindtypes, detokenize(token_bindtype,
BINDTYPE_KERBEROS));
! bindtypes = g_list_append(bindtypes, detokenize(token_bindtype,
BINDTYPE_SASL));
gtk_object_set_data(GTK_OBJECT(editwindow), "bindtype",
! detokenize(token_bindtype, BINDTYPE_SIMPLE));
gtk_combo_set_popdown_strings(GTK_COMBO(bindtype), bindtypes);
g_list_free(bindtypes);
--- 630,645 ----
bindtype = gtk_combo_new();
! bindtypes = g_list_append(NULL,
! (gpointer) detokenize(token_bindtype,
! BINDTYPE_SIMPLE));
! bindtypes = g_list_append(bindtypes,
! (gpointer) detokenize(token_bindtype,
BINDTYPE_KERBEROS));
! bindtypes = g_list_append(bindtypes,
! (gpointer) detokenize(token_bindtype,
BINDTYPE_SASL));
gtk_object_set_data(GTK_OBJECT(editwindow), "bindtype",
! (gpointer) detokenize(token_bindtype, BINDTYPE_SIMPLE));
!
gtk_combo_set_popdown_strings(GTK_COMBO(bindtype), bindtypes);
g_list_free(bindtypes);
***************
*** 1505,1509 ****
GtkWidget *servercombo;
struct ldapserver *server;
! char *servername;
if( (servercombo = gtk_object_get_data(GTK_OBJECT(target), "schemaserver")) == NULL)
--- 1522,1526 ----
GtkWidget *servercombo;
struct ldapserver *server;
! const char *servername;
if( (servercombo = gtk_object_get_data(GTK_OBJECT(target), "schemaserver")) == NULL)
***************
*** 1525,1529 ****
GtkWidget *servercombo, *templatelist;
struct ldapserver *server;
! char *servername, *templatename;
if( (servercombo = gtk_object_get_data(GTK_OBJECT(target), "schemaserver")) == NULL)
--- 1542,1546 ----
GtkWidget *servercombo, *templatelist;
struct ldapserver *server;
! const char *servername, *templatename;
if( (servercombo = gtk_object_get_data(GTK_OBJECT(target), "schemaserver")) == NULL)
Index: prefs.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/prefs.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** prefs.h 12 Oct 2002 12:31:04 -0000 1.5
--- prefs.h 29 Sep 2003 19:24:17 -0000 1.6
***************
*** 28,31 ****
--- 28,34 ----
#define GQ_PREFS_H_INCLUDED
+ #include <gtk/gtk.h>
+ #include "common.h"
+
void create_edit_server_window(struct ldapserver *server);
void serverstab_newbutton_callback(GtkWidget *widget, GtkWidget *clist);
Index: schema.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/schema.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** schema.h 19 Apr 2002 04:18:55 -0000 1.6
--- schema.h 29 Sep 2003 19:24:17 -0000 1.7
***************
*** 31,34 ****
--- 31,36 ----
#include <ldap_schema.h>
+ #include "common.h"
+
#define GQ_SCHEMA_PARSE_FLAG 0x03
Index: schemabrowse.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/schemabrowse.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** schemabrowse.c 28 Sep 2003 22:50:38 -0000 1.15
--- schemabrowse.c 29 Sep 2003 19:24:17 -0000 1.16
***************
*** 34,37 ****
--- 34,40 ----
#include <string.h>
+
+ #define GTK_ENABLE_BROKEN /* for the tree widget - should be replaced */
+
#include <glib.h>
#include <gtk/gtk.h>
***************
*** 371,375 ****
if(tree) {
! /* this is a workaround -- lots of GTK warnings if I don't do this :-( */
sel = GTK_TREE_SELECTION(tree);
while(sel) {
--- 374,378 ----
if(tree) {
! /* thi#s is a workaround -- lots of GTK warnings if I don't do this :-( */
sel = GTK_TREE_SELECTION(tree);
while(sel) {
***************
*** 652,657 ****
--- 655,663 ----
paned = gtk_vpaned_new();
+ #if GTK_MAJOR < 1
gtk_paned_set_gutter_size(GTK_PANED(paned), 0);
gtk_paned_set_handle_size(GTK_PANED(paned), 0);
+ #endif
+
gtk_widget_show(paned);
gtk_box_pack_start(GTK_BOX(hbox1), paned, TRUE, TRUE, 10);
***************
*** 1502,1507 ****
--- 1508,1516 ----
paned = gtk_vpaned_new();
+ #if GTK_MAJOR < 1
gtk_paned_set_gutter_size(GTK_PANED(paned), 0);
gtk_paned_set_handle_size(GTK_PANED(paned), 0);
+ #endif
+
gtk_paned_set_position(GTK_PANED(paned), 157);
gtk_widget_show(paned);
Index: search.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/search.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** search.c 28 Sep 2003 22:50:39 -0000 1.31
--- search.c 29 Sep 2003 19:24:17 -0000 1.32
***************
*** 83,87 ****
GTK_WIDGET_SET_FLAGS(stinput, GTK_CAN_DEFAULT);
GTK_WIDGET_SET_FLAGS(stinput, GTK_RECEIVES_DEFAULT);
! gtk_widget_grab_default(stinput);
tab->focus = stinput;
--- 83,89 ----
GTK_WIDGET_SET_FLAGS(stinput, GTK_CAN_DEFAULT);
GTK_WIDGET_SET_FLAGS(stinput, GTK_RECEIVES_DEFAULT);
! /* yields a warning in gtk2 - FIXME, Maybe has to do with
! GtkNotebook being a NO_WINDOW widget */
! /* gtk_widget_grab_default(stinput); */
tab->focus = stinput;
Index: tdefault.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/tdefault.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** tdefault.h 19 Apr 2002 04:20:58 -0000 1.1
--- tdefault.h 29 Sep 2003 19:24:17 -0000 1.2
***************
*** 2,5 ****
--- 2,6 ----
GQ -- a GTK-based LDAP client
Copyright (C) 1998-2002 Bert Vermeulen
+ Copyright (c) 2002-2003 Peter Stamfest <pe...@st...>
This program is released under the Gnu General Public License with
***************
*** 22,25 ****
--- 23,33 ----
*/
+ /* $Id$ */
+
+ #ifndef GQ_TDEFAULT_H_INCLUDED
+ #define GQ_TDEFAULT_H_INCLUDED
+
+ #include <glib.h>
+ #include <gtk/gtk.h>
struct tdefault_ui {
***************
*** 50,51 ****
--- 58,61 ----
void create_tdefault_edit_window(GtkWidget *dummy, GtkWidget *templatewin);
void tdefault_type_changed(struct tdefault_ui *tdui);
+
+ #endif /* GQ_TDEFAULT_H_INCLUDED */
Index: template.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/template.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** template.c 12 Oct 2002 12:37:11 -0000 1.8
--- template.c 29 Sep 2003 19:24:17 -0000 1.9
***************
*** 55,59 ****
! void create_template_edit_window(struct ldapserver *server, char *templatename)
{
GList *list;
--- 55,60 ----
! void create_template_edit_window(struct ldapserver *server,
! const char *templatename)
{
GList *list;
***************
*** 321,330 ****
* this is g_strdup'ed so need to free it before the window goes
*/
gboolean delete_edit_window(GtkWidget *window)
{
char *templatename;
! if( (templatename = gtk_object_get_data(GTK_OBJECT(window), "templatename")))
! g_free(templatename);
return(FALSE);
--- 322,336 ----
* this is g_strdup'ed so need to free it before the window goes
*/
+ /* gtk2 checked (multiple destroy callbacks safety), confidence 0.9 */
gboolean delete_edit_window(GtkWidget *window)
{
char *templatename;
! if (window) {
! if( (templatename = gtk_object_get_data(GTK_OBJECT(window), "templatename")) != NULL) {
! g_free(templatename);
! gtk_object_set_data(GTK_OBJECT(window), "templatename", NULL);
! }
! }
return(FALSE);
Index: template.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/template.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** template.h 20 Feb 2001 01:22:46 -0000 1.2
--- template.h 29 Sep 2003 19:24:17 -0000 1.3
***************
*** 22,25 ****
--- 22,32 ----
*/
+ /* $Id$ */
+
+ #ifndef GQ_TEMPLATE_H_INCLUDED
+ #define GQ_TEMPLATE_H_INCLUDED
+
+ #include <glib.h>
+ #include "common.h"
struct gq_template {
***************
*** 28,34 ****
};
!
!
! void create_template_edit_window(struct ldapserver *server, char *template_name);
gboolean delete_edit_window(GtkWidget *window);
void fill_new_template(GtkWidget *window);
--- 35,40 ----
};
! void create_template_edit_window(struct ldapserver *server,
! const char *template_name);
gboolean delete_edit_window(GtkWidget *window);
void fill_new_template(GtkWidget *window);
***************
*** 42,43 ****
--- 48,52 ----
char *get_clist_selection(GtkWidget *clist);
int get_clist_row_by_text(GtkWidget *clist, char *text);
+
+
+ #endif
Index: tinput.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/tinput.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** tinput.h 20 Feb 2001 01:22:46 -0000 1.12
--- tinput.h 29 Sep 2003 19:24:17 -0000 1.13
***************
*** 22,25 ****
--- 22,33 ----
*/
+ /* $Id$ */
+
+ #ifndef GQ_TINPUT_H_INCLUDED
+ #define GQ_TINPUT_H_INCLUDED
+
+ #include <glib.h>
+ #include "common.h"
+ #include "template.h"
GList *formfill_from_template(struct ldapserver *schemaserver, struct gq_template *template);
***************
*** 27,28 ****
--- 35,38 ----
GList *add_attrs_by_oc(struct ldapserver *server, GList *oclist);
GList *add_schema_attrs(struct ldapserver *server, GList *value_list);
+
+ #endif /* GQ_TINPUT_H_INCLUDED */
Index: util.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/util.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** util.c 28 Sep 2003 22:43:25 -0000 1.56
--- util.c 29 Sep 2003 19:24:17 -0000 1.57
***************
*** 629,639 ****
int close_on_esc(GtkWidget *widget, GdkEventKey *event, gpointer obj)
{
-
if(event && event->type == GDK_KEY_PRESS && event->keyval == GDK_Escape) {
gtk_widget_destroy(GTK_WIDGET(obj));
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
}
! return(TRUE);
}
--- 629,643 ----
int close_on_esc(GtkWidget *widget, GdkEventKey *event, gpointer obj)
{
if(event && event->type == GDK_KEY_PRESS && event->keyval == GDK_Escape) {
gtk_widget_destroy(GTK_WIDGET(obj));
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
+ return(TRUE);
}
! #if GTK_MAJOR >= 2
! return(FALSE);
! #else
! return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
! #endif
}
***************
*** 650,660 ****
func(widget);
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
}
! return(TRUE);
}
! int tokenize(struct tokenlist *list, char *keyword)
{
int i;
--- 654,669 ----
func(widget);
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
+ return(TRUE);
}
! #if GTK_MAJOR >= 2
! return(FALSE);
! #else
! return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */
! #endif
}
! int tokenize(struct tokenlist *list, const char *keyword)
{
int i;
***************
*** 668,672 ****
! char *detokenize(struct tokenlist *list, int token)
{
int i;
--- 677,681 ----
! const char *detokenize(struct tokenlist *list, int token)
{
int i;
***************
*** 679,683 ****
}
! gpointer detokenize_data(struct tokenlist *list, int token)
{
int i;
--- 688,692 ----
}
! const gpointer detokenize_data(struct tokenlist *list, int token)
{
int i;
***************
*** 759,763 ****
* return pointer to (struct ldapserver *) matching name
*/
! struct ldapserver *server_by_name(char *name)
{
struct ldapserver *server;
--- 768,772 ----
* return pointer to (struct ldapserver *) matching name
*/
! struct ldapserver *server_by_name(const char *name)
{
struct ldapserver *server;
***************
*** 945,951 ****
--- 954,962 ----
gtk_widget_show(ok_button);
+ /* what does this mean? PS: 20030928 - FIXME */
gtk_signal_connect_object(GTK_OBJECT(window), "destroy",
(GtkSignalFunc) gtk_widget_destroy,
(gpointer) window);
+
gtk_signal_connect_object(GTK_OBJECT(window), "key_press_event",
GTK_SIGNAL_FUNC(close_on_esc),
***************
*** 970,974 ****
#ifdef HAVE_LDAP_STR2OBJECTCLASS
! GList *find_at_by_mr_oid(struct ldapserver *server, char *oid)
{
GList *list, *srvlist;
--- 981,985 ----
#ifdef HAVE_LDAP_STR2OBJECTCLASS
! GList *find_at_by_mr_oid(struct ldapserver *server, const char *oid)
{
GList *list, *srvlist;
***************
*** 995,999 ****
LDAPAttributeType *find_canonical_at_by_at(struct server_schema *schema,
! char *attr)
{
GList *atlist;
--- 1006,1010 ----
LDAPAttributeType *find_canonical_at_by_at(struct server_schema *schema,
! const char *attr)
{
GList *atlist;
***************
*** 1017,1021 ****
}
! GList *find_at_by_s_oid(struct ldapserver *server, char *oid)
{
GList *list, *srvlist;
--- 1028,1032 ----
}
! GList *find_at_by_s_oid(struct ldapserver *server, const char *oid)
{
GList *list, *srvlist;
***************
*** 1040,1044 ****
! GList *find_mr_by_s_oid(struct ldapserver *server, char *oid)
{
GList *list, *srvlist;
--- 1051,1055 ----
! GList *find_mr_by_s_oid(struct ldapserver *server, const char *oid)
{
GList *list, *srvlist;
***************
*** 1063,1067 ****
! GList *find_oc_by_at(struct ldapserver *server, char *atname)
{
GList *list, *srvlist;
--- 1074,1078 ----
! GList *find_oc_by_at(struct ldapserver *server, const char *atname)
{
GList *list, *srvlist;
***************
*** 1170,1174 ****
! struct gq_template *find_template_by_name(char *templatename)
{
GList *templatelist;
--- 1181,1185 ----
! struct gq_template *find_template_by_name(const char *templatename)
{
GList *templatelist;
***************
*** 1218,1224 ****
}
static void query_destroy(GtkWidget *button, GtkWidget *comm) {
if (! gtk_object_get_data(GTK_OBJECT(comm), "ended"))
! gtk_main_quit();
gtk_object_set_data(GTK_OBJECT(comm), "destroyed", "1");
--- 1229,1238 ----
}
+ /* gtk2 checked (multiple destroy callbacks safety), confidence 0.7 */
static void query_destroy(GtkWidget *button, GtkWidget *comm) {
+ assert(comm);
+ if (!comm) return;
if (! gtk_object_get_data(GTK_OBJECT(comm), "ended"))
! gtk_main_quit(); /* quits only nested main loop */
gtk_object_set_data(GTK_OBJECT(comm), "destroyed", "1");
Index: util.h
===================================================================
RCS file: /cvsroot/gqclient/gq/src/util.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** util.h 12 Oct 2002 12:50:42 -0000 1.19
--- util.h 29 Sep 2003 19:24:17 -0000 1.20
***************
*** 35,38 ****
--- 35,40 ----
#include <ldap_schema.h>
+ #include "common.h"
+
LDAP *open_connection(struct ldapserver *server);
void close_connection(struct ldapserver *server, int always);
***************
*** 60,69 ****
int close_on_esc(GtkWidget *widget, GdkEventKey *event, gpointer obj);
int func_on_esc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window);
! int tokenize(struct tokenlist *list, char *keyword);
! char *detokenize(struct tokenlist *list, int token);
! gpointer detokenize_data(struct tokenlist *list, int token);
char *get_username(void);
void statusbar_msg(char *message);
! struct ldapserver *server_by_name(char *name);
int is_leaf_entry(struct ldapserver *server, char *dn);
gboolean is_direct_parent(char *child, char *possible_parent);
--- 62,71 ----
int close_on_esc(GtkWidget *widget, GdkEventKey *event, gpointer obj);
int func_on_esc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window);
! int tokenize(struct tokenlist *list, const char *keyword);
! const char *detokenize(struct tokenlist *list, int token);
! const gpointer detokenize_data(struct tokenlist *list, int token);
char *get_username(void);
void statusbar_msg(char *message);
! struct ldapserver *server_by_name(const char *name);
int is_leaf_entry(struct ldapserver *server, char *dn);
gboolean is_direct_parent(char *child, char *possible_parent);
***************
*** 72,84 ****
void warning_popup(GList *messages);
void single_warning_popup(char *message);
! GList *find_at_by_mr_oid(struct ldapserver *server, char *oid);
! GList *find_at_by_s_oid(struct ldapserver *server, char *oid);
! GList *find_mr_by_s_oid(struct ldapserver *server, char *oid);
! GList *find_oc_by_at(struct ldapserver *server, char *atname);
LDAPAttributeType *find_canonical_at_by_at(struct server_schema *schema,
! char *attr);
! struct gq_template *find_template_by_name(char *templatename);
void dump_mods(LDAPMod **mods);
const char *find_s_by_at_oid(struct ldapserver *server, const char *oid);
--- 74,86 ----
void warning_popup(GList *messages);
void single_warning_popup(char *message);
! GList *find_at_by_mr_oid(struct ldapserver *server, const char *oid);
! GList *find_at_by_s_oid(struct ldapserver *server, const char *oid);
! GList *find_mr_by_s_oid(struct ldapserver *server, const char *oid);
! GList *find_oc_by_at(struct ldapserver *server, const char *atname);
LDAPAttributeType *find_canonical_at_by_at(struct server_schema *schema,
! const char *attr);
! struct gq_template *find_template_by_name(const char *templatename);
void dump_mods(LDAPMod **mods);
const char *find_s_by_at_oid(struct ldapserver *server, const char *oid);
|
|
From: <sta...@us...> - 2003-09-29 19:32:52
|
Update of /cvsroot/gqclient/gq
In directory sc8-pr-cvs1:/tmp/cvs-serv18154
Modified Files:
missing
Log Message:
* Upgraded to the missing script coming with automake 1.6
Index: missing
===================================================================
RCS file: /cvsroot/gqclient/gq/missing,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** missing 25 Mar 2000 14:40:34 -0000 1.1.1.1
--- missing 29 Sep 2003 19:32:47 -0000 1.2
***************
*** 1,6 ****
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
! # Copyright (C) 1996, 1997 Free Software Foundation, Inc.
! # Franc,ois Pinard <pi...@ir...>, 1996.
# This program is free software; you can redistribute it and/or modify
--- 1,6 ----
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
! # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
! # Originally by Fran,cois Pinard <pi...@ir...>, 1996.
# This program is free software; you can redistribute it and/or modify
***************
*** 19,22 ****
--- 19,27 ----
# 02111-1307, USA.
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
***************
*** 24,27 ****
--- 29,53 ----
fi
+ run=:
+
+ # In the cases where this matters, `missing' is being run in the
+ # srcdir already.
+ if test -f configure.ac; then
+ configure_ac=configure.ac
+ else
+ configure_ac=configure.in
+ fi
+
+ case "$1" in
+ --run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+ esac
+
+ # If it does not exist, or fails to run (possibly an outdated version),
+ # try to emulate it.
case "$1" in
***************
*** 36,39 ****
--- 62,66 ----
-h, --help display this help and exit
-v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
***************
*** 44,54 ****
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
! echo "missing - GNU libit 0.0"
;;
--- 71,83 ----
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
! echo "missing 0.4 - GNU automake"
;;
***************
*** 59,66 ****
;;
! aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
--- 88,100 ----
;;
! aclocal*)
! if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
! # We have it, but it failed.
! exit 1
! fi
!
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
***************
*** 69,75 ****
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
--- 103,114 ----
autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
***************
*** 78,106 ****
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
! files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in`
! if test -z "$files"; then
! files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in`
! test -z "$files" || files="$files.in"
! else
! files=`echo "$files" | sed -e 's/:/ /g'`
! fi
! test -z "$files" && files="config.h.in"
! touch $files
;;
! automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
! find . -type f -name Makefile.am -print \
! | sed 's/^\(.*\).am$/touch \1.in/' \
! | sh
;;
--- 117,185 ----
autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
! files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
! test -z "$files" && files="config.h"
! touch_files=
! for f in $files; do
! case "$f" in
! *:*) touch_files="$touch_files "`echo "$f" |
! sed -e 's/^[^:]*://' -e 's/:.*//'`;;
! *) touch_files="$touch_files $f.in";;
! esac
! done
! touch $touch_files
;;
! automake*)
! if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
! # We have it, but it failed.
! exit 1
! fi
!
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
! you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
! find . -type f -name Makefile.am -print |
! sed 's/\.am$/.in/' |
! while read f; do touch "$f"; done
! ;;
!
! autom4te)
! if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
! # We have it, but it failed.
! exit 1
! fi
!
! echo 1>&2 "\
! WARNING: \`$1' is needed, and you do not seem to have it handy on your
! system. You might have modified some files without having the
! proper tools for further handling them.
! You can get \`$1Help2man' as part of \`Autoconf' from any GNU
! archive site."
!
! file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
! test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
! if test -f "$file"; then
! touch $file
! else
! test -z "$file" || exec >$file
! echo "#! /bin/sh"
! echo "# Created by GNU Automake missing as a replacement of"
! echo "# $ $@"
! echo "exit 0"
! chmod +x $file
! exit 1
! fi
;;
***************
*** 158,162 ****
--- 237,271 ----
;;
+ help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+ WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
***************
*** 172,175 ****
--- 281,323 ----
fi
touch $file
+ ;;
+
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+ WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
;;
|