diff -cr rox-1.3.9/ROX-Filer/src/toolbar.c rox-1.3.9-selbutton/ROX-Filer/src/toolbar.c *** rox-1.3.9/ROX-Filer/src/toolbar.c Tue Apr 15 21:09:26 2003 --- rox-1.3.9-selbutton/ROX-Filer/src/toolbar.c Wed May 21 17:49:01 2003 *************** *** 84,89 **** --- 84,91 ---- FilerWindow *filer_window); static void toolbar_hidden_clicked(GtkWidget *widget, FilerWindow *filer_window); + static void toolbar_select_clicked(GtkWidget *widget, + FilerWindow *filer_window); static GtkWidget *add_button(GtkWidget *bar, Tool *tool, FilerWindow *filer_window); static GtkWidget *create_toolbar(FilerWindow *filer_window); *************** *** 142,147 **** --- 144,153 ---- toolbar_hidden_clicked, DROP_NONE, TRUE, FALSE}, + {N_("Select"), GTK_STOCK_COPY, N_("Select all/invert selection"), + toolbar_select_clicked, DROP_NONE, TRUE, + FALSE}, + {N_("Help"), GTK_STOCK_HELP, N_("Show ROX-Filer help"), toolbar_help_clicked, DROP_NONE, TRUE, FALSE}, *************** *** 393,398 **** --- 399,428 ---- FilerWindow *filer_window) { display_set_hidden(filer_window, !filer_window->show_hidden); + } + + static gboolean invert_cb(ViewIter *iter, gpointer data) + { + return !view_get_selected((ViewIface *) data, iter); + } + + static void toolbar_select_clicked(GtkWidget *widget, FilerWindow *filer_window) + { + GdkEvent *event; + + event = gtk_get_current_event(); + if (event->type == GDK_BUTTON_RELEASE && + ((GdkEventButton *) event)->button==2) + { + view_select_if(filer_window->view, invert_cb, + filer_window->view); + } + else if (event->type == GDK_BUTTON_RELEASE && + ((GdkEventButton *) event)->button==1) + { + view_select_all(filer_window->view); + } + filer_window->temp_item_selected = FALSE; } /* If filer_window is NULL, the toolbar is for the options window */