[gq-commit] gq/src input.c,1.47,1.48
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2002-09-26 19:09:26
|
Update of /cvsroot/gqclient/gq/src In directory usw-pr-cvs1:/tmp/cvs-serv15404 Modified Files: input.c Log Message: * Added two new icons to the right half of the browse tree. They are not operational yet, but are intended to switch on/off value-less attributes. * Fixed the "Add as new" button in the browse window. Index: input.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/input.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** input.c 18 Sep 2002 09:46:54 -0000 1.47 --- input.c 26 Sep 2002 19:09:21 -0000 1.48 *************** *** 51,54 **** --- 51,56 ---- #include "../icons/line.xpm" #include "../icons/textarea.xpm" + #include "../icons/new.xpm" + #include "../icons/hide.xpm" void refresh_inputform(GHashTable *browsehash); *************** *** 93,96 **** --- 95,99 ---- GtkWidget *target_vbox, *vbox2, *hbox1, *hbox2; GtkWidget *button, *linebutton, *textareabutton; + GtkWidget *newattrbutton, *hideattrbutton; GtkWidget *scwin, *table; GtkWidget *pixmap; *************** *** 149,152 **** --- 152,196 ---- (gpointer) hash); + /* new attribute button */ + 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(target_vbox)->window, + &icon_mask, + &target_vbox->style->white, + new_xpm); + pixmap = gtk_pixmap_new(icon, icon_mask); + gdk_pixmap_unref(icon); + gdk_bitmap_unref(icon_mask); + + gtk_widget_show(pixmap); + gtk_container_add(GTK_CONTAINER(newattrbutton), pixmap); + gtk_widget_show(newattrbutton); + gtk_box_pack_end(GTK_BOX(hbox1), newattrbutton, FALSE, FALSE, 5); + /* gtk_signal_connect(GTK_OBJECT(newattrbutton), "clicked", */ + /* GTK_SIGNAL_FUNC(change_displaytype), */ + /* (gpointer) hash); */ + + /* hide empty attributes button */ + hideattrbutton = gtk_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(target_vbox)->window, + &icon_mask, + &target_vbox->style->white, + hide_xpm); + pixmap = gtk_pixmap_new(icon, icon_mask); + gdk_pixmap_unref(icon); + gdk_bitmap_unref(icon_mask); + + gtk_widget_show(pixmap); + gtk_container_add(GTK_CONTAINER(hideattrbutton), pixmap); + gtk_widget_show(hideattrbutton); + gtk_box_pack_end(GTK_BOX(hbox1), hideattrbutton, FALSE, FALSE, 0); + /* gtk_signal_connect(GTK_OBJECT(hideattrbutton), "clicked", */ + /* GTK_SIGNAL_FUNC(change_displaytype), */ + /* (gpointer) hash); */ + + /* scrolled window with vbox2 inside */ scwin = gtk_scrolled_window_new(NULL, NULL); *************** *** 754,757 **** --- 798,813 ---- + char *get_new_dn(GHashTable *hash) + { + GtkWidget *child = g_hash_table_lookup(hash, "dn-widget"); + if (child) { + char *content = gtk_editable_get_chars(GTK_EDITABLE(child), 0, -1); + char *content_enc = encoded_string(content); + g_free(content); + return content_enc; + } + return NULL; + } + /* * update formlist from on-screen table *************** *** 875,888 **** static void add_entry_from_formlist_and_select(GHashTable *hash) { int rc = add_entry_from_formlist_no_close(hash); ! ! if (rc) { ! char *dn = g_hash_table_lookup(hash, "dn"); ! GtkCTree *tree = g_hash_table_lookup(hash, "ctreeroot"); ! ! if (dn && tree) { ! show_dn(tree, NULL, dn, TRUE); ! } } } --- 931,942 ---- static void add_entry_from_formlist_and_select(GHashTable *hash) { + char *dn = get_new_dn(hash); + GtkCTree *tree = g_hash_table_lookup(hash, "ctreeroot"); int rc = add_entry_from_formlist_no_close(hash); ! ! if (rc && dn && tree) { ! show_dn(tree, NULL, dn, TRUE); } + if (dn) free(dn); } |