Merge lp:~isak-karlsson/syncany/syncany-remote-watch-interval into lp:~syncany-team/syncany/trunk

Proposed by isakkarlsson
Status: Needs review
Proposed branch: lp:~isak-karlsson/syncany/syncany-remote-watch-interval
Merge into: lp:~syncany-team/syncany/trunk
Diff against target: 1264 lines (+451/-353)
7 files modified
syncany/src/org/syncany/config/Profile.java (+5/-0)
syncany/src/org/syncany/gui/settings/ProfilePanel.form (+2/-2)
syncany/src/org/syncany/gui/settings/ProfilePanel.java (+60/-60)
syncany/src/org/syncany/gui/settings/RepositoryPanel.form (+73/-27)
syncany/src/org/syncany/gui/settings/RepositoryPanel.java (+137/-115)
syncany/src/org/syncany/i18n/I18n_en_US.properties (+2/-0)
syncany/src/org/syncany/watch/remote/RemoteWatcher.java (+172/-149)
To merge this branch: bzr merge lp:~isak-karlsson/syncany/syncany-remote-watch-interval
Reviewer Review Type Date Requested Status
Philipp C. Heckel Approve
Review via email: mp+64850@code.launchpad.net

Description of the change

Added the ability to change the remote checking inverval.

To post a comment you must log in.
Revision history for this message
Philipp C. Heckel (binwiederhier) wrote :
Download full text (55.0 KiB)

I'll review this tonight and then merge it :-D

On Thu, Jun 16, 2011 at 4:58 PM, isakkarlsson <email address hidden> 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 <email address hidden>
>
> === 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 def...

Revision history for this message
isakkarlsson (isak-karlsson) wrote :
Download full text (55.4 KiB)

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<email address hidden> 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<email address hidden>
>>
>> === 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 F...

Revision history for this message
Philipp C. Heckel (binwiederhier) wrote :
Download full text (57.5 KiB)

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 <email address hidden> 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<email address hidden>  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<email address hidden>
>>>
>>> === 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"/>
>...

Revision history for this message
isakkarlsson (isak-karlsson) wrote :
Download full text (59.1 KiB)

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<email address hidden> 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<email address hidden> 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<email address hidden>
>>>>
>>>> === 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 m...

Revision history for this message
Philipp C. Heckel (binwiederhier) wrote :
Download full text (61.1 KiB)

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 <email address hidden> 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<email address hidden>  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<email address hidden>    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<email address hidden>
>>>>>
>>>>> === 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
...

Revision history for this message
isakkarlsson (isak-karlsson) wrote :
Download full text (62.9 KiB)

Hi,

Sounds like a plan. When will the thesis (on the algorithm) be publised?
Sounds like an interesting read.

Regards

On 06/17/2011 09:27 PM, Philipp C. Heckel wrote:
> 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<email address hidden> 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<email address hidden> 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<email address hidden> 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<email address hidden>
>>>>>>
>>>>>> === 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.s...

Revision history for this message
Philipp C. Heckel (binwiederhier) wrote :
Download full text (65.0 KiB)

Hi Isak,

Although the syncing stuff will be briefly described in the thesis, is
not really the core of my thesis -- I'm doing that just for fun :-D
The thesis is more about optimizing the bandwidth and storage
utilization.

I'll push the code as soon as it's working. Hopefully today or tomorrow :-D

Cheers
Philipp

On Sat, Jun 18, 2011 at 1:34 AM, isakkarlsson <email address hidden> wrote:
> Hi,
>
> Sounds like a plan. When will the thesis (on the algorithm) be publised?
> Sounds like an interesting read.
>
> Regards
>
> On 06/17/2011 09:27 PM, Philipp C. Heckel wrote:
>> 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<email address hidden>  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<email address hidden>    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<email address hidden>      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<email address hidden>
>>>>>>>
>>>>>>> === 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 Repositor...

Revision history for this message
Philipp C. Heckel (binwiederhier) wrote :

changes have been merged in my newsync branch; and will be in the trunk soon.

review: Approve

Unmerged revisions

48. By isakkarlsson

fix resourceBundle

47. By isakkarlsson

fix native.py

46. By isakkarlsson

merge trunk

45. By isakkarlsson

moved the gui to RepositoryPanel seemed more fitting there..

44. By isakkarlsson

merge trunk

43. By isakkarlsson

Added possibility to change the remote watch check interval (to lower costs for i.e. google storage)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 18:12:48 +0000
@@ -149,6 +149,8 @@
149 // Repo149 // Repo
150 repository = new Repository();150 repository = new Repository();
151 repository.load(node.findChildByName("repository"));151 repository.load(node.findChildByName("repository"));
152
153 remoteWatcher.load(node.findChildByName("watcher"));
152 154
153 // Folders155 // Folders
154 folders = new Folders(this);156 folders = new Folders(this);
@@ -175,5 +177,8 @@
175177
176 // Folders178 // Folders
177 folders.save(node.findOrCreateChildByXpath("folders", "folders"));179 folders.save(node.findOrCreateChildByXpath("folders", "folders"));
180
181 // Watcher
182 remoteWatcher.save(node.findOrCreateChildByXpath("watcher", "watcher"));
178 } 183 }
179}184}
180185
=== 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 18:12:48 +0000
@@ -28,8 +28,8 @@
28 <Component id="cbActive" alignment="0" min="-2" max="-2" attributes="0"/>28 <Component id="cbActive" alignment="0" min="-2" max="-2" attributes="0"/>
29 <Group type="102" alignment="0" attributes="0">29 <Group type="102" alignment="0" attributes="0">
30 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>30 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
31 <EmptySpace max="-2" attributes="0"/>31 <EmptySpace min="-2" pref="62" max="-2" attributes="0"/>
32 <Component id="txtProfileName" pref="344" max="32767" attributes="0"/>32 <Component id="txtProfileName" pref="294" max="32767" attributes="0"/>
33 </Group>33 </Group>
34 </Group>34 </Group>
35 <EmptySpace max="-2" attributes="0"/>35 <EmptySpace max="-2" attributes="0"/>
3636
=== 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 18:12:48 +0000
@@ -69,65 +69,65 @@
69 * always regenerated by the Form Editor.69 * always regenerated by the Form Editor.
70 */70 */
71 @SuppressWarnings("unchecked")71 @SuppressWarnings("unchecked")
72 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents72 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
73 private void initComponents() {73 private void initComponents() {
7474
75 jLabel1 = new javax.swing.JLabel();75 jLabel1 = new javax.swing.JLabel();
76 txtProfileName = new javax.swing.JTextField();76 txtProfileName = new javax.swing.JTextField();
77 cbActive = new javax.swing.JCheckBox();77 cbActive = new javax.swing.JCheckBox();
78 jLabel2 = new javax.swing.JLabel();78 jLabel2 = new javax.swing.JLabel();
7979
80 setBorder(null);80 setBorder(null);
8181
82 jLabel1.setLabelFor(txtProfileName);82 jLabel1.setLabelFor(txtProfileName);
83 jLabel1.setText(resourceBundle.getString("profp_name"));83 jLabel1.setText("Profile Name:");
84 jLabel1.setName("jLabel1"); // NOI18N84 jLabel1.setName("jLabel1"); // NOI18N
8585
86 txtProfileName.setName("txtProfileName"); // NOI18N86 txtProfileName.setName("txtProfileName"); // NOI18N
8787
88 cbActive.setText(resourceBundle.getString("profp_activate"));88 cbActive.setText("Activate Profile");
89 cbActive.setName("cbActive"); // NOI18N89 cbActive.setName("cbActive"); // NOI18N
9090
91 jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() | java.awt.Font.BOLD));91 jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() | java.awt.Font.BOLD));
92 jLabel2.setText(resourceBundle.getString("profp_settings"));92 jLabel2.setText("Profile Settings");
93 jLabel2.setName("jLabel2"); // NOI18N93 jLabel2.setName("jLabel2"); // NOI18N
9494
95 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);95 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
96 this.setLayout(layout);96 this.setLayout(layout);
97 layout.setHorizontalGroup(97 layout.setHorizontalGroup(
98 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)98 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
99 .addGroup(layout.createSequentialGroup()99 .addGroup(layout.createSequentialGroup()
100 .addContainerGap()100 .addContainerGap()
101 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)101 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
102 .addComponent(jLabel2)102 .addComponent(jLabel2)
103 .addComponent(cbActive)103 .addComponent(cbActive)
104 .addGroup(layout.createSequentialGroup()104 .addGroup(layout.createSequentialGroup()
105 .addComponent(jLabel1)105 .addComponent(jLabel1)
106 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)106 .addGap(62, 62, 62)
107 .addComponent(txtProfileName, javax.swing.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)))107 .addComponent(txtProfileName, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)))
108 .addContainerGap())108 .addContainerGap())
109 );109 );
110 layout.setVerticalGroup(110 layout.setVerticalGroup(
111 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)111 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
112 .addGroup(layout.createSequentialGroup()112 .addGroup(layout.createSequentialGroup()
113 .addGap(10, 10, 10)113 .addGap(10, 10, 10)
114 .addComponent(jLabel2)114 .addComponent(jLabel2)
115 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)115 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
116 .addComponent(cbActive)116 .addComponent(cbActive)
117 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)117 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
118 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)118 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
119 .addComponent(txtProfileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)119 .addComponent(txtProfileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
120 .addComponent(jLabel1))120 .addComponent(jLabel1))
121 .addContainerGap(213, Short.MAX_VALUE))121 .addContainerGap(213, Short.MAX_VALUE))
122 );122 );
123 }// </editor-fold>//GEN-END:initComponents123 }// </editor-fold>//GEN-END:initComponents
124124
125125
126 // Variables declaration - do not modify//GEN-BEGIN:variables126 // Variables declaration - do not modify//GEN-BEGIN:variables
127 private javax.swing.JCheckBox cbActive;127 private javax.swing.JCheckBox cbActive;
128 private javax.swing.JLabel jLabel1;128 private javax.swing.JLabel jLabel1;
129 private javax.swing.JLabel jLabel2;129 private javax.swing.JLabel jLabel2;
130 private javax.swing.JTextField txtProfileName;130 private javax.swing.JTextField txtProfileName;
131 // End of variables declaration//GEN-END:variables131 // End of variables declaration//GEN-END:variables
132132
133}133}
134134
=== 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 18:12:48 +0000
@@ -23,22 +23,29 @@
23 <EmptySpace pref="2" max="-2" attributes="0"/>23 <EmptySpace pref="2" max="-2" attributes="0"/>
24 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>24 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
25 </Group>25 </Group>
26 <Component id="scrConnection" alignment="0" min="-2" pref="499" max="-2" attributes="0"/>
27 <Component id="lblConnection" alignment="0" min="-2" max="-2" attributes="0"/>
28 <Group type="102" alignment="0" attributes="0">
29 <Group type="103" groupAlignment="0" attributes="0">
30 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
31 <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
32 </Group>
33 <EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
34 <Group type="103" groupAlignment="0" max="-2" attributes="0">
35 <Component id="jspRemoteInterval" max="32767" attributes="1"/>
36 <Component id="lblEncryption" alignment="0" max="32767" attributes="1"/>
37 </Group>
38 <EmptySpace max="-2" attributes="0"/>
39 <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
40 </Group>
26 <Group type="102" alignment="0" attributes="0">41 <Group type="102" alignment="0" attributes="0">
27 <Component id="jLabel3" min="-2" max="-2" attributes="0"/>42 <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
28 <EmptySpace min="12" pref="12" max="12" attributes="0"/>43 <EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
29 <Component id="lblStorageType" min="-2" max="-2" attributes="0"/>44 <Group type="103" groupAlignment="0" attributes="0">
30 </Group>45 <Component id="lblStorageType" min="-2" max="-2" attributes="0"/>
31 <Group type="102" alignment="0" attributes="0">46 <Component id="lblStorageDescription" alignment="0" min="-2" max="-2" attributes="0"/>
32 <EmptySpace min="-2" pref="120" max="-2" attributes="0"/>47 </Group>
33 <Component id="lblStorageDescription" min="-2" max="-2" attributes="0"/>48 </Group>
34 </Group>
35 <Group type="102" alignment="0" attributes="0">
36 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
37 <EmptySpace min="50" pref="50" max="50" attributes="0"/>
38 <Component id="lblEncryption" min="-2" max="-2" attributes="0"/>
39 </Group>
40 <Component id="lblConnection" alignment="0" min="-2" max="-2" attributes="0"/>
41 <Component id="scrConnection" alignment="0" min="-2" pref="499" max="-2" attributes="0"/>
42 </Group>49 </Group>
43 <EmptySpace max="32767" attributes="0"/>50 <EmptySpace max="32767" attributes="0"/>
44 </Group>51 </Group>
@@ -50,20 +57,26 @@
50 <EmptySpace max="-2" attributes="0"/>57 <EmptySpace max="-2" attributes="0"/>
51 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>58 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
52 <EmptySpace type="unrelated" max="-2" attributes="0"/>59 <EmptySpace type="unrelated" max="-2" attributes="0"/>
53 <Group type="103" groupAlignment="0" attributes="0">60 <Group type="103" groupAlignment="3" attributes="0">
54 <Component id="jLabel3" min="-2" max="-2" attributes="0"/>61 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
55 <Component id="lblStorageType" min="-2" max="-2" attributes="0"/>62 <Component id="lblStorageType" alignment="3" min="-2" max="-2" attributes="0"/>
56 </Group>63 </Group>
57 <EmptySpace min="5" pref="5" max="5" attributes="0"/>64 <EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
58 <Component id="lblStorageDescription" min="-2" max="-2" attributes="0"/>65 <Component id="lblStorageDescription" min="-2" max="-2" attributes="0"/>
59 <EmptySpace min="-2" pref="15" max="-2" attributes="0"/>66 <EmptySpace type="separate" max="-2" attributes="0"/>
60 <Group type="103" groupAlignment="0" attributes="0">67 <Group type="103" groupAlignment="0" attributes="0">
61 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>68 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
62 <Component id="lblEncryption" min="-2" max="-2" attributes="0"/>69 <Component id="lblEncryption" min="-2" max="-2" attributes="0"/>
63 </Group>70 </Group>
64 <EmptySpace min="-2" pref="30" max="-2" attributes="0"/>71 <EmptySpace type="unrelated" max="-2" attributes="0"/>
72 <Group type="103" groupAlignment="3" attributes="0">
73 <Component id="jspRemoteInterval" alignment="3" min="-2" max="-2" attributes="0"/>
74 <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
75 <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
76 </Group>
77 <EmptySpace pref="28" max="32767" attributes="0"/>
65 <Component id="lblConnection" min="-2" max="-2" attributes="0"/>78 <Component id="lblConnection" min="-2" max="-2" attributes="0"/>
66 <EmptySpace pref="12" max="32767" attributes="0"/>79 <EmptySpace type="unrelated" max="-2" attributes="0"/>
67 <Component id="scrConnection" min="-2" pref="237" max="-2" attributes="0"/>80 <Component id="scrConnection" min="-2" pref="237" max="-2" attributes="0"/>
68 <EmptySpace max="-2" attributes="0"/>81 <EmptySpace max="-2" attributes="0"/>
69 </Group>82 </Group>
@@ -89,7 +102,9 @@
89 <Font bold="true" component="lblConnection" property="font" relativeSize="true" size="0"/>102 <Font bold="true" component="lblConnection" property="font" relativeSize="true" size="0"/>
90 </FontInfo>103 </FontInfo>
91 </Property>104 </Property>
92 <Property name="text" type="java.lang.String" value="(xyz) Connection"/>105 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
106 <Connection code="resourceBundle.getString(&quot;reposp_connection&quot;)" type="code"/>
107 </Property>
93 <Property name="name" type="java.lang.String" value="lblConnection" noResource="true"/>108 <Property name="name" type="java.lang.String" value="lblConnection" noResource="true"/>
94 </Properties>109 </Properties>
95 </Component>110 </Component>
@@ -112,33 +127,64 @@
112 </Container>127 </Container>
113 <Component class="javax.swing.JLabel" name="jLabel3">128 <Component class="javax.swing.JLabel" name="jLabel3">
114 <Properties>129 <Properties>
115 <Property name="text" type="java.lang.String" value="Connection Type:"/>130 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
131 <Connection code="resourceBundle.getString(&quot;reposp_connection_type&quot;)" type="code"/>
132 </Property>
116 <Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>133 <Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
117 </Properties>134 </Properties>
118 </Component>135 </Component>
119 <Component class="javax.swing.JLabel" name="jLabel4">136 <Component class="javax.swing.JLabel" name="jLabel4">
120 <Properties>137 <Properties>
121 <Property name="text" type="java.lang.String" value="Encryption:"/>138 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
139 <Connection code="resourceBundle.getString(&quot;reposp_encryption&quot;)" type="code"/>
140 </Property>
122 <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>141 <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>
123 </Properties>142 </Properties>
124 </Component>143 </Component>
125 <Component class="javax.swing.JLabel" name="lblStorageType">144 <Component class="javax.swing.JLabel" name="lblStorageType">
126 <Properties>145 <Properties>
127 <Property name="text" type="java.lang.String" value="(type)"/>146 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
147 <Connection code="resourceBundle.getString(&quot;reposp_temp_type&quot;)" type="code"/>
148 </Property>
128 <Property name="name" type="java.lang.String" value="lblStorageType" noResource="true"/>149 <Property name="name" type="java.lang.String" value="lblStorageType" noResource="true"/>
129 </Properties>150 </Properties>
130 </Component>151 </Component>
131 <Component class="javax.swing.JLabel" name="lblEncryption">152 <Component class="javax.swing.JLabel" name="lblEncryption">
132 <Properties>153 <Properties>
133 <Property name="text" type="java.lang.String" value="(encryption)"/>154 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
155 <Connection code="resourceBundle.getString(&quot;reposp_temp_encryption&quot;)" type="code"/>
156 </Property>
134 <Property name="name" type="java.lang.String" value="lblEncryption" noResource="true"/>157 <Property name="name" type="java.lang.String" value="lblEncryption" noResource="true"/>
135 </Properties>158 </Properties>
136 </Component>159 </Component>
137 <Component class="javax.swing.JLabel" name="lblStorageDescription">160 <Component class="javax.swing.JLabel" name="lblStorageDescription">
138 <Properties>161 <Properties>
139 <Property name="text" type="java.lang.String" value="(description)"/>162 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
163 <Connection code="resourceBundle.getString(&quot;reposp_temp_description&quot;)" type="code"/>
164 </Property>
140 <Property name="name" type="java.lang.String" value="lblStorageDescription" noResource="true"/>165 <Property name="name" type="java.lang.String" value="lblStorageDescription" noResource="true"/>
141 </Properties>166 </Properties>
142 </Component>167 </Component>
168 <Component class="javax.swing.JSpinner" name="jspRemoteInterval">
169 <Properties>
170 <Property name="name" type="java.lang.String" value="jspRemoteInterval" noResource="true"/>
171 </Properties>
172 </Component>
173 <Component class="javax.swing.JLabel" name="jLabel2">
174 <Properties>
175 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
176 <Connection code="resourceBundle.getString(&quot;reposp_watch_interval&quot;)" type="code"/>
177 </Property>
178 <Property name="name" type="java.lang.String" value="lblWatchInterval" noResource="true"/>
179 </Properties>
180 </Component>
181 <Component class="javax.swing.JLabel" name="jLabel5">
182 <Properties>
183 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
184 <Connection code="resourceBundle.getString(&quot;reposp_watch_ms&quot;)" type="code"/>
185 </Property>
186 <Property name="name" type="java.lang.String" value="lblMiliSeconds" noResource="true"/>
187 </Properties>
188 </Component>
143 </SubComponents>189 </SubComponents>
144</Form>190</Form>
145191
=== 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 18:12:48 +0000
@@ -21,7 +21,6 @@
21 *21 *
22 * Created on Mar 27, 2011, 12:51:42 AM22 * Created on Mar 27, 2011, 12:51:42 AM
23 */23 */
24
25package org.syncany.gui.settings;24package org.syncany.gui.settings;
2625
27import java.util.ResourceBundle;26import java.util.ResourceBundle;
@@ -37,146 +36,169 @@
37 * @author Philipp C. Heckel <philipp.heckel@gmail.com>36 * @author Philipp C. Heckel <philipp.heckel@gmail.com>
38 */37 */
39public class RepositoryPanel extends SettingsPanel {38public class RepositoryPanel extends SettingsPanel {
39
40 private Profile profile;40 private Profile profile;
41 private ConfigPanel pnlConnection;41 private ConfigPanel pnlConnection;
42 private ResourceBundle resourceBundle;42 private ResourceBundle resourceBundle;
4343
44 /** Creates new form ProxyPanel */44 /** Creates new form ProxyPanel */
45 public RepositoryPanel(Profile profile) {45 public RepositoryPanel(Profile profile) {
46 resourceBundle = Config.getInstance().getResourceBundle();46 resourceBundle = Config.getInstance().getResourceBundle();
47 initComponents();47 initComponents();
4848
49 this.profile = profile;49 this.profile = profile;
50 this.pnlConnection = profile.getRepository().getConnection().createConfigPanel();50 this.pnlConnection = profile.getRepository().getConnection().createConfigPanel();
5151
52 scrConnection.setViewportView(pnlConnection);52 scrConnection.setViewportView(pnlConnection);
53 //scrConnection.getViewport().setViewPosition(new Point(0, 0));53 //scrConnection.getViewport().setViewPosition(new Point(0, 0));
54 54
55 }55 }
56 56
57 @Override57 @Override
58 public void load() { 58 public void load() {
59 Repository repo = profile.getRepository();59 Repository repo = profile.getRepository();
60 Connection connection = repo.getConnection();60 Connection connection = repo.getConnection();
61 61
62 lblStorageType.setText(connection.getPluginInfo().getName() + ", " + resourceBundle.getString("reposp_version") + " " + repo.getConnection().getPluginInfo().getVersionStr());62 lblStorageType.setText(connection.getPluginInfo().getName() + ", " + resourceBundle.getString("reposp_version") + " " + repo.getConnection().getPluginInfo().getVersionStr());
63 lblStorageDescription.setText(connection.getPluginInfo().getDescripton());63 lblStorageDescription.setText(connection.getPluginInfo().getDescripton());
64 lblEncryption.setText(repo.getEncryption().getCipherStr() + ", " + repo.getEncryption().getKeylength() + " bit");64 lblEncryption.setText(repo.getEncryption().getCipherStr() + ", " + repo.getEncryption().getKeylength() + " bit");
65 65
66 lblConnection.setText(connection.getPluginInfo().getName()+ resourceBundle.getString("reposp_connection_details"));66 lblConnection.setText(connection.getPluginInfo().getName() + resourceBundle.getString("reposp_connection_details"));
67 pnlConnection.load();67 pnlConnection.load();
68 jspRemoteInterval.setValue(profile.getRemoteWatcher().getInterval());
68 }69 }
6970
70 @Override71 @Override
71 public void save() {72 public void save() {
72 // TODO73 // TODO
73 pnlConnection.save();74 pnlConnection.save();
75 profile.getRemoteWatcher().setInterval((Integer) jspRemoteInterval.getValue());
74 }76 }
7577
76
77 /** This method is called from within the constructor to78 /** This method is called from within the constructor to
78 * initialize the form.79 * initialize the form.
79 * WARNING: Do NOT modify this code. The content of this method is80 * WARNING: Do NOT modify this code. The content of this method is
80 * always regenerated by the Form Editor.81 * always regenerated by the Form Editor.
81 */82 */
82 @SuppressWarnings("unchecked")83 @SuppressWarnings("unchecked")
83 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents84 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
84 private void initComponents() {85 private void initComponents() {
8586
86 jLabel1 = new javax.swing.JLabel();87 jLabel1 = new javax.swing.JLabel();
87 lblConnection = new javax.swing.JLabel();88 lblConnection = new javax.swing.JLabel();
88 scrConnection = new javax.swing.JScrollPane();89 scrConnection = new javax.swing.JScrollPane();
89 jLabel3 = new javax.swing.JLabel();90 jLabel3 = new javax.swing.JLabel();
90 jLabel4 = new javax.swing.JLabel();91 jLabel4 = new javax.swing.JLabel();
91 lblStorageType = new javax.swing.JLabel();92 lblStorageType = new javax.swing.JLabel();
92 lblEncryption = new javax.swing.JLabel();93 lblEncryption = new javax.swing.JLabel();
93 lblStorageDescription = new javax.swing.JLabel();94 lblStorageDescription = new javax.swing.JLabel();
9495 jspRemoteInterval = new javax.swing.JSpinner();
95 jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));96 jLabel2 = new javax.swing.JLabel();
96 jLabel1.setText(resourceBundle.getString("reposp_remote_storage"));97 jLabel5 = new javax.swing.JLabel();
97 jLabel1.setName("jLabel1"); // NOI18N98
9899 jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));
99 lblConnection.setFont(lblConnection.getFont().deriveFont(lblConnection.getFont().getStyle() | java.awt.Font.BOLD));100 jLabel1.setText("Remote Storage");
100 lblConnection.setText(resourceBundle.getString("reposp_connection"));101 jLabel1.setName("jLabel1"); // NOI18N
101 lblConnection.setName("lblConnection"); // NOI18N102
102103 lblConnection.setFont(lblConnection.getFont().deriveFont(lblConnection.getFont().getStyle() | java.awt.Font.BOLD));
103 scrConnection.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));104 lblConnection.setText(resourceBundle.getString("reposp_connection"));
104 scrConnection.setViewportBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));105 lblConnection.setName("lblConnection"); // NOI18N
105 scrConnection.setName("scrConnection"); // NOI18N106
106107 scrConnection.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
107 jLabel3.setText(resourceBundle.getString("reposp_connection_type"));108 scrConnection.setViewportBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
108 jLabel3.setName("jLabel3"); // NOI18N109 scrConnection.setName("scrConnection"); // NOI18N
109110
110 jLabel4.setText(resourceBundle.getString("reposp_encryption"));111 jLabel3.setText(resourceBundle.getString("reposp_connection_type"));
111 jLabel4.setName("jLabel4"); // NOI18N112 jLabel3.setName("jLabel3"); // NOI18N
112113
113 lblStorageType.setText(resourceBundle.getString("reposp_temp_type"));114 jLabel4.setText(resourceBundle.getString("reposp_encryption"));
114 lblStorageType.setName("lblStorageType"); // NOI18N115 jLabel4.setName("jLabel4"); // NOI18N
115116
116 lblEncryption.setText(resourceBundle.getString("reposp_temp_encryption"));117 lblStorageType.setText(resourceBundle.getString("reposp_temp_type"));
117 lblEncryption.setName("lblEncryption"); // NOI18N118 lblStorageType.setName("lblStorageType"); // NOI18N
118119
119 lblStorageDescription.setText(resourceBundle.getString("reposp_temp_description"));120 lblEncryption.setText(resourceBundle.getString("reposp_temp_encryption"));
120 lblStorageDescription.setName("lblStorageDescription"); // NOI18N121 lblEncryption.setName("lblEncryption"); // NOI18N
121122
122 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);123 lblStorageDescription.setText(resourceBundle.getString("reposp_temp_description"));
123 this.setLayout(layout);124 lblStorageDescription.setName("lblStorageDescription"); // NOI18N
124 layout.setHorizontalGroup(125
125 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)126 jspRemoteInterval.setName("jspRemoteInterval"); // NOI18N
126 .addGroup(layout.createSequentialGroup()127
127 .addContainerGap()128 jLabel2.setText(resourceBundle.getString("reposp_watch_interval"));
128 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)129 jLabel2.setName("lblWatchInterval"); // NOI18N
129 .addGroup(layout.createSequentialGroup()130
130 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2, javax.swing.GroupLayout.PREFERRED_SIZE)131 jLabel5.setText(resourceBundle.getString("reposp_watch_ms"));
131 .addComponent(jLabel1))132 jLabel5.setName("lblMiliSeconds"); // NOI18N
132 .addGroup(layout.createSequentialGroup()133
133 .addComponent(jLabel3)134 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
134 .addGap(12, 12, 12)135 this.setLayout(layout);
135 .addComponent(lblStorageType))136 layout.setHorizontalGroup(
136 .addGroup(layout.createSequentialGroup()137 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
137 .addGap(120, 120, 120)138 .addGroup(layout.createSequentialGroup()
138 .addComponent(lblStorageDescription))139 .addContainerGap()
139 .addGroup(layout.createSequentialGroup()140 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
140 .addComponent(jLabel4)141 .addGroup(layout.createSequentialGroup()
141 .addGap(50, 50, 50)142 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
142 .addComponent(lblEncryption))143 .addComponent(jLabel1))
143 .addComponent(lblConnection)144 .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE)
144 .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE))145 .addComponent(lblConnection)
145 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))146 .addGroup(layout.createSequentialGroup()
146 );147 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
147 layout.setVerticalGroup(148 .addComponent(jLabel4)
148 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)149 .addComponent(jLabel2))
149 .addGroup(layout.createSequentialGroup()150 .addGap(50, 50, 50)
150 .addContainerGap()151 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
151 .addComponent(jLabel1)152 .addComponent(jspRemoteInterval)
152 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)153 .addComponent(lblEncryption, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
153 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)154 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
154 .addComponent(jLabel3)155 .addComponent(jLabel5))
155 .addComponent(lblStorageType))156 .addGroup(layout.createSequentialGroup()
156 .addGap(5, 5, 5)157 .addComponent(jLabel3)
157 .addComponent(lblStorageDescription)158 .addGap(30, 30, 30)
158 .addGap(15, 15, 15)159 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
159 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)160 .addComponent(lblStorageType)
160 .addComponent(jLabel4)161 .addComponent(lblStorageDescription))))
161 .addComponent(lblEncryption))162 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
162 .addGap(30, 30, 30)163 );
163 .addComponent(lblConnection)164 layout.setVerticalGroup(
164 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)165 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
165 .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)166 .addGroup(layout.createSequentialGroup()
166 .addContainerGap())167 .addContainerGap()
167 );168 .addComponent(jLabel1)
168 }// </editor-fold>//GEN-END:initComponents169 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
169170 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
170171 .addComponent(jLabel3)
171 // Variables declaration - do not modify//GEN-BEGIN:variables172 .addComponent(lblStorageType))
172 private javax.swing.JLabel jLabel1;173 .addGap(2, 2, 2)
173 private javax.swing.JLabel jLabel3;174 .addComponent(lblStorageDescription)
174 private javax.swing.JLabel jLabel4;175 .addGap(18, 18, 18)
175 private javax.swing.JLabel lblConnection;176 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
176 private javax.swing.JLabel lblEncryption;177 .addComponent(jLabel4)
177 private javax.swing.JLabel lblStorageDescription;178 .addComponent(lblEncryption))
178 private javax.swing.JLabel lblStorageType;179 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
179 private javax.swing.JScrollPane scrConnection;180 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
180 // End of variables declaration//GEN-END:variables181 .addComponent(jspRemoteInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
181182 .addComponent(jLabel2)
183 .addComponent(jLabel5))
184 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
185 .addComponent(lblConnection)
186 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
187 .addComponent(scrConnection, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)
188 .addContainerGap())
189 );
190 }// </editor-fold>//GEN-END:initComponents
191 // Variables declaration - do not modify//GEN-BEGIN:variables
192 private javax.swing.JLabel jLabel1;
193 private javax.swing.JLabel jLabel2;
194 private javax.swing.JLabel jLabel3;
195 private javax.swing.JLabel jLabel4;
196 private javax.swing.JLabel jLabel5;
197 private javax.swing.JSpinner jspRemoteInterval;
198 private javax.swing.JLabel lblConnection;
199 private javax.swing.JLabel lblEncryption;
200 private javax.swing.JLabel lblStorageDescription;
201 private javax.swing.JLabel lblStorageType;
202 private javax.swing.JScrollPane scrConnection;
203 // End of variables declaration//GEN-END:variables
182}204}
183205
=== modified file 'syncany/src/org/syncany/i18n/I18n_en_US.properties'
--- syncany/src/org/syncany/i18n/I18n_en_US.properties 2011-06-04 00:29:53 +0000
+++ syncany/src/org/syncany/i18n/I18n_en_US.properties 2011-06-16 18:12:48 +0000
@@ -116,6 +116,8 @@
116reposp_temp_type = (type)116reposp_temp_type = (type)
117reposp_temp_encryption = (encryption)117reposp_temp_encryption = (encryption)
118reposp_temp_description = (description)118reposp_temp_description = (description)
119reposp_watch_interval = Watch Interval:
120reposp_watch_ms = ms
119121
120## SETTINGS DIALOG122## SETTINGS DIALOG
121sd_app_settings = Application Settings123sd_app_settings = Application Settings
122124
=== 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 18:12:48 +0000
@@ -19,11 +19,13 @@
1919
20import java.util.Map.Entry;20import java.util.Map.Entry;
21import org.syncany.config.Config;21import org.syncany.config.Config;
22import org.syncany.config.ConfigNode;
22import org.syncany.config.Profile;23import org.syncany.config.Profile;
23import org.syncany.connection.plugins.TransferManager;24import org.syncany.connection.plugins.TransferManager;
24import org.syncany.db.CloneClient;25import org.syncany.db.CloneClient;
25import org.syncany.db.CloneFile;26import org.syncany.db.CloneFile;
26import org.syncany.db.DatabaseHelper;27import org.syncany.db.DatabaseHelper;
28import org.syncany.exceptions.ConfigException;
27import org.syncany.exceptions.RemoteFileNotFoundException;29import org.syncany.exceptions.RemoteFileNotFoundException;
28import org.syncany.repository.files.RemoteFile;30import org.syncany.repository.files.RemoteFile;
29import org.syncany.exceptions.StorageException;31import org.syncany.exceptions.StorageException;
@@ -63,42 +65,33 @@
63 *65 *
64 * @author Philipp C. Heckel <philipp.heckel@gmail.com>66 * @author Philipp C. Heckel <philipp.heckel@gmail.com>
65 */67 */
66public class RemoteWatcher {68public class RemoteWatcher implements org.syncany.config.Configurable {
69
67 private static final Logger logger = Logger.getLogger(RemoteWatcher.class.getSimpleName());70 private static final Logger logger = Logger.getLogger(RemoteWatcher.class.getSimpleName());
68 71 private static final int DEFAULT_INTERVAL = 10000;
69 private static final int INTERVAL = 10000;
70 private static final boolean DEBUG_GZIP_AND_ENCRYPT_UPDATE_FILES = false;72 private static final boolean DEBUG_GZIP_AND_ENCRYPT_UPDATE_FILES = false;
71
72 private Config config;73 private Config config;
73 private DatabaseHelper db; 74 private DatabaseHelper db;
74 75 private int interval = DEFAULT_INTERVAL;
75 private Profile profile; 76 private Profile profile;
76
77 private ChangeManager changeManager;77 private ChangeManager changeManager;
78 private Timer timer;78 private Timer timer;
79
80 private Map<String, RemoteFile> remoteFileList;79 private Map<String, RemoteFile> remoteFileList;
81 private StructuredFileList fileList;80 private StructuredFileList fileList;
82 private UpdateList updateList;81 private UpdateList updateList;
83 private TransferManager transfer;82 private TransferManager transfer;
84
85 // TODO this should be in the DB cached somewhere.83 // TODO this should be in the DB cached somewhere.
86 private Long lastFileVersionCount;84 private Long lastFileVersionCount;
87
88 // TODO this should be in the DB cached somewhere.85 // TODO this should be in the DB cached somewhere.
89 private Date lastRepoFileUpdate;86 private Date lastRepoFileUpdate;
90
91 // TODO this should be in the DB cached somewhere.87 // TODO this should be in the DB cached somewhere.
92 private Date lastUpdateFileDate;88 private Date lastUpdateFileDate;
93
94 // TODO this should be in the DB cached somewhere.89 // TODO this should be in the DB cached somewhere.
95 private Date lastLocalProfileFileUpdate;90 private Date lastLocalProfileFileUpdate;
96
97 // TODO this should be in the DB cached somewhere.91 // TODO this should be in the DB cached somewhere.
98 private Date lastLocalImageFileUpdate;92 private Date lastLocalImageFileUpdate;
9993
10094 public RemoteWatcher(Profile profile) {
101 public RemoteWatcher(Profile profile) {
102 this.profile = profile;95 this.profile = profile;
10396
104 this.changeManager = new ChangeManager(profile);97 this.changeManager = new ChangeManager(profile);
@@ -108,27 +101,34 @@
108 // cp. start()101 // cp. start()
109 this.config = null;102 this.config = null;
110 this.db = null;103 this.db = null;
111 104
112 // cp. doUpdateCheck()105 // cp. doUpdateCheck()
113 this.remoteFileList = null;106 this.remoteFileList = null;
114 this.updateList = null;107 this.updateList = null;
115 this.transfer = null;108 this.transfer = null;
116 }109 }
117110
118 public synchronized void start() { 111 public synchronized void setInterval(int interval) {
112 if (interval >= 1000) {
113 this.interval = interval;
114 }
115 startUpdateCheck();
116 }
117
118 public int getInterval() {
119 return this.interval;
120 }
121
122 public synchronized void start() {
119 // Dependencies123 // Dependencies
120 if (config == null) {124 if (config == null) {
121 config = Config.getInstance();125 config = Config.getInstance();
122 db = DatabaseHelper.getInstance();126 db = DatabaseHelper.getInstance();
123 }127 }
124 128
125 // Reset connection129 // Reset connection
126 reset();130 reset();
127 131 startUpdateCheck();
128 timer = new Timer("RemoteWatcher");
129 timer.scheduleAtFixedRate(new TimerTask() {
130 @Override public void run() { doUpdateCheck(); } }, 0, INTERVAL);
131
132 changeManager.start();132 changeManager.start();
133 }133 }
134134
@@ -143,8 +143,27 @@
143 timer = null;143 timer = null;
144 }144 }
145145
146 private void startUpdateCheck() {
147 logger.log(Level.INFO, "Staring remote watcher...");
148 if (timer != null) {
149 try {
150 timer.cancel();
151 } catch (IllegalStateException ex) {
152 logger.log(Level.SEVERE, ex.getMessage());
153 }
154 }
155 timer = new Timer("RemoteWatcher");
156 timer.scheduleAtFixedRate(new TimerTask() {
157 @Override
158 public void run() {
159 logger.log(Level.INFO, "Do Update Check Interval = " + interval);
160 doUpdateCheck();
161 }
162 }, 0, interval);
163 }
164
146 private void reset() {165 private void reset() {
147 166
148 transfer = profile.getRepository().getConnection().createTransferManager();167 transfer = profile.getRepository().getConnection().createTransferManager();
149 updateList = new UpdateList(profile);168 updateList = new UpdateList(profile);
150 }169 }
@@ -158,10 +177,10 @@
158177
159 try {178 try {
160 updateFileList();179 updateFileList();
161 180
162 updateRepository();181 updateRepository();
163 commitRepository();182 commitRepository();
164 183
165 // 1. download update files184 // 1. download update files
166 downloadUpdates();185 downloadUpdates();
167186
@@ -170,112 +189,108 @@
170189
171 // 4. Create and upload local updates ///////190 // 4. Create and upload local updates ///////
172 commitLocalUpdateFile();191 commitLocalUpdateFile();
173 192
174 // Profiles 193 // Profiles
175 commitLocalProfile();194 commitLocalProfile();
176 updateRemoteProfiles();195 updateRemoteProfiles();
177196
178 // Images197 // Images
179 commitLocalImage(); 198 commitLocalImage();
180 updateRemoteImages();199 updateRemoteImages();
181200
182 // 5. Delete old updates (only mine!) ///////201 // 5. Delete old updates (only mine!) ///////
183 deleteOldUpdateFiles();202 deleteOldUpdateFiles();
184 deleteOldProfileFiles();203 deleteOldProfileFiles();
185 deleteOldImageFiles();204 deleteOldImageFiles();
186 }205 } catch (StorageException ex) {
187 catch (StorageException ex) {
188 logger.log(Level.WARNING, "Update check failed. Trying again in a couple of seconds.", ex);206 logger.log(Level.WARNING, "Update check failed. Trying again in a couple of seconds.", ex);
189 }207 } finally {
190 finally {
191 if (logger.isLoggable(Level.INFO)) {208 if (logger.isLoggable(Level.INFO)) {
192 logger.info("DONE WITH PERIODIC UPDATE CHECK ...");209 logger.info("DONE WITH PERIODIC UPDATE CHECK ...");
193 }210 }
194211
195 try { transfer.disconnect(); }212 try {
196 catch (StorageException ex) { /* Fressen! */ }213 transfer.disconnect();
214 } catch (StorageException ex) { /* Fressen! */ }
197 }215 }
198 216
199 }217 }
200218
201 private void updateFileList() throws StorageException {219 private void updateFileList() throws StorageException {
202 remoteFileList = transfer.list();220 remoteFileList = transfer.list();
203 fileList = new StructuredFileList(profile.getRepository(), remoteFileList);221 fileList = new StructuredFileList(profile.getRepository(), remoteFileList);
204 }222 }
205 223
206
207 private void updateRepository() throws StorageException {224 private void updateRepository() throws StorageException {
208 RepositoryFile repoFile = fileList.getNewestRepositoryFile();225 RepositoryFile repoFile = fileList.getNewestRepositoryFile();
209 226
210 if (repoFile == null) {227 if (repoFile == null) {
211 throw new StorageException("Unable to find repository-* file.");228 throw new StorageException("Unable to find repository-* file.");
212 }229 }
213 230
214 // Are we already up-to-date?231 // Are we already up-to-date?
215 if (lastRepoFileUpdate != null && !repoFile.getLastUpdate().after(lastRepoFileUpdate)) {232 if (lastRepoFileUpdate != null && !repoFile.getLastUpdate().after(lastRepoFileUpdate)) {
216 return;233 return;
217 }234 }
218 235
219 // Do download and read it!236 // Do download and read it!
220 try { 237 try {
221 profile.getRepository().update(transfer, fileList);238 profile.getRepository().update(transfer, fileList);
222 lastRepoFileUpdate = repoFile.getLastUpdate();239 lastRepoFileUpdate = repoFile.getLastUpdate();
223 }240 } catch (Exception e) {
224 catch (Exception e) {
225 throw new StorageException(e);241 throw new StorageException(e);
226 }242 }
227 } 243 }
228 244
229 private void commitRepository() throws StorageException {245 private void commitRepository() throws StorageException {
230 RepositoryFile repoFile = fileList.getNewestRepositoryFile();246 RepositoryFile repoFile = fileList.getNewestRepositoryFile();
231 247
232 if (repoFile == null) {248 if (repoFile == null) {
233 throw new StorageException("Unable to find repository-* file.");249 throw new StorageException("Unable to find repository-* file.");
234 }250 }
235 251
236 // Are we already up-to-date?252 // Are we already up-to-date?
237 if (!profile.getRepository().isChanged()) {253 if (!profile.getRepository().isChanged()) {
238 if (logger.isLoggable(Level.INFO)) {254 if (logger.isLoggable(Level.INFO)) {
239 logger.info("repository has not changed locally. No need to upload.");255 logger.info("repository has not changed locally. No need to upload.");
240 }256 }
241 257
242 return;258 return;
243 }259 }
244 260
245 // Upload261 // Upload
246 if (logger.isLoggable(Level.INFO)) {262 if (logger.isLoggable(Level.INFO)) {
247 logger.info("Uploading changed repository file ...");263 logger.info("Uploading changed repository file ...");
248 }264 }
249 265
250 try { 266 try {
251 profile.getRepository().commit(transfer, fileList, false);267 profile.getRepository().commit(transfer, fileList, false);
252 }268 } catch (Exception e) {
253 catch (Exception e) {
254 throw new StorageException(e);269 throw new StorageException(e);
255 }270 }
256 } 271 }
257272
258 private void downloadUpdates() throws StorageException {273 private void downloadUpdates() throws StorageException {
259 if (logger.isLoggable(Level.INFO)) {274 if (logger.isLoggable(Level.INFO)) {
260 logger.info("2. Downloading update lists ...");275 logger.info("2. Downloading update lists ...");
261 }276 }
262 277
263 // Find newest client update files278 // Find newest client update files
264 Collection<UpdateFile> newestUpdateFiles = fileList.getRemoteUpdateFiles().values();279 Collection<UpdateFile> newestUpdateFiles = fileList.getRemoteUpdateFiles().values();
265 280
266 for (UpdateFile updateFile : newestUpdateFiles) {281 for (UpdateFile updateFile : newestUpdateFiles) {
267 // Get client from DB (or create it!)282 // Get client from DB (or create it!)
268 CloneClient client = db.getClient(profile, updateFile.getMachineName(), true); 283 CloneClient client = db.getClient(profile, updateFile.getMachineName(), true);
269 284
270 // Ignore if we are up-to-date285 // Ignore if we are up-to-date
271 if (client.getLastUpdate() != null && !updateFile.getLastUpdate().after(client.getLastUpdate())) {286 if (client.getLastUpdate() != null && !updateFile.getLastUpdate().after(client.getLastUpdate())) {
272 if (logger.isLoggable(Level.INFO)) {287 if (logger.isLoggable(Level.INFO)) {
273 logger.log(Level.INFO, " - Client ''{0}'' is up-to-date", updateFile.getMachineName());288 logger.log(Level.INFO, " - Client ''{0}'' is up-to-date", updateFile.getMachineName());
274 }289 }
275 290
276 continue;291 continue;
277 }292 }
278 293
279 try {294 try {
280 // Download update file295 // Download update file
281 if (logger.isLoggable(Level.INFO)) {296 if (logger.isLoggable(Level.INFO)) {
@@ -295,12 +310,11 @@
295310
296 // Add to update manager311 // Add to update manager
297 updateList.addRemoteUpdateFile(client, updateFile);312 updateList.addRemoteUpdateFile(client, updateFile);
298 }313 } catch (Exception ex) {
299 catch (Exception ex) {
300 if (logger.isLoggable(Level.WARNING)) {314 if (logger.isLoggable(Level.WARNING)) {
301 logger.log(Level.WARNING, "Reading update file of client {0} failed. Skipping update check.", client.getMachineName());315 logger.log(Level.WARNING, "Reading update file of client {0} failed. Skipping update check.", client.getMachineName());
302 }316 }
303 317
304 throw new StorageException(ex);318 throw new StorageException(ex);
305 }319 }
306 }320 }
@@ -317,15 +331,15 @@
317331
318 // TODO should the changes be synchronous?332 // TODO should the changes be synchronous?
319 // TODO because setting the clients' lastUpdate value assumes that the change mgr doesnt crash333 // TODO because setting the clients' lastUpdate value assumes that the change mgr doesnt crash
320 334
321 // Update last-updated date of clients335 // Update last-updated date of clients
322 if (logger.isLoggable(Level.INFO)) {336 if (logger.isLoggable(Level.INFO)) {
323 logger.info("3b. Updating client DB entries ...");337 logger.info("3b. Updating client DB entries ...");
324 }338 }
325339
326 for (Map.Entry<CloneClient, UpdateFile> e : updateList.getRemoteUpdateFiles().entrySet()) {340 for (Map.Entry<CloneClient, UpdateFile> e : updateList.getRemoteUpdateFiles().entrySet()) {
327 CloneClient client = e.getKey(); 341 CloneClient client = e.getKey();
328 UpdateFile updateFile = e.getValue();342 UpdateFile updateFile = e.getValue();
329343
330 client.setLastUpdate(updateFile.getLastUpdate());344 client.setLastUpdate(updateFile.getLastUpdate());
331 client.merge();345 client.merge();
@@ -350,25 +364,24 @@
350 lastUpdateFileDate = new Date();364 lastUpdateFileDate = new Date();
351 lastFileVersionCount = fileVersionCount;365 lastFileVersionCount = fileVersionCount;
352366
353 File localUpdateFile = null; 367 File localUpdateFile = null;
354 UpdateFile remoteUpdateFile = new UpdateFile(profile.getRepository(), config.getMachineName(), lastUpdateFileDate);368 UpdateFile remoteUpdateFile = new UpdateFile(profile.getRepository(), config.getMachineName(), lastUpdateFileDate);
355369
356 try {370 try {
357 // Make temp. update file371 // Make temp. update file
358 localUpdateFile = config.getCache().createTempFile("update-"+config.getMachineName());372 localUpdateFile = config.getCache().createTempFile("update-" + config.getMachineName());
359 logger.info("4. Writing local changes to '"+localUpdateFile+"' ...");373 logger.info("4. Writing local changes to '" + localUpdateFile + "' ...");
360374
361 List<CloneFile> updatedFiles = db.getHistory(profile);375 List<CloneFile> updatedFiles = db.getHistory(profile);
362 remoteUpdateFile.setVersions(updatedFiles);376 remoteUpdateFile.setVersions(updatedFiles);
363 remoteUpdateFile.write(localUpdateFile, DEBUG_GZIP_AND_ENCRYPT_UPDATE_FILES);377 remoteUpdateFile.write(localUpdateFile, DEBUG_GZIP_AND_ENCRYPT_UPDATE_FILES);
364378
365 // Upload379 // Upload
366 logger.info(" - Uploading file to temp. file '"+remoteUpdateFile.getName()+"' ...");380 logger.info(" - Uploading file to temp. file '" + remoteUpdateFile.getName() + "' ...");
367 transfer.upload(localUpdateFile, remoteUpdateFile);381 transfer.upload(localUpdateFile, remoteUpdateFile);
368382
369 localUpdateFile.delete();383 localUpdateFile.delete();
370 }384 } catch (IOException ex) {
371 catch (IOException ex) {
372 if (localUpdateFile != null) {385 if (localUpdateFile != null) {
373 localUpdateFile.delete();386 localUpdateFile.delete();
374 }387 }
@@ -376,18 +389,18 @@
376 logger.log(Level.SEVERE, null, ex);389 logger.log(Level.SEVERE, null, ex);
377 }390 }
378 }391 }
379 392
380 // Upload new local profile (if changed)393 // Upload new local profile (if changed)
381 private void commitLocalProfile() throws StorageException { 394 private void commitLocalProfile() throws StorageException {
382 ProfileFile localNewestProfileFile = fileList.getNewestProfileFile();395 ProfileFile localNewestProfileFile = fileList.getNewestProfileFile();
383 396
384 // Skip if no update needed397 // Skip if no update needed
385 if (!(localNewestProfileFile == null || lastLocalProfileFileUpdate == null ||398 if (!(localNewestProfileFile == null || lastLocalProfileFileUpdate == null
386 localNewestProfileFile.getLastUpdate().after(lastLocalProfileFileUpdate))) {399 || localNewestProfileFile.getLastUpdate().after(lastLocalProfileFileUpdate))) {
387 400
388 return;401 return;
389 }402 }
390 403
391 Date newDate = new Date();404 Date newDate = new Date();
392 ProfileFile localProfileFile = new ProfileFile(profile.getRepository(), config.getMachineName(), newDate);405 ProfileFile localProfileFile = new ProfileFile(profile.getRepository(), config.getMachineName(), newDate);
393406
@@ -408,13 +421,12 @@
408421
409 // Update 422 // Update
410 lastLocalProfileFileUpdate = newDate;423 lastLocalProfileFileUpdate = newDate;
411 }424 } catch (IOException e) {
412 catch (IOException e) {
413 logger.log(Level.SEVERE, "ERROR while uploading local profile.", e);425 logger.log(Level.SEVERE, "ERROR while uploading local profile.", e);
414 // TODO do something426 // TODO do something
415 }427 }
416 }428 }
417 429
418 private void updateRemoteProfiles() throws RemoteFileNotFoundException, StorageException {430 private void updateRemoteProfiles() throws RemoteFileNotFoundException, StorageException {
419 /// Download new user profiles431 /// Download new user profiles
420 Collection<ProfileFile> remoteProfileFiles = fileList.getRemoteProfileFiles().values();432 Collection<ProfileFile> remoteProfileFiles = fileList.getRemoteProfileFiles().values();
@@ -426,7 +438,7 @@
426 if (client.getLastProfileUpdate() != null && !f.getLastUpdate().after(client.getLastProfileUpdate())) {438 if (client.getLastProfileUpdate() != null && !f.getLastUpdate().after(client.getLastProfileUpdate())) {
427 continue;439 continue;
428 }440 }
429 441
430 if (logger.isLoggable(Level.INFO)) {442 if (logger.isLoggable(Level.INFO)) {
431 logger.log(Level.INFO, "Downloading profile of client ''{0}'' ...", client.getMachineName());443 logger.log(Level.INFO, "Downloading profile of client ''{0}'' ...", client.getMachineName());
432 }444 }
@@ -440,68 +452,67 @@
440 client.setLastProfileUpdate(new Date());452 client.setLastProfileUpdate(new Date());
441 client.setUserName(f.getUserName());453 client.setUserName(f.getUserName());
442 client.merge();454 client.merge();
443 }455 } catch (IOException e) {
444 catch (IOException e) {
445 logger.log(Level.SEVERE, "ERROR while downloading remote profile of " + client.getMachineName() + ".", e);456 logger.log(Level.SEVERE, "ERROR while downloading remote profile of " + client.getMachineName() + ".", e);
446 // TODO do something457 // TODO do something
447 } 458 }
448 }459 }
449 }460 }
450 461
451 private void commitLocalImage() throws RemoteFileNotFoundException, StorageException {462 private void commitLocalImage() throws RemoteFileNotFoundException, StorageException {
452 // Upload local image (if updated)463 // Upload local image (if updated)
453 ImageFile localNewestImageFile = fileList.getNewestImageFile();464 ImageFile localNewestImageFile = fileList.getNewestImageFile();
454 465
455 // Skip if no update needed466 // Skip if no update needed
456 if (!(localNewestImageFile == null || lastLocalImageFileUpdate == null ||467 if (!(localNewestImageFile == null || lastLocalImageFileUpdate == null
457 localNewestImageFile.getLastUpdate().after(lastLocalImageFileUpdate))) {468 || localNewestImageFile.getLastUpdate().after(lastLocalImageFileUpdate))) {
458 469
459 return;470 return;
460 }471 }
461 472
462 return;473 return;
463 /*474 /*
464 Date newDate = new Date();475 Date newDate = new Date();
465 ImageFile localImageFile = new ImageFile(profile.getRepository(), config.getMachineName(), newDate);476 ImageFile localImageFile = new ImageFile(profile.getRepository(), config.getMachineName(), newDate);
466 477
467 if (lastLocalImageFileUpdate == null || localNewestImageFile == null || localNewestImageFile.getLastUpdate().after(lastLocalImageFileUpdate)) {478 if (lastLocalImageFileUpdate == null || localNewestImageFile == null || localNewestImageFile.getLastUpdate().after(lastLocalImageFileUpdate)) {
468 // If 'No Image' is selected, OR (!) if the local image file is not there479 // If 'No Image' is selected, OR (!) if the local image file is not there
469 if (config.getUserImageType() == Config.UserImageType.None480 if (config.getUserImageType() == Config.UserImageType.None
470 || config.getUserImageFile() == null || !config.getUserImageFile().exists()) {481 || config.getUserImageFile() == null || !config.getUserImageFile().exists()) {
471482
472 if (localNewestImageFile != null) {483 if (localNewestImageFile != null) {
473 transfer.delete(localNewestImageFile);484 transfer.delete(localNewestImageFile);
474 }485 }
475486
476 lastLocalImageFileUpdate = new Date();487 lastLocalImageFileUpdate = new Date();
477 } else {488 } else {
478 try {489 try {
479 File originalImageFile = null;490 File originalImageFile = null;
480491
481 if (config.getUserImageType() == Config.UserImageType.System) {492 if (config.getUserImageType() == Config.UserImageType.System) {
482 originalImageFile = config.getCache().createTempFile("image-" + config.getMachineName());493 originalImageFile = config.getCache().createTempFile("image-" + config.getMachineName());
483 Image image = ImageUtil.getScaledImage(config.getUserImage(), Constants.PROFILE_IMAGE_MAX_WIDTH, Constants.PROFILE_IMAGE_MAX_HEIGHT);494 Image image = ImageUtil.getScaledImage(config.getUserImage(), Constants.PROFILE_IMAGE_MAX_WIDTH, Constants.PROFILE_IMAGE_MAX_HEIGHT);
484 ImageIO.write(ImageUtil.toBufferedImage(image), "png", originalImageFile);495 ImageIO.write(ImageUtil.toBufferedImage(image), "png", originalImageFile);
485 }496 }
486 else if (config.getUserImageType() == Config.UserImageType.Other) {497 else if (config.getUserImageType() == Config.UserImageType.Other) {
487 originalImageFile = config.getUserImageFile();498 originalImageFile = config.getUserImageFile();
488 }499 }
489500
490 // TODO encrypt501 // TODO encrypt
491502
492 Date newDate = new Date();503 Date newDate = new Date();
493 transfer.upload(originalImageFile, new ImageFile(profile.getRepository(), config.getMachineName(), newDate));504 transfer.upload(originalImageFile, new ImageFile(profile.getRepository(), config.getMachineName(), newDate));
494505
495 // Update cached value506 // Update cached value
496 lastLocalImageFileUpdate = newDate;507 lastLocalImageFileUpdate = newDate;
497 } catch (IOException e) {508 } catch (IOException e) {
498 // TODO do something509 // TODO do something
499 logger.log(Level.WARNING, "Error while uploading local image.", e);510 logger.log(Level.WARNING, "Error while uploading local image.", e);
500 }511 }
501 }512 }
502 }*/513 }*/
503 }514 }
504 515
505 private void updateRemoteImages() {516 private void updateRemoteImages() {
506 // Download new user images (if changed)517 // Download new user images (if changed)
507 Map<String, ImageFile> remoteImageFiles = fileList.getRemoteImageFiles();518 Map<String, ImageFile> remoteImageFiles = fileList.getRemoteImageFiles();
@@ -513,11 +524,11 @@
513 if (client.getLastImageUpdate() != null && !f.getLastUpdate().after(client.getLastImageUpdate())) {524 if (client.getLastImageUpdate() != null && !f.getLastUpdate().after(client.getLastImageUpdate())) {
514 continue;525 continue;
515 }526 }
516 527
517 if (logger.isLoggable(Level.INFO)) {528 if (logger.isLoggable(Level.INFO)) {
518 logger.log(Level.INFO, "Downloading image of client ''{0}'' ...", client.getMachineName());529 logger.log(Level.INFO, "Downloading image of client ''{0}'' ...", client.getMachineName());
519 }530 }
520 531
521 // Download 532 // Download
522 try {533 try {
523 File tempRemoteImage = config.getCache().createTempFile(f.getName());534 File tempRemoteImage = config.getCache().createTempFile(f.getName());
@@ -530,8 +541,7 @@
530 // Apply and persist541 // Apply and persist
531 client.setLastImageUpdate(new Date());542 client.setLastImageUpdate(new Date());
532 client.merge();543 client.merge();
533 }544 } catch (Exception e) {
534 catch (Exception e) {
535 if (logger.isLoggable(Level.SEVERE)) {545 if (logger.isLoggable(Level.SEVERE)) {
536 logger.log(Level.SEVERE, "ERROR while downloading remote image of " + client.getMachineName() + ".", e);546 logger.log(Level.SEVERE, "ERROR while downloading remote image of " + client.getMachineName() + ".", e);
537 }547 }
@@ -541,47 +551,60 @@
541551
542 private void deleteOldUpdateFiles() {552 private void deleteOldUpdateFiles() {
543 TreeMap<Long, UpdateFile> localUpdatesMap = fileList.getLocalUpdateFiles();553 TreeMap<Long, UpdateFile> localUpdatesMap = fileList.getLocalUpdateFiles();
544 554
545 while (localUpdatesMap.size() > 1) {555 while (localUpdatesMap.size() > 1) {
546 Entry<Long, UpdateFile> firstEntry = localUpdatesMap.pollFirstEntry(); 556 Entry<Long, UpdateFile> firstEntry = localUpdatesMap.pollFirstEntry();
547557
548 try {558 try {
549 transfer.delete(firstEntry.getValue()); 559 transfer.delete(firstEntry.getValue());
550 }560 } catch (Exception e) {
551 catch (Exception e) {
552 logger.log(Level.WARNING, "Could not delete old update file", e);561 logger.log(Level.WARNING, "Could not delete old update file", e);
553 }562 }
554 }563 }
555 }564 }
556 565
557 private void deleteOldProfileFiles() {566 private void deleteOldProfileFiles() {
558 TreeMap<Long, ProfileFile> localUpdatesMap = fileList.getLocalProfileFiles();567 TreeMap<Long, ProfileFile> localUpdatesMap = fileList.getLocalProfileFiles();
559 568
560 while (localUpdatesMap.size() > 1) {569 while (localUpdatesMap.size() > 1) {
561 Entry<Long, ProfileFile> firstEntry = localUpdatesMap.pollFirstEntry(); 570 Entry<Long, ProfileFile> firstEntry = localUpdatesMap.pollFirstEntry();
562571
563 try {572 try {
564 transfer.delete(firstEntry.getValue()); 573 transfer.delete(firstEntry.getValue());
565 }574 } catch (Exception e) {
566 catch (Exception e) {
567 logger.log(Level.WARNING, "Could not delete old profile file", e);575 logger.log(Level.WARNING, "Could not delete old profile file", e);
568 }576 }
569 }577 }
570 }578 }
571 579
572 private void deleteOldImageFiles() {580 private void deleteOldImageFiles() {
573 TreeMap<Long, ImageFile> localUpdatesMap = fileList.getLocalImageFiles();581 TreeMap<Long, ImageFile> localUpdatesMap = fileList.getLocalImageFiles();
574 582
575 while (localUpdatesMap.size() > 1) {583 while (localUpdatesMap.size() > 1) {
576 Entry<Long, ImageFile> firstEntry = localUpdatesMap.pollFirstEntry(); 584 Entry<Long, ImageFile> firstEntry = localUpdatesMap.pollFirstEntry();
577585
578 try {586 try {
579 transfer.delete(firstEntry.getValue()); 587 transfer.delete(firstEntry.getValue());
580 }588 } catch (Exception e) {
581 catch (Exception e) {
582 logger.log(Level.WARNING, "Could not delete old image file", e);589 logger.log(Level.WARNING, "Could not delete old image file", e);
583 }590 }
584 }591 }
585 }592 }
586593
594 @Override
595 public void load(ConfigNode node) throws ConfigException {
596 if (node != null) {
597 ConfigNode remote = node.findChildByName("remote");
598 Integer inter = remote.getInteger("interval");
599 if (inter != null) {
600 interval = inter;
601 }
602 }
603 }
604
605 @Override
606 public void save(ConfigNode node) {
607 ConfigNode remote = node.findOrCreateChildByXpath("remote", "remote");
608 remote.setProperty("interval", interval);
609 }
587}610}