From e3a9e12ca9ba1aaa20abb0f1acb33b08b788b41f Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 10 Feb 1999 01:16:42 +0000 Subject: [PATCH] 1999-02-09 Miguel de Icaza * view.c (search): Provide GNOME specific code for the search progress --- ChangeLog | 4 ++++ configure.in | 3 --- src/ChangeLog | 2 ++ src/view.c | 34 +++++++++++++++++++++++++++++++--- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73657afcd..d057e0286 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1999-02-09 Miguel de Icaza + + * configure.in (CCOPTS): Drop the prefix auto-detection. + Wed Feb 10 02:48:51 1999 Timur Bakeyev * configure.in: Add check, which, in case of system-installed SLang diff --git a/configure.in b/configure.in index 3c39e1be8..228199ead 100644 --- a/configure.in +++ b/configure.in @@ -24,9 +24,6 @@ dnl We reset it back soon. CCOPTS="$CFLAGS" unset CFLAGS -dnl Find out, if we should default to /usr/local or /usr -AC_PREFIX_PROGRAM(mc) - AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_CPP diff --git a/src/ChangeLog b/src/ChangeLog index 7eb40dcdd..07a227c43 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 1999-02-09 Miguel de Icaza + * view.c (search): Provide GNOME specific code for the search progress + * 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. diff --git a/src/view.c b/src/view.c index 43bf54712..0975c4323 100644 --- a/src/view.c +++ b/src/view.c @@ -1421,6 +1421,14 @@ search_update_steps (WView *view) update_steps = 20000; } +#ifdef HAVE_GNOME +static void +cancel_pressed (GtkWidget *widget, int *abort) +{ + *abort = 1; +} +#endif + static void search (WView *view, char *text, int (*search)(WView *, char *, char *, int)) { @@ -1432,7 +1440,9 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int)) int found_len, search_start; Dlg_head *d = 0; int search_status; - + int abort; + void *gd; + /* Used to keep track of where the line starts, when looking forward */ /* is the index before transfering the line; the reverse case uses */ /* the position returned after the line has been read */ @@ -1441,11 +1451,21 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int)) long t; /* Clear interrupt status */ got_interrupt (); - + + abort = 0; +#ifdef HAVE_GNOME + gd = gnome_message_box_new (_("Searching for `%s'"), + GNOME_MESSAGE_BOX_INFO, + GNOME_STOCK_BUTTON_CANCEL, + NULL); + gnome_dialog_button_connect (GNOME_DIALOG (gd), 0, GTK_SIGNAL_FUNC (cancel_pressed), &abort); + gtk_widget_show (gd); +#else if (verbose){ d = message (D_INSERT, _(" Search "), _("Searching %s"), text); mc_refresh (); } +#endif ch = 0; if (view->direction == 1){ p = view->found_len ? view->search_start + 1 : view->search_start; @@ -1468,8 +1488,13 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int)) if ((count++ % 32) == 0) x_flush_events (); +#ifdef HAVE_GNOME + if (abort) + break; +#else if (verbose && !d->running) break; +#endif #endif if (p >= update_activate){ update_activate += update_steps; @@ -1527,11 +1552,14 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int)) break; } disable_interrupt_key (); +#ifdef HAVE_GNOME + gtk_object_destroy (GTK_OBJECT (gd)); +#else if (verbose){ dlg_run_done (d); destroy_dlg (d); } - +#endif if (!s){ message (0, _(" Search "), _(" Search string not found ")); view->found_len = 0;