2 Updated, 3 new patches.
[webos-internals:modifications.git] / contacts / contacts-add-sync-now.patch
1 diff --git a/usr/palm/applications/com.palm.app.contacts/app/controllers/list-assistant.js b/usr/palm/applications/com.palm.app.contacts/app/controllers/list-assistant.js
2 index fbb9529..09da0b4 100644
3 --- a/usr/palm/applications/com.palm.app.contacts/app/controllers/list-assistant.js
4 +++ b/usr/palm/applications/com.palm.app.contacts/app/controllers/list-assistant.js
5 @@ -285,6 +285,9 @@ ListAssistant = Class.create(App.Scene,{
6                                 omitDefaultItems: true
7                         }, {
8                                 items: [Mojo.Menu.editItem,{
9 +                                       label:$L("Sync Now"),
10 +                                       command:"syncnow"
11 +                               }, {
12                                         label:$L("Send All to Car Kit"),
13                                         command:"sendcontacts"
14                                 }, prefsItem, {
15 @@ -462,6 +465,8 @@ ListAssistant = Class.create(App.Scene,{
16                                 newContact: true,
17                                 onSaveCallback: this.dataSource.doUpdate.bind(this.dataSource)
18                         });
19 +               }else if (event.type == Mojo.Event.command && event.command == "syncnow") {
20 +                       this.syncAccounts();
21                 }else if (event.type == Mojo.Event.command && event.command === Mojo.Menu.prefsCmd) {
22                         this.controller.stageController.pushScene('prefs');
23                 }else if (event.type == Mojo.Event.command && event.command == "sendcontacts") {
24 @@ -691,6 +696,14 @@ ListAssistant = Class.create(App.Scene,{
25                                         
26                                 }.bind(this)
27                         });
28 +       },
29 +       
30 +       syncAccounts: function() {
31 +               AppAssistant.pimSyncService.syncAll(this.controller, this.easAccounts, this.showSyncing.bind(this));
32 +       },
33 +       
34 +       showSyncing: function() {
35 +               this.controller.showBanner($L("Syncing Accounts..."), {});
36         }
37         
38