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 GtkTooltips
*tooltips
= NULL
;
65 static FilerWindow
*filer_window_being_counted
;
67 /* TRUE if the button presses (or released) should open a new window,
68 * rather than reusing the existing one.
70 #define NEW_WIN_BUTTON(button_event) \
71 (o_new_button_1.int_value \
72 ? ((GdkEventButton *) button_event)->button == 1 \
73 : ((GdkEventButton *) button_event)->button != 1)
75 /* Static prototypes */
76 static void toolbar_close_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
77 static void toolbar_up_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
78 static void toolbar_home_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
79 static void toolbar_bookmarks_clicked(GtkWidget
*widget
,
80 FilerWindow
*filer_window
);
81 static void toolbar_help_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
82 static void toolbar_refresh_clicked(GtkWidget
*widget
,
83 FilerWindow
*filer_window
);
84 static void toolbar_size_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
85 static void toolbar_autosize_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
);
86 static void toolbar_details_clicked(GtkWidget
*widget
,
87 FilerWindow
*filer_window
);
88 static void toolbar_hidden_clicked(GtkWidget
*widget
,
89 FilerWindow
*filer_window
);
90 static void toolbar_select_clicked(GtkWidget
*widget
,
91 FilerWindow
*filer_window
);
92 static void toolbar_sort_clicked(GtkWidget
*widget
,
93 FilerWindow
*filer_window
);
94 static GtkWidget
*add_button(GtkWidget
*bar
, Tool
*tool
,
95 FilerWindow
*filer_window
);
96 static GtkWidget
*create_toolbar(FilerWindow
*filer_window
);
97 static gboolean
drag_motion(GtkWidget
*widget
,
98 GdkDragContext
*context
,
102 FilerWindow
*filer_window
);
103 static void drag_leave(GtkWidget
*widget
,
104 GdkDragContext
*context
,
106 FilerWindow
*filer_window
);
107 static void handle_drops(FilerWindow
*filer_window
,
110 static void toggle_selected(GtkToggleButton
*widget
, gpointer data
);
111 static void option_notify(void);
112 static GList
*build_tool_options(Option
*option
, xmlNode
*node
, guchar
*label
);
113 static void tally_items(gpointer key
, gpointer value
, gpointer data
);
115 static Tool all_tools
[] = {
116 {N_("Close"), GTK_STOCK_CLOSE
, N_("Close filer window"),
117 toolbar_close_clicked
, DROP_NONE
, FALSE
,
120 {N_("Up"), GTK_STOCK_GO_UP
, N_("Change to parent directory"),
121 toolbar_up_clicked
, DROP_TO_PARENT
, TRUE
,
124 {N_("Home"), GTK_STOCK_HOME
, N_("Change to home directory"),
125 toolbar_home_clicked
, DROP_TO_HOME
, TRUE
,
128 {N_("Bookmarks"), ROX_STOCK_BOOKMARKS
, N_("Bookmarks menu"),
129 toolbar_bookmarks_clicked
, DROP_BOOKMARK
, FALSE
,
132 {N_("Scan"), GTK_STOCK_REFRESH
, N_("Rescan directory contents"),
133 toolbar_refresh_clicked
, DROP_NONE
, TRUE
,
136 {N_("Size"), GTK_STOCK_ZOOM_IN
, N_("Change icon size"),
137 toolbar_size_clicked
, DROP_NONE
, TRUE
,
140 {N_("Size"), GTK_STOCK_ZOOM_FIT
, N_("Automatic size mode"),
141 toolbar_autosize_clicked
, DROP_NONE
, TRUE
,
144 {N_("Details"), ROX_STOCK_SHOW_DETAILS
, N_("Show extra details"),
145 toolbar_details_clicked
, DROP_NONE
, TRUE
,
148 {N_("Sort"), GTK_STOCK_SORT_ASCENDING
, N_("Change sort criteria"),
149 toolbar_sort_clicked
, DROP_NONE
, FALSE
,
152 {N_("Hidden"), ROX_STOCK_SHOW_HIDDEN
, N_("Show/hide hidden files"),
153 toolbar_hidden_clicked
, DROP_NONE
, TRUE
,
156 {N_("Select"), ROX_STOCK_SELECT
, N_("Select all/invert selection"),
157 toolbar_select_clicked
, DROP_NONE
, FALSE
,
160 {N_("Help"), GTK_STOCK_HELP
, N_("Show ROX-Filer help"),
161 toolbar_help_clicked
, DROP_NONE
, TRUE
,
166 /****************************************************************
167 * EXTERNAL INTERFACE *
168 ****************************************************************/
170 void toolbar_init(void)
172 option_add_int(&o_toolbar
, "toolbar_type", TOOLBAR_NORMAL
);
173 option_add_int(&o_toolbar_info
, "toolbar_show_info", 1);
174 option_add_string(&o_toolbar_disable
, "toolbar_disable",
176 option_add_int(&o_toolbar_min_width
, "toolbar_min_width", 1);
177 option_add_notify(option_notify
);
179 tooltips
= gtk_tooltips_new();
181 option_register_widget("tool-options", build_tool_options
);
184 void toolbar_update_info(FilerWindow
*filer_window
)
190 if (o_toolbar
.int_value
== TOOLBAR_NONE
|| !o_toolbar_info
.int_value
)
191 return; /* Not showing info */
193 if (filer_window
->target_cb
)
196 view
= filer_window
->view
;
198 n_selected
= view_count_selected(view
);
205 if (filer_window
->scanning
)
208 GTK_LABEL(filer_window
->toolbar_text
), "");
212 if (!(filer_window
->show_hidden
||
213 filer_window
->temp_show_hidden
) ||
214 filer_window
->filter
!=FILER_SHOW_ALL
)
216 GHashTable
*hash
= filer_window
->directory
->known_items
;
219 filer_window_being_counted
=filer_window
;
220 g_hash_table_foreach(hash
, tally_items
, &tally
);
223 s
= g_strdup_printf(_(" (%u hidden)"), tally
);
226 n_items
= view_count_items(view
);
229 label
= g_strdup_printf("%d %s%s",
231 n_items
!= 1 ? _("items") : _("item"),
233 else /* (French plurals work differently for zero) */
234 label
= g_strdup_printf(_("No items%s"),
244 view_get_iter(filer_window
->view
, &iter
, VIEW_ITER_SELECTED
);
246 while ((item
= iter
.next(&iter
)))
248 if (item
->base_type
!= TYPE_DIRECTORY
&&
249 item
->base_type
!= TYPE_UNKNOWN
)
250 size
+= (double) item
->size
;
253 label
= g_strdup_printf(_("%u selected (%s)"),
254 n_selected
, format_double_size(size
));
257 gtk_label_set_text(GTK_LABEL(filer_window
->toolbar_text
), label
);
261 /* Create, destroy or recreate toolbar for this window so that it
262 * matches the option setting.
264 void toolbar_update_toolbar(FilerWindow
*filer_window
)
266 g_return_if_fail(filer_window
!= NULL
);
268 if (filer_window
->toolbar
)
270 gtk_widget_destroy(filer_window
->toolbar
);
271 filer_window
->toolbar
= NULL
;
272 filer_window
->toolbar_text
= NULL
;
275 if (o_toolbar
.int_value
!= TOOLBAR_NONE
)
277 filer_window
->toolbar
= create_toolbar(filer_window
);
278 gtk_box_pack_start(filer_window
->toplevel_vbox
,
279 filer_window
->toolbar
, FALSE
, TRUE
, 0);
280 gtk_box_reorder_child(filer_window
->toplevel_vbox
,
281 filer_window
->toolbar
, 0);
282 gtk_widget_show_all(filer_window
->toolbar
);
285 filer_target_mode(filer_window
, NULL
, NULL
, NULL
);
286 toolbar_update_info(filer_window
);
289 /****************************************************************
290 * INTERNAL FUNCTIONS *
291 ****************************************************************/
293 static void toolbar_help_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
297 event
= gtk_get_current_event();
298 if (event
->type
== GDK_BUTTON_RELEASE
&&
299 ((GdkEventButton
*) event
)->button
!= 1)
300 menu_rox_help(NULL
, HELP_MANUAL
, NULL
);
302 filer_opendir(make_path(app_dir
, "Help"), NULL
, NULL
);
305 static void toolbar_refresh_clicked(GtkWidget
*widget
,
306 FilerWindow
*filer_window
)
310 event
= gtk_get_current_event();
311 if (event
->type
== GDK_BUTTON_RELEASE
&&
312 ((GdkEventButton
*) event
)->button
!= 1)
314 filer_opendir(filer_window
->sym_path
, filer_window
, NULL
);
317 filer_refresh(filer_window
);
320 static void toolbar_home_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
324 event
= gtk_get_current_event();
325 if (event
->type
== GDK_BUTTON_RELEASE
&& NEW_WIN_BUTTON(event
))
327 filer_opendir(home_dir
, filer_window
, NULL
);
330 filer_change_to(filer_window
, home_dir
, NULL
);
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)
353 static void toolbar_close_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
357 g_return_if_fail(filer_window
!= NULL
);
359 event
= gtk_get_current_event();
360 if (event
->type
== GDK_BUTTON_RELEASE
&&
361 ((GdkEventButton
*) event
)->button
!= 1)
363 filer_opendir(filer_window
->sym_path
, filer_window
, NULL
);
365 else if (!filer_window_delete(filer_window
->window
, NULL
, filer_window
))
366 gtk_widget_destroy(filer_window
->window
);
369 static void toolbar_up_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
373 event
= gtk_get_current_event();
374 if (event
->type
== GDK_BUTTON_RELEASE
&& NEW_WIN_BUTTON(event
))
376 filer_open_parent(filer_window
);
379 change_to_parent(filer_window
);
382 static void toolbar_autosize_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
386 bev
= (GdkEventButton
*) gtk_get_current_event();
387 if (bev
->type
!= GDK_BUTTON_RELEASE
)
390 display_set_layout(filer_window
, AUTO_SIZE_ICONS
, filer_window
->details_type
,
394 static void toolbar_size_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
398 bev
= (GdkEventButton
*) gtk_get_current_event();
399 if (bev
->type
!= GDK_BUTTON_RELEASE
)
402 display_change_size(filer_window
, bev
->button
== 1);
405 static void toolbar_sort_clicked(GtkWidget
*widget
,
406 FilerWindow
*filer_window
)
409 int i
, current
, next
, next_wrapped
;
414 static const SortType sorts
[]={
415 SORT_NAME
, SORT_TYPE
, SORT_DATE
, SORT_SIZE
,
416 SORT_OWNER
, SORT_GROUP
,
418 static const char *sort_names
[] = {
419 N_("Sort by name"), N_("Sort by type"), N_("Sort by date"),
420 N_("Sort by size"), N_("Sort by owner"), N_("Sort by group"),
423 bev
= (GdkEventButton
*) gtk_get_current_event();
424 adjust
= (bev
->button
!= 1) && bev
->type
== GDK_BUTTON_RELEASE
;
427 dir
= filer_window
->sort_order
;
428 for (i
=0; i
< G_N_ELEMENTS(sort_names
); i
++)
430 if (filer_window
->sort_type
== sorts
[i
])
444 next_wrapped
= next
% G_N_ELEMENTS(sorts
);
446 if (next_wrapped
!= next
)
447 dir
= (dir
== GTK_SORT_ASCENDING
)
448 ? GTK_SORT_DESCENDING
: GTK_SORT_ASCENDING
;
450 display_set_sort_type(filer_window
, sorts
[next_wrapped
], dir
);
451 tip
= g_strconcat(_(sort_names
[next_wrapped
]), ", ",
452 dir
== GTK_SORT_ASCENDING
453 ? _("ascending") : _("descending"),
459 static void toolbar_details_clicked(GtkWidget
*widget
,
460 FilerWindow
*filer_window
)
462 if (filer_window
->view_type
== VIEW_TYPE_DETAILS
)
463 filer_set_view_type(filer_window
, VIEW_TYPE_COLLECTION
);
465 filer_set_view_type(filer_window
, VIEW_TYPE_DETAILS
);
468 static void toolbar_hidden_clicked(GtkWidget
*widget
,
469 FilerWindow
*filer_window
)
471 display_set_hidden(filer_window
, !filer_window
->show_hidden
);
474 static gboolean
invert_cb(ViewIter
*iter
, gpointer data
)
476 return !view_get_selected((ViewIface
*) data
, iter
);
479 static void toolbar_select_clicked(GtkWidget
*widget
, FilerWindow
*filer_window
)
483 event
= gtk_get_current_event();
484 if (event
->type
== GDK_BUTTON_RELEASE
)
486 if (((GdkEventButton
*) event
)->button
== 1)
487 view_select_all(filer_window
->view
);
489 view_select_if(filer_window
->view
, invert_cb
,
492 filer_window
->temp_item_selected
= FALSE
;
495 /* If filer_window is NULL, the toolbar is for the options window */
496 static GtkWidget
*create_toolbar(FilerWindow
*filer_window
)
503 bar
= gtk_toolbar_new();
505 if (o_toolbar
.int_value
== TOOLBAR_NORMAL
|| !filer_window
)
506 gtk_toolbar_set_style(GTK_TOOLBAR(bar
), GTK_TOOLBAR_ICONS
);
507 else if (o_toolbar
.int_value
== TOOLBAR_HORIZONTAL
)
508 gtk_toolbar_set_style(GTK_TOOLBAR(bar
), GTK_TOOLBAR_BOTH_HORIZ
);
510 gtk_toolbar_set_style(GTK_TOOLBAR(bar
), GTK_TOOLBAR_BOTH
);
513 for (i
= 0; i
< sizeof(all_tools
) / sizeof(*all_tools
); i
++)
515 Tool
*tool
= &all_tools
[i
];
518 if (filer_window
&& !tool
->enabled
)
521 b
= add_button(bar
, tool
, filer_window
);
523 gtk_widget_size_request(b
, &req
);
526 if (filer_window
&& tool
->drop_action
!= DROP_NONE
)
527 handle_drops(filer_window
, b
, tool
->drop_action
);
532 if(o_toolbar_min_width
.int_value
)
534 /* Make the toolbar wide enough for all icons to be
535 seen, plus a little for the (start of the) text
537 gtk_widget_set_size_request(bar
, width
+32, -1);
539 gtk_widget_set_size_request(bar
, 100, -1);
542 filer_window
->toolbar_text
= gtk_label_new("");
543 gtk_misc_set_alignment(GTK_MISC(filer_window
->toolbar_text
),
545 gtk_toolbar_append_widget(GTK_TOOLBAR(bar
),
546 filer_window
->toolbar_text
, NULL
, NULL
);
552 /* This is used to simulate a click when button 3 is used (GtkButton
553 * normally ignores this).
555 static gint toolbar_other_button
= 0;
556 static gint
toolbar_button_pressed(GtkButton
*button
,
557 GdkEventButton
*event
,
558 FilerWindow
*filer_window
)
560 gint b
= event
->button
;
563 tool
= g_object_get_data(G_OBJECT(button
), "rox-tool");
564 g_return_val_if_fail(tool
!= NULL
, TRUE
);
566 if (tool
->menu
&& b
== 1)
568 tool
->clicked((GtkWidget
*) button
, filer_window
);
572 if ((b
== 2 || b
== 3) && toolbar_other_button
== 0)
574 toolbar_other_button
= event
->button
;
575 gtk_grab_add(GTK_WIDGET(button
));
576 gtk_button_pressed(button
);
584 static gint
toolbar_button_released(GtkButton
*button
,
585 GdkEventButton
*event
,
586 FilerWindow
*filer_window
)
588 if (event
->button
== toolbar_other_button
)
590 toolbar_other_button
= 0;
591 gtk_grab_remove(GTK_WIDGET(button
));
592 gtk_button_released(button
);
600 /* If filer_window is NULL, the toolbar is for the options window */
601 static GtkWidget
*add_button(GtkWidget
*bar
, Tool
*tool
,
602 FilerWindow
*filer_window
)
604 GtkWidget
*button
, *icon_widget
;
606 icon_widget
= gtk_image_new_from_stock(tool
->name
,
607 GTK_ICON_SIZE_LARGE_TOOLBAR
);
609 button
= gtk_toolbar_insert_element(GTK_TOOLBAR(bar
),
610 filer_window
? GTK_TOOLBAR_CHILD_BUTTON
611 : GTK_TOOLBAR_CHILD_TOGGLEBUTTON
,
616 NULL
, NULL
, /* CB, userdata */
617 GTK_TOOLBAR(bar
)->num_children
);
618 GTK_WIDGET_UNSET_FLAGS(button
, GTK_CAN_FOCUS
);
620 if (o_toolbar
.int_value
== TOOLBAR_HORIZONTAL
)
622 GtkWidget
*hbox
, *label
;
624 hbox
= GTK_BIN(button
)->child
;
625 kids
= gtk_container_get_children(GTK_CONTAINER(hbox
));
626 label
= g_list_nth_data(kids
, 1);
631 gtk_box_set_child_packing(GTK_BOX(hbox
), label
,
632 TRUE
, TRUE
, 0, GTK_PACK_END
);
633 gtk_misc_set_alignment(GTK_MISC(label
), 0, 0.5);
637 g_object_set_data(G_OBJECT(button
), "rox-tool", tool
);
641 g_signal_connect(button
, "clicked",
642 G_CALLBACK(tool
->clicked
), filer_window
);
643 g_signal_connect(button
, "button_press_event",
644 G_CALLBACK(toolbar_button_pressed
), filer_window
);
645 g_signal_connect(button
, "button_release_event",
646 G_CALLBACK(toolbar_button_released
), filer_window
);
650 g_signal_connect(button
, "clicked",
651 G_CALLBACK(toggle_selected
), NULL
);
652 g_object_set_data(G_OBJECT(button
), "tool_name",
653 (gpointer
) tool
->name
);
659 static void toggle_selected(GtkToggleButton
*widget
, gpointer data
)
661 option_check_widget(&o_toolbar_disable
);
664 /* Called during the drag when the mouse is in a widget registered
665 * as a drop target. Returns TRUE if we can accept the drop.
667 static gboolean
drag_motion(GtkWidget
*widget
,
668 GdkDragContext
*context
,
672 FilerWindow
*filer_window
)
674 GdkDragAction action
= context
->suggested_action
;
676 gpointer type
= (gpointer
) drop_dest_dir
;
678 dest
= (DropDest
) g_object_get_data(G_OBJECT(widget
), "toolbar_dest");
680 if ((context
->actions
& GDK_ACTION_ASK
) && o_dnd_left_menu
.int_value
&&
681 dest
!= DROP_BOOKMARK
)
684 gdk_window_get_pointer(NULL
, NULL
, NULL
, &state
);
685 if (state
& GDK_BUTTON1_MASK
)
686 action
= GDK_ACTION_ASK
;
689 if (dest
== DROP_TO_HOME
)
690 g_dataset_set_data(context
, "drop_dest_path",
692 else if (dest
== DROP_BOOKMARK
)
693 type
= (gpointer
) drop_dest_bookmark
;
695 g_dataset_set_data_full(context
, "drop_dest_path",
696 g_path_get_dirname(filer_window
->sym_path
),
699 g_dataset_set_data(context
, "drop_dest_type", type
);
700 gdk_drag_status(context
, action
, time
);
702 dnd_spring_load(context
, filer_window
);
703 gtk_button_set_relief(GTK_BUTTON(widget
), GTK_RELIEF_NORMAL
);
708 static void drag_leave(GtkWidget
*widget
,
709 GdkDragContext
*context
,
711 FilerWindow
*filer_window
)
713 gtk_button_set_relief(GTK_BUTTON(widget
), GTK_RELIEF_NONE
);
717 static void handle_drops(FilerWindow
*filer_window
,
721 make_drop_target(button
, 0);
722 g_signal_connect(button
, "drag_motion",
723 G_CALLBACK(drag_motion
), filer_window
);
724 g_signal_connect(button
, "drag_leave",
725 G_CALLBACK(drag_leave
), filer_window
);
726 g_object_set_data(G_OBJECT(button
), "toolbar_dest", (gpointer
) dest
);
729 static void tally_items(gpointer key
, gpointer value
, gpointer data
)
731 guchar
*leafname
= (guchar
*) key
;
732 int *tally
= (int *) data
;
734 if (!filer_match_filter(filer_window_being_counted
, leafname
))
738 static void option_notify(void)
741 gboolean changed
= FALSE
;
742 guchar
*list
= o_toolbar_disable
.value
;
744 for (i
= 0; i
< sizeof(all_tools
) / sizeof(*all_tools
); i
++)
746 Tool
*tool
= &all_tools
[i
];
747 gboolean old
= tool
->enabled
;
749 tool
->enabled
= !in_list(tool
->name
, list
);
751 if (old
!= tool
->enabled
)
755 if (changed
|| o_toolbar
.has_changed
|| o_toolbar_info
.has_changed
)
759 for (next
= all_filer_windows
; next
; next
= next
->next
)
761 FilerWindow
*filer_window
= (FilerWindow
*) next
->data
;
763 toolbar_update_toolbar(filer_window
);
768 static void update_tools(Option
*option
)
772 kids
= gtk_container_get_children(GTK_CONTAINER(option
->widget
));
774 for (next
= kids
; next
; next
= next
->next
)
776 GtkToggleButton
*kid
= (GtkToggleButton
*) next
->data
;
779 name
= g_object_get_data(G_OBJECT(kid
), "tool_name");
781 g_return_if_fail(name
!= NULL
);
783 gtk_toggle_button_set_active(kid
,
784 !in_list(name
, option
->value
));
790 static guchar
*read_tools(Option
*option
)
796 list
= g_string_new(NULL
);
798 kids
= gtk_container_get_children(GTK_CONTAINER(option
->widget
));
800 for (next
= kids
; next
; next
= next
->next
)
802 GtkToggleButton
*kid
= (GtkToggleButton
*) next
->data
;
805 if (!gtk_toggle_button_get_active(kid
))
807 name
= g_object_get_data(G_OBJECT(kid
), "tool_name");
808 g_return_val_if_fail(name
!= NULL
, list
->str
);
811 g_string_append(list
, ", ");
812 g_string_append(list
, name
);
818 g_string_free(list
, FALSE
);
823 static GList
*build_tool_options(Option
*option
, xmlNode
*node
, guchar
*label
)
827 g_return_val_if_fail(option
!= NULL
, NULL
);
829 bar
= create_toolbar(NULL
);
831 option
->update_widget
= update_tools
;
832 option
->read_widget
= read_tools
;
833 option
->widget
= bar
;
835 return g_list_append(NULL
, bar
);