rhodes 2.2.3 → 2.2.4.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/CHANGELOG +13 -0
  2. data/Rakefile +1 -1
  3. data/bin/c2dm.rb +59 -0
  4. data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +4 -0
  5. data/lib/framework/rho/rho.rb +2 -0
  6. data/lib/framework/rho/rhoapplication.rb +1 -0
  7. data/lib/framework/rhodes.rb +1 -1
  8. data/lib/framework/version.rb +1 -1
  9. data/lib/rhodes.rb +1 -1
  10. data/platform/android/Rhodes/AndroidManifest.xml +1 -1
  11. data/platform/android/Rhodes/jni/src/callbacks.cpp +21 -0
  12. data/platform/android/Rhodes/jni/src/nativebar.cpp +4 -0
  13. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoActivity.java +3 -1
  14. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +68 -7
  15. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +113 -10
  16. data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +34 -3
  17. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +21 -17
  18. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +29 -5
  19. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +7 -0
  20. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/ExternalHttpHandler.java +37 -0
  21. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +0 -1
  22. data/platform/android/build/RhodesSRC_build.files +24 -23
  23. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +6 -0
  24. data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +42 -20
  25. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +111 -19
  26. data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +2 -0
  27. data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +2 -1
  28. data/platform/bb/RubyVM/src/com/rho/net/URI.java +80 -0
  29. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +21 -1
  30. data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +6 -1
  31. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +139 -46
  32. data/platform/bb/build/bb.rake +8 -3
  33. data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +32 -21
  34. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +31 -14
  35. data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +3 -2
  36. data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +3 -2
  37. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +28 -0
  38. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +111 -26
  39. data/platform/iphone/Classes/AppManager/AppManager.m +22 -0
  40. data/platform/iphone/Classes/DateTimePickerDelegate.m +3 -0
  41. data/platform/iphone/Classes/MapView/MapViewController.h +8 -3
  42. data/platform/iphone/Classes/MapView/MapViewController.m +63 -12
  43. data/platform/iphone/Classes/NativeBar.h +4 -3
  44. data/platform/iphone/Classes/NativeBar.m +28 -1
  45. data/platform/iphone/Classes/Rhodes.m +87 -20
  46. data/platform/iphone/Classes/Signature/SignatureView.m +16 -10
  47. data/platform/iphone/Classes/Signature/SignatureViewController.m +2 -0
  48. data/platform/iphone/Classes/SimpleMainView.h +2 -0
  49. data/platform/iphone/Classes/SimpleMainView.m +120 -35
  50. data/platform/iphone/Classes/SplashViewController.h +8 -1
  51. data/platform/iphone/Classes/SplashViewController.m +233 -11
  52. data/platform/iphone/Classes/SplitView/LeftViewController.h +30 -0
  53. data/platform/iphone/Classes/SplitView/LeftViewController.m +189 -0
  54. data/platform/iphone/Classes/SplitView/RightViewController.h +54 -0
  55. data/platform/iphone/Classes/SplitView/RightViewController.m +268 -0
  56. data/platform/iphone/Classes/SplitView/SplitViewDelegate.h +22 -0
  57. data/platform/iphone/Classes/SplitView/SplitViewDelegate.m +92 -0
  58. data/platform/iphone/Classes/SplitView/SplittedMainView.h +65 -0
  59. data/platform/iphone/Classes/SplitView/SplittedMainView.m +304 -0
  60. data/platform/iphone/Classes/TabbedMainView.m +23 -6
  61. data/platform/iphone/Classes/WebView.m +1 -1
  62. data/platform/iphone/Info.plist +11 -2
  63. data/platform/iphone/rbuild/iphone.rake +80 -3
  64. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +50 -3
  65. data/platform/shared/common/RhoConf.cpp +5 -5
  66. data/platform/shared/db/DBAdapter.cpp +81 -3
  67. data/platform/shared/db/DBAdapter.h +1 -0
  68. data/platform/shared/json/JSONIterator.cpp +5 -0
  69. data/platform/shared/json/JSONIterator.h +1 -0
  70. data/platform/shared/net/CURLNetRequest.cpp +2 -2
  71. data/platform/shared/net/URI.cpp +53 -0
  72. data/platform/shared/net/URI.h +5 -1
  73. data/platform/shared/ruby/ext/system/system.i +9 -1
  74. data/platform/shared/ruby/ext/system/system_wrap.c +2632 -2574
  75. data/platform/shared/ruby/win32/win32.c +2 -0
  76. data/platform/shared/ruby/wince/direct.c +4 -0
  77. data/platform/shared/sync/SyncEngine.cpp +20 -1
  78. data/platform/shared/sync/SyncEngine.h +6 -1
  79. data/platform/shared/sync/SyncNotify.cpp +6 -1
  80. data/platform/shared/sync/SyncSource.cpp +130 -74
  81. data/platform/shared/sync/SyncSource.h +3 -1
  82. data/platform/wm/rhodes.sln +30 -22
  83. data/platform/wm/rhodes/Alert.cpp +4 -3
  84. data/platform/wm/rhodes/MainWindow.cpp +73 -20
  85. data/platform/wm/rhodes/RingtoneManager.cpp +4 -4
  86. data/platform/wm/rhodes/RingtoneManager.h +2 -1
  87. data/platform/wm/rhodes/Vibrate.cpp +1 -2
  88. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +37 -0
  89. data/platform/wm/rhodes/rhodes.vcproj +219 -5
  90. data/platform/wm/rhodes/stdafx.h +1 -0
  91. data/platform/wm/rubylib/rubylib.vcproj +10 -8
  92. data/platform/wm/sqlite3/sqlite3.vcproj +6 -4
  93. data/platform/wm/syncengine/syncengine.vcproj +7 -5
  94. data/platform/wm/tcmalloc/tcmalloc.vcproj +11 -8
  95. data/rakefile.rb +1 -1
  96. data/res/generators/templates/application/public/jqtouch/jqtouch.js +9 -1
  97. data/rhodes.gemspec +1 -1
  98. data/spec/phone_spec/app/spec/bulksync_spec.rb +71 -1
  99. metadata +17 -5
@@ -57,37 +57,52 @@
57
57
  @synthesize tabbar, tabbarData, tabindex;
58
58
 
59
59
  - (id)initWithMainView:(id<RhoMainView>)v parent:(UIWindow*)p tabs:(NSArray *)items {
60
+ [SimpleMainView disableHiddenOnStart];
60
61
  CGRect frame = [[v view] frame];
61
62
 
63
+
62
64
  tabbar = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
63
65
  tabbar.delegate = [Rhodes sharedInstance];
64
66
  tabbar.view.frame = frame;
65
67
  tabbar.selectedIndex = 0;
68
+ //tabbar.tabBar.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
69
+ //tabbar.tabBar.autoresizesSubviews = YES;
70
+
66
71
 
67
- CGRect childFrame = frame;
72
+ CGRect childFrame = [[v view] bounds];
73
+ childFrame.origin.x = 0;
74
+ childFrame.origin.y = 0;
68
75
  CGRect tbFrame = tabbar.tabBar.frame;
69
- childFrame.size.height -= tbFrame.size.height;
70
-
71
- int count = [items count]/4;
76
+ UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
77
+ //if ((orientation == UIInterfaceOrientationLandscapeLeft)) {
78
+ //childFrame.size.width -= tbFrame.size.height;
79
+ //}
80
+ //else {
81
+ childFrame.size.height -= tbFrame.size.height;
82
+ //}
83
+ int count = [items count]/5;
72
84
  NSMutableArray *views = [NSMutableArray arrayWithCapacity:count];
73
85
  NSMutableArray *tabs = [[NSMutableArray alloc] initWithCapacity:count];
74
86
 
75
87
  NSString *initUrl = nil;
76
88
 
77
89
  for (int i = 0; i < count; ++i) {
78
- int index = i*4 - 1;
90
+ int index = i*5 - 1;
79
91
  NSString *label = [items objectAtIndex:++index];
80
92
  NSString *url = [items objectAtIndex:++index];
81
93
  NSString *icon = [items objectAtIndex:++index];
82
94
  NSString *reload = [items objectAtIndex:++index];
95
+ NSString *colored_icon = [items objectAtIndex:++index];
83
96
 
97
+ colored_icon = nil;
98
+
84
99
  if (!initUrl)
85
100
  initUrl = url;
86
101
 
87
102
  if (label && url && icon) {
88
103
  RhoTabBarData *td = [[RhoTabBarData alloc] init];
89
104
  td.url = url;
90
- td.reload = [reload isEqualToString:@"true"];
105
+ td.reload = [reload isEqualToString:@"true"];
91
106
 
92
107
  SimpleMainView *subController = [[SimpleMainView alloc] initWithParentView:tabbar.view frame:childFrame];
93
108
  subController.title = label;
@@ -105,6 +120,8 @@
105
120
  tabbar.viewControllers = views;
106
121
  tabbar.customizableViewControllers = NO;
107
122
  tabbar.view.hidden = NO;
123
+ tabbar.view.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
124
+ tabbar.view.autoresizesSubviews = YES;
108
125
 
109
126
  self.tabbarData = tabs;
110
127
  [tabs release];
@@ -32,7 +32,7 @@ static int getIndex(NSValue *value)
32
32
  // Workaround:
33
33
  // Navigation MUST be done through 'redirect_to' - otherwise WebView does not
34
34
  // perform actual url loading from time to time
35
- [[Rhodes sharedInstance] hideSplash];
35
+ //[[Rhodes sharedInstance] hideSplash];
36
36
  int index = getIndex(value);
37
37
  [[[Rhodes sharedInstance] mainView] navigateRedirect:url tab:index];
38
38
  }
@@ -17,7 +17,7 @@
17
17
  <string>icon114.png</string>
18
18
  </array>
19
19
  <key>CFBundleIdentifier</key>
20
- <string>com.rhomobile.brian</string>
20
+ <string>com.rhomobile.rhosyncclient</string>
21
21
  <key>CFBundleInfoDictionaryVersion</key>
22
22
  <string>6.0</string>
23
23
  <key>CFBundleName</key>
@@ -27,8 +27,17 @@
27
27
  <key>CFBundleSignature</key>
28
28
  <string>????</string>
29
29
  <key>CFBundleVersion</key>
30
- <string>2.2.3</string>
30
+ <string>2.2.4</string>
31
31
  <key>LSRequiresIPhoneOS</key>
32
32
  <true/>
33
+ <key>UILaunchImageFile</key>
34
+ <string>Default</string>
35
+ <key>UISupportedInterfaceOrientations</key>
36
+ <array>
37
+ <string>UIInterfaceOrientationPortrait</string>
38
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
39
+ <string>UIInterfaceOrientationLandscapeLeft</string>
40
+ <string>UIInterfaceOrientationLandscapeRight</string>
41
+ </array>
33
42
  </dict>
34
43
  </plist>
@@ -52,9 +52,49 @@ def set_app_icon
52
52
  rescue => e
53
53
  puts "WARNING!!! Can not change icon: #{e.to_s}"
54
54
  end
55
+ end
56
+
57
+ LOADINGIMAGES = ['loading', 'loading@2x', 'loading-Portrait', 'loading-PortraitUpsideDown', 'loading-Landscape', 'loading-LadscapeLeft', 'loading-LandscapeRight']
55
58
 
59
+ def restore_default_images
60
+ puts "restore_default_images"
61
+ ipath = $config["build"]["iphonepath"]
62
+ LOADINGIMAGES.each do |name|
63
+ defname = name.sub('loading', 'Default')
64
+ ibak = File.join(ipath, defname + '.bak')
65
+ imag = File.join(ipath, defname + '.png')
66
+ rm_f imag
67
+ next if !File.exists? ibak
68
+ rm_f imag
69
+ cp ibak, imag
70
+ rm_f ibak
71
+ end
72
+ end
73
+
74
+ def set_default_images
75
+ puts "set_default_images"
76
+ ipath = $config["build"]["iphonepath"]
77
+ begin
78
+ LOADINGIMAGES.each do |name|
79
+ defname = name.sub('loading', 'Default')
80
+ ibak = File.join(ipath, defname + '.bak')
81
+ imag = File.join(ipath, defname + '.png')
82
+ appimage = File.join($app_path, 'app', name + '.png')
83
+ if File.exists? imag
84
+ cp imag, ibak unless File.exists? ibak
85
+ end
86
+ #bundlei = File.join($srcdir, defname + '.png')
87
+ #cp appimage, bundlei unless !File.exist? appimage
88
+ cp appimage, imag unless !File.exists? appimage
89
+ end
90
+ rescue => e
91
+ puts "WARNING!!! Can not change default image: #{e.to_s}"
92
+ end
56
93
  end
57
94
 
95
+
96
+
97
+
58
98
  def set_signing_identity(identity,profile,entitlements)
59
99
  fname = $config["build"]["iphonepath"] + "/rhorunner.xcodeproj/project.pbxproj"
60
100
  buf = ""
@@ -229,6 +269,7 @@ namespace "build" do
229
269
 
230
270
  set_app_name($app_config["name"]) unless $app_config["name"].nil?
231
271
  set_app_icon
272
+ set_default_images
232
273
 
233
274
  set_signing_identity($signidentity,$provisionprofile,$entitlements.to_s) if $signidentity.to_s != ""
234
275
 
@@ -239,7 +280,9 @@ namespace "build" do
239
280
  ret = $?
240
281
 
241
282
  chdir $startdir
283
+
242
284
  set_app_name("Rhodes") unless $app_config["name"].nil?
285
+ restore_default_images
243
286
  restore_app_icon
244
287
 
245
288
  unless ret == 0
@@ -394,7 +437,7 @@ namespace "run" do
394
437
  elements << e
395
438
 
396
439
  File.open(xmlplist, 'w') do |f|
397
- f.puts "<?xml version=\"1.0\" encoding=\"UTF-8'\"?>"
440
+ f.puts "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
398
441
  f.puts "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"
399
442
  f.puts "<plist version=\"1.0\">"
400
443
  f.puts "<dict>"
@@ -502,6 +545,10 @@ namespace "clean" do
502
545
  namespace "iphone" do
503
546
  # desc "Clean rhodes binaries"
504
547
  task :rhodes => ["config:iphone"] do
548
+
549
+ app_path = File.join($app_path, 'bin', 'target', 'iOS')
550
+ rm_rf app_path
551
+
505
552
  chdir $config["build"]["iphonepath"]
506
553
 
507
554
  args = ['clean', '-target', 'rhorunner', '-configuration', $configuration, '-sdk', $sdk]
@@ -538,7 +585,7 @@ namespace "clean" do
538
585
  end
539
586
  end
540
587
  end
541
-
588
+
542
589
  # desc "Clean rhobundle"
543
590
  task :rhobundle => ["config:iphone"] do
544
591
  rm_rf $bindir
@@ -548,10 +595,40 @@ namespace "clean" do
548
595
  end
549
596
  end
550
597
 
598
+
599
+
600
+
551
601
  namespace "device" do
552
602
  namespace "iphone" do
553
603
  desc "Builds and signs iphone for production"
554
- task :production => ["config:iphone", "build:iphone:rhodes"]
604
+ task :production => ["config:iphone", "build:iphone:rhodes"] do
605
+
606
+ #copy build results to app folder
607
+
608
+ app_path = File.join($app_path, 'bin', 'target', 'iOS', $sdk)
609
+
610
+ iphone_path = $config["build"]["iphonepath"]
611
+ if $sdk =~ /iphonesimulator/
612
+ iphone_path = File.join(iphone_path, 'build', $configuration+'-iphonesimulator')
613
+ else
614
+ iphone_path = File.join(iphone_path, 'build', $configuration+'-iphoneos')
615
+ end
616
+ appname = $app_config["name"]
617
+ if appname == nil
618
+ appname = 'rhorunner'
619
+ end
620
+ src_file = File.join(iphone_path, 'rhorunner.app')
621
+ dst_file = File.join(app_path, appname+'.app')
622
+
623
+ rm_rf dst_file
624
+ rm_rf app_path
625
+
626
+ mkdir_p app_path
627
+
628
+ puts 'copy result build package to application target folder ...'
629
+ cp_r src_file, dst_file
630
+
631
+ end
555
632
  end
556
633
 
557
634
  end
@@ -71,6 +71,10 @@
71
71
  FA291E9811FF2EF70096AC39 /* SignatureDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FA291E9511FF2EF70096AC39 /* SignatureDelegate.m */; };
72
72
  FA291E9911FF2EF70096AC39 /* SignatureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FA291E9711FF2EF70096AC39 /* SignatureViewController.m */; };
73
73
  FA4981B511FFC53C00488CB2 /* SignatureView.m in Sources */ = {isa = PBXBuildFile; fileRef = FA4981B411FFC53C00488CB2 /* SignatureView.m */; };
74
+ FACA4C781270AC0900777CFF /* LeftViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA4C711270AC0900777CFF /* LeftViewController.m */; };
75
+ FACA4C791270AC0900777CFF /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA4C731270AC0900777CFF /* RightViewController.m */; };
76
+ FACA4C7A1270AC0900777CFF /* SplittedMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA4C751270AC0900777CFF /* SplittedMainView.m */; };
77
+ FACA4C7B1270AC0900777CFF /* SplitViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA4C771270AC0900777CFF /* SplitViewDelegate.m */; };
74
78
  FACC20CA123A60F40088A447 /* Bluetooth.m in Sources */ = {isa = PBXBuildFile; fileRef = FACC20C9123A60F40088A447 /* Bluetooth.m */; };
75
79
  FACC2100123A759A0088A447 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FACC20FF123A759A0088A447 /* GameKit.framework */; };
76
80
  FAD45E8E122566CB00141873 /* RhoNativeViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAD45E8D122566CB00141873 /* RhoNativeViewManager.mm */; };
@@ -249,6 +253,14 @@
249
253
  FA291E9711FF2EF70096AC39 /* SignatureViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureViewController.m; path = Signature/SignatureViewController.m; sourceTree = "<group>"; };
250
254
  FA4981B311FFC53C00488CB2 /* SignatureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignatureView.h; path = Signature/SignatureView.h; sourceTree = "<group>"; };
251
255
  FA4981B411FFC53C00488CB2 /* SignatureView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureView.m; path = Signature/SignatureView.m; sourceTree = "<group>"; };
256
+ FACA4C701270AC0900777CFF /* LeftViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LeftViewController.h; path = SplitView/LeftViewController.h; sourceTree = "<group>"; };
257
+ FACA4C711270AC0900777CFF /* LeftViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LeftViewController.m; path = SplitView/LeftViewController.m; sourceTree = "<group>"; };
258
+ FACA4C721270AC0900777CFF /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RightViewController.h; path = SplitView/RightViewController.h; sourceTree = "<group>"; };
259
+ FACA4C731270AC0900777CFF /* RightViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RightViewController.m; path = SplitView/RightViewController.m; sourceTree = "<group>"; };
260
+ FACA4C741270AC0900777CFF /* SplittedMainView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SplittedMainView.h; path = SplitView/SplittedMainView.h; sourceTree = "<group>"; };
261
+ FACA4C751270AC0900777CFF /* SplittedMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SplittedMainView.m; path = SplitView/SplittedMainView.m; sourceTree = "<group>"; };
262
+ FACA4C761270AC0900777CFF /* SplitViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SplitViewDelegate.h; path = SplitView/SplitViewDelegate.h; sourceTree = "<group>"; };
263
+ FACA4C771270AC0900777CFF /* SplitViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SplitViewDelegate.m; path = SplitView/SplitViewDelegate.m; sourceTree = "<group>"; };
252
264
  FACC20C8123A60F40088A447 /* Bluetooth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bluetooth.h; path = Bluetooth/Bluetooth.h; sourceTree = "<group>"; };
253
265
  FACC20C9123A60F40088A447 /* Bluetooth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Bluetooth.m; path = Bluetooth/Bluetooth.m; sourceTree = "<group>"; };
254
266
  FACC20FF123A759A0088A447 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
@@ -508,6 +520,7 @@
508
520
  BDB3735D11441FE0006EA6DA /* MainView */ = {
509
521
  isa = PBXGroup;
510
522
  children = (
523
+ FACA4C6E1270ABCD00777CFF /* SplitView */,
511
524
  BDB37363114420DE006EA6DA /* RhoMainView.h */,
512
525
  BDB373641144220F006EA6DA /* SimpleMainView.h */,
513
526
  BDB373651144220F006EA6DA /* SimpleMainView.m */,
@@ -628,6 +641,21 @@
628
641
  name = Signature;
629
642
  sourceTree = "<group>";
630
643
  };
644
+ FACA4C6E1270ABCD00777CFF /* SplitView */ = {
645
+ isa = PBXGroup;
646
+ children = (
647
+ FACA4C701270AC0900777CFF /* LeftViewController.h */,
648
+ FACA4C711270AC0900777CFF /* LeftViewController.m */,
649
+ FACA4C721270AC0900777CFF /* RightViewController.h */,
650
+ FACA4C731270AC0900777CFF /* RightViewController.m */,
651
+ FACA4C741270AC0900777CFF /* SplittedMainView.h */,
652
+ FACA4C751270AC0900777CFF /* SplittedMainView.m */,
653
+ FACA4C761270AC0900777CFF /* SplitViewDelegate.h */,
654
+ FACA4C771270AC0900777CFF /* SplitViewDelegate.m */,
655
+ );
656
+ name = SplitView;
657
+ sourceTree = "<group>";
658
+ };
631
659
  FACC20C4123A60800088A447 /* Bluetooth */ = {
632
660
  isa = PBXGroup;
633
661
  children = (
@@ -646,6 +674,7 @@
646
674
  buildPhases = (
647
675
  5C0442920EFBE79D0014E5C6 /* Create RhoBundle */,
648
676
  BD4D7DCE10AE2DA4003DCE59 /* Copy RhoBundle */,
677
+ FA4207711277930A00BDE415 /* Copy Loading images */,
649
678
  BDFBD98F10B1B98100BAAFAB /* Resources */,
650
679
  5C61F2BD1022321A0013E321 /* Move alerts to root of app */,
651
680
  1D60588E0D05DD3D006BFB54 /* Sources */,
@@ -824,6 +853,20 @@
824
853
  shellPath = /bin/sh;
825
854
  shellScript = "RHO_SOURCE_DIR=${TARGET_BUILD_DIR}/../../bin/RhoBundle\nRHO_TARGET_DIR=${TARGET_BUILD_DIR}/${TARGET_NAME}.app\necho \"Create dir $RHO_TARGET_DIR\"\nmkdir -p ${RHO_TARGET_DIR}\nfor i in `ls -1 ${RHO_SOURCE_DIR}`\ndo\n echo \"rm -Rf $RHO_TARGET_DIR/$i\"\n rm -Rf ${RHO_TARGET_DIR}/$i\ndone\necho \"cp -Rf $RHO_SOURCE_DIR/* $RHO_TARGET_DIR\"\ncp -Rf ${RHO_SOURCE_DIR}/* ${RHO_TARGET_DIR}";
826
855
  };
856
+ FA4207711277930A00BDE415 /* Copy Loading images */ = {
857
+ isa = PBXShellScriptBuildPhase;
858
+ buildActionMask = 2147483647;
859
+ files = (
860
+ );
861
+ inputPaths = (
862
+ );
863
+ name = "Copy Loading images";
864
+ outputPaths = (
865
+ );
866
+ runOnlyForDeploymentPostprocessing = 0;
867
+ shellPath = /bin/sh;
868
+ shellScript = "RHO_SOURCE_DIR=${TARGET_BUILD_DIR}/../..\nRHO_TARGET_DIR=${TARGET_BUILD_DIR}/${TARGET_NAME}.app\necho \"Create dir $RHO_TARGET_DIR\"\nmkdir -p ${RHO_TARGET_DIR}\n\nif [ -e ${RHO_SOURCE_DIR}/Default.png ]; then\necho \"cp -Rf ${RHO_SOURCE_DIR}/Default.png ${RHO_TARGET_DIR}\"\ncp -Rf ${RHO_SOURCE_DIR}/Default.png ${RHO_TARGET_DIR}\nfi\n\nif [ -e ${RHO_SOURCE_DIR}/Default@2x.png ]; then\necho \"cp -Rf ${RHO_SOURCE_DIR}/Default@2x.png ${RHO_TARGET_DIR}\"\ncp -Rf ${RHO_SOURCE_DIR}/Default@2x.png ${RHO_TARGET_DIR}\nfi\n\nif [ -e ${RHO_SOURCE_DIR}/Default-Portrait.png ]; then\necho \"cp -Rf ${RHO_SOURCE_DIR}/Default-Portrait.png ${RHO_TARGET_DIR}\"\ncp -Rf ${RHO_SOURCE_DIR}/Default-Portrait.png ${RHO_TARGET_DIR}\nfi\n\nif [ -e ${RHO_SOURCE_DIR}/Default-PortraitUpsideDown.png ]; then\necho \"cp -Rf ${RHO_SOURCE_DIR}/Default-PortraitUpsideDown.png ${RHO_TARGET_DIR}\"\ncp -Rf ${RHO_SOURCE_DIR}/Default-PortraitUpsideDown.png ${RHO_TARGET_DIR}\nfi\n\nif [ -e ${RHO_SOURCE_DIR}/Default-Landscape.png ]; then\necho \"cp -Rf ${RHO_SOURCE_DIR}/Default-Landscape.png ${RHO_TARGET_DIR}\"\ncp -Rf ${RHO_SOURCE_DIR}/Default-Landscape.png ${RHO_TARGET_DIR}\nfi\n\nif [ -e ${RHO_SOURCE_DIR}/Default-LandscapeLeft.png ]; then\necho \"cp -Rf ${RHO_SOURCE_DIR}/Default-LandscapeLeft.png ${RHO_TARGET_DIR}\"\ncp -Rf ${RHO_SOURCE_DIR}/Default-LandscapeLeft.png ${RHO_TARGET_DIR}\nfi\n\nif [ -e ${RHO_SOURCE_DIR}/Default-LandscapeRight.png ]; then\necho \"cp -Rf ${RHO_SOURCE_DIR}/Default-LandscapeRight.png ${RHO_TARGET_DIR}\"\ncp -Rf ${RHO_SOURCE_DIR}/Default-LandscapeRight.png ${RHO_TARGET_DIR}\nfi";
869
+ };
827
870
  /* End PBXShellScriptBuildPhase section */
828
871
 
829
872
  /* Begin PBXSourcesBuildPhase section */
@@ -869,6 +912,10 @@
869
912
  BD6A622A123E46BB0093E03C /* RhoViewController.m in Sources */,
870
913
  FACC20CA123A60F40088A447 /* Bluetooth.m in Sources */,
871
914
  BD486F59124FB66600F8A93F /* Event.m in Sources */,
915
+ FACA4C781270AC0900777CFF /* LeftViewController.m in Sources */,
916
+ FACA4C791270AC0900777CFF /* RightViewController.m in Sources */,
917
+ FACA4C7A1270AC0900777CFF /* SplittedMainView.m in Sources */,
918
+ FACA4C7B1270AC0900777CFF /* SplitViewDelegate.m in Sources */,
872
919
  );
873
920
  runOnlyForDeploymentPostprocessing = 0;
874
921
  };
@@ -928,7 +975,7 @@
928
975
  PRODUCT_NAME = rhorunner;
929
976
  PROVISIONING_PROFILE = "";
930
977
  "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
931
- SDKROOT = iphonesimulator4.0;
978
+ SDKROOT = iphoneos4.1;
932
979
  STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic;
933
980
  TARGETED_DEVICE_FAMILY = "1,2";
934
981
  USER_HEADER_SEARCH_PATHS = "../shared/ruby/iphone ../shared/ruby/include ../shared/curl/include ../shared/ ../shared/syncengine ../shared/logging ../shared/common rhoextlib";
@@ -960,7 +1007,7 @@
960
1007
  PRODUCT_NAME = rhorunner;
961
1008
  PROVISIONING_PROFILE = "";
962
1009
  "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
963
- SDKROOT = iphoneos4.0;
1010
+ SDKROOT = iphoneos4.1;
964
1011
  TARGETED_DEVICE_FAMILY = "1,2";
965
1012
  USER_HEADER_SEARCH_PATHS = "../shared/ruby/iphone ../shared/ruby/include ../shared/curl/include ../shared/ ../shared/syncengine ../shared/logging ../shared/common rhoextlib";
966
1013
  };
@@ -1019,7 +1066,7 @@
1019
1066
  OTHER_CFLAGS = "";
1020
1067
  OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
1021
1068
  PRODUCT_NAME = rhorunner;
1022
- SDKROOT = iphoneos4.0;
1069
+ SDKROOT = iphoneos4.1;
1023
1070
  TARGETED_DEVICE_FAMILY = "1,2";
1024
1071
  USER_HEADER_SEARCH_PATHS = "../shared/ruby/iphone ../shared/ruby/include ../shared/curl/include ../shared/ ../shared/syncengine ../shared/logging ../shared/common rhoextlib";
1025
1072
  };
@@ -44,11 +44,11 @@ void RhoSettings::loadFromString(const char* szSettings)
44
44
  int len = 0;
45
45
 
46
46
  const char* end = strchr(start,'\n');
47
- if (end){
48
- if ( end > start && *(end-1) == '\r' )
49
- len = end-start-1;
50
- else
51
- len = end-start;
47
+ if (end)
48
+ {
49
+ len = end-start;
50
+ while(start[len-1] == '\r' && len > 0 )
51
+ len--;
52
52
  }else {
53
53
  len = (int)strlen(start);
54
54
  }
@@ -1,5 +1,6 @@
1
1
  #include "DBAdapter.h"
2
2
  #include "sync/SyncThread.h"
3
+ #include "sync/SyncEngine.h"
3
4
 
4
5
  #include "common/RhoFile.h"
5
6
  #include "common/RhoFilePath.h"
@@ -141,6 +142,28 @@ void CDBAdapter::open (String strDbPath, String strVer, boolean bTemp)
141
142
  sqlite3_busy_handler(m_dbHandle, onDBBusy, 0 );
142
143
 
143
144
  getAttrMgr().load(*this);
145
+
146
+ //copy client_info table
147
+ if ( !bTemp && !bExist && CRhoFile::isFileExist((strDbPath+"_oldver").c_str()) )
148
+ {
149
+ LOG(INFO) + "Copy client_info table from old database";
150
+ CDBAdapter db(m_strDbPartition.c_str(), true);
151
+ db.open( strDbPath+"_oldver", m_strDbVer, true );
152
+ copyTable( "client_info", db, *this );
153
+ {
154
+ DBResult( res, executeSQL( "SELECT client_id FROM client_info" ));
155
+ if ( !res.isEnd() && res.getStringByIdx(0).length() > 0 )
156
+ {
157
+ LOG(INFO) + "Set reset=1 in client_info";
158
+ executeSQL( "UPDATE client_info SET reset=1" );
159
+ }
160
+ }
161
+ db.close();
162
+
163
+ CRhoFile::deleteFile( (m_strDbPath+"_oldver").c_str());
164
+ CRhoFile::deleteFile( (m_strDbPath+"_oldver-journal").c_str());
165
+ }
166
+
144
167
  }
145
168
 
146
169
  boolean CDBAdapter::migrateDB(const CDBVersion& dbVer, const String& strRhoDBVer, const String& strAppDBVer )
@@ -153,6 +176,14 @@ boolean CDBAdapter::migrateDB(const CDBVersion& dbVer, const String& strRhoDBVer
153
176
  return true;
154
177
  }
155
178
 
179
+ if ( (dbVer.m_strRhoVer.find("2.0") == 0||dbVer.m_strRhoVer.find("2.1") == 0||dbVer.m_strRhoVer.find("2.2") == 0)&&
180
+ (strRhoDBVer.find("2.0")==0||strRhoDBVer.find("2.1")==0||strRhoDBVer.find("2.2")==0) )
181
+ {
182
+ LOG(INFO) + "No migration required from " + dbVer.m_strRhoVer + " to " + strRhoDBVer;
183
+ writeDBVersion( CDBVersion(strRhoDBVer, strAppDBVer) );
184
+ return true;
185
+ }
186
+
156
187
  //1.2.x -> 1.5.x,1.4.x
157
188
  if ( (dbVer.m_strRhoVer.find("1.2") == 0)&& (strRhoDBVer.find("1.5")==0||strRhoDBVer.find("1.4")==0) )
158
189
  {
@@ -189,7 +220,6 @@ boolean CDBAdapter::migrateDB(const CDBVersion& dbVer, const String& strRhoDBVer
189
220
  return true;
190
221
  }
191
222
 
192
-
193
223
  return false;
194
224
  }
195
225
 
@@ -220,8 +250,11 @@ void CDBAdapter::checkDBVersion(String& strRhoDBVer)
220
250
  {
221
251
  LOG(INFO) + "Reset database because version is changed.";
222
252
 
223
- CRhoFile::deleteFile(m_strDbPath.c_str());
224
- CRhoFile::deleteFile((m_strDbPath+"-journal").c_str());
253
+ CRhoFile::deleteFile( (m_strDbPath+"_oldver").c_str());
254
+ CRhoFile::deleteFile( (m_strDbPath+"_oldver-journal").c_str());
255
+
256
+ CRhoFile::renameFile( m_strDbPath.c_str(), (m_strDbPath+"_oldver").c_str());
257
+ CRhoFile::renameFile((m_strDbPath+"-journal").c_str(), (m_strDbPath+"_oldver-journal").c_str());
225
258
 
226
259
  CRhoFile::deleteFilesInFolder(RHODESAPPBASE().getBlobsDirPath().c_str());
227
260
 
@@ -412,6 +445,41 @@ void CDBAdapter::copyTable(String tableName, CDBAdapter& dbFrom, CDBAdapter& dbT
412
445
  }
413
446
  }
414
447
 
448
+ void CDBAdapter::copyChangedValues(CDBAdapter& db)
449
+ {
450
+ copyTable("changed_values", *this, db );
451
+ {
452
+ Vector<int> arOldSrcs;
453
+ {
454
+ DBResult( resSrc , db.executeSQL( "SELECT DISTINCT(source_id) FROM changed_values" ) );
455
+ for ( ; !resSrc.isEnd(); resSrc.next() )
456
+ arOldSrcs.addElement( resSrc.getIntByIdx(0) );
457
+ }
458
+ for( int i = 0; i < arOldSrcs.size(); i++)
459
+ {
460
+ int nOldSrcID = arOldSrcs.elementAt(i);
461
+
462
+ DBResult( res, executeSQL("SELECT name from sources WHERE source_id=?", nOldSrcID) );
463
+ if ( !res.isEnd() )
464
+ {
465
+ String strSrcName = res.getStringByIdx(0);
466
+
467
+ DBResult( res2, db.executeSQL("SELECT source_id from sources WHERE name=?", strSrcName) );
468
+ if ( !res2.isEnd() )
469
+ {
470
+ if ( nOldSrcID != res2.getIntByIdx(0) )
471
+ db.executeSQL("UPDATE changed_values SET source_id=? WHERE source_id=?", res2.getIntByIdx(0), nOldSrcID);
472
+
473
+ continue;
474
+ }
475
+ }
476
+
477
+ //source not exist in new partition, remove this changes
478
+ db.executeSQL("DELETE FROM changed_values WHERE source_id=?", nOldSrcID);
479
+ }
480
+ }
481
+ }
482
+
415
483
  void CDBAdapter::setBulkSyncDB(String fDataName)
416
484
  {
417
485
  CDBAdapter db(m_strDbPartition.c_str(), true);
@@ -421,23 +489,33 @@ void CDBAdapter::setBulkSyncDB(String fDataName)
421
489
  db.startTransaction();
422
490
 
423
491
  copyTable("client_info", *this, db );
492
+ copyChangedValues(db);
424
493
 
425
494
  //update User partition
426
495
  if ( m_strDbPartition.compare(USER_PARTITION_NAME())==0 )
427
496
  {
428
497
  //copy all NOT user sources from current db to bulk db
498
+ startTransaction();
429
499
  executeSQL("DELETE FROM sources WHERE partition=?", m_strDbPartition);
430
500
  copyTable("sources", *this, db );
501
+ rollback();
431
502
  }else
432
503
  {
433
504
  //remove all m_strDbPartition sources from user db
434
505
  //copy all sources from bulk db to user db
435
506
  CDBAdapter& dbUser = getDB(USER_PARTITION_NAME());
507
+ dbUser.startTransaction();
436
508
  dbUser.executeSQL("DELETE FROM sources WHERE partition=?", m_strDbPartition);
437
509
 
438
510
  copyTable("sources", db, dbUser );
511
+
512
+ dbUser.endTransaction();
439
513
  }
440
514
 
515
+ getDBPartitions().put(m_strDbPartition.c_str(), &db);
516
+ sync::CSyncThread::getSyncEngine().applyChangedValues(db);
517
+ getDBPartitions().put(m_strDbPartition.c_str(), this);
518
+
441
519
  db.endTransaction();
442
520
  db.close();
443
521