From scm@users.codelutin.com Wed Aug 26 15:23:14 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: faxtomail-commits@list.forge.codelutin.com
Subject: [Faxtomail-commits] 01/01: raffraichissement automatique fixes #7420
Date: Wed, 26 Aug 2015 15:23:14 +0200
Message-ID: <20150826132314.069A65C4A6F@goh.codelutin.com>
In-Reply-To: <20150826132313.3633.84963@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3049259216505547664=="

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

This is an automated email from the git hooks/post-receive script.

New commit to branch feature/7420 in repository faxtomail.

See http://git.codelutin.com/faxtomail.git

commit 07be950fcf0e637aa6aaefd7f96dfef652919d11
Author: Kevin Morin <morin@codelutin.com>
Date:   Wed Aug 26 15:22:31 2015 +0200

    raffraichissement automatique fixes #7420
---
 .../faxtomail/FaxToMailConfiguration.java          | 17 +++++++--------
 .../faxtomail/FaxToMailConfigurationOption.java    | 17 +++++++--------
 .../i18n/faxtomail-persistence_fr_FR.properties    |  1 +
 .../ui/swing/actions/LoadFolderEmailsAction.java   |  4 ++--
 .../content/demande/DemandeListUIHandler.java      | 24 +++++++++++++++-----=
--
 5 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/Fa=
xToMailConfiguration.java b/faxtomail-persistence/src/main/java/com/franciafl=
ex/faxtomail/FaxToMailConfiguration.java
index 6358ed7..f643814 100644
--- a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMail=
Configuration.java
+++ b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMail=
Configuration.java
@@ -288,14 +288,6 @@ public class FaxToMailConfiguration extends ApplicationC=
onfiguration {
         return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption=
.ARCHIVE_IMPORT_COMMIT_TRESHOLD.getKey());
     }
=20
-    public String getInstanceUrl() {
-        return applicationConfig.getOption(FaxToMailConfigurationOption.INST=
ANCE_URL.getKey());
-    }
-
-    public String getInstanceDisclaimer() {
-        return applicationConfig.getOption(FaxToMailConfigurationOption.INST=
ANCE_DISCLAIMER.getKey());
-    }
-
     public boolean isLogConfigurationProvided() {
         boolean logConfigurationProvided =3D
                 StringUtils.isNotBlank(applicationConfig.getOption(FaxToMail=
ConfigurationOption.LOG_CONFIGURATION_FILE.getKey()));
@@ -419,6 +411,15 @@ public class FaxToMailConfiguration extends ApplicationC=
onfiguration {
         applicationConfig.setOption(FaxToMailConfigurationOption.RESULT_PER_=
PAGE.getKey(), String.valueOf(resultPerPage));
     }
=20
+    public int getRefreshListInterval() {
+        return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption=
.REFRESH_LIST_INTERVAL.getKey());
+    }
+
+    public void setRefreshListInterval(int refreshListInterval) {
+        applicationConfig.setOption(FaxToMailConfigurationOption.REFRESH_LIS=
T_INTERVAL.getKey(),
+                                    String.valueOf(refreshListInterval));
+    }
+
     @Override
     public KeyStroke getShortcutClosePopup() {
         return applicationConfig.getOptionAsKeyStroke(FaxToMailConfiguration=
Option.SHORTCUT_CLOSE_POPUP.getKey());
diff --git a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/Fa=
xToMailConfigurationOption.java b/faxtomail-persistence/src/main/java/com/fra=
nciaflex/faxtomail/FaxToMailConfigurationOption.java
index 97e0081..e2ce9fa 100644
--- a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMail=
ConfigurationOption.java
+++ b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMail=
ConfigurationOption.java
@@ -38,16 +38,6 @@ import static org.nuiton.i18n.I18n.n;
=20
 public enum FaxToMailConfigurationOption implements ConfigOptionDef {
=20
-    INSTANCE_URL(
-            "faxtomail.instanceUrl",
-            "URL =C3=A0 laquelle on peut acc=C3=A9der =C3=A0 l'instance de f=
axToMail",
-            "http://localhost:8080/faxtomail", String.class),
-
-    INSTANCE_DISCLAIMER(
-            "faxtomail.instanceDisclaimer",
-            "Avertissement =C3=A0 afficher aux utilisateurs si l'instance es=
t instable",
-            null, String.class),
-
     SMTP_HOST(
             "faxtomail.smtp.host",
             "Nom d'h=C3=B4te du serveur SMTP",
@@ -323,6 +313,13 @@ defaults.put("Table.alternateRowColor", new Color(217, 2=
17, 217));
             n("faxtomail.config.option.ui.resultPerPage.description"),
             "50",
             Integer.class
+    ),
+
+    REFRESH_LIST_INTERVAL(
+            "faxtomail.ui.refreshListInterval",
+            n("faxtomail.config.option.ui.refreshListInterval.description"),
+            "300",
+            Integer.class
     );
=20
     /** Configuration key. */
diff --git a/faxtomail-persistence/src/main/resources/i18n/faxtomail-persiste=
nce_fr_FR.properties b/faxtomail-persistence/src/main/resources/i18n/faxtomai=
l-persistence_fr_FR.properties
index f226c51..e72d288 100644
--- a/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_=
FR.properties
+++ b/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_=
FR.properties
@@ -17,6 +17,7 @@ faxtomail.config.option.ui.color.blockingLayer.description=
=3D
 faxtomail.config.option.ui.color.selectedRow.description=3D
 faxtomail.config.option.ui.config.file.description=3D
 faxtomail.config.option.ui.dateFormat.description=3D
+faxtomail.config.option.ui.refreshListInterval.description=3D
 faxtomail.config.option.ui.resultPerPage.description=3D
 faxtomail.config.option.ui.shortcut.closePopup.description=3D
 faxtomail.config.option.ui.showNumberEditorButton.description=3D
diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/sw=
ing/actions/LoadFolderEmailsAction.java b/faxtomail-ui-swing/src/main/java/co=
m/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java
index 9fdada7..f3b2f78 100644
--- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/act=
ions/LoadFolderEmailsAction.java
+++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/act=
ions/LoadFolderEmailsAction.java
@@ -28,14 +28,12 @@ import com.franciaflex.faxtomail.persistence.entities.Ema=
il;
 import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
 import com.franciaflex.faxtomail.persistence.entities.MailField;
 import com.franciaflex.faxtomail.persistence.entities.MailFolder;
-import com.franciaflex.faxtomail.persistence.entities.RangeRow;
 import com.franciaflex.faxtomail.persistence.entities.WaitingState;
 import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
 import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI;
 import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandl=
er;
 import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIModel;
 import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel;
 import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
@@ -178,6 +176,8 @@ public class LoadFolderEmailsAction extends AbstractFaxTo=
MailAction<DemandeListU
                 dataTable.scrollRowToVisible(row);
             }
         }
+
+        getHandler().resetTimer();
     }
=20
     @Override
diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/sw=
ing/content/demande/DemandeListUIHandler.java b/faxtomail-ui-swing/src/main/j=
ava/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.j=
ava
index f76d091..4bab379 100644
--- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/con=
tent/demande/DemandeListUIHandler.java
+++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/con=
tent/demande/DemandeListUIHandler.java
@@ -109,6 +109,8 @@ public class DemandeListUIHandler extends AbstractFaxToMa=
ilDemandListHandler<Dem
=20
     protected DemandeListTableFilter tableFilter;
=20
+    protected Timer refreshListTimer;
+
     protected final Binder<EmailFilter, EmailFilter> binder =3D BinderFactor=
y.newBinder(EmailFilter.class);
=20
     protected final PropertyChangeListener actionInProgressListener =3D new =
RemoveablePropertyChangeListener() {
@@ -162,7 +164,7 @@ public class DemandeListUIHandler extends AbstractFaxToMa=
ilDemandListHandler<Dem
         DemandeListUIModel model =3D new DemandeListUIModel();
         Collection<MailFolder> folders =3D getContext().newServiceContext().=
getMailFolderService()
                                                 .getRootMailFoldersWithReadi=
ngRights(getContext().getCurrentUser());
-        model.setFolders(new ArrayList<MailFolder>(folders));
+        model.setFolders(new ArrayList<>(folders));
=20
         this.ui.setContextValue(model);
     }
@@ -216,6 +218,7 @@ public class DemandeListUIHandler extends AbstractFaxToMa=
ilDemandListHandler<Dem
                 DemandeListUIModel model =3D getModel();
                 if (source.isSelectionEmpty()) {
                     model.setSelectedEmails(null);
+
                 } else {
                     List<DemandeUIModel> selectedRows =3D new ArrayList<Dema=
ndeUIModel>();
                     DemandeTableModel dataTableModel =3D (DemandeTableModel)=
 dataTable.getModel();
@@ -269,6 +272,8 @@ public class DemandeListUIHandler extends AbstractFaxToMa=
ilDemandListHandler<Dem
                         demand.addPropertyChangeListener(selectedDemandeChan=
geListener);
                     }
                 }
+
+                resetTimer();
             }
         });
=20
@@ -327,21 +332,26 @@ public class DemandeListUIHandler extends AbstractFaxTo=
MailDemandListHandler<Dem
         // add refresh shortcut
         JRootPane rootPane =3D getContext().getMainUI().getRootPane();
         rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStrok=
e.getKeyStroke(REFRESH_KEY), REFRESH_FOLDER_ACTION);
-        ApplicationUIAction<LoadFolderEmailsAction> refreshAction =3D getCon=
text().getActionFactory().createUIAction(this, LoadFolderEmailsAction.class);
+        ApplicationUIAction<LoadFolderEmailsAction> refreshAction =3D getCon=
text().getActionFactory()
+                .createUIAction(this, LoadFolderEmailsAction.class);
         rootPane.getActionMap().put(REFRESH_FOLDER_ACTION, refreshAction);
=20
-        loadFolderDemands(nodesByFolder);
-
-        Timer t =3D new Timer(10000, new ActionListener() {
+        int interval =3D getConfig().getRefreshListInterval() * 1000;
+        refreshListTimer =3D new Timer(interval, new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
-                LoadFolderEmailsAction refreshAction =3D getContext().getAct=
ionFactory().createLogicAction(DemandeListUIHandler.this, LoadFolderEmailsAct=
ion.class);
+                LoadFolderEmailsAction refreshAction =3D getContext().getAct=
ionFactory()
+                        .createLogicAction(DemandeListUIHandler.this, LoadFo=
lderEmailsAction.class);
                 getContext().getActionEngine().runAction(refreshAction);
             }
         });
=20
-        t.start();
+        loadFolderDemands(nodesByFolder);
+
+    }
=20
+    public void resetTimer() {
+        refreshListTimer.restart();
     }
=20
     public void updateEmailFilterWithContextEmailFilter() {

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============3049259216505547664==--


From scm@users.codelutin.com Wed Aug 26 15:23:14 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: faxtomail-commits@list.forge.codelutin.com
Subject: [Faxtomail-commits] branch feature/7420 updated (d216c2a -> 07be950)
Date: Wed, 26 Aug 2015 15:23:13 +0200
Message-ID: <20150826132313.3633.84963@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0686695588892411395=="

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

This is an automated email from the git hooks/post-receive script.

New change to branch feature/7420 in repository faxtomail.

See http://git.codelutin.com/faxtomail.git

      from  d216c2a   test de timer
       new  07be950   raffraichissement automatique fixes #7420

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Detailed log of new commits:

commit 07be950fcf0e637aa6aaefd7f96dfef652919d11
Author: Kevin Morin <morin@codelutin.com>
Date:   Wed Aug 26 15:22:31 2015 +0200

    raffraichissement automatique fixes #7420

Summary of changes:
 .../faxtomail/FaxToMailConfiguration.java          | 17 +++++++--------
 .../faxtomail/FaxToMailConfigurationOption.java    | 17 +++++++--------
 .../i18n/faxtomail-persistence_fr_FR.properties    |  1 +
 .../ui/swing/actions/LoadFolderEmailsAction.java   |  4 ++--
 .../content/demande/DemandeListUIHandler.java      | 24 +++++++++++++++-----=
--
 5 files changed, 36 insertions(+), 27 deletions(-)

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============0686695588892411395==--


