mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
1999-02-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
* view.c (search): Provide GNOME specific code for the search progress
This commit is contained in:
parent
a08bebe655
commit
e3a9e12ca9
@ -1,3 +1,7 @@
|
|||||||
|
1999-02-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* configure.in (CCOPTS): Drop the prefix auto-detection.
|
||||||
|
|
||||||
Wed Feb 10 02:48:51 1999 Timur Bakeyev <mc@bat.ru>
|
Wed Feb 10 02:48:51 1999 Timur Bakeyev <mc@bat.ru>
|
||||||
|
|
||||||
* configure.in: Add check, which, in case of system-installed SLang
|
* configure.in: Add check, which, in case of system-installed SLang
|
||||||
|
@ -24,9 +24,6 @@ dnl We reset it back soon.
|
|||||||
CCOPTS="$CFLAGS"
|
CCOPTS="$CFLAGS"
|
||||||
unset 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_MAKE_SET
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_CPP
|
AC_PROG_CPP
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
1999-02-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
1999-02-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* view.c (search): Provide GNOME specific code for the search progress
|
||||||
|
|
||||||
* treestore.c: Add a new hook system to hint a tree freeze/thaw.
|
* 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.
|
* setup.c: In the GNOME version, we do not show the dot files by default.
|
||||||
|
30
src/view.c
30
src/view.c
@ -1421,6 +1421,14 @@ search_update_steps (WView *view)
|
|||||||
update_steps = 20000;
|
update_steps = 20000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_GNOME
|
||||||
|
static void
|
||||||
|
cancel_pressed (GtkWidget *widget, int *abort)
|
||||||
|
{
|
||||||
|
*abort = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
|
search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
|
||||||
{
|
{
|
||||||
@ -1432,6 +1440,8 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
|
|||||||
int found_len, search_start;
|
int found_len, search_start;
|
||||||
Dlg_head *d = 0;
|
Dlg_head *d = 0;
|
||||||
int search_status;
|
int search_status;
|
||||||
|
int abort;
|
||||||
|
void *gd;
|
||||||
|
|
||||||
/* Used to keep track of where the line starts, when looking forward */
|
/* Used to keep track of where the line starts, when looking forward */
|
||||||
/* is the index before transfering the line; the reverse case uses */
|
/* is the index before transfering the line; the reverse case uses */
|
||||||
@ -1442,10 +1452,20 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
|
|||||||
/* Clear interrupt status */
|
/* Clear interrupt status */
|
||||||
got_interrupt ();
|
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){
|
if (verbose){
|
||||||
d = message (D_INSERT, _(" Search "), _("Searching %s"), text);
|
d = message (D_INSERT, _(" Search "), _("Searching %s"), text);
|
||||||
mc_refresh ();
|
mc_refresh ();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
ch = 0;
|
ch = 0;
|
||||||
if (view->direction == 1){
|
if (view->direction == 1){
|
||||||
p = view->found_len ? view->search_start + 1 : view->search_start;
|
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)
|
if ((count++ % 32) == 0)
|
||||||
x_flush_events ();
|
x_flush_events ();
|
||||||
|
#ifdef HAVE_GNOME
|
||||||
|
if (abort)
|
||||||
|
break;
|
||||||
|
#else
|
||||||
if (verbose && !d->running)
|
if (verbose && !d->running)
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (p >= update_activate){
|
if (p >= update_activate){
|
||||||
update_activate += update_steps;
|
update_activate += update_steps;
|
||||||
@ -1527,11 +1552,14 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
disable_interrupt_key ();
|
disable_interrupt_key ();
|
||||||
|
#ifdef HAVE_GNOME
|
||||||
|
gtk_object_destroy (GTK_OBJECT (gd));
|
||||||
|
#else
|
||||||
if (verbose){
|
if (verbose){
|
||||||
dlg_run_done (d);
|
dlg_run_done (d);
|
||||||
destroy_dlg (d);
|
destroy_dlg (d);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (!s){
|
if (!s){
|
||||||
message (0, _(" Search "), _(" Search string not found "));
|
message (0, _(" Search "), _(" Search string not found "));
|
||||||
view->found_len = 0;
|
view->found_len = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user