kopia lustrzana https://gitlab.com/sane-project/frontends
Disable "Scan" and "Acquire Preview" buttons while scanning, and "Acquire
Preview" while acquiring a preview. Avoids error messages and/or lockups. Patch from Aurelien Jarno <ml@aurel32.net>.DEVEL_2_0_BRANCH-1
rodzic
a4bcb6edea
commit
32586c1b7b
|
@ -1,3 +1,10 @@
|
||||||
|
2002-10-17 Henning Meier-Geinitz <henning@meier-geinitz.de>
|
||||||
|
|
||||||
|
* src/preview.c src/preview.h src/xscanimage.c: Disable "Scan"
|
||||||
|
and "Acquire Preview" buttons while scanning, and "Acquire
|
||||||
|
Preview" while acquiring a preview. Avoids error messages and/or
|
||||||
|
lockups. Patch from Aurelien Jarno <ml@aurel32.net>.
|
||||||
|
|
||||||
2002-10-15 Henning Meier-Geinitz <henning@meier-geinitz.de>
|
2002-10-15 Henning Meier-Geinitz <henning@meier-geinitz.de>
|
||||||
|
|
||||||
* src/preview.c: Added malloc that got lost in previous commit.
|
* src/preview.c: Added malloc that got lost in previous commit.
|
||||||
|
|
|
@ -810,6 +810,7 @@ scan_done (Preview *p)
|
||||||
set_option_bool (p, p->dialog->well_known.preview, SANE_FALSE);
|
set_option_bool (p, p->dialog->well_known.preview, SANE_FALSE);
|
||||||
|
|
||||||
gtk_widget_set_sensitive (p->cancel, FALSE);
|
gtk_widget_set_sensitive (p->cancel, FALSE);
|
||||||
|
gtk_widget_set_sensitive (p->preview, TRUE);
|
||||||
gsg_set_sensitivity (p->dialog, TRUE);
|
gsg_set_sensitivity (p->dialog, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,6 +823,7 @@ scan_start (Preview *p)
|
||||||
int fd, y;
|
int fd, y;
|
||||||
|
|
||||||
gtk_widget_set_sensitive (p->cancel, TRUE);
|
gtk_widget_set_sensitive (p->cancel, TRUE);
|
||||||
|
gtk_widget_set_sensitive (p->preview, FALSE);
|
||||||
gsg_set_sensitivity (p->dialog, FALSE);
|
gsg_set_sensitivity (p->dialog, FALSE);
|
||||||
|
|
||||||
/* clear old preview: */
|
/* clear old preview: */
|
||||||
|
@ -1124,7 +1126,7 @@ Preview *
|
||||||
preview_new (GSGDialog *dialog)
|
preview_new (GSGDialog *dialog)
|
||||||
{
|
{
|
||||||
static int first_time = 1;
|
static int first_time = 1;
|
||||||
GtkWidget *table, *frame, *button;
|
GtkWidget *table, *frame;
|
||||||
GtkSignalFunc signal_func;
|
GtkSignalFunc signal_func;
|
||||||
GtkWidgetClass *class;
|
GtkWidgetClass *class;
|
||||||
GtkBox *vbox, *hbox;
|
GtkBox *vbox, *hbox;
|
||||||
|
@ -1224,12 +1226,12 @@ preview_new (GSGDialog *dialog)
|
||||||
|
|
||||||
/* fill in action area: */
|
/* fill in action area: */
|
||||||
|
|
||||||
/* Start button */
|
/* Preview button */
|
||||||
button = gtk_button_new_with_label ("Acquire Preview");
|
p->preview = gtk_button_new_with_label ("Acquire Preview");
|
||||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
gtk_signal_connect (GTK_OBJECT (p->preview), "clicked",
|
||||||
(GtkSignalFunc) start_button_clicked, p);
|
(GtkSignalFunc) start_button_clicked, p);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), p->preview, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (p->preview);
|
||||||
|
|
||||||
/* Cancel button */
|
/* Cancel button */
|
||||||
p->cancel = gtk_button_new_with_label ("Cancel Preview");
|
p->cancel = gtk_button_new_with_label ("Cancel Preview");
|
||||||
|
|
|
@ -68,6 +68,7 @@ typedef struct
|
||||||
GtkWidget *viewport;
|
GtkWidget *viewport;
|
||||||
GtkWidget *window; /* the preview window */
|
GtkWidget *window; /* the preview window */
|
||||||
GtkWidget *cancel; /* the cancel button */
|
GtkWidget *cancel; /* the cancel button */
|
||||||
|
GtkWidget *preview; /* the preview button */
|
||||||
}
|
}
|
||||||
Preview;
|
Preview;
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,8 @@ static struct
|
||||||
GtkWidget *hruler;
|
GtkWidget *hruler;
|
||||||
GtkWidget *vruler;
|
GtkWidget *vruler;
|
||||||
GtkWidget *info_label;
|
GtkWidget *info_label;
|
||||||
|
GtkWidget *preview_button;
|
||||||
|
GtkWidget *scan_button;
|
||||||
Preview *preview;
|
Preview *preview;
|
||||||
gint32 mode;
|
gint32 mode;
|
||||||
/* various scanning related state: */
|
/* various scanning related state: */
|
||||||
|
@ -534,6 +536,8 @@ scan_preview (GtkWidget * widget, gpointer call_data)
|
||||||
widget);
|
widget);
|
||||||
else
|
else
|
||||||
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (widget), FALSE);
|
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (widget), FALSE);
|
||||||
|
if (scan_win.progress)
|
||||||
|
gtk_widget_set_sensitive (scan_win.preview->preview, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (scan_win.preview)
|
else if (scan_win.preview)
|
||||||
|
@ -802,6 +806,9 @@ static void
|
||||||
scan_done (void)
|
scan_done (void)
|
||||||
{
|
{
|
||||||
gsg_set_sensitivity (dialog, TRUE);
|
gsg_set_sensitivity (dialog, TRUE);
|
||||||
|
if (scan_win.preview)
|
||||||
|
gtk_widget_set_sensitive (scan_win.preview->preview, TRUE);
|
||||||
|
gtk_widget_set_sensitive (scan_win.scan_button, TRUE);
|
||||||
|
|
||||||
if (scan_win.input_tag >= 0)
|
if (scan_win.input_tag >= 0)
|
||||||
{
|
{
|
||||||
|
@ -861,6 +868,9 @@ scan_start (void)
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
gsg_set_sensitivity (dialog, FALSE);
|
gsg_set_sensitivity (dialog, FALSE);
|
||||||
|
if (scan_win.preview)
|
||||||
|
gtk_widget_set_sensitive (scan_win.preview->preview, FALSE);
|
||||||
|
gtk_widget_set_sensitive (scan_win.scan_button, FALSE);
|
||||||
|
|
||||||
#ifdef HAVE_LIBGIMP_GIMP_H
|
#ifdef HAVE_LIBGIMP_GIMP_H
|
||||||
if (scan_win.mode == SANE_GIMP_EXTENSION && scan_win.tile)
|
if (scan_win.mode == SANE_GIMP_EXTENSION && scan_win.tile)
|
||||||
|
@ -1548,19 +1558,19 @@ device_dialog (void)
|
||||||
hbox = GTK_DIALOG (scan_win.shell)->action_area;
|
hbox = GTK_DIALOG (scan_win.shell)->action_area;
|
||||||
|
|
||||||
/* The Scan button */
|
/* The Scan button */
|
||||||
button = gtk_button_new_with_label ("Scan");
|
scan_win.scan_button = gtk_button_new_with_label ("Scan");
|
||||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
gtk_signal_connect (GTK_OBJECT (scan_win.scan_button), "clicked",
|
||||||
(GtkSignalFunc) scan_dialog,
|
(GtkSignalFunc) scan_dialog,
|
||||||
NULL);
|
NULL);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), scan_win.scan_button, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (scan_win.scan_button);
|
||||||
|
|
||||||
/* The Preview button */
|
/* The Preview button */
|
||||||
button = gtk_toggle_button_new_with_label ("Preview Window");
|
scan_win.preview_button = gtk_toggle_button_new_with_label ("Preview Window");
|
||||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
gtk_signal_connect (GTK_OBJECT (scan_win.preview_button), "clicked",
|
||||||
(GtkSignalFunc) scan_preview, NULL);
|
(GtkSignalFunc) scan_preview, NULL);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), scan_win.preview_button, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (scan_win.preview_button);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* The Zoom in button */
|
/* The Zoom in button */
|
||||||
|
|
Ładowanie…
Reference in New Issue