]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/rastertolabel.c
Merge changes from CUPS 1.5svn-r9385.
[thirdparty/cups.git] / filter / rastertolabel.c
index 917c0e38131a0f30d98688f99c38f61cae7f58bf..cc220cf660d9874b0804f61c46582a0b97ca6faf 100644 (file)
@@ -1130,9 +1130,9 @@ main(int  argc,                           /* I - Number of command-line arguments */
     * and return.
     */
 
-    _cupsLangPrintf(stderr,
-                    _("Usage: %s job-id user title copies options [file]\n"),
-                    "rastertolabel");
+    _cupsLangPrintFilter(stderr, "ERROR",
+                         _("%s job-id user title copies options [file]"),
+                        "rastertolabel");
     return (1);
   }
 
@@ -1144,8 +1144,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
   {
     if ((fd = open(argv[6], O_RDONLY)) == -1)
     {
-      _cupsLangPrintf(stderr, _("ERROR: Unable to open raster file - %s\n"),
-                      strerror(errno));
+      _cupsLangPrintError("ERROR", _("Unable to open raster file"));
       sleep(1);
       return (1);
     }
@@ -1186,7 +1185,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
     ppd_status_t       status;         /* PPD error */
     int                        linenum;        /* Line number */
 
-    _cupsLangPrintf(stderr, _("ERROR: The PPD file could not be opened.\n"));
+    _cupsLangPrintFilter(stderr, "ERROR",
+                         _("The PPD file could not be opened."));
 
     status = ppdLastError(&linenum);
 
@@ -1222,6 +1222,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
     Page ++;
 
     fprintf(stderr, "PAGE: %d 1\n", Page);
+    _cupsLangPrintFilter(stderr, "INFO", _("Starting page %d."), Page);
 
    /*
     * Start the page...
@@ -1243,8 +1244,13 @@ main(int  argc,                          /* I - Number of command-line arguments */
        break;
 
       if ((y & 15) == 0)
-        _cupsLangPrintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"),
-                        Page, 100 * y / header.cupsHeight);
+      {
+        _cupsLangPrintFilter(stderr, "INFO",
+                            _("Printing page %d, %d%% complete."),
+                            Page, 100 * y / header.cupsHeight);
+        fprintf(stderr, "ATTR: job-media-progress=%d\n",
+               100 * y / header.cupsHeight);
+      }
 
      /*
       * Read a line of graphics...
@@ -1264,6 +1270,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
     * Eject the page...
     */
 
+    _cupsLangPrintFilter(stderr, "INFO", _("Finished page %d."), Page);
+
     EndPage(ppd, &header);
 
     if (Canceled)
@@ -1291,12 +1299,12 @@ main(int  argc,                         /* I - Number of command-line arguments */
 
   if (Page == 0)
   {
-    _cupsLangPuts(stderr, _("ERROR: No pages were found.\n"));
+    _cupsLangPrintFilter(stderr, "ERROR", _("No pages were found."));
     return (1);
   }
   else
   {
-    _cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
+    _cupsLangPrintFilter(stderr, "INFO", _("Ready to print."));
     return (0);
   }