branch feature/7420 updated (d216c2a -> 07be950)
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(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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/FaxToMailConfiguration.java b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java index 6358ed7..f643814 100644 --- a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java +++ b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java @@ -288,14 +288,6 @@ public class FaxToMailConfiguration extends ApplicationConfiguration { return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption.ARCHIVE_IMPORT_COMMIT_TRESHOLD.getKey()); } - public String getInstanceUrl() { - return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_URL.getKey()); - } - - public String getInstanceDisclaimer() { - return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_DISCLAIMER.getKey()); - } - public boolean isLogConfigurationProvided() { boolean logConfigurationProvided = StringUtils.isNotBlank(applicationConfig.getOption(FaxToMailConfigurationOption.LOG_CONFIGURATION_FILE.getKey())); @@ -419,6 +411,15 @@ public class FaxToMailConfiguration extends ApplicationConfiguration { applicationConfig.setOption(FaxToMailConfigurationOption.RESULT_PER_PAGE.getKey(), String.valueOf(resultPerPage)); } + public int getRefreshListInterval() { + return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption.REFRESH_LIST_INTERVAL.getKey()); + } + + public void setRefreshListInterval(int refreshListInterval) { + applicationConfig.setOption(FaxToMailConfigurationOption.REFRESH_LIST_INTERVAL.getKey(), + String.valueOf(refreshListInterval)); + } + @Override public KeyStroke getShortcutClosePopup() { return applicationConfig.getOptionAsKeyStroke(FaxToMailConfigurationOption.SHORTCUT_CLOSE_POPUP.getKey()); diff --git a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java index 97e0081..e2ce9fa 100644 --- a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java +++ b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java @@ -38,16 +38,6 @@ import static org.nuiton.i18n.I18n.n; public enum FaxToMailConfigurationOption implements ConfigOptionDef { - INSTANCE_URL( - "faxtomail.instanceUrl", - "URL à laquelle on peut accéder à l'instance de faxToMail", - "http://localhost:8080/faxtomail", String.class), - - INSTANCE_DISCLAIMER( - "faxtomail.instanceDisclaimer", - "Avertissement à afficher aux utilisateurs si l'instance est instable", - null, String.class), - SMTP_HOST( "faxtomail.smtp.host", "Nom d'hôte du serveur SMTP", @@ -323,6 +313,13 @@ defaults.put("Table.alternateRowColor", new Color(217, 217, 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 ); /** Configuration key. */ diff --git a/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties b/faxtomail-persistence/src/main/resources/i18n/faxtomail-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= faxtomail.config.option.ui.color.selectedRow.description= faxtomail.config.option.ui.config.file.description= faxtomail.config.option.ui.dateFormat.description= +faxtomail.config.option.ui.refreshListInterval.description= faxtomail.config.option.ui.resultPerPage.description= faxtomail.config.option.ui.shortcut.closePopup.description= faxtomail.config.option.ui.showNumberEditorButton.description= diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java index 9fdada7..f3b2f78 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java @@ -28,14 +28,12 @@ import com.franciaflex.faxtomail.persistence.entities.Email; 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.DemandeListUIHandler; 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 AbstractFaxToMailAction<DemandeListU dataTable.scrollRowToVisible(row); } } + + getHandler().resetTimer(); } @Override diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java index f76d091..4bab379 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java @@ -109,6 +109,8 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem protected DemandeListTableFilter tableFilter; + protected Timer refreshListTimer; + protected final Binder<EmailFilter, EmailFilter> binder = BinderFactory.newBinder(EmailFilter.class); protected final PropertyChangeListener actionInProgressListener = new RemoveablePropertyChangeListener() { @@ -162,7 +164,7 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem DemandeListUIModel model = new DemandeListUIModel(); Collection<MailFolder> folders = getContext().newServiceContext().getMailFolderService() .getRootMailFoldersWithReadingRights(getContext().getCurrentUser()); - model.setFolders(new ArrayList<MailFolder>(folders)); + model.setFolders(new ArrayList<>(folders)); this.ui.setContextValue(model); } @@ -216,6 +218,7 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem DemandeListUIModel model = getModel(); if (source.isSelectionEmpty()) { model.setSelectedEmails(null); + } else { List<DemandeUIModel> selectedRows = new ArrayList<DemandeUIModel>(); DemandeTableModel dataTableModel = (DemandeTableModel) dataTable.getModel(); @@ -269,6 +272,8 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem demand.addPropertyChangeListener(selectedDemandeChangeListener); } } + + resetTimer(); } }); @@ -327,21 +332,26 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem // add refresh shortcut JRootPane rootPane = getContext().getMainUI().getRootPane(); rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(REFRESH_KEY), REFRESH_FOLDER_ACTION); - ApplicationUIAction<LoadFolderEmailsAction> refreshAction = getContext().getActionFactory().createUIAction(this, LoadFolderEmailsAction.class); + ApplicationUIAction<LoadFolderEmailsAction> refreshAction = getContext().getActionFactory() + .createUIAction(this, LoadFolderEmailsAction.class); rootPane.getActionMap().put(REFRESH_FOLDER_ACTION, refreshAction); - loadFolderDemands(nodesByFolder); - - Timer t = new Timer(10000, new ActionListener() { + int interval = getConfig().getRefreshListInterval() * 1000; + refreshListTimer = new Timer(interval, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - LoadFolderEmailsAction refreshAction = getContext().getActionFactory().createLogicAction(DemandeListUIHandler.this, LoadFolderEmailsAction.class); + LoadFolderEmailsAction refreshAction = getContext().getActionFactory() + .createLogicAction(DemandeListUIHandler.this, LoadFolderEmailsAction.class); getContext().getActionEngine().runAction(refreshAction); } }); - t.start(); + loadFolderDemands(nodesByFolder); + + } + public void resetTimer() { + refreshListTimer.restart(); } public void updateEmailFilterWithContextEmailFilter() { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm