Commit bc177a67 authored by Andy Hertzfeld's avatar Andy Hertzfeld
Browse files

implemented the "select all" command in the context menu


       implemented the "select all" command in the context menu
parent 36e8d6ca
2000-01-31 Andy Hertzfeld <andy@eazel.com>
implemented the "select all" command in the context menus
* src/file-manager/directory_view.c,h:
added a directory_view_select_all slot for subclasses to override,
enabled "select all" item and attached a signal to the item, whose
callback calls fm_directory_view_select_all
* src/file-manager/directory_view_icons.c:
implemented directory_view_icons_select_all by invoking the "select all"
operation of GnomeIconContainer
* src/file-manager/directory_view_list.c:
implemented directory_view_list_select_all by invoking the "select all"
operation of the clist widget
2000-01-31 Elliot Lee <sopwith@redhat.com>
* src/ntl-window-msgs.c, src/ntl-window-private.h: Update debugging messages. Allow
......
......@@ -73,6 +73,8 @@ static NautilusZoomLevel fm_directory_view_icons_get_zoom_level
(FMDirectoryViewIcons *view);
static void fm_directory_view_icons_initialize (FMDirectoryViewIcons *icon_view);
static void fm_directory_view_icons_initialize_class (FMDirectoryViewIconsClass *klass);
static void fm_directory_view_icons_select_all (FMDirectoryView *view);
static void fm_directory_view_icons_set_zoom_level
(FMDirectoryViewIcons *view,
NautilusZoomLevel new_level);
......@@ -127,7 +129,8 @@ fm_directory_view_icons_initialize_class (FMDirectoryViewIconsClass *klass)
= fm_directory_view_icons_can_zoom_in;
fm_directory_view_class->can_zoom_out
= fm_directory_view_icons_can_zoom_out;
fm_directory_view_class->select_all
= fm_directory_view_icons_select_all;
}
static void
......@@ -370,6 +373,17 @@ fm_directory_view_icons_get_selection (FMDirectoryView *view)
(get_icon_container (FM_DIRECTORY_VIEW_ICONS (view)));
}
static void
fm_directory_view_icons_select_all (FMDirectoryView *view)
{
GnomeIconContainer *icon_container;
g_return_if_fail (FM_IS_DIRECTORY_VIEW_ICONS (view));
icon_container = get_icon_container (FM_DIRECTORY_VIEW_ICONS (view));
gnome_icon_container_select_all(icon_container);
}
/**
* fm_directory_view_icons_line_up_icons:
......
......@@ -103,6 +103,8 @@ static void fm_directory_view_list_initialize_class (gpointer klass);
static void fm_directory_view_list_destroy (GtkObject *object);
static void fm_directory_view_list_done_adding_entries
(FMDirectoryView *view);
static void fm_directory_view_list_select_all (FMDirectoryView *view);
static void fm_directory_view_list_set_zoom_level (FMDirectoryViewList *list_view,
NautilusZoomLevel new_level);
static void fm_directory_view_list_sort_items (FMDirectoryViewList *list_view,
......@@ -166,6 +168,7 @@ fm_directory_view_list_initialize_class (gpointer klass)
fm_directory_view_class->bump_zoom_level = fm_directory_view_list_bump_zoom_level;
fm_directory_view_class->can_zoom_in = fm_directory_view_list_can_zoom_in;
fm_directory_view_class->can_zoom_out = fm_directory_view_list_can_zoom_out;
fm_directory_view_class->select_all = fm_directory_view_list_select_all;
}
static void
......@@ -644,6 +647,17 @@ fm_directory_view_list_set_zoom_level (FMDirectoryViewList *list_view,
gtk_clist_thaw (clist);
}
/* select all of the items in the view */
static void
fm_directory_view_list_select_all (FMDirectoryView *view)
{
GtkCList *clist;
g_return_if_fail (FM_IS_DIRECTORY_VIEW_LIST (view));
clist = GTK_CLIST (get_flist (FM_DIRECTORY_VIEW_LIST(view)));
gtk_clist_select_all(clist);
}
static void
fm_directory_view_list_sort_items (FMDirectoryViewList *list_view,
int column,
......
......@@ -84,6 +84,7 @@ static void stop_location_change_cb (NautilusViewFrame *view_frame,
static void notify_location_change_cb (NautilusViewFrame *view_frame,
Nautilus_NavigationInfo *nav_context,
FMDirectoryView *directory_view);
static void select_all_cb (GtkMenuItem *item, FMDirectoryView *directory_view);
static void zoom_in_cb (GtkMenuItem *item, FMDirectoryView *directory_view);
static void zoom_out_cb (GtkMenuItem *item, FMDirectoryView *directory_view);
......@@ -99,6 +100,7 @@ NAUTILUS_DEFINE_CLASS_BOILERPLATE (FMDirectoryView, fm_directory_view, GTK_TYPE_
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, add_entry)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, clear)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_selection)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, select_all)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, bump_zoom_level)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, can_zoom_in)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, can_zoom_out)
......@@ -153,6 +155,7 @@ fm_directory_view_initialize_class (FMDirectoryViewClass *klass)
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, add_entry);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, clear);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_selection);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, select_all);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, bump_zoom_level);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, can_zoom_in);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, can_zoom_out);
......@@ -348,6 +351,14 @@ stop_load (FMDirectoryView *view, gboolean error)
/* handle the "select all" menu command */
static void
select_all_cb(GtkMenuItem *item, FMDirectoryView *directory_view)
{
fm_directory_view_select_all (directory_view);
}
/* handle the zoom in/out menu items */
static void
......@@ -744,8 +755,9 @@ append_background_items (FMDirectoryView *view, GtkMenu *menu)
GtkWidget *menu_item;
menu_item = gtk_menu_item_new_with_label ("Select all");
gtk_widget_set_sensitive (menu_item, FALSE);
gtk_widget_show (menu_item);
gtk_signal_connect(GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (select_all_cb), view);
gtk_menu_append (menu, menu_item);
......@@ -965,6 +977,20 @@ disconnect_model_handlers (FMDirectoryView *view)
}
}
/**
* fm_directory_view_select_all:
*
* select all the items in the view
*
**/
void
fm_directory_view_select_all (FMDirectoryView *view)
{
g_return_if_fail (FM_IS_DIRECTORY_VIEW (view));
(* FM_DIRECTORY_VIEW_CLASS (GTK_OBJECT (view)->klass)->select_all) (view);
}
/**
* fm_directory_view_stop:
*
......
......@@ -101,6 +101,10 @@ struct _FMDirectoryViewClass {
/* can_zoom_out is a function pointer that subclasses must override to
* return whether the view is at minimum size (furthest-out zoom level) */
gboolean (* can_zoom_out) (FMDirectoryView *view);
/* select_sll is a function pointer that subclasses must override to
* select all of the items in the view */
void (* select_all) (FMDirectoryView *view);
};
......@@ -122,6 +126,7 @@ gboolean fm_directory_view_can_zoom_in (FMDirectoryView *view);
gboolean fm_directory_view_can_zoom_out (FMDirectoryView *view);
void fm_directory_view_bump_zoom_level (FMDirectoryView *view,
gint zoom_increment);
void fm_directory_view_select_all (FMDirectoryView *view);
/* Wrappers for signal emitters. These are normally called
* only by FMDirectoryView itself. They have corresponding signals
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment