summaryrefslogtreecommitdiff
path: root/src/xsane-back-gtk.c
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:09 +0000
committerMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:09 +0000
commit6fceea28608be0fda32d94f59e1b1550774318a0 (patch)
tree9be4df525ab59533784ce0c8d441d61130b59e76 /src/xsane-back-gtk.c
parent817e6294b42b3e4435f1b99728afc1dca84a6445 (diff)
Imported Upstream version 0.98upstream/0.98
Diffstat (limited to 'src/xsane-back-gtk.c')
-rw-r--r--src/xsane-back-gtk.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/xsane-back-gtk.c b/src/xsane-back-gtk.c
index 0aa382e..c4ddeef 100644
--- a/src/xsane-back-gtk.c
+++ b/src/xsane-back-gtk.c
@@ -183,7 +183,10 @@ SANE_Status xsane_control_option(SANE_Handle handle, SANE_Int option, SANE_Actio
if ((opt) && (!(opt->cap & SANE_CAP_SOFT_DETECT)))
{
DBG(DBG_warning, "WARNING: xsane_control_option(option = %d, action = %d): SANE_CAP_SOFT_DETECT is not set\n", option, action);
- return SANE_STATUS_GOOD;
+ if (option > 0) /* continue for option == 0, otherwise we can not read this option */
+ {
+ return SANE_STATUS_GOOD;
+ }
}
}
#endif
@@ -352,6 +355,14 @@ int xsane_back_gtk_make_path(size_t buf_size, char *buf, const char *prog_name,
buf[len++] = '_';
break;
+ case '*': /* "*" -> "_" */
+ buf[len++] = '_';
+ break;
+
+ case '?': /* "?" -> "_" */
+ buf[len++] = '_';
+ break;
+
#ifdef _WIN32
case ':': /* ":" -> "_" */
buf[len++] = '_';
@@ -881,7 +892,7 @@ static void xsane_back_gtk_filetype_callback(GtkWidget *widget, gpointer data)
{
if ( (!strcasecmp(extension, ".pnm")) || (!strcasecmp(extension, ".raw"))
|| (!strcasecmp(extension, ".png")) || (!strcasecmp(extension, ".ps"))
- || (!strcasecmp(extension, ".rgba"))
+ || (!strcasecmp(extension, ".pdf")) || (!strcasecmp(extension, ".rgba"))
|| (!strcasecmp(extension, ".tiff")) || (!strcasecmp(extension, ".tif"))
|| (!strcasecmp(extension, ".text")) || (!strcasecmp(extension, ".txt"))
|| (!strcasecmp(extension, ".jpg")) || (!strcasecmp(extension, ".jpeg"))
@@ -951,6 +962,12 @@ void xsane_back_gtk_filetype_menu_set_history(GtkWidget *xsane_filetype_option_m
select_item = filetype_nr;
}
+ filetype_nr++;
+ if ( (filetype) && (!strcasecmp(filetype, XSANE_FILETYPE_PDF)) )
+ {
+ select_item = filetype_nr;
+ }
+
#ifdef SUPPORT_RGBA
filetype_nr++;
if ( (filetype) && (!strcasecmp(filetype, XSANE_FILETYPE_RGBA)) )
@@ -1007,6 +1024,16 @@ GtkWidget *xsane_back_gtk_filetype_menu_new(char *filetype, GtkSignalFunc filety
}
#endif
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_PDF);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ g_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate", filetype_callback, (void *) XSANE_FILETYPE_PDF);
+ gtk_widget_show(xsane_filetype_item);
+ filetype_nr++;
+ if ( (filetype) && (!strcasecmp(filetype, XSANE_FILETYPE_PDF)) )
+ {
+ select_item = filetype_nr;
+ }
+
#ifdef HAVE_LIBPNG
#ifdef HAVE_LIBZ
xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_PNG);