syncany-team team mailing list archive
-
syncany-team team
-
Mailing list archive
-
Message #00182
Re: lp:~isak-karlsson/syncany/syncany-remote-watch-interval into lp:syncany
Hi Isak,
Just so you know; I reviewed the code and it looks good. However, I
did not yet merge it into the trunk, but I already merged it in my
local version. It'll be in the branch with the new sync algorithm (not
yet published).
Cheers,
Philipp
On Thu, Jun 16, 2011 at 8:12 PM, isakkarlsson <isak.karlsson@xxxxxxxxx> wrote:
> I've fixed it now.
>
> On 06/16/2011 07:31 PM, Philipp C. Heckel wrote:
>> While you're at it: I noticed that due to your chanes in the GUI, the
>> internationalization stuff (resourceBundle...) has been kicked out. It
>> was in the Netbeans-do-not-change block, so the editor must have
>> overwritten it.
>>
>> Could you by any chance try to make it work again? Maybe just
>> overwrite the values in the constructor of the frame:
>> lblXYZ.setText(resourceBundle...)
>>
>> On Thu, Jun 16, 2011 at 7:16 PM, isakkarlsson<isak.karlsson@xxxxxxxxx> wrote:
>>> I'll fix the native.py script first..
>>>
>>> On 06/16/2011 05:13 PM, Philipp C. Heckel wrote:
>>>> I'll review this tonight and then merge it :-D
>>>>
>>>> On Thu, Jun 16, 2011 at 4:58 PM, isakkarlsson<isak.karlsson@xxxxxxxxx> wrote:
>>>>> isakkarlsson has proposed merging lp:~isak-karlsson/syncany/syncany-remote-watch-interval into lp:syncany.
>>>>>
>>>>> Requested reviews:
>>>>> Syncany Team (syncany-team)
>>>>>
>>>>> For more details, see:
>>>>> https://code.launchpad.net/~isak-karlsson/syncany/syncany-remote-watch-interval/+merge/64850
>>>>>
>>>>> Added the ability to change the remote checking inverval.
>>>>> --
>>>>> https://code.launchpad.net/~isak-karlsson/syncany/syncany-remote-watch-interval/+merge/64850
>>>>> Your team Syncany Team is requested to review the proposed merge of lp:~isak-karlsson/syncany/syncany-remote-watch-interval into lp:syncany.
>>>>>
>>>>> === modified file 'syncany/bin/native.py'
>>>>> --- syncany/bin/native.py 2011-06-11 12:47:02 +0000
>>>>> +++ syncany/bin/native.py 2011-06-16 14:58:24 +0000
>>>>> @@ -1,4 +1,4 @@
>>>>> -#!/usr/bin/python
>>>>> +#!/usr/bin/python2
>>>>> #
>>>>> # Syncany Linux Native Functions
>>>>> # Copyright (C) 2011 Philipp C. Heckel<philipp.heckel@xxxxxxxxx>
>>>>>
>>>>> === modified file 'syncany/src/org/syncany/config/Profile.java'
>>>>> --- syncany/src/org/syncany/config/Profile.java 2011-05-23 16:50:04 +0000
>>>>> +++ syncany/src/org/syncany/config/Profile.java 2011-06-16 14:58:24 +0000
>>>>> @@ -149,6 +149,8 @@
>>>>> // Repo
>>>>> repository = new Repository();
>>>>> repository.load(node.findChildByName("repository"));
>>>>> +
>>>>> + remoteWatcher.load(node.findChildByName("watcher"));
>>>>>
>>>>> // Folders
>>>>> folders = new Folders(this);
>>>>> @@ -175,5 +177,8 @@
>>>>>
>>>>> // Folders
>>>>> folders.save(node.findOrCreateChildByXpath("folders", "folders"));
>>>>> +
>>>>> + // Watcher
>>>>> + remoteWatcher.save(node.findOrCreateChildByXpath("watcher", "watcher"));
>>>>> }
>>>>> }
>>>>>
>>>>> === modified file 'syncany/src/org/syncany/gui/settings/ProfilePanel.form'
>>>>> --- syncany/src/org/syncany/gui/settings/ProfilePanel.form 2011-05-23 16:50:04 +0000
>>>>> +++ syncany/src/org/syncany/gui/settings/ProfilePanel.form 2011-06-16 14:58:24 +0000
>>>>> @@ -28,8 +28,8 @@
>>>>> <Component id="cbActive" alignment="0" min="-2" max="-2" attributes="0"/>
>>>>> <Group type="102" alignment="0" attributes="0">
>>>>> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
>>>>> -<EmptySpace max="-2" attributes="0"/>
>>>>> -<Component id="txtProfileName" pref="344" max="32767" attributes="0"/>
>>>>> +<EmptySpace min="-2" pref="62" max="-2" attributes="0"/>
>>>>> +<Component id="txtProfileName" pref="294" max="32767" attributes="0"/>
>>>>> </Group>
>>>>> </Group>
>>>>> <EmptySpace max="-2" attributes="0"/>
>>>>>
>>>>> === modified file 'syncany/src/org/syncany/gui/settings/ProfilePanel.java'
>>>>> --- syncany/src/org/syncany/gui/settings/ProfilePanel.java 2011-06-05 21:26:56 +0000
>>>>> +++ syncany/src/org/syncany/gui/settings/ProfilePanel.java 2011-06-16 14:58:24 +0000
>>>>> @@ -69,65 +69,65 @@
>>>>> * always regenerated by the Form Editor.
>>>>> */
>>>>> @SuppressWarnings("unchecked")
>>>>> - //<editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
>>>>> - private void initComponents() {
>>>>> -
>>>>> - jLabel1 = new javax.swing.JLabel();
>>>>> - txtProfileName = new javax.swing.JTextField();
>>>>> - cbActive = new javax.swing.JCheckBox();
>>>>> - jLabel2 = new javax.swing.JLabel();
>>>>> -
>>>>> - setBorder(null);
>>>>> -
>>>>> - jLabel1.setLabelFor(txtProfileName);
>>>>> - jLabel1.setText(resourceBundle.getString("profp_name"));
>>>>> - jLabel1.setName("jLabel1"); // NOI18N
>>>>> -
>>>>> - txtProfileName.setName("txtProfileName"); // NOI18N
>>>>> -
>>>>> - cbActive.setText(resourceBundle.getString("profp_activate"));
>>>>> - cbActive.setName("cbActive"); // NOI18N
>>>>> -
>>>>> - jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() | java.awt.Font.BOLD));
>>>>> - jLabel2.setText(resourceBundle.getString("profp_settings"));
>>>>> - jLabel2.setName("jLabel2"); // NOI18N
>>>>> -
>>>>> - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
>>>>> - this.setLayout(layout);
>>>>> - layout.setHorizontalGroup(
>>>>> - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addContainerGap()
>>>>> - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addComponent(jLabel2)
>>>>> - .addComponent(cbActive)
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addComponent(jLabel1)
>>>>> - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
>>>>> - .addComponent(txtProfileName, javax.swing.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)))
>>>>> - .addContainerGap())
>>>>> - );
>>>>> - layout.setVerticalGroup(
>>>>> - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addGap(10, 10, 10)
>>>>> - .addComponent(jLabel2)
>>>>> - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> - .addComponent(cbActive)
>>>>> - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
>>>>> - .addComponent(txtProfileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> - .addComponent(jLabel1))
>>>>> - .addContainerGap(213, Short.MAX_VALUE))
>>>>> - );
>>>>> - }//</editor-fold>//GEN-END:initComponents
>>>>> -
>>>>> -
>>>>> - // Variables declaration - do not modify//GEN-BEGIN:variables
>>>>> - private javax.swing.JCheckBox cbActive;
>>>>> - private javax.swing.JLabel jLabel1;
>>>>> - private javax.swing.JLabel jLabel2;
>>>>> - private javax.swing.JTextField txtProfileName;
>>>>> - // End of variables declaration//GEN-END:variables
>>>>> + //<editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
>>>>> + private void initComponents() {
>>>>> +
>>>>> + jLabel1 = new javax.swing.JLabel();
>>>>> + txtProfileName = new javax.swing.JTextField();
>>>>> + cbActive = new javax.swing.JCheckBox();
>>>>> + jLabel2 = new javax.swing.JLabel();
>>>>> +
>>>>> + setBorder(null);
>>>>> +
>>>>> + jLabel1.setLabelFor(txtProfileName);
>>>>> + jLabel1.setText("Profile Name:");
>>>>> + jLabel1.setName("jLabel1"); // NOI18N
>>>>> +
>>>>> + txtProfileName.setName("txtProfileName"); // NOI18N
>>>>> +
>>>>> + cbActive.setText("Activate Profile");
>>>>> + cbActive.setName("cbActive"); // NOI18N
>>>>> +
>>>>> + jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() | java.awt.Font.BOLD));
>>>>> + jLabel2.setText("Profile Settings");
>>>>> + jLabel2.setName("jLabel2"); // NOI18N
>>>>> +
>>>>> + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
>>>>> + this.setLayout(layout);
>>>>> + layout.setHorizontalGroup(
>>>>> + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addContainerGap()
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addComponent(jLabel2)
>>>>> + .addComponent(cbActive)
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addComponent(jLabel1)
>>>>> + .addGap(62, 62, 62)
>>>>> + .addComponent(txtProfileName, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)))
>>>>> + .addContainerGap())
>>>>> + );
>>>>> + layout.setVerticalGroup(
>>>>> + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addGap(10, 10, 10)
>>>>> + .addComponent(jLabel2)
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> + .addComponent(cbActive)
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
>>>>> + .addComponent(txtProfileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> + .addComponent(jLabel1))
>>>>> + .addContainerGap(213, Short.MAX_VALUE))
>>>>> + );
>>>>> + }//</editor-fold>//GEN-END:initComponents
>>>>> +
>>>>> +
>>>>> + // Variables declaration - do not modify//GEN-BEGIN:variables
>>>>> + private javax.swing.JCheckBox cbActive;
>>>>> + private javax.swing.JLabel jLabel1;
>>>>> + private javax.swing.JLabel jLabel2;
>>>>> + private javax.swing.JTextField txtProfileName;
>>>>> + // End of variables declaration//GEN-END:variables
>>>>>
>>>>> }
>>>>>
>>>>> === modified file 'syncany/src/org/syncany/gui/settings/RepositoryPanel.form'
>>>>> --- syncany/src/org/syncany/gui/settings/RepositoryPanel.form 2011-05-23 16:50:04 +0000
>>>>> +++ syncany/src/org/syncany/gui/settings/RepositoryPanel.form 2011-06-16 14:58:24 +0000
>>>>> @@ -23,22 +23,29 @@
>>>>> <EmptySpace pref="2" max="-2" attributes="0"/>
>>>>> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
>>>>> </Group>
>>>>> +<Component id="scrConnection" alignment="0" min="-2" pref="499" max="-2" attributes="0"/>
>>>>> +<Component id="lblConnection" alignment="0" min="-2" max="-2" attributes="0"/>
>>>>> +<Group type="102" alignment="0" attributes="0">
>>>>> +<Group type="103" groupAlignment="0" attributes="0">
>>>>> +<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
>>>>> +<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
>>>>> +</Group>
>>>>> +<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
>>>>> +<Group type="103" groupAlignment="0" max="-2" attributes="0">
>>>>> +<Component id="jspRemoteInterval" max="32767" attributes="1"/>
>>>>> +<Component id="lblEncryption" alignment="0" max="32767" attributes="1"/>
>>>>> +</Group>
>>>>> +<EmptySpace max="-2" attributes="0"/>
>>>>> +<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
>>>>> +</Group>
>>>>> <Group type="102" alignment="0" attributes="0">
>>>>> <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
>>>>> -<EmptySpace min="12" pref="12" max="12" attributes="0"/>
>>>>> -<Component id="lblStorageType" min="-2" max="-2" attributes="0"/>
>>>>> -</Group>
>>>>> -<Group type="102" alignment="0" attributes="0">
>>>>> -<EmptySpace min="-2" pref="120" max="-2" attributes="0"/>
>>>>> -<Component id="lblStorageDescription" min="-2" max="-2" attributes="0"/>
>>>>> -</Group>
>>>>> -<Group type="102" alignment="0" attributes="0">
>>>>> -<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
>>>>> -<EmptySpace min="50" pref="50" max="50" attributes="0"/>
>>>>> -<Component id="lblEncryption" min="-2" max="-2" attributes="0"/>
>>>>> -</Group>
>>>>> -<Component id="lblConnection" alignment="0" min="-2" max="-2" attributes="0"/>
>>>>> -<Component id="scrConnection" alignment="0" min="-2" pref="499" max="-2" attributes="0"/>
>>>>> +<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
>>>>> +<Group type="103" groupAlignment="0" attributes="0">
>>>>> +<Component id="lblStorageType" min="-2" max="-2" attributes="0"/>
>>>>> +<Component id="lblStorageDescription" alignment="0" min="-2" max="-2" attributes="0"/>
>>>>> +</Group>
>>>>> +</Group>
>>>>> </Group>
>>>>> <EmptySpace max="32767" attributes="0"/>
>>>>> </Group>
>>>>> @@ -50,20 +57,26 @@
>>>>> <EmptySpace max="-2" attributes="0"/>
>>>>> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
>>>>> <EmptySpace type="unrelated" max="-2" attributes="0"/>
>>>>> -<Group type="103" groupAlignment="0" attributes="0">
>>>>> -<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
>>>>> -<Component id="lblStorageType" min="-2" max="-2" attributes="0"/>
>>>>> +<Group type="103" groupAlignment="3" attributes="0">
>>>>> +<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
>>>>> +<Component id="lblStorageType" alignment="3" min="-2" max="-2" attributes="0"/>
>>>>> </Group>
>>>>> -<EmptySpace min="5" pref="5" max="5" attributes="0"/>
>>>>> +<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
>>>>> <Component id="lblStorageDescription" min="-2" max="-2" attributes="0"/>
>>>>> -<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
>>>>> +<EmptySpace type="separate" max="-2" attributes="0"/>
>>>>> <Group type="103" groupAlignment="0" attributes="0">
>>>>> <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
>>>>> <Component id="lblEncryption" min="-2" max="-2" attributes="0"/>
>>>>> </Group>
>>>>> -<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
>>>>> +<EmptySpace type="unrelated" max="-2" attributes="0"/>
>>>>> +<Group type="103" groupAlignment="3" attributes="0">
>>>>> +<Component id="jspRemoteInterval" alignment="3" min="-2" max="-2" attributes="0"/>
>>>>> +<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
>>>>> +<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
>>>>> +</Group>
>>>>> +<EmptySpace pref="28" max="32767" attributes="0"/>
>>>>> <Component id="lblConnection" min="-2" max="-2" attributes="0"/>
>>>>> -<EmptySpace pref="12" max="32767" attributes="0"/>
>>>>> +<EmptySpace type="unrelated" max="-2" attributes="0"/>
>>>>> <Component id="scrConnection" min="-2" pref="237" max="-2" attributes="0"/>
>>>>> <EmptySpace max="-2" attributes="0"/>
>>>>> </Group>
>>>>> @@ -140,5 +153,22 @@
>>>>> <Property name="name" type="java.lang.String" value="lblStorageDescription" noResource="true"/>
>>>>> </Properties>
>>>>> </Component>
>>>>> +<Component class="javax.swing.JSpinner" name="jspRemoteInterval">
>>>>> +<Properties>
>>>>> +<Property name="name" type="java.lang.String" value="jspRemoteInterval" noResource="true"/>
>>>>> +</Properties>
>>>>> +</Component>
>>>>> +<Component class="javax.swing.JLabel" name="jLabel2">
>>>>> +<Properties>
>>>>> +<Property name="text" type="java.lang.String" value="Watch Interval"/>
>>>>> +<Property name="name" type="java.lang.String" value="lblWatchInterval" noResource="true"/>
>>>>> +</Properties>
>>>>> +</Component>
>>>>> +<Component class="javax.swing.JLabel" name="jLabel5">
>>>>> +<Properties>
>>>>> +<Property name="text" type="java.lang.String" value="ms"/>
>>>>> +<Property name="name" type="java.lang.String" value="lblMiliSeconds" noResource="true"/>
>>>>> +</Properties>
>>>>> +</Component>
>>>>> </SubComponents>
>>>>> </Form>
>>>>>
>>>>> === modified file 'syncany/src/org/syncany/gui/settings/RepositoryPanel.java'
>>>>> --- syncany/src/org/syncany/gui/settings/RepositoryPanel.java 2011-06-05 21:26:56 +0000
>>>>> +++ syncany/src/org/syncany/gui/settings/RepositoryPanel.java 2011-06-16 14:58:24 +0000
>>>>> @@ -21,7 +21,6 @@
>>>>> *
>>>>> * Created on Mar 27, 2011, 12:51:42 AM
>>>>> */
>>>>> -
>>>>> package org.syncany.gui.settings;
>>>>>
>>>>> import java.util.ResourceBundle;
>>>>> @@ -37,146 +36,169 @@
>>>>> * @author Philipp C. Heckel<philipp.heckel@xxxxxxxxx>
>>>>> */
>>>>> public class RepositoryPanel extends SettingsPanel {
>>>>> +
>>>>> private Profile profile;
>>>>> private ConfigPanel pnlConnection;
>>>>> private ResourceBundle resourceBundle;
>>>>>
>>>>> /** Creates new form ProxyPanel */
>>>>> public RepositoryPanel(Profile profile) {
>>>>> - resourceBundle = Config.getInstance().getResourceBundle();
>>>>> - initComponents();
>>>>> + resourceBundle = Config.getInstance().getResourceBundle();
>>>>> + initComponents();
>>>>>
>>>>> this.profile = profile;
>>>>> this.pnlConnection = profile.getRepository().getConnection().createConfigPanel();
>>>>>
>>>>> scrConnection.setViewportView(pnlConnection);
>>>>> - //scrConnection.getViewport().setViewPosition(new Point(0, 0));
>>>>> -
>>>>> + //scrConnection.getViewport().setViewPosition(new Point(0, 0));
>>>>> +
>>>>> }
>>>>> -
>>>>> +
>>>>> @Override
>>>>> - public void load() {
>>>>> - Repository repo = profile.getRepository();
>>>>> - Connection connection = repo.getConnection();
>>>>> -
>>>>> - lblStorageType.setText(connection.getPluginInfo().getName() + ", " + resourceBundle.getString("reposp_version") + " " + repo.getConnection().getPluginInfo().getVersionStr());
>>>>> - lblStorageDescription.setText(connection.getPluginInfo().getDescripton());
>>>>> - lblEncryption.setText(repo.getEncryption().getCipherStr() + ", " + repo.getEncryption().getKeylength() + " bit");
>>>>> -
>>>>> - lblConnection.setText(connection.getPluginInfo().getName()+ resourceBundle.getString("reposp_connection_details"));
>>>>> + public void load() {
>>>>> + Repository repo = profile.getRepository();
>>>>> + Connection connection = repo.getConnection();
>>>>> +
>>>>> + lblStorageType.setText(connection.getPluginInfo().getName() + ", " + resourceBundle.getString("reposp_version") + " " + repo.getConnection().getPluginInfo().getVersionStr());
>>>>> + lblStorageDescription.setText(connection.getPluginInfo().getDescripton());
>>>>> + lblEncryption.setText(repo.getEncryption().getCipherStr() + ", " + repo.getEncryption().getKeylength() + " bit");
>>>>> +
>>>>> + lblConnection.setText(connection.getPluginInfo().getName() + resourceBundle.getString("reposp_connection_details"));
>>>>> pnlConnection.load();
>>>>> + jspRemoteInterval.setValue(profile.getRemoteWatcher().getInterval());
>>>>> }
>>>>>
>>>>> @Override
>>>>> public void save() {
>>>>> // TODO
>>>>> pnlConnection.save();
>>>>> + profile.getRemoteWatcher().setInterval((Integer) jspRemoteInterval.getValue());
>>>>> }
>>>>>
>>>>> -
>>>>> /** This method is called from within the constructor to
>>>>> * initialize the form.
>>>>> * WARNING: Do NOT modify this code. The content of this method is
>>>>> * always regenerated by the Form Editor.
>>>>> */
>>>>> @SuppressWarnings("unchecked")
>>>>> - //<editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
>>>>> - private void initComponents() {
>>>>> -
>>>>> - jLabel1 = new javax.swing.JLabel();
>>>>> - lblConnection = new javax.swing.JLabel();
>>>>> - scrConnection = new javax.swing.JScrollPane();
>>>>> - jLabel3 = new javax.swing.JLabel();
>>>>> - jLabel4 = new javax.swing.JLabel();
>>>>> - lblStorageType = new javax.swing.JLabel();
>>>>> - lblEncryption = new javax.swing.JLabel();
>>>>> - lblStorageDescription = new javax.swing.JLabel();
>>>>> -
>>>>> - jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));
>>>>> - jLabel1.setText(resourceBundle.getString("reposp_remote_storage"));
>>>>> - jLabel1.setName("jLabel1"); // NOI18N
>>>>> -
>>>>> - lblConnection.setFont(lblConnection.getFont().deriveFont(lblConnection.getFont().getStyle() | java.awt.Font.BOLD));
>>>>> - lblConnection.setText(resourceBundle.getString("reposp_connection"));
>>>>> - lblConnection.setName("lblConnection"); // NOI18N
>>>>> -
>>>>> - scrConnection.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
>>>>> - scrConnection.setViewportBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
>>>>> - scrConnection.setName("scrConnection"); // NOI18N
>>>>> -
>>>>> - jLabel3.setText(resourceBundle.getString("reposp_connection_type"));
>>>>> - jLabel3.setName("jLabel3"); // NOI18N
>>>>> -
>>>>> - jLabel4.setText(resourceBundle.getString("reposp_encryption"));
>>>>> - jLabel4.setName("jLabel4"); // NOI18N
>>>>> -
>>>>> - lblStorageType.setText(resourceBundle.getString("reposp_temp_type"));
>>>>> - lblStorageType.setName("lblStorageType"); // NOI18N
>>>>> -
>>>>> - lblEncryption.setText(resourceBundle.getString("reposp_temp_encryption"));
>>>>> - lblEncryption.setName("lblEncryption"); // NOI18N
>>>>> -
>>>>> - lblStorageDescription.setText(resourceBundle.getString("reposp_temp_description"));
>>>>> - lblStorageDescription.setName("lblStorageDescription"); // NOI18N
>>>>> -
>>>>> - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
>>>>> - this.setLayout(layout);
>>>>> - layout.setHorizontalGroup(
>>>>> - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addContainerGap()
>>>>> - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> - .addComponent(jLabel1))
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addComponent(jLabel3)
>>>>> - .addGap(12, 12, 12)
>>>>> - .addComponent(lblStorageType))
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addGap(120, 120, 120)
>>>>> - .addComponent(lblStorageDescription))
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addComponent(jLabel4)
>>>>> - .addGap(50, 50, 50)
>>>>> - .addComponent(lblEncryption))
>>>>> - .addComponent(lblConnection)
>>>>> - .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE))
>>>>> - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
>>>>> - );
>>>>> - layout.setVerticalGroup(
>>>>> - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addGroup(layout.createSequentialGroup()
>>>>> - .addContainerGap()
>>>>> - .addComponent(jLabel1)
>>>>> - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addComponent(jLabel3)
>>>>> - .addComponent(lblStorageType))
>>>>> - .addGap(5, 5, 5)
>>>>> - .addComponent(lblStorageDescription)
>>>>> - .addGap(15, 15, 15)
>>>>> - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> - .addComponent(jLabel4)
>>>>> - .addComponent(lblEncryption))
>>>>> - .addGap(30, 30, 30)
>>>>> - .addComponent(lblConnection)
>>>>> - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
>>>>> - .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> - .addContainerGap())
>>>>> - );
>>>>> - }//</editor-fold>//GEN-END:initComponents
>>>>> -
>>>>> -
>>>>> - // Variables declaration - do not modify//GEN-BEGIN:variables
>>>>> - private javax.swing.JLabel jLabel1;
>>>>> - private javax.swing.JLabel jLabel3;
>>>>> - private javax.swing.JLabel jLabel4;
>>>>> - private javax.swing.JLabel lblConnection;
>>>>> - private javax.swing.JLabel lblEncryption;
>>>>> - private javax.swing.JLabel lblStorageDescription;
>>>>> - private javax.swing.JLabel lblStorageType;
>>>>> - private javax.swing.JScrollPane scrConnection;
>>>>> - // End of variables declaration//GEN-END:variables
>>>>> -
>>>>> + //<editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
>>>>> + private void initComponents() {
>>>>> +
>>>>> + jLabel1 = new javax.swing.JLabel();
>>>>> + lblConnection = new javax.swing.JLabel();
>>>>> + scrConnection = new javax.swing.JScrollPane();
>>>>> + jLabel3 = new javax.swing.JLabel();
>>>>> + jLabel4 = new javax.swing.JLabel();
>>>>> + lblStorageType = new javax.swing.JLabel();
>>>>> + lblEncryption = new javax.swing.JLabel();
>>>>> + lblStorageDescription = new javax.swing.JLabel();
>>>>> + jspRemoteInterval = new javax.swing.JSpinner();
>>>>> + jLabel2 = new javax.swing.JLabel();
>>>>> + jLabel5 = new javax.swing.JLabel();
>>>>> +
>>>>> + jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));
>>>>> + jLabel1.setText("Remote Storage");
>>>>> + jLabel1.setName("jLabel1"); // NOI18N
>>>>> +
>>>>> + lblConnection.setFont(lblConnection.getFont().deriveFont(lblConnection.getFont().getStyle() | java.awt.Font.BOLD));
>>>>> + lblConnection.setText("(xyz) Connection");
>>>>> + lblConnection.setName("lblConnection"); // NOI18N
>>>>> +
>>>>> + scrConnection.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
>>>>> + scrConnection.setViewportBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
>>>>> + scrConnection.setName("scrConnection"); // NOI18N
>>>>> +
>>>>> + jLabel3.setText("Connection Type:");
>>>>> + jLabel3.setName("jLabel3"); // NOI18N
>>>>> +
>>>>> + jLabel4.setText("Encryption:");
>>>>> + jLabel4.setName("jLabel4"); // NOI18N
>>>>> +
>>>>> + lblStorageType.setText("(type)");
>>>>> + lblStorageType.setName("lblStorageType"); // NOI18N
>>>>> +
>>>>> + lblEncryption.setText("(encryption)");
>>>>> + lblEncryption.setName("lblEncryption"); // NOI18N
>>>>> +
>>>>> + lblStorageDescription.setText("(description)");
>>>>> + lblStorageDescription.setName("lblStorageDescription"); // NOI18N
>>>>> +
>>>>> + jspRemoteInterval.setName("jspRemoteInterval"); // NOI18N
>>>>> +
>>>>> + jLabel2.setText("Watch Interval");
>>>>> + jLabel2.setName("lblWatchInterval"); // NOI18N
>>>>> +
>>>>> + jLabel5.setText("ms");
>>>>> + jLabel5.setName("lblMiliSeconds"); // NOI18N
>>>>> +
>>>>> + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
>>>>> + this.setLayout(layout);
>>>>> + layout.setHorizontalGroup(
>>>>> + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addContainerGap()
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> + .addComponent(jLabel1))
>>>>> + .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> + .addComponent(lblConnection)
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addComponent(jLabel4)
>>>>> + .addComponent(jLabel2))
>>>>> + .addGap(50, 50, 50)
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
>>>>> + .addComponent(jspRemoteInterval)
>>>>> + .addComponent(lblEncryption, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
>>>>> + .addComponent(jLabel5))
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addComponent(jLabel3)
>>>>> + .addGap(30, 30, 30)
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addComponent(lblStorageType)
>>>>> + .addComponent(lblStorageDescription))))
>>>>> + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
>>>>> + );
>>>>> + layout.setVerticalGroup(
>>>>> + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addGroup(layout.createSequentialGroup()
>>>>> + .addContainerGap()
>>>>> + .addComponent(jLabel1)
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
>>>>> + .addComponent(jLabel3)
>>>>> + .addComponent(lblStorageType))
>>>>> + .addGap(2, 2, 2)
>>>>> + .addComponent(lblStorageDescription)
>>>>> + .addGap(18, 18, 18)
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
>>>>> + .addComponent(jLabel4)
>>>>> + .addComponent(lblEncryption))
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
>>>>> + .addComponent(jspRemoteInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> + .addComponent(jLabel2)
>>>>> + .addComponent(jLabel5))
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
>>>>> + .addComponent(lblConnection)
>>>>> + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
>>>>> + .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)
>>>>> + .addContainerGap())
>>>>> + );
>>>>> + }//</editor-fold>//GEN-END:initComponents
>>>>> + // Variables declaration - do not modify//GEN-BEGIN:variables
>>>>> + private javax.swing.JLabel jLabel1;
>>>>> + private javax.swing.JLabel jLabel2;
>>>>> + private javax.swing.JLabel jLabel3;
>>>>> + private javax.swing.JLabel jLabel4;
>>>>> + private javax.swing.JLabel jLabel5;
>>>>> + private javax.swing.JSpinner jspRemoteInterval;
>>>>> + private javax.swing.JLabel lblConnection;
>>>>> + private javax.swing.JLabel lblEncryption;
>>>>> + private javax.swing.JLabel lblStorageDescription;
>>>>> + private javax.swing.JLabel lblStorageType;
>>>>> + private javax.swing.JScrollPane scrConnection;
>>>>> + // End of variables declaration//GEN-END:variables
>>>>> }
>>>>>
>>>>> === modified file 'syncany/src/org/syncany/watch/remote/RemoteWatcher.java'
>>>>> --- syncany/src/org/syncany/watch/remote/RemoteWatcher.java 2011-05-23 16:50:04 +0000
>>>>> +++ syncany/src/org/syncany/watch/remote/RemoteWatcher.java 2011-06-16 14:58:24 +0000
>>>>> @@ -19,11 +19,13 @@
>>>>>
>>>>> import java.util.Map.Entry;
>>>>> import org.syncany.config.Config;
>>>>> +import org.syncany.config.ConfigNode;
>>>>> import org.syncany.config.Profile;
>>>>> import org.syncany.connection.plugins.TransferManager;
>>>>> import org.syncany.db.CloneClient;
>>>>> import org.syncany.db.CloneFile;
>>>>> import org.syncany.db.DatabaseHelper;
>>>>> +import org.syncany.exceptions.ConfigException;
>>>>> import org.syncany.exceptions.RemoteFileNotFoundException;
>>>>> import org.syncany.repository.files.RemoteFile;
>>>>> import org.syncany.exceptions.StorageException;
>>>>> @@ -63,42 +65,33 @@
>>>>> *
>>>>> * @author Philipp C. Heckel<philipp.heckel@xxxxxxxxx>
>>>>> */
>>>>> -public class RemoteWatcher {
>>>>> +public class RemoteWatcher implements org.syncany.config.Configurable {
>>>>> +
>>>>> private static final Logger logger = Logger.getLogger(RemoteWatcher.class.getSimpleName());
>>>>> -
>>>>> - private static final int INTERVAL = 10000;
>>>>> + private static final int DEFAULT_INTERVAL = 10000;
>>>>> private static final boolean DEBUG_GZIP_AND_ENCRYPT_UPDATE_FILES = false;
>>>>> -
>>>>> private Config config;
>>>>> - private DatabaseHelper db;
>>>>> -
>>>>> - private Profile profile;
>>>>> -
>>>>> + private DatabaseHelper db;
>>>>> + private int interval = DEFAULT_INTERVAL;
>>>>> + private Profile profile;
>>>>> private ChangeManager changeManager;
>>>>> private Timer timer;
>>>>> -
>>>>> private Map<String, RemoteFile> remoteFileList;
>>>>> private StructuredFileList fileList;
>>>>> private UpdateList updateList;
>>>>> private TransferManager transfer;
>>>>> -
>>>>> // TODO this should be in the DB cached somewhere.
>>>>> private Long lastFileVersionCount;
>>>>> -
>>>>> // TODO this should be in the DB cached somewhere.
>>>>> private Date lastRepoFileUpdate;
>>>>> -
>>>>> // TODO this should be in the DB cached somewhere.
>>>>> private Date lastUpdateFileDate;
>>>>> -
>>>>> // TODO this should be in the DB cached somewhere.
>>>>> private Date lastLocalProfileFileUpdate;
>>>>> -
>>>>> // TODO this should be in the DB cached somewhere.
>>>>> private Date lastLocalImageFileUpdate;
>>>>>
>>>>> -
>>>>> - public RemoteWatcher(Profile profile) {
>>>>> + public RemoteWatcher(Profile profile) {
>>>>> this.profile = profile;
>>>>>
>>>>> this.changeManager = new ChangeManager(profile);
>>>>> @@ -108,27 +101,34 @@
>>>>> // cp. start()
>>>>> this.config = null;
>>>>> this.db = null;
>>>>> -
>>>>> +
>>>>> // cp. doUpdateCheck()
>>>>> this.remoteFileList = null;
>>>>> this.updateList = null;
>>>>> this.transfer = null;
>>>>> }
>>>>>
>>>>> - public synchronized void start() {
>>>>> + public synchronized void setInterval(int interval) {
>>>>> + if (interval>= 1000) {
>>>>> + this.interval = interval;
>>>>> + }
>>>>> + startUpdateCheck();
>>>>> + }
>>>>> +
>>>>> + public int getInterval() {
>>>>> + return this.interval;
>>>>> + }
>>>>> +
>>>>> + public synchronized void start() {
>>>>> // Dependencies
>>>>> if (config == null) {
>>>>> config = Config.getInstance();
>>>>> db = DatabaseHelper.getInstance();
>>>>> }
>>>>> -
>>>>> +
>>>>> // Reset connection
>>>>> reset();
>>>>> -
>>>>> - timer = new Timer("RemoteWatcher");
>>>>> - timer.scheduleAtFixedRate(new TimerTask() {
>>>>> - @Override public void run() { doUpdateCheck(); } }, 0, INTERVAL);
>>>>> -
>>>>> + startUpdateCheck();
>>>>> changeManager.start();
>>>>> }
>>>>>
>>>>> @@ -143,8 +143,27 @@
>>>>> timer = null;
>>>>> }
>>>>>
>>>>> + private void startUpdateCheck() {
>>>>> + logger.log(Level.INFO, "Staring remote watcher...");
>>>>> + if (timer != null) {
>>>>> + try {
>>>>> + timer.cancel();
>>>>> + } catch (IllegalStateException ex) {
>>>>> + logger.log(Level.SEVERE, ex.getMessage());
>>>>> + }
>>>>> + }
>>>>> + timer = new Timer("RemoteWatcher");
>>>>> + timer.scheduleAtFixedRate(new TimerTask() {
>>>>> + @Override
>>>>> + public void run() {
>>>>> + logger.log(Level.INFO, "Do Update Check Interval = " + interval);
>>>>> + doUpdateCheck();
>>>>> + }
>>>>> + }, 0, interval);
>>>>> + }
>>>>> +
>>>>> private void reset() {
>>>>> -
>>>>> +
>>>>> transfer = profile.getRepository().getConnection().createTransferManager();
>>>>> updateList = new UpdateList(profile);
>>>>> }
>>>>> @@ -158,10 +177,10 @@
>>>>>
>>>>> try {
>>>>> updateFileList();
>>>>> -
>>>>> +
>>>>> updateRepository();
>>>>> commitRepository();
>>>>> -
>>>>> +
>>>>> // 1. download update files
>>>>> downloadUpdates();
>>>>>
>>>>> @@ -170,112 +189,108 @@
>>>>>
>>>>> // 4. Create and upload local updates ///////
>>>>> commitLocalUpdateFile();
>>>>> -
>>>>> +
>>>>> // Profiles
>>>>> commitLocalProfile();
>>>>> updateRemoteProfiles();
>>>>>
>>>>> // Images
>>>>> - commitLocalImage();
>>>>> + commitLocalImage();
>>>>> updateRemoteImages();
>>>>>
>>>>> // 5. Delete old updates (only mine!) ///////
>>>>> deleteOldUpdateFiles();
>>>>> deleteOldProfileFiles();
>>>>> deleteOldImageFiles();
>>>>> - }
>>>>> - catch (StorageException ex) {
>>>>> + } catch (StorageException ex) {
>>>>> logger.log(Level.WARNING, "Update check failed. Trying again in a couple of seconds.", ex);
>>>>> - }
>>>>> - finally {
>>>>> + } finally {
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.info("DONE WITH PERIODIC UPDATE CHECK ...");
>>>>> }
>>>>>
>>>>> - try { transfer.disconnect(); }
>>>>> - catch (StorageException ex) { /* Fressen! */ }
>>>>> + try {
>>>>> + transfer.disconnect();
>>>>> + } catch (StorageException ex) { /* Fressen! */ }
>>>>> }
>>>>> -
>>>>> +
>>>>> }
>>>>>
>>>>> private void updateFileList() throws StorageException {
>>>>> remoteFileList = transfer.list();
>>>>> fileList = new StructuredFileList(profile.getRepository(), remoteFileList);
>>>>> }
>>>>> -
>>>>> -
>>>>> +
>>>>> private void updateRepository() throws StorageException {
>>>>> RepositoryFile repoFile = fileList.getNewestRepositoryFile();
>>>>> -
>>>>> +
>>>>> if (repoFile == null) {
>>>>> throw new StorageException("Unable to find repository-* file.");
>>>>> }
>>>>> -
>>>>> +
>>>>> // Are we already up-to-date?
>>>>> if (lastRepoFileUpdate != null&& !repoFile.getLastUpdate().after(lastRepoFileUpdate)) {
>>>>> return;
>>>>> }
>>>>> -
>>>>> +
>>>>> // Do download and read it!
>>>>> - try {
>>>>> + try {
>>>>> profile.getRepository().update(transfer, fileList);
>>>>> lastRepoFileUpdate = repoFile.getLastUpdate();
>>>>> - }
>>>>> - catch (Exception e) {
>>>>> + } catch (Exception e) {
>>>>> throw new StorageException(e);
>>>>> }
>>>>> - }
>>>>> -
>>>>> + }
>>>>> +
>>>>> private void commitRepository() throws StorageException {
>>>>> RepositoryFile repoFile = fileList.getNewestRepositoryFile();
>>>>> -
>>>>> +
>>>>> if (repoFile == null) {
>>>>> throw new StorageException("Unable to find repository-* file.");
>>>>> }
>>>>> -
>>>>> +
>>>>> // Are we already up-to-date?
>>>>> if (!profile.getRepository().isChanged()) {
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.info("repository has not changed locally. No need to upload.");
>>>>> }
>>>>> -
>>>>> +
>>>>> return;
>>>>> }
>>>>> -
>>>>> +
>>>>> // Upload
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.info("Uploading changed repository file ...");
>>>>> }
>>>>> -
>>>>> - try {
>>>>> +
>>>>> + try {
>>>>> profile.getRepository().commit(transfer, fileList, false);
>>>>> - }
>>>>> - catch (Exception e) {
>>>>> + } catch (Exception e) {
>>>>> throw new StorageException(e);
>>>>> }
>>>>> - }
>>>>> + }
>>>>>
>>>>> private void downloadUpdates() throws StorageException {
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.info("2. Downloading update lists ...");
>>>>> }
>>>>> -
>>>>> +
>>>>> // Find newest client update files
>>>>> Collection<UpdateFile> newestUpdateFiles = fileList.getRemoteUpdateFiles().values();
>>>>> -
>>>>> +
>>>>> for (UpdateFile updateFile : newestUpdateFiles) {
>>>>> // Get client from DB (or create it!)
>>>>> - CloneClient client = db.getClient(profile, updateFile.getMachineName(), true);
>>>>> -
>>>>> + CloneClient client = db.getClient(profile, updateFile.getMachineName(), true);
>>>>> +
>>>>> // Ignore if we are up-to-date
>>>>> if (client.getLastUpdate() != null&& !updateFile.getLastUpdate().after(client.getLastUpdate())) {
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.log(Level.INFO, " - Client ''{0}'' is up-to-date", updateFile.getMachineName());
>>>>> }
>>>>> -
>>>>> +
>>>>> continue;
>>>>> }
>>>>> -
>>>>> +
>>>>> try {
>>>>> // Download update file
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> @@ -295,12 +310,11 @@
>>>>>
>>>>> // Add to update manager
>>>>> updateList.addRemoteUpdateFile(client, updateFile);
>>>>> - }
>>>>> - catch (Exception ex) {
>>>>> + } catch (Exception ex) {
>>>>> if (logger.isLoggable(Level.WARNING)) {
>>>>> logger.log(Level.WARNING, "Reading update file of client {0} failed. Skipping update check.", client.getMachineName());
>>>>> }
>>>>> -
>>>>> +
>>>>> throw new StorageException(ex);
>>>>> }
>>>>> }
>>>>> @@ -317,15 +331,15 @@
>>>>>
>>>>> // TODO should the changes be synchronous?
>>>>> // TODO because setting the clients' lastUpdate value assumes that the change mgr doesnt crash
>>>>> -
>>>>> +
>>>>> // Update last-updated date of clients
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.info("3b. Updating client DB entries ...");
>>>>> }
>>>>>
>>>>> for (Map.Entry<CloneClient, UpdateFile> e : updateList.getRemoteUpdateFiles().entrySet()) {
>>>>> - CloneClient client = e.getKey();
>>>>> - UpdateFile updateFile = e.getValue();
>>>>> + CloneClient client = e.getKey();
>>>>> + UpdateFile updateFile = e.getValue();
>>>>>
>>>>> client.setLastUpdate(updateFile.getLastUpdate());
>>>>> client.merge();
>>>>> @@ -350,25 +364,24 @@
>>>>> lastUpdateFileDate = new Date();
>>>>> lastFileVersionCount = fileVersionCount;
>>>>>
>>>>> - File localUpdateFile = null;
>>>>> + File localUpdateFile = null;
>>>>> UpdateFile remoteUpdateFile = new UpdateFile(profile.getRepository(), config.getMachineName(), lastUpdateFileDate);
>>>>>
>>>>> try {
>>>>> // Make temp. update file
>>>>> - localUpdateFile = config.getCache().createTempFile("update-"+config.getMachineName());
>>>>> - logger.info("4. Writing local changes to '"+localUpdateFile+"' ...");
>>>>> + localUpdateFile = config.getCache().createTempFile("update-" + config.getMachineName());
>>>>> + logger.info("4. Writing local changes to '" + localUpdateFile + "' ...");
>>>>>
>>>>> List<CloneFile> updatedFiles = db.getHistory(profile);
>>>>> remoteUpdateFile.setVersions(updatedFiles);
>>>>> remoteUpdateFile.write(localUpdateFile, DEBUG_GZIP_AND_ENCRYPT_UPDATE_FILES);
>>>>>
>>>>> // Upload
>>>>> - logger.info(" - Uploading file to temp. file '"+remoteUpdateFile.getName()+"' ...");
>>>>> + logger.info(" - Uploading file to temp. file '" + remoteUpdateFile.getName() + "' ...");
>>>>> transfer.upload(localUpdateFile, remoteUpdateFile);
>>>>>
>>>>> localUpdateFile.delete();
>>>>> - }
>>>>> - catch (IOException ex) {
>>>>> + } catch (IOException ex) {
>>>>> if (localUpdateFile != null) {
>>>>> localUpdateFile.delete();
>>>>> }
>>>>> @@ -376,18 +389,18 @@
>>>>> logger.log(Level.SEVERE, null, ex);
>>>>> }
>>>>> }
>>>>> -
>>>>> +
>>>>> // Upload new local profile (if changed)
>>>>> - private void commitLocalProfile() throws StorageException {
>>>>> + private void commitLocalProfile() throws StorageException {
>>>>> ProfileFile localNewestProfileFile = fileList.getNewestProfileFile();
>>>>> -
>>>>> +
>>>>> // Skip if no update needed
>>>>> - if (!(localNewestProfileFile == null || lastLocalProfileFileUpdate == null ||
>>>>> - localNewestProfileFile.getLastUpdate().after(lastLocalProfileFileUpdate))) {
>>>>> -
>>>>> + if (!(localNewestProfileFile == null || lastLocalProfileFileUpdate == null
>>>>> + || localNewestProfileFile.getLastUpdate().after(lastLocalProfileFileUpdate))) {
>>>>> +
>>>>> return;
>>>>> }
>>>>> -
>>>>> +
>>>>> Date newDate = new Date();
>>>>> ProfileFile localProfileFile = new ProfileFile(profile.getRepository(), config.getMachineName(), newDate);
>>>>>
>>>>> @@ -408,13 +421,12 @@
>>>>>
>>>>> // Update
>>>>> lastLocalProfileFileUpdate = newDate;
>>>>> - }
>>>>> - catch (IOException e) {
>>>>> + } catch (IOException e) {
>>>>> logger.log(Level.SEVERE, "ERROR while uploading local profile.", e);
>>>>> // TODO do something
>>>>> }
>>>>> }
>>>>> -
>>>>> +
>>>>> private void updateRemoteProfiles() throws RemoteFileNotFoundException, StorageException {
>>>>> /// Download new user profiles
>>>>> Collection<ProfileFile> remoteProfileFiles = fileList.getRemoteProfileFiles().values();
>>>>> @@ -426,7 +438,7 @@
>>>>> if (client.getLastProfileUpdate() != null&& !f.getLastUpdate().after(client.getLastProfileUpdate())) {
>>>>> continue;
>>>>> }
>>>>> -
>>>>> +
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.log(Level.INFO, "Downloading profile of client ''{0}'' ...", client.getMachineName());
>>>>> }
>>>>> @@ -440,68 +452,67 @@
>>>>> client.setLastProfileUpdate(new Date());
>>>>> client.setUserName(f.getUserName());
>>>>> client.merge();
>>>>> - }
>>>>> - catch (IOException e) {
>>>>> + } catch (IOException e) {
>>>>> logger.log(Level.SEVERE, "ERROR while downloading remote profile of " + client.getMachineName() + ".", e);
>>>>> // TODO do something
>>>>> - }
>>>>> + }
>>>>> }
>>>>> }
>>>>> -
>>>>> +
>>>>> private void commitLocalImage() throws RemoteFileNotFoundException, StorageException {
>>>>> // Upload local image (if updated)
>>>>> ImageFile localNewestImageFile = fileList.getNewestImageFile();
>>>>> -
>>>>> +
>>>>> // Skip if no update needed
>>>>> - if (!(localNewestImageFile == null || lastLocalImageFileUpdate == null ||
>>>>> - localNewestImageFile.getLastUpdate().after(lastLocalImageFileUpdate))) {
>>>>> -
>>>>> + if (!(localNewestImageFile == null || lastLocalImageFileUpdate == null
>>>>> + || localNewestImageFile.getLastUpdate().after(lastLocalImageFileUpdate))) {
>>>>> +
>>>>> return;
>>>>> }
>>>>> -
>>>>> +
>>>>> return;
>>>>> /*
>>>>> Date newDate = new Date();
>>>>> ImageFile localImageFile = new ImageFile(profile.getRepository(), config.getMachineName(), newDate);
>>>>>
>>>>> if (lastLocalImageFileUpdate == null || localNewestImageFile == null || localNewestImageFile.getLastUpdate().after(lastLocalImageFileUpdate)) {
>>>>> - // If 'No Image' is selected, OR (!) if the local image file is not there
>>>>> - if (config.getUserImageType() == Config.UserImageType.None
>>>>> - || config.getUserImageFile() == null || !config.getUserImageFile().exists()) {
>>>>> -
>>>>> - if (localNewestImageFile != null) {
>>>>> - transfer.delete(localNewestImageFile);
>>>>> - }
>>>>> -
>>>>> - lastLocalImageFileUpdate = new Date();
>>>>> - } else {
>>>>> - try {
>>>>> - File originalImageFile = null;
>>>>> -
>>>>> - if (config.getUserImageType() == Config.UserImageType.System) {
>>>>> - originalImageFile = config.getCache().createTempFile("image-" + config.getMachineName());
>>>>> - Image image = ImageUtil.getScaledImage(config.getUserImage(), Constants.PROFILE_IMAGE_MAX_WIDTH, Constants.PROFILE_IMAGE_MAX_HEIGHT);
>>>>> - ImageIO.write(ImageUtil.toBufferedImage(image), "png", originalImageFile);
>>>>> - }
>>>>> - else if (config.getUserImageType() == Config.UserImageType.Other) {
>>>>> - originalImageFile = config.getUserImageFile();
>>>>> - }
>>>>> -
>>>>> - // TODO encrypt
>>>>> -
>>>>> - Date newDate = new Date();
>>>>> - transfer.upload(originalImageFile, new ImageFile(profile.getRepository(), config.getMachineName(), newDate));
>>>>> -
>>>>> - // Update cached value
>>>>> - lastLocalImageFileUpdate = newDate;
>>>>> - } catch (IOException e) {
>>>>> - // TODO do something
>>>>> - logger.log(Level.WARNING, "Error while uploading local image.", e);
>>>>> - }
>>>>> - }
>>>>> + // If 'No Image' is selected, OR (!) if the local image file is not there
>>>>> + if (config.getUserImageType() == Config.UserImageType.None
>>>>> + || config.getUserImageFile() == null || !config.getUserImageFile().exists()) {
>>>>> +
>>>>> + if (localNewestImageFile != null) {
>>>>> + transfer.delete(localNewestImageFile);
>>>>> + }
>>>>> +
>>>>> + lastLocalImageFileUpdate = new Date();
>>>>> + } else {
>>>>> + try {
>>>>> + File originalImageFile = null;
>>>>> +
>>>>> + if (config.getUserImageType() == Config.UserImageType.System) {
>>>>> + originalImageFile = config.getCache().createTempFile("image-" + config.getMachineName());
>>>>> + Image image = ImageUtil.getScaledImage(config.getUserImage(), Constants.PROFILE_IMAGE_MAX_WIDTH, Constants.PROFILE_IMAGE_MAX_HEIGHT);
>>>>> + ImageIO.write(ImageUtil.toBufferedImage(image), "png", originalImageFile);
>>>>> + }
>>>>> + else if (config.getUserImageType() == Config.UserImageType.Other) {
>>>>> + originalImageFile = config.getUserImageFile();
>>>>> + }
>>>>> +
>>>>> + // TODO encrypt
>>>>> +
>>>>> + Date newDate = new Date();
>>>>> + transfer.upload(originalImageFile, new ImageFile(profile.getRepository(), config.getMachineName(), newDate));
>>>>> +
>>>>> + // Update cached value
>>>>> + lastLocalImageFileUpdate = newDate;
>>>>> + } catch (IOException e) {
>>>>> + // TODO do something
>>>>> + logger.log(Level.WARNING, "Error while uploading local image.", e);
>>>>> + }
>>>>> + }
>>>>> }*/
>>>>> }
>>>>> -
>>>>> +
>>>>> private void updateRemoteImages() {
>>>>> // Download new user images (if changed)
>>>>> Map<String, ImageFile> remoteImageFiles = fileList.getRemoteImageFiles();
>>>>> @@ -513,11 +524,11 @@
>>>>> if (client.getLastImageUpdate() != null&& !f.getLastUpdate().after(client.getLastImageUpdate())) {
>>>>> continue;
>>>>> }
>>>>> -
>>>>> +
>>>>> if (logger.isLoggable(Level.INFO)) {
>>>>> logger.log(Level.INFO, "Downloading image of client ''{0}'' ...", client.getMachineName());
>>>>> }
>>>>> -
>>>>> +
>>>>> // Download
>>>>> try {
>>>>> File tempRemoteImage = config.getCache().createTempFile(f.getName());
>>>>> @@ -530,8 +541,7 @@
>>>>> // Apply and persist
>>>>> client.setLastImageUpdate(new Date());
>>>>> client.merge();
>>>>> - }
>>>>> - catch (Exception e) {
>>>>> + } catch (Exception e) {
>>>>> if (logger.isLoggable(Level.SEVERE)) {
>>>>> logger.log(Level.SEVERE, "ERROR while downloading remote image of " + client.getMachineName() + ".", e);
>>>>> }
>>>>> @@ -541,47 +551,60 @@
>>>>>
>>>>> private void deleteOldUpdateFiles() {
>>>>> TreeMap<Long, UpdateFile> localUpdatesMap = fileList.getLocalUpdateFiles();
>>>>> -
>>>>> +
>>>>> while (localUpdatesMap.size()> 1) {
>>>>> - Entry<Long, UpdateFile> firstEntry = localUpdatesMap.pollFirstEntry();
>>>>> + Entry<Long, UpdateFile> firstEntry = localUpdatesMap.pollFirstEntry();
>>>>>
>>>>> try {
>>>>> - transfer.delete(firstEntry.getValue());
>>>>> - }
>>>>> - catch (Exception e) {
>>>>> + transfer.delete(firstEntry.getValue());
>>>>> + } catch (Exception e) {
>>>>> logger.log(Level.WARNING, "Could not delete old update file", e);
>>>>> }
>>>>> }
>>>>> }
>>>>> -
>>>>> +
>>>>> private void deleteOldProfileFiles() {
>>>>> TreeMap<Long, ProfileFile> localUpdatesMap = fileList.getLocalProfileFiles();
>>>>> -
>>>>> +
>>>>> while (localUpdatesMap.size()> 1) {
>>>>> - Entry<Long, ProfileFile> firstEntry = localUpdatesMap.pollFirstEntry();
>>>>> + Entry<Long, ProfileFile> firstEntry = localUpdatesMap.pollFirstEntry();
>>>>>
>>>>> try {
>>>>> - transfer.delete(firstEntry.getValue());
>>>>> - }
>>>>> - catch (Exception e) {
>>>>> + transfer.delete(firstEntry.getValue());
>>>>> + } catch (Exception e) {
>>>>> logger.log(Level.WARNING, "Could not delete old profile file", e);
>>>>> }
>>>>> }
>>>>> }
>>>>> -
>>>>> +
>>>>> private void deleteOldImageFiles() {
>>>>> TreeMap<Long, ImageFile> localUpdatesMap = fileList.getLocalImageFiles();
>>>>> -
>>>>> +
>>>>> while (localUpdatesMap.size()> 1) {
>>>>> - Entry<Long, ImageFile> firstEntry = localUpdatesMap.pollFirstEntry();
>>>>> + Entry<Long, ImageFile> firstEntry = localUpdatesMap.pollFirstEntry();
>>>>>
>>>>> try {
>>>>> - transfer.delete(firstEntry.getValue());
>>>>> - }
>>>>> - catch (Exception e) {
>>>>> + transfer.delete(firstEntry.getValue());
>>>>> + } catch (Exception e) {
>>>>> logger.log(Level.WARNING, "Could not delete old image file", e);
>>>>> }
>>>>> }
>>>>> }
>>>>>
>>>>> + @Override
>>>>> + public void load(ConfigNode node) throws ConfigException {
>>>>> + if (node != null) {
>>>>> + ConfigNode remote = node.findChildByName("remote");
>>>>> + Integer inter = remote.getInteger("interval");
>>>>> + if (inter != null) {
>>>>> + interval = inter;
>>>>> + }
>>>>> + }
>>>>> + }
>>>>> +
>>>>> + @Override
>>>>> + public void save(ConfigNode node) {
>>>>> + ConfigNode remote = node.findOrCreateChildByXpath("remote", "remote");
>>>>> + remote.setProperty("interval", interval);
>>>>> + }
>>>>> }
>>>>>
>>>>>
>>>>> --
>>>>> Mailing list: https://launchpad.net/~syncany-team
>>>>> Post to : syncany-team@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~syncany-team
>>>>> More help : https://help.launchpad.net/ListHelp
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>
>>> --
>>> https://code.launchpad.net/~isak-karlsson/syncany/syncany-remote-watch-interval/+merge/64850
>>> Your team Syncany Team is requested to review the proposed merge of lp:~isak-karlsson/syncany/syncany-remote-watch-interval into lp:syncany.
>>>
>>> --
>>> Mailing list: https://launchpad.net/~syncany-team
>>> Post to : syncany-team@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~syncany-team
>>> More help : https://help.launchpad.net/ListHelp
>>>
>>
>
> --
> https://code.launchpad.net/~isak-karlsson/syncany/syncany-remote-watch-interval/+merge/64850
> Your team Syncany Team is requested to review the proposed merge of lp:~isak-karlsson/syncany/syncany-remote-watch-interval into lp:syncany.
>
> --
> Mailing list: https://launchpad.net/~syncany-team
> Post to : syncany-team@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~syncany-team
> More help : https://help.launchpad.net/ListHelp
>
--
https://code.launchpad.net/~isak-karlsson/syncany/syncany-remote-watch-interval/+merge/64850
Your team Syncany Team is requested to review the proposed merge of lp:~isak-karlsson/syncany/syncany-remote-watch-interval into lp:syncany.
Follow ups
References