From kmorin@users.forge.codelutin.com Tue Jun 24 21:49:03 2014
From: kmorin@users.forge.codelutin.com
To: faxtomail-commits@list.forge.codelutin.com
Subject: [Faxtomail-commits] r262 - in trunk/faxtomail-ui-swing/src/main:
	java/com/franciaflex/faxtomail/ui/swing/content/print resources/i18n
Date: Tue, 24 Jun 2014 21:49:02 +0200
Message-ID: <20140624194902.E256018078E@goh.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1947378158075216055=="

--===============1947378158075216055==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Author: kmorin
Date: 2014-06-24 21:49:01 +0200 (Tue, 24 Jun 2014)
New Revision: 262

Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/262

Log:
corrections sur l'impression

Modified:
   trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/=
content/print/AttachmentToPrintChooserUIHandler.java
   trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.=
properties

Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui=
/swing/content/print/AttachmentToPrintChooserUIHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing=
/content/print/AttachmentToPrintChooserUIHandler.java	2014-06-24 19:07:48 UTC=
 (rev 261)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing=
/content/print/AttachmentToPrintChooserUIHandler.java	2014-06-24 19:49:01 UTC=
 (rev 262)
@@ -35,6 +35,7 @@
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.io.Closeables;
+import jaxx.runtime.JAXXUtil;
 import jaxx.runtime.validator.swing.SwingValidator;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
@@ -161,27 +162,30 @@
                 if (StringUtils.isNotBlank(attachmentFile.getFilename())) {
                     FaxToMailUIUtil.print(attachmentFile, true);
                 }
-                attachmentsToPrint.remove(attachmentFile);
+//                attachmentsToPrint.remove(attachmentFile);
             } catch (Exception e) {
                 if (log.isErrorEnabled()) {
                     log.error("Could not print attachement.", e);
                 }
             }
         }
+
         // TODO DCoss=C3=A9 23/06/14 not sure it works=20
         if (!attachmentsToPrint.isEmpty()) {
=20
-            AttachmentFile f =3D attachmentsToPrint.get(0);
-            String filesName =3D f.getFilename() =3D=3D null ? "" : f.getFil=
ename();
-            for (int i =3D 1; i < attachmentsToPrint.size(); i++) {
-                String fileName=3D attachmentsToPrint.get(i).getFilename() =
=3D=3D null ? "" : attachmentsToPrint.get(i).getFilename();
-                filesName +=3D ", " + fileName;
+            StringBuilder fileNames =3D new StringBuilder();
+            for (AttachmentFile attachmentFile : attachmentsToPrint) {
+                String fileName =3D JAXXUtil.getStringValue(attachmentFile.g=
etFilename());
+                fileNames.append("- ").append(fileName).append("\n");
             }
             JOptionPane.showMessageDialog(
                     getTopestUI(),
-                    t("faxtomail.demande.print.error.message.filesName", fil=
esName),
+                    t("faxtomail.demande.print.error.message.filesName", fil=
eNames.toString()),
                     t("faxtomail.demande.print.error.message.title"),
                     JOptionPane.ERROR_MESSAGE);
+
+        } else {
+            closeDialog();
         }
     }
=20

Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing=
_fr_FR.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR=
.properties	2014-06-24 19:07:48 UTC (rev 261)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR=
.properties	2014-06-24 19:49:01 UTC (rev 262)
@@ -121,7 +121,7 @@
 faxtomail.demande.mailFolder.label=3DDossier
 faxtomail.demande.object.label=3DObjet
 faxtomail.demande.print.button.label=3DImprimer
-faxtomail.demande.print.error.message.filesName=3DLes documents suivant n'on=
t pu =C3=AAtre imprim=C3=A9\: %s
+faxtomail.demande.print.error.message.filesName=3DLes documents suivant n'on=
t pas pu =C3=AAtre imprim=C3=A9s \:\n%s
 faxtomail.demande.print.error.message.title=3D=C3=89chec d'impression de la =
demande
 faxtomail.demande.printedBy.label=3DImprim=C3=A9 par
 faxtomail.demande.priority.label=3DPriorit=C3=A9


--===============1947378158075216055==--


