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>
|
||||
|
||||
* 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);
|
||||
|
||||
gtk_widget_set_sensitive (p->cancel, FALSE);
|
||||
gtk_widget_set_sensitive (p->preview, TRUE);
|
||||
gsg_set_sensitivity (p->dialog, TRUE);
|
||||
}
|
||||
|
||||
|
@ -822,6 +823,7 @@ scan_start (Preview *p)
|
|||
int fd, y;
|
||||
|
||||
gtk_widget_set_sensitive (p->cancel, TRUE);
|
||||
gtk_widget_set_sensitive (p->preview, FALSE);
|
||||
gsg_set_sensitivity (p->dialog, FALSE);
|
||||
|
||||
/* clear old preview: */
|
||||
|
@ -1124,7 +1126,7 @@ Preview *
|
|||
preview_new (GSGDialog *dialog)
|
||||
{
|
||||
static int first_time = 1;
|
||||
GtkWidget *table, *frame, *button;
|
||||
GtkWidget *table, *frame;
|
||||
GtkSignalFunc signal_func;
|
||||
GtkWidgetClass *class;
|
||||
GtkBox *vbox, *hbox;
|
||||
|
@ -1224,12 +1226,12 @@ preview_new (GSGDialog *dialog)
|
|||
|
||||
/* fill in action area: */
|
||||
|
||||
/* Start button */
|
||||
button = gtk_button_new_with_label ("Acquire Preview");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
/* Preview button */
|
||||
p->preview = gtk_button_new_with_label ("Acquire Preview");
|
||||
gtk_signal_connect (GTK_OBJECT (p->preview), "clicked",
|
||||
(GtkSignalFunc) start_button_clicked, p);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (button);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), p->preview, TRUE, TRUE, 0);
|
||||
gtk_widget_show (p->preview);
|
||||
|
||||
/* Cancel button */
|
||||
p->cancel = gtk_button_new_with_label ("Cancel Preview");
|
||||
|
|
|
@ -68,6 +68,7 @@ typedef struct
|
|||
GtkWidget *viewport;
|
||||
GtkWidget *window; /* the preview window */
|
||||
GtkWidget *cancel; /* the cancel button */
|
||||
GtkWidget *preview; /* the preview button */
|
||||
}
|
||||
Preview;
|
||||
|
||||
|
|
|
@ -111,6 +111,8 @@ static struct
|
|||
GtkWidget *hruler;
|
||||
GtkWidget *vruler;
|
||||
GtkWidget *info_label;
|
||||
GtkWidget *preview_button;
|
||||
GtkWidget *scan_button;
|
||||
Preview *preview;
|
||||
gint32 mode;
|
||||
/* various scanning related state: */
|
||||
|
@ -534,6 +536,8 @@ scan_preview (GtkWidget * widget, gpointer call_data)
|
|||
widget);
|
||||
else
|
||||
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)
|
||||
|
@ -802,6 +806,9 @@ static void
|
|||
scan_done (void)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -861,6 +868,9 @@ scan_start (void)
|
|||
int fd;
|
||||
|
||||
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
|
||||
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;
|
||||
|
||||
/* The Scan button */
|
||||
button = gtk_button_new_with_label ("Scan");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
scan_win.scan_button = gtk_button_new_with_label ("Scan");
|
||||
gtk_signal_connect (GTK_OBJECT (scan_win.scan_button), "clicked",
|
||||
(GtkSignalFunc) scan_dialog,
|
||||
NULL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (button);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), scan_win.scan_button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (scan_win.scan_button);
|
||||
|
||||
/* The Preview button */
|
||||
button = gtk_toggle_button_new_with_label ("Preview Window");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
scan_win.preview_button = gtk_toggle_button_new_with_label ("Preview Window");
|
||||
gtk_signal_connect (GTK_OBJECT (scan_win.preview_button), "clicked",
|
||||
(GtkSignalFunc) scan_preview, NULL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (button);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), scan_win.preview_button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (scan_win.preview_button);
|
||||
|
||||
#if 0
|
||||
/* The Zoom in button */
|
||||
|
|
Ładowanie…
Reference in New Issue