4 * ROX-Filer, filer for the ROX desktop project
5 * Copyright (C) 2005, the ROX-Filer team.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 * Place, Suite 330, Boston, MA 02111-1307 USA
22 /* toolbar.c - for the button bars that go along the tops of windows */
43 #include "view_iface.h"
44 #include "bookmarks.h"
45 #include "gui_support.h"
47 typedef struct _Tool Tool
;
49 typedef enum {DROP_NONE
, DROP_TO_PARENT
, DROP_TO_HOME
, DROP_BOOKMARK
} DropDest
;
54 const gchar
*tip
; /* Tooltip */
55 void (*clicked
)(GtkWidget
*w
, FilerWindow
*filer_window
);
58 gboolean menu
; /* Activate on button-press */
61 Option o_toolbar
, o_toolbar_info
, o_toolbar_disable
;
62 Option o_toolbar_min_width
;
64 static FilerWindow
*filer_window_being_counted
;
66 /* TRUE if the button presses (or released) should open a new window,
67 * rather than reusing the existing one.
69 #define NEW_WIN_BUTTON(button_event) \
70 (o_new_button_1.int_value \
71 ? ((GdkEventButton *) button_event)->button == 1 \
72 : ((GdkEventButton *) button_event)->button != 1)
74 /* Static prototypes */
75 static void toolbar_close_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
76 static void toolbar_up_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
77 static void toolbar_home_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
78 static void toolbar_bookmarks_clicked(GtkWidget
*widget
,
79 FilerWindow
*filer_window
);
80 static void toolbar_help_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
81 static void toolbar_refresh_clicked(GtkWidget
*widget
,
82 FilerWindow
*filer_window
);
83 static void toolbar_size_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
84 static void toolbar_autosize_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
85 static void toolbar_details_clicked(GtkWidget
*widget
,
86 FilerWindow
*filer_window
);
87 static void toolbar_hidden_clicked(GtkWidget
*widget
,
88 FilerWindow
*filer_window
);
89 static void toolbar_select_clicked(GtkWidget
*widget
,
90 FilerWindow
*filer_window
);
91 static void toolbar_sort_clicked(GtkWidget
*widget
,
92 FilerWindow
*filer_window
);
93 static GtkWidget
*add_button(GtkWidget
*bar
, Tool
*tool
,
94 FilerWindow
*filer_window
);
95 static GtkWidget
*create_toolbar(FilerWindow
*filer_window
);
96 static gboolean
drag_motion(GtkWidget
*widget
,
97 GdkDragContext
*context
,
101 FilerWindow
*filer_window
);
102 static void drag_leave(GtkWidget
*widget
,
103 GdkDragContext
*context
,
105 FilerWindow
*filer_window
);
106 static void handle_drops(FilerWindow
*filer_window
,
109 static void toggle_selected(GtkToggleButton
*widget
, gpointer data
);
110 static void option_notify(void);
111 static GList
*build_tool_options(Option
*option
, xmlNode
*node
, guchar
*label
);
112 static void tally_items(gpointer key
, gpointer value
, gpointer data
);
114 static Tool all_tools
[] = {
115 {N_("Close"), GTK_STOCK_CLOSE
, N_("Close filer window"),
116 toolbar_close_clicked
, DROP_NONE
, FALSE
,
119 {N_("Up"), GTK_STOCK_GO_UP
, N_("Change to parent directory"),
120 toolbar_up_clicked
, DROP_TO_PARENT
, TRUE
,
123 {N_("Home"), GTK_STOCK_HOME
, N_("Change to home directory"),
124 toolbar_home_clicked
, DROP_TO_HOME
, TRUE
,
127 {N_("Bookmarks"), ROX_STOCK_BOOKMARKS
, N_("Bookmarks menu"),
128 toolbar_bookmarks_clicked
, DROP_BOOKMARK
, FALSE
,
131 {N_("Scan"), GTK_STOCK_REFRESH
, N_("Rescan directory contents"),
132 toolbar_refresh_clicked
, DROP_NONE
, TRUE
,
135 {N_("Size"), GTK_STOCK_ZOOM_IN
, N_("Change icon size"),
136 toolbar_size_clicked
, DROP_NONE
, TRUE
,
139 {N_("Size"), GTK_STOCK_ZOOM_FIT
, N_("Automatic size mode"),
140 toolbar_autosize_clicked
, DROP_NONE
, TRUE
,
143 {N_("Details"), ROX_STOCK_SHOW_DETAILS
, N_("Show extra details"),
144 toolbar_details_clicked
, DROP_NONE
, TRUE
,
147 {N_("Sort"), GTK_STOCK_SORT_ASCENDING
, N_("Change sort criteria"),
148 toolbar_sort_clicked
, DROP_NONE
, FALSE
,
151 {N_("Hidden"), ROX_STOCK_SHOW_HIDDEN
, N_("Show/hide hidden files"),
152 toolbar_hidden_clicked
, DROP_NONE
, TRUE
,
155 {N_("Select"), ROX_STOCK_SELECT
, N_("Select all/invert selection"),
156 toolbar_select_clicked
, DROP_NONE
, FALSE
,
159 {N_("Help"), GTK_STOCK_HELP
, N_("Show ROX-Filer help"),
160 toolbar_help_clicked
, DROP_NONE
, TRUE
,
165 /****************************************************************
166 * EXTERNAL INTERFACE *
167 ****************************************************************/
169 void toolbar_init(void)
171 option_add_int(&o_toolbar
, "toolbar_type", TOOLBAR_NORMAL
);
172 option_add_int(&o_toolbar_info
, "toolbar_show_info", 1);
173 option_add_string(&o_toolbar_disable
, "toolbar_disable",
175 option_add_int(&o_toolbar_min_width
, "toolbar_min_width", 1);
176 option_add_notify(option_notify
);
178 option_register_widget("tool-options", build_tool_options
);
181 void toolbar_update_info(FilerWindow
*filer_window
)
187 if (o_toolbar
.int_value
== TOOLBAR_NONE
|| !o_toolbar_info
.int_value
)
188 return; /* Not showing info */
190 if (filer_window
->target_cb
)
193 view
= filer_window
->view
;
195 n_selected
= view_count_selected(view
);
202 if (filer_window
->scanning
)
205 GTK_LABEL(filer_window
->toolbar_text
), "");
209 if (!(filer_window
->show_hidden
||
210 filer_window
->temp_show_hidden
) ||
211 filer_window
->filter
!=FILER_SHOW_ALL
)
213 GHashTable
*hash
= filer_window
->directory
->known_items
;
216 filer_window_being_counted
=filer_window
;
217 g_hash_table_foreach(hash
, tally_items
, &tally
);
220 s
= g_strdup_printf(_(" (%u hidden)"), tally
);
223 n_items
= view_count_items(view
);
226 label
= g_strdup_printf("%d %s%s",
228 n_items
!= 1 ? _("items") : _("item"),
230 else /* (French plurals work differently for zero) */
231 label
= g_strdup_printf(_("No items%s"),
241 view_get_iter(filer_window
->view
, &iter
, VIEW_ITER_SELECTED
);
243 while ((item
= iter
.next(&iter
)))
245 if (item
->base_type
!= TYPE_DIRECTORY
&&
246 item
->base_type
!= TYPE_UNKNOWN
)
247 size
+= (double) item
->size
;
250 label
= g_strdup_printf(_("%u selected (%s)"),
251 n_selected
, format_double_size(size
));
254 gtk_label_set_text(GTK_LABEL(filer_window
->toolbar_text
), label
);
258 /* Create, destroy or recreate toolbar for this window so that it
259 * matches the option setting.
261 void toolbar_update_toolbar(FilerWindow
*filer_window
)
263 g_return_if_fail(filer_window
!= NULL
);
265 if (filer_window
->toolbar
)
267 gtk_widget_destroy(filer_window
->toolbar
);
268 filer_window
->toolbar
= NULL
;
269 filer_window
->toolbar_text
= NULL
;
272 if (o_toolbar
.int_value
!= TOOLBAR_NONE
)
274 filer_window
->toolbar
= create_toolbar(filer_window
);
275 gtk_box_pack_start(filer_window
->toplevel_vbox
,
276 filer_window
->toolbar
, FALSE
, TRUE
, 0);
277 gtk_box_reorder_child(filer_window
->toplevel_vbox
,
278 filer_window
->toolbar
, 0);
279 gtk_widget_show_all(filer_window
->toolbar
);
282 filer_target_mode(filer_window
, NULL
, NULL
, NULL
);
283 toolbar_update_info(filer_window
);
286 /****************************************************************
287 * INTERNAL FUNCTIONS *
288 ****************************************************************/
290 static void toolbar_help_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
294 event
= gtk_get_current_event();
295 if (event
->type
== GDK_BUTTON_RELEASE
&&
296 ((GdkEventButton
*) event
)->button
!= 1)
297 menu_rox_help(NULL
, HELP_MANUAL
, NULL
);
299 filer_opendir(make_path(app_dir
, "Help"), NULL
, NULL
);
300 gdk_event_free(event
);
303 static void toolbar_refresh_clicked(GtkWidget
*widget
,
304 FilerWindow
*filer_window
)
308 event
= gtk_get_current_event();
309 if (event
->type
== GDK_BUTTON_RELEASE
&&
310 ((GdkEventButton
*) event
)->button
!= 1)
312 filer_opendir(filer_window
->sym_path
, filer_window
, NULL
);
315 filer_refresh(filer_window
);
316 gdk_event_free(event
);
319 static void toolbar_home_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
323 event
= gtk_get_current_event();
324 if (event
->type
== GDK_BUTTON_RELEASE
&& NEW_WIN_BUTTON(event
))
326 filer_opendir(home_dir
, filer_window
, NULL
);
329 filer_change_to(filer_window
, home_dir
, NULL
);
330 gdk_event_free(event
);
333 static void toolbar_bookmarks_clicked(GtkWidget
*widget
,
334 FilerWindow
*filer_window
)
338 g_return_if_fail(filer_window
!= NULL
);
340 event
= gtk_get_current_event();
341 if (event
->type
== GDK_BUTTON_PRESS
&&
342 ((GdkEventButton
*) event
)->button
== 1)
344 bookmarks_show_menu(filer_window
);
346 else if (event
->type
== GDK_BUTTON_RELEASE
&&
347 ((GdkEventButton
*) event
)->button
!= 1)
351 gdk_event_free(event
);
354 static void toolbar_close_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
358 g_return_if_fail(filer_window
!= NULL
);
360 event
= gtk_get_current_event();
361 if (event
->type
== GDK_BUTTON_RELEASE
&&
362 ((GdkEventButton
*) event
)->button
!= 1)
364 filer_opendir(filer_window
->sym_path
, filer_window
, NULL
);
366 else if (!filer_window_delete(filer_window
->window
, NULL
, filer_window
))
367 gtk_widget_destroy(filer_window
->window
);
368 gdk_event_free(event
);
371 static void toolbar_up_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
375 event
= gtk_get_current_event();
376 if (event
->type
== GDK_BUTTON_RELEASE
&& NEW_WIN_BUTTON(event
))
378 filer_open_parent(filer_window
);
381 change_to_parent(filer_window
);
382 gdk_event_free(event
);
385 static void toolbar_autosize_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
389 bev
= (GdkEventButton
*) gtk_get_current_event();
390 if (bev
->type
== GDK_BUTTON_RELEASE
)
392 display_set_layout(filer_window
, AUTO_SIZE_ICONS
, filer_window
->details_type
,
395 gdk_event_free((GdkEvent
*) bev
);
398 static void toolbar_size_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
402 bev
= (GdkEventButton
*) gtk_get_current_event();
403 if (bev
->type
== GDK_BUTTON_RELEASE
)
404 display_change_size(filer_window
, bev
->button
== 1);
405 gdk_event_free((GdkEvent
*) bev
);
408 static void toolbar_sort_clicked(GtkWidget
*widget
,
409 FilerWindow
*filer_window
)
412 int i
, current
, next
, next_wrapped
;
417 static const SortType sorts
[]={
418 SORT_NAME
, SORT_TYPE
, SORT_DATE
, SORT_SIZE
,
419 SORT_OWNER
, SORT_GROUP
,
421 static const char *sort_names
[] = {
422 N_("Sort by name"), N_("Sort by type"), N_("Sort by date"),
423 N_("Sort by size"), N_("Sort by owner"), N_("Sort by group"),
426 bev
= (GdkEventButton
*) gtk_get_current_event();
427 adjust
= (bev
->button
!= 1) && bev
->type
== GDK_BUTTON_RELEASE
;
428 gdk_event_free((GdkEvent
*) bev
);
431 dir
= filer_window
->sort_order
;
432 for (i
=0; i
< G_N_ELEMENTS(sort_names
); i
++)
434 if (filer_window
->sort_type
== sorts
[i
])
448 next_wrapped
= next
% G_N_ELEMENTS(sorts
);
450 if (next_wrapped
!= next
)
451 dir
= (dir
== GTK_SORT_ASCENDING
)
452 ? GTK_SORT_DESCENDING
: GTK_SORT_ASCENDING
;
454 display_set_sort_type(filer_window
, sorts
[next_wrapped
], dir
);
455 tip
= g_strconcat(_(sort_names
[next_wrapped
]), ", ",
456 dir
== GTK_SORT_ASCENDING
457 ? _("ascending") : _("descending"),
463 static void toolbar_details_clicked(GtkWidget
*widget
,
464 FilerWindow
*filer_window
)
466 if (filer_window
->view_type
== VIEW_TYPE_DETAILS
)
467 filer_set_view_type(filer_window
, VIEW_TYPE_COLLECTION
);
469 filer_set_view_type(filer_window
, VIEW_TYPE_DETAILS
);
472 static void toolbar_hidden_clicked(GtkWidget
*widget
,
473 FilerWindow
*filer_window
)
475 display_set_hidden(filer_window
, !filer_window
->show_hidden
);
478 static gboolean
invert_cb(ViewIter
*iter
, gpointer data
)
480 return !view_get_selected((ViewIface
*) data
, iter
);
483 static void toolbar_select_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
487 event
= gtk_get_current_event();
488 if (event
->type
== GDK_BUTTON_RELEASE
)
490 if (((GdkEventButton
*) event
)->button
== 1)
491 view_select_all(filer_window
->view
);
493 view_select_if(filer_window
->view
, invert_cb
,
496 filer_window
->temp_item_selected
= FALSE
;
497 gdk_event_free(event
);
500 /* If filer_window is NULL, the toolbar is for the options window */
501 static GtkWidget
*create_toolbar(FilerWindow
*filer_window
)
508 bar
= gtk_toolbar_new();
510 if (o_toolbar
.int_value
== TOOLBAR_NORMAL
|| !filer_window
)
511 gtk_toolbar_set_style(GTK_TOOLBAR(bar
), GTK_TOOLBAR_ICONS
);
512 else if (o_toolbar
.int_value
== TOOLBAR_HORIZONTAL
)
513 gtk_toolbar_set_style(GTK_TOOLBAR(bar
), GTK_TOOLBAR_BOTH_HORIZ
);
515 gtk_toolbar_set_style(GTK_TOOLBAR(bar
), GTK_TOOLBAR_BOTH
);
518 for (i
= 0; i
< sizeof(all_tools
) / sizeof(*all_tools
); i
++)
520 Tool
*tool
= &all_tools
[i
];
523 if (filer_window
&& !tool
->enabled
)
526 b
= add_button(bar
, tool
, filer_window
);
528 gtk_widget_size_request(b
, &req
);
531 if (filer_window
&& tool
->drop_action
!= DROP_NONE
)
532 handle_drops(filer_window
, b
, tool
->drop_action
);
537 if(o_toolbar_min_width
.int_value
)
539 /* Make the toolbar wide enough for all icons to be
540 seen, plus a little for the (start of the) text
542 gtk_widget_set_size_request(bar
, width
+32, -1);
544 gtk_widget_set_size_request(bar
, 100, -1);
547 filer_window
->toolbar_text
= gtk_label_new("");
548 gtk_misc_set_alignment(GTK_MISC(filer_window
->toolbar_text
),
550 gtk_toolbar_append_widget(GTK_TOOLBAR(bar
),
551 filer_window
->toolbar_text
, NULL
, NULL
);
557 /* This is used to simulate a click when button 3 is used (GtkButton
558 * normally ignores this).
560 static gint toolbar_other_button
= 0;
561 static gint
toolbar_button_pressed(GtkButton
*button
,
562 GdkEventButton
*event
,
563 FilerWindow
*filer_window
)
565 gint b
= event
->button
;
568 tool
= g_object_get_data(G_OBJECT(button
), "rox-tool");
569 g_return_val_if_fail(tool
!= NULL
, TRUE
);
571 if (tool
->menu
&& b
== 1)
573 tool
->clicked((GtkWidget
*) button
, filer_window
);
577 if ((b
== 2 || b
== 3) && toolbar_other_button
== 0)
579 toolbar_other_button
= event
->button
;
580 gtk_grab_add(GTK_WIDGET(button
));
581 gtk_button_pressed(button
);
589 static gint
toolbar_button_released(GtkButton
*button
,
590 GdkEventButton
*event
,
591 FilerWindow
*filer_window
)
593 if (event
->button
== toolbar_other_button
)
595 toolbar_other_button
= 0;
596 gtk_grab_remove(GTK_WIDGET(button
));
597 gtk_button_released(button
);
605 /* If filer_window is NULL, the toolbar is for the options window */
606 static GtkWidget
*add_button(GtkWidget
*bar
, Tool
*tool
,
607 FilerWindow
*filer_window
)
609 GtkWidget
*button
, *icon_widget
;
611 icon_widget
= gtk_image_new_from_stock(tool
->name
,
612 GTK_ICON_SIZE_LARGE_TOOLBAR
);
614 button
= gtk_toolbar_insert_element(GTK_TOOLBAR(bar
),
615 filer_window
? GTK_TOOLBAR_CHILD_BUTTON
616 : GTK_TOOLBAR_CHILD_TOGGLEBUTTON
,
621 NULL
, NULL
, /* CB, userdata */
622 GTK_TOOLBAR(bar
)->num_children
);
623 GTK_WIDGET_UNSET_FLAGS(button
, GTK_CAN_FOCUS
);
625 if (o_toolbar
.int_value
== TOOLBAR_HORIZONTAL
)
627 GtkWidget
*hbox
, *label
;
629 hbox
= GTK_BIN(button
)->child
;
630 kids
= gtk_container_get_children(GTK_CONTAINER(hbox
));
631 label
= g_list_nth_data(kids
, 1);
636 gtk_box_set_child_packing(GTK_BOX(hbox
), label
,
637 TRUE
, TRUE
, 0, GTK_PACK_END
);
638 gtk_misc_set_alignment(GTK_MISC(label
), 0, 0.5);
642 g_object_set_data(G_OBJECT(button
), "rox-tool", tool
);
646 g_signal_connect(button
, "clicked",
647 G_CALLBACK(tool
->clicked
), filer_window
);
648 g_signal_connect(button
, "button_press_event",
649 G_CALLBACK(toolbar_button_pressed
), filer_window
);
650 g_signal_connect(button
, "button_release_event",
651 G_CALLBACK(toolbar_button_released
), filer_window
);
655 g_signal_connect(button
, "clicked",
656 G_CALLBACK(toggle_selected
), NULL
);
657 g_object_set_data(G_OBJECT(button
), "tool_name",
658 (gpointer
) tool
->name
);
664 static void toggle_selected(GtkToggleButton
*widget
, gpointer data
)
666 option_check_widget(&o_toolbar_disable
);
669 /* Called during the drag when the mouse is in a widget registered
670 * as a drop target. Returns TRUE if we can accept the drop.
672 static gboolean
drag_motion(GtkWidget
*widget
,
673 GdkDragContext
*context
,
677 FilerWindow
*filer_window
)
679 GdkDragAction action
= context
->suggested_action
;
681 gpointer type
= (gpointer
) drop_dest_dir
;
683 dest
= (DropDest
) g_object_get_data(G_OBJECT(widget
), "toolbar_dest");
685 if ((context
->actions
& GDK_ACTION_ASK
) && o_dnd_left_menu
.int_value
&&
686 dest
!= DROP_BOOKMARK
)
689 gdk_window_get_pointer(NULL
, NULL
, NULL
, &state
);
690 if (state
& GDK_BUTTON1_MASK
)
691 action
= GDK_ACTION_ASK
;
694 if (dest
== DROP_TO_HOME
)
695 g_dataset_set_data(context
, "drop_dest_path",
697 else if (dest
== DROP_BOOKMARK
)
698 type
= (gpointer
) drop_dest_bookmark
;
700 g_dataset_set_data_full(context
, "drop_dest_path",
701 g_path_get_dirname(filer_window
->sym_path
),
704 g_dataset_set_data(context
, "drop_dest_type", type
);
705 gdk_drag_status(context
, action
, time
);
707 dnd_spring_load(context
, filer_window
);
708 gtk_button_set_relief(GTK_BUTTON(widget
), GTK_RELIEF_NORMAL
);
713 static void drag_leave(GtkWidget
*widget
,
714 GdkDragContext
*context
,
716 FilerWindow
*filer_window
)
718 gtk_button_set_relief(GTK_BUTTON(widget
), GTK_RELIEF_NONE
);
722 static void handle_drops(FilerWindow
*filer_window
,
726 make_drop_target(button
, 0);
727 g_signal_connect(button
, "drag_motion",
728 G_CALLBACK(drag_motion
), filer_window
);
729 g_signal_connect(button
, "drag_leave",
730 G_CALLBACK(drag_leave
), filer_window
);
731 g_object_set_data(G_OBJECT(button
), "toolbar_dest", (gpointer
) dest
);
734 static void tally_items(gpointer key
, gpointer value
, gpointer data
)
736 guchar
*leafname
= (guchar
*) key
;
737 int *tally
= (int *) data
;
739 if (!filer_match_filter(filer_window_being_counted
, leafname
))
743 static void option_notify(void)
746 gboolean changed
= FALSE
;
747 guchar
*list
= o_toolbar_disable
.value
;
749 for (i
= 0; i
< sizeof(all_tools
) / sizeof(*all_tools
); i
++)
751 Tool
*tool
= &all_tools
[i
];
752 gboolean old
= tool
->enabled
;
754 tool
->enabled
= !in_list(tool
->name
, list
);
756 if (old
!= tool
->enabled
)
760 if (changed
|| o_toolbar
.has_changed
|| o_toolbar_info
.has_changed
)
764 for (next
= all_filer_windows
; next
; next
= next
->next
)
766 FilerWindow
*filer_window
= (FilerWindow
*) next
->data
;
768 toolbar_update_toolbar(filer_window
);
773 static void update_tools(Option
*option
)
777 kids
= gtk_container_get_children(GTK_CONTAINER(option
->widget
));
779 for (next
= kids
; next
; next
= next
->next
)
781 GtkToggleButton
*kid
= (GtkToggleButton
*) next
->data
;
784 name
= g_object_get_data(G_OBJECT(kid
), "tool_name");
786 g_return_if_fail(name
!= NULL
);
788 gtk_toggle_button_set_active(kid
,
789 !in_list(name
, option
->value
));
795 static guchar
*read_tools(Option
*option
)
801 list
= g_string_new(NULL
);
803 kids
= gtk_container_get_children(GTK_CONTAINER(option
->widget
));
805 for (next
= kids
; next
; next
= next
->next
)
807 GtkToggleButton
*kid
= (GtkToggleButton
*) next
->data
;
810 if (!gtk_toggle_button_get_active(kid
))
812 name
= g_object_get_data(G_OBJECT(kid
), "tool_name");
813 g_return_val_if_fail(name
!= NULL
, list
->str
);
816 g_string_append(list
, ", ");
817 g_string_append(list
, name
);
823 g_string_free(list
, FALSE
);
828 static GList
*build_tool_options(Option
*option
, xmlNode
*node
, guchar
*label
)
832 g_return_val_if_fail(option
!= NULL
, NULL
);
834 bar
= create_toolbar(NULL
);
836 option
->update_widget
= update_tools
;
837 option
->read_widget
= read_tools
;
838 option
->widget
= bar
;
840 return g_list_append(NULL
, bar
);