[gq-commit] gq/src prefs.c,1.43,1.44 prefs.h,1.7,1.8
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2003-10-17 07:18:49
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv917 Modified Files: prefs.c prefs.h Log Message: * Added support to indicate "transient" servers when editing server settings. Transient servers are servers added when dealing with referrals. They are not saved in the configuration and they might get initialized from existing servers through a canonical server name lookup. Index: prefs.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/prefs.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** prefs.c 17 Oct 2003 06:52:39 -0000 1.43 --- prefs.c 17 Oct 2003 07:16:14 -0000 1.44 *************** *** 136,139 **** --- 136,141 ---- struct ldapserver *server; int edit_new_server; + /* is the server a dynamically added one */ + gboolean transient; } prefs_callback_data; *************** *** 200,204 **** } ! if (passwdtext && strlen(passwdtext) > 0) { int rc = question_popup(_("Warning: Cleartext password"), --- 202,206 ---- } ! if (passwdtext && strlen(passwdtext) > 0 && !cb_data->transient) { int rc = question_popup(_("Warning: Cleartext password"), *************** *** 334,339 **** } ! /* so the cancel button doesn't really cancel :-) */ ! save_config(); update_serverlist(&mainwin); --- 336,347 ---- } ! /* I do not really like this ad-hoc solution to check if a server ! is a transient server or a configured one, but ... */ ! if (!is_transient_server(server)) { ! /* so the cancel button doesn't really cancel :-) */ ! save_config(); ! } ! ! update_serverlist(&mainwin); *************** *** 429,432 **** --- 437,441 ---- cb_data = new_prefs_callback_data(sw); cb_data->edit_new_server = (server == NULL); + cb_data->transient = is_transient_server(server); if(server == NULL) { *************** *** 454,461 **** title = g_string_sized_new(64); ! if(cb_data->edit_new_server) g_string_sprintf(title, _("New server")); ! else g_string_sprintf(title, _("Server %s"), server->name); gtk_window_set_title(GTK_WINDOW(editwindow), title->str); --- 463,474 ---- title = g_string_sized_new(64); ! if(cb_data->edit_new_server) { g_string_sprintf(title, _("New server")); ! } else { g_string_sprintf(title, _("Server %s"), server->name); + } + if (cb_data->transient) { + g_string_sprintf(title, _("Transient server %s"), server->name); + } gtk_window_set_title(GTK_WINDOW(editwindow), title->str); *************** *** 625,628 **** --- 638,654 ---- gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); #endif + + + /* Add not if the server is transient */ + + + if (cb_data->transient) { + label = gtk_label_new(_("NOTE: This is a transient server definition. It has been added dynamically and it will not be saved to the permanent configuration.")); + + gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); + gtk_box_pack_start(GTK_BOX(vbox1), label, FALSE, FALSE, 0); + gtk_widget_show(label); + } + /* "Details" tab */ Index: prefs.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/prefs.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** prefs.h 9 Oct 2003 05:51:55 -0000 1.7 --- prefs.h 17 Oct 2003 07:16:14 -0000 1.8 *************** *** 38,43 **** void fill_serverlist_serverstab(void); void create_prefs_window(void); - GtkWidget* get_widget(GtkWidget *widget, gchar *widget_name); - #endif --- 38,41 ---- |