diff --git a/Make.common.in b/Make.common.in index 66dde6120..cff9bf73b 100644 --- a/Make.common.in +++ b/Make.common.in @@ -1,6 +1,6 @@ VERSION = @VERSION@ -SHELL = /bin/sh +SHELL = @SHELL@ # This variable makes it possible to move the installation root to another # directory. This is useful when you're creating a binary distribution of mc. diff --git a/configure.in b/configure.in index 164d8d4c8..af8ba971d 100644 --- a/configure.in +++ b/configure.in @@ -1217,6 +1217,9 @@ AC_SUBST(PCENTRULE) AC_SUBST(builddir) builddir=`pwd` +SHELL=${SHELL-"/bin/sh"} +AC_SUBST(SHELL) + dnl dnl Output configuration filesn dnl diff --git a/gnome/gtkdtree.c b/gnome/gtkdtree.c index 9096151d5..8eac74c50 100644 --- a/gnome/gtkdtree.c +++ b/gnome/gtkdtree.c @@ -478,6 +478,21 @@ entry_added_callback (char *dirname, void *data) g_free (dirname); } +/* + * Callback routine invoked from the treestore to hint us + * about the progress of the freezing + */ +static void +tree_set_freeze (int state, void *data) +{ + GtkDTree *dtree = GTK_DTREE (data); + + if (state) + gtk_clist_freeze (GTK_CLIST (dtree)); + else + gtk_clist_thaw (GTK_CLIST (dtree)); +} + static void gtk_dtree_destroy (GtkObject *object) { @@ -485,6 +500,8 @@ gtk_dtree_destroy (GtkObject *object) tree_store_remove_entry_remove_hook (entry_removed_callback); tree_store_remove_entry_add_hook (entry_added_callback); + tree_store_remove_freeze_hook (tree_set_freeze); + gdk_pixmap_unref (dtree->pixmap_open); gdk_pixmap_unref (dtree->pixmap_close); gdk_bitmap_unref (dtree->bitmap_open); @@ -648,6 +665,7 @@ gtk_dtree_init (GtkDTree *dtree) tree_store_add_entry_remove_hook (entry_removed_callback, dtree); tree_store_add_entry_add_hook (entry_added_callback, dtree); + tree_store_add_freeze_hook (tree_set_freeze, dtree); } void diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 1b81b831f..3b75e15f7 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -2,7 +2,7 @@ PACKAGE = mc VERSION = @VERSION@ -SHELL = /bin/sh +SHELL = @SHELL@ @SET_MAKE@ srcdir = @srcdir@ diff --git a/src/ChangeLog b/src/ChangeLog index 84151da83..7eb40dcdd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +1999-02-09 Miguel de Icaza + + * treestore.c: Add a new hook system to hint a tree freeze/thaw. + + * setup.c: In the GNOME version, we do not show the dot files by default. + 1999-02-08 Miguel de Icaza * file.c (copy_file_file): Add support for the GNOME metadata here. diff --git a/src/Makefile.in b/src/Makefile.in index 474ef1157..aa034ebd5 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ -SHELL = /bin/sh +SHELL = @SHELL@ rootdir = $(srcdir)/.. @MCFG@@MCF@ diff --git a/src/dir.c b/src/dir.c index 4dbc958e4..c1fdaa7fe 100644 --- a/src/dir.c +++ b/src/dir.c @@ -32,8 +32,16 @@ /* "$Id$" */ -/* If true show files starting with a dot */ +/* + * If true show files starting with a dot. + * + * In GNOME we default to not showing them. + */ +#ifdef HAVE_GNOME +int show_dot_files = 0; +#else int show_dot_files = 1; +#endif /* If true show files ending in ~ */ int show_backups = 0; diff --git a/src/setup.c b/src/setup.c index 7c592a378..ce48fa4a4 100644 --- a/src/setup.c +++ b/src/setup.c @@ -166,7 +166,11 @@ static struct { int *opt_addr; } options [] = { { "show_backups", &show_backups }, +#ifdef HAVE_GNOME + { "gnome_show_dot_files", &show_dot_files }, +#else { "show_dot_files", &show_dot_files }, +#endif { "verbose", &verbose }, { "mark_moves_down", &mark_moves_down }, { "pause_after_run", &pause_after_run }, diff --git a/src/treestore.c b/src/treestore.c index ea1fc3b01..e36aff105 100644 --- a/src/treestore.c +++ b/src/treestore.c @@ -597,6 +597,8 @@ tree_store_start_check (char *path) g_assert (ts.check_name == NULL); ts.check_start = NULL; + tree_store_set_freeze (TRUE); + /* Search for the start of subdirectories */ current = tree_store_whereis (path); if (!current){ @@ -681,6 +683,8 @@ tree_store_end_check (void) } g_list_free (the_queue); + + tree_store_set_freeze (FALSE); } tree_entry * @@ -722,6 +726,7 @@ tree_store_rescan (char *dir) static Hook *remove_entry_hooks; static Hook *add_entry_hooks; +static Hook *freeze_hooks; void tree_store_add_entry_remove_hook (tree_store_remove_fn callback, void *data) @@ -748,7 +753,6 @@ tree_store_notify_remove (tree_entry *entry) p = p->next; } } - void tree_store_add_entry_add_hook (tree_store_add_fn callback, void *data) { @@ -774,6 +778,31 @@ tree_store_notify_add (char *directory) } } +void +tree_store_add_freeze_hook (tree_freeze_fn callback, void *data) +{ + add_hook (&freeze_hooks, (void (*)(void *)) callback, data); +} + +void +tree_store_remove_freeze_hook (tree_freeze_fn callback) +{ + delete_hook (&freeze_hooks, (void (*)(void *))callback); +} + +void +tree_store_set_freeze (int freeze) +{ + Hook *p = freeze_hooks; + tree_freeze_fn f; + + while (p) { + f = (tree_freeze_fn) p->hook_fn; + f (freeze, p->hook_data); + p = p->next; + } +} + tree_scan * tree_store_opendir (char *path) { diff --git a/src/treestore.h b/src/treestore.h index 98631f3e9..d05f7941d 100644 --- a/src/treestore.h +++ b/src/treestore.h @@ -61,12 +61,24 @@ typedef void (*tree_store_add_fn)(char *name, void *data); void tree_store_add_entry_add_hook (tree_store_add_fn callback, void *data); void tree_store_remove_entry_add_hook (tree_store_add_fn callback); +/* + * Register/unregister freeze/unfreeze functions for the tree + */ +typedef void (*tree_freeze_fn)(int freeze, void *data); +void tree_store_add_freeze_hook (tree_freeze_fn callback, void *data); +void tree_store_remove_freeze_hook (tree_freeze_fn); + /* * Changes in the tree_entry are notified with these */ void tree_store_notify_remove (tree_entry *entry); void tree_store_notify_add (char *directory); +/* + * Freeze unfreeze notification + */ +void tree_store_set_freeze (int freeze); + tree_scan *tree_store_opendir (char *path); tree_entry *tree_store_readdir (tree_scan *scanner); void tree_store_closedir (tree_scan *scanner);