[gq-commit] gq/src template.c,1.12,1.13 template.h,1.4,1.5
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2003-10-27 22:15:44
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv1318 Modified Files: template.c template.h Log Message: * Fix SF bug 830376 - Made template window modal for preferences window * Did I18N for the template window Index: template.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/template.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** template.c 18 Oct 2003 08:27:00 -0000 1.12 --- template.c 27 Oct 2003 22:10:26 -0000 1.13 *************** *** 48,51 **** --- 48,52 ---- #include "errorchain.h" #include "debug.h" + #include "i18n.h" *************** *** 78,82 **** void create_template_edit_window(struct ldapserver *server, ! const char *templatename) { GList *list; --- 79,84 ---- void create_template_edit_window(struct ldapserver *server, ! const char *templatename, ! GtkWidget *modalFor) { GList *list; *************** *** 87,94 **** struct server_schema *ss; struct gq_template *tmpl; ! char *otitle[1] = { "Available objectclasses" }; ! char *ttitle[1] = { "Template objectclasses" }; ! char *rtitle[1] = { "Required attributes" }; ! char *atitle[1] = { "Allowed attributes" }; gmessage = NULL; --- 89,96 ---- struct server_schema *ss; struct gq_template *tmpl; ! char *otitle[1] = { _("Available objectclasses") }; ! char *ttitle[1] = { _("Template objectclasses") }; ! char *rtitle[1] = { _("Required attributes") }; ! char *atitle[1] = { _("Allowed attributes") }; gmessage = NULL; *************** *** 96,115 **** if(ss == NULL) { gmessage = g_string_sized_new(64); ! g_string_sprintf(gmessage, "no schema information found for server %s", server->name); } else if(ss->oc == NULL) { gmessage = g_string_sized_new(64); ! g_string_sprintf(gmessage, "no objectclass information found for server %s", server->name); } else if(ss->at == NULL) { gmessage = g_string_sized_new(64); ! g_string_sprintf(gmessage, "no attribute type information found for server %s", server->name); } if(gmessage) { ! error_popup("Error getting schema", gmessage->str); g_string_free(gmessage, TRUE); return; --- 98,120 ---- if(ss == NULL) { gmessage = g_string_sized_new(64); ! g_string_sprintf(gmessage, ! _("No schema information found for server %s"), server->name); } else if(ss->oc == NULL) { gmessage = g_string_sized_new(64); ! g_string_sprintf(gmessage, ! _("No objectclass information found for server %s"), server->name); } else if(ss->at == NULL) { gmessage = g_string_sized_new(64); ! g_string_sprintf(gmessage, ! _("No attribute type information found for server %s"), server->name); } if(gmessage) { ! error_popup(_("Error getting schema"), gmessage->str); g_string_free(gmessage, TRUE); return; *************** *** 117,120 **** --- 122,133 ---- templatewin = gtk_window_new(GTK_WINDOW_TOPLEVEL); + + if (modalFor) { + assert(GTK_IS_WINDOW(modalFor)); + gtk_window_set_modal(GTK_WINDOW(templatewin), TRUE); + gtk_window_set_transient_for(GTK_WINDOW(templatewin), + GTK_WINDOW(modalFor)); + } + gtk_object_set_data_full(GTK_OBJECT(templatewin), "server", server, (GtkDestroyNotify) ldapserver_unref); *************** *** 282,286 **** /* Template name */ ! label = gtk_label_new("Template name"); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox3), label, FALSE, FALSE, 0); --- 295,299 ---- /* Template name */ ! label = gtk_label_new(_("Template name")); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox3), label, FALSE, FALSE, 0); *************** *** 300,304 **** /* Save */ ! button = gtk_button_new_with_label(" Save "); GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); gtk_signal_connect(GTK_OBJECT(button), "pressed", --- 313,321 ---- /* Save */ ! #if GTK_MAJOR >= 2 ! button = gtk_button_new_from_stock(GTK_STOCK_SAVE); ! #else ! button = gq_button_new_with_label(_("_Save")); ! #endif GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); gtk_signal_connect(GTK_OBJECT(button), "pressed", *************** *** 310,314 **** /* Cancel */ ! button = gtk_button_new_with_label(" Cancel "); GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); gtk_signal_connect_object(GTK_OBJECT(button), "pressed", --- 327,335 ---- /* Cancel */ ! #if GTK_MAJOR >= 2 ! button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); ! #else ! button = gq_button_new_with_label(_("_Cancel")); ! #endif GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); gtk_signal_connect_object(GTK_OBJECT(button), "pressed", *************** *** 324,332 **** /* default title, in case editing doesn't work out */ ! gtk_window_set_title(GTK_WINDOW(templatewin), "GQ: create new template"); if(templatename) { ! gtk_window_set_title(GTK_WINDOW(templatewin), "GQ: edit template"); ! gtk_object_set_data(GTK_OBJECT(templatewin), "templatename", g_strdup(templatename)); tmpl = find_template_by_name(templatename); if(tmpl) { --- 345,356 ---- /* default title, in case editing doesn't work out */ ! gtk_window_set_title(GTK_WINDOW(templatewin), ! _("GQ: create new template")); if(templatename) { ! gtk_window_set_title(GTK_WINDOW(templatewin), ! _("GQ: edit template")); ! gtk_object_set_data(GTK_OBJECT(templatewin), ! "templatename", g_strdup(templatename)); tmpl = find_template_by_name(templatename); if(tmpl) { *************** *** 566,571 **** if(strlen(tmpl->name) == 0) { /* need a name for this template, warning popup */ ! list = g_list_append(NULL, "You need to enter a name for the new template."); ! list = g_list_append(list, "Please enter one and try again."); warning_popup(list); return; --- 590,595 ---- if(strlen(tmpl->name) == 0) { /* need a name for this template, warning popup */ ! list = g_list_append(NULL, _("You need to enter a name for the new template.")); ! list = g_list_append(list, _("Please enter one and try again.")); warning_popup(list); return; *************** *** 578,584 **** } else { ! list = g_list_append(NULL, "A template by that name already exists!"); ! list = g_list_append(list, "Please choose another name, or delete " ! "the existing template"); warning_popup(list); return; --- 602,608 ---- } else { ! list = g_list_append(NULL, _("A template by that name already exists!")); ! list = g_list_append(list, _("Please choose another name, or delete " ! "the existing template")); warning_popup(list); return; Index: template.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/template.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** template.h 5 Oct 2003 13:49:29 -0000 1.4 --- template.h 27 Oct 2003 22:10:26 -0000 1.5 *************** *** 39,43 **** void create_template_edit_window(struct ldapserver *server, ! const char *template_name); gboolean delete_edit_window(GtkWidget *window); void fill_new_template(GtkWidget *window); --- 39,44 ---- void create_template_edit_window(struct ldapserver *server, ! const char *template_name, ! GtkWidget *parent); gboolean delete_edit_window(GtkWidget *window); void fill_new_template(GtkWidget *window); |