[gq-commit] gq/src Makefile.am,1.27,1.28 browse.c,1.82,1.83 mainwin.c,1.44,1.45 search.c,1.52,1.53
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2003-10-17 07:08:54
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv32408 Modified Files: Makefile.am browse.c mainwin.c search.c Log Message: * Added a progress bar window during GUI restoration to avoid long delays without visual feedback during startup. Index: Makefile.am =================================================================== RCS file: /cvsroot/gqclient/gq/src/Makefile.am,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Makefile.am 5 Oct 2003 22:25:07 -0000 1.27 --- Makefile.am 17 Oct 2003 07:07:05 -0000 1.28 *************** *** 44,47 **** --- 44,48 ---- xmlparse.c \ xmlutil.c \ + progress.c \ state.c *************** *** 90,93 **** --- 91,95 ---- state.h \ xmlutil.h \ + progress.h \ COPYING.h Index: browse.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/browse.c,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** browse.c 13 Oct 2003 08:43:13 -0000 1.82 --- browse.c 17 Oct 2003 07:07:05 -0000 1.83 *************** *** 1,6 **** /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2001 Bert Vermeulen ! Parts: Copyright (C) 2002 Peter Stamfest <pe...@st...> This program is released under the Gnu General Public License with --- 1,6 ---- /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2003 Bert Vermeulen ! Parts: Copyright (C) 2002-2003 Peter Stamfest <pe...@st...> This program is released under the Gnu General Public License with *************** *** 53,56 **** --- 53,58 ---- #include "state.h" #include "utf8-compat.h" + #include "progress.h" + #include "prefs.h" #ifdef BROWSER_DND *************** *** 1549,1553 **** } ! static void browse_restore_snapshot(char *state_name, struct tab *tab) { GtkCTree *ctree = BROWSETAB(tab)->ctreeroot; --- 1551,1556 ---- } ! static void browse_restore_snapshot(char *state_name, struct tab *tab, ! struct pbar_win *progress) { GtkCTree *ctree = BROWSETAB(tab)->ctreeroot; *************** *** 1567,1574 **** long type = strtol(s, &ep, 10); if (c == ep) { switch(type) { case DN_BROWSE_ENTRY: ! node = show_dn(ctree, node, c + 1, TRUE); break; case REF_BROWSE_ENTRY: --- 1570,1583 ---- long type = strtol(s, &ep, 10); + if (progress->cancelled) break; + + if (progress) { + update_progress(progress, _("Opening %s"), c + 1); + } + if (c == ep) { switch(type) { case DN_BROWSE_ENTRY: ! node = show_dn(ctree, node, c + 1, FALSE); break; case REF_BROWSE_ENTRY: *************** *** 1582,1591 **** case SERVER_BROWSE_ENTRY: server = server_by_name(c + 1); ! node = tree_node_from_server_dn(ctree, server, ""); break; default: break; } } } if (node) gtk_ctree_select(ctree, node); --- 1591,1608 ---- case SERVER_BROWSE_ENTRY: server = server_by_name(c + 1); ! if (server != NULL) { ! node = tree_node_from_server_dn(ctree, server, ! ""); ! } else { ! /* FIXME - popup error? */ ! node = NULL; ! } break; default: + node = NULL; break; } } + if (node == NULL) break; } if (node) gtk_ctree_select(ctree, node); *************** *** 2042,2045 **** --- 2059,2070 ---- close_connection(server, FALSE); + } else { + /* ERROR - cannot open connection to server, + either it was just restarted or the server is + down. In order to not prolong the time for + deeply nested DNs to finally fail just break + out of this DN parts loop. + */ + break; } } Index: mainwin.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/mainwin.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** mainwin.c 12 Oct 2003 06:22:57 -0000 1.44 --- mainwin.c 17 Oct 2003 07:07:06 -0000 1.45 *************** *** 47,50 **** --- 47,51 ---- #include "input.h" #include "state.h" + #include "progress.h" #include "../icons/logo.xpm" *************** *** 116,124 **** int i, type; char tmp[32]; if (!config->restore_tabs) return FALSE; - if (!exists_entity("mainwin.tabs")) return FALSE; for (i = 0 ; ; i++) { snprintf(tmp, sizeof(tmp), "mainwin.tabs.%d", i); --- 117,128 ---- int i, type; char tmp[32]; + struct pbar_win *pw = NULL; if (!config->restore_tabs) return FALSE; if (!exists_entity("mainwin.tabs")) return FALSE; + pw = create_progress_bar_in_window(_("Restoring last GUI state")); + update_progress(pw, _("Restoring tabs")); + for (i = 0 ; ; i++) { snprintf(tmp, sizeof(tmp), "mainwin.tabs.%d", i); *************** *** 129,136 **** if (tab->vtab && tab->vtab->restore_snapshot) { ! tab->vtab->restore_snapshot(tmp, tab); } } ! } --- 133,141 ---- if (tab->vtab && tab->vtab->restore_snapshot) { ! tab->vtab->restore_snapshot(tmp, tab, pw); } } ! update_progress(pw, NULL); ! if (pw->cancelled) break; } *************** *** 138,144 **** type = state_value_get_int("mainwin.tabs", "active", -1); gtk_notebook_set_page(GTK_NOTEBOOK(win->mainbook), type); - return TRUE; } ! return FALSE; } --- 143,152 ---- type = state_value_get_int("mainwin.tabs", "active", -1); gtk_notebook_set_page(GTK_NOTEBOOK(win->mainbook), type); } ! ! update_progress(pw, _("Restoring tabs")); ! free_progress(pw); ! ! return i > 0; } Index: search.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/search.c,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** search.c 17 Oct 2003 05:26:23 -0000 1.52 --- search.c 17 Oct 2003 07:07:07 -0000 1.53 *************** *** 76,80 **** ! static void search_restore_snapshot(char *state_name, struct tab *tab) { struct ldapserver *server; --- 76,81 ---- ! static void search_restore_snapshot(char *state_name, struct tab *tab, ! struct pbar_win *progress) { struct ldapserver *server; |