summaryrefslogtreecommitdiff
path: root/src/xsane-batch-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xsane-batch-scan.c')
-rw-r--r--src/xsane-batch-scan.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/xsane-batch-scan.c b/src/xsane-batch-scan.c
index c7ae532..a356612 100644
--- a/src/xsane-batch-scan.c
+++ b/src/xsane-batch-scan.c
@@ -447,7 +447,7 @@ static void xsane_batch_scan_scan_list(void)
GList *list = GTK_LIST(xsane.batch_scan_list)->children;
Batch_Scan_Parameters *parameters = NULL;
SANE_Int val_start = SANE_TRUE;
- SANE_Int val_loop = SANE_TRUE;
+ SANE_Int val_loop = BATCH_MODE_LOOP;
SANE_Int val_end = SANE_FALSE;
SANE_Word val_next_tl_y = SANE_FIX(0.0);
@@ -463,7 +463,7 @@ static void xsane_batch_scan_scan_list(void)
{
if (!list->next) /* last scan */
{
- val_loop = SANE_FALSE;
+ val_loop = BATCH_MODE_LAST_SCAN;
val_end = SANE_TRUE;
val_next_tl_y = SANE_FIX(0.0);
}
@@ -501,7 +501,7 @@ static void xsane_batch_scan_scan_list(void)
gtk_main_iteration();
}
- xsane_scan_dialog();
+ xsane_scan_dialog(NULL);
while (xsane.scanning)
{
@@ -533,7 +533,7 @@ static void xsane_batch_scan_scan_list(void)
xsane_control_option(xsane.dev, xsane.well_known.batch_scan_end, SANE_ACTION_SET_VALUE, &val_end, NULL);
xsane_control_option(xsane.dev, xsane.well_known.batch_scan_next_tl_y, SANE_ACTION_SET_VALUE, &val_next_tl_y, NULL);
- xsane.batch_loop = FALSE; /* make sure we reset the batch scan loop flag */
+ xsane.batch_loop = BATCH_MODE_OFF; /* make sure we reset the batch scan loop flag */
if (parameters)
{
@@ -561,7 +561,11 @@ static void xsane_batch_scan_scan_selected(void)
xsane_batch_scan_establish_parameters(parameters, TRUE);
}
- xsane_scan_dialog();
+ xsane.batch_loop = BATCH_MODE_LAST_SCAN; /* to make sure we do not scan multiple times */
+
+ xsane_scan_dialog(NULL);
+
+ xsane.batch_loop = BATCH_MODE_OFF; /* make sure we reset the batch scan loop flag */
}
}
@@ -939,6 +943,12 @@ static gint xsane_batch_scan_win_delete(GtkWidget *widget, gpointer data)
{
DBG(DBG_proc, "xsane_batch_scan_win_delete\n");
+ if (preferences.show_batch_scan)
+ {
+ xsane_window_get_position(xsane.batch_scan_dialog, &xsane.batch_dialog_posx, &xsane.batch_dialog_posy);
+ gtk_window_move(GTK_WINDOW(xsane.batch_scan_dialog), xsane.batch_dialog_posx, xsane.batch_dialog_posy);
+ }
+
gtk_widget_hide(widget);
preferences.show_batch_scan = FALSE;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_batch_scan_widget), preferences.show_batch_scan);