rhodes 2.3.0 → 2.3.1.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/Manifest.txt +5819 -0
- data/README.md +2 -2
- data/Rakefile +9 -5
- data/doc/build.txt +7 -13
- data/doc/configuration.txt +4 -0
- data/doc/connect-to-web-services.txt +0 -1
- data/doc/device-caps.txt +2 -2
- data/doc/extensions.txt +2 -0
- data/doc/linea.txt +699 -0
- data/doc/rhom.txt +2 -1
- data/doc/synchronization.txt +39 -2
- data/doc/ui.txt +1 -0
- data/installer/README.html +1 -1
- data/lib/build/jake.rb +3 -0
- data/lib/framework/res/esri.wm.png +0 -0
- data/lib/framework/rho/render.rb +2 -0
- data/lib/framework/rho/rho.rb +17 -10
- data/lib/framework/rho/rhoapplication.rb +13 -3
- data/lib/framework/rho/rhoevent_bb.rb +3 -1
- data/lib/framework/rho/rhoevent_c.rb +4 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhom/rhom.rb +10 -0
- data/lib/framework/rhom/rhom_object_factory.rb +45 -0
- data/lib/framework/rhom/rhom_source.rb +1 -1
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +1 -1
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +1 -1
- data/platform/android/Rhodes/jni/src/callbacks.cpp +9 -11
- data/platform/android/Rhodes/jni/src/event.cpp +17 -9
- data/platform/android/Rhodes/jni/src/mapview.cpp +34 -4
- data/platform/android/Rhodes/jni/src/rhodes.cpp +1 -1
- data/platform/android/Rhodes/res/drawable/esri.png +0 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +3 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +8 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +80 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +29 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +50 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +3 -0
- data/platform/android/build/android.rake +45 -23
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +6 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/CachedDataRow.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/CachedRow.java +3 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/Row.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/CachedObject.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/DataFileCache.java +66 -16
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/RhoCrypto.java +116 -0
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +39 -2
- data/platform/bb/RubyVM/src/com/rho/Tokenizer.java +11 -6
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +157 -150
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +15 -0
- data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +35 -23
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +6 -9
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +54 -16
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +18 -9
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +37 -59
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +3 -0
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +4 -5
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +4 -1
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +8 -3
- data/platform/bb/rhodes/resources/esri.png +0 -0
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +2 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +8 -3
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoCalendar.java +4 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +2 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +9 -0
- data/platform/iphone/Classes/Event/Event.m +12 -2
- data/platform/iphone/Classes/NativeBar.h +12 -11
- data/platform/iphone/Classes/NativeBar.m +13 -3
- data/platform/iphone/Classes/Rhodes.m +48 -10
- data/platform/iphone/Classes/SimpleMainView.h +1 -0
- data/platform/iphone/Classes/SimpleMainView.m +7 -1
- data/platform/iphone/Classes/SplitView/LeftViewController.m +3 -0
- data/platform/iphone/Classes/SplitView/RightViewController.m +11 -6
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +8 -0
- data/platform/iphone/Classes/TabbedMainView.m +39 -3
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +3 -3
- data/platform/shared/SyncClient/SyncClient.cpp +23 -23
- data/platform/shared/common/IRhoClassFactory.h +6 -4
- data/platform/shared/common/RhoAppAdapter.h +1 -1
- data/platform/shared/common/RhoFile.cpp +10 -0
- data/platform/shared/common/RhoFile.h +1 -0
- data/platform/shared/common/RhoMutexLock.h +1 -1
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoThread.cpp +2 -2
- data/platform/shared/common/RhoThread.h +1 -2
- data/platform/shared/common/RhodesApp.cpp +33 -55
- data/platform/shared/common/RhodesApp.h +0 -5
- data/platform/shared/common/RhodesAppBase.cpp +1 -1
- data/platform/shared/common/SplashScreen.cpp +1 -2
- data/platform/shared/common/ThreadQueue.cpp +31 -4
- data/platform/shared/common/ThreadQueue.h +10 -3
- data/platform/shared/common/Tokenizer.cpp +12 -8
- data/platform/shared/common/iphone/RhoClassFactory.cpp +5 -8
- data/platform/shared/common/iphone/RhoClassfactory.h +1 -1
- data/platform/shared/common/map/ESRIMapEngine.cpp +17 -7
- data/platform/shared/common/map/ESRIMapEngine.h +11 -1
- data/platform/shared/common/map/GoogleMapEngine.cpp +3 -3
- data/platform/shared/common/map/GoogleMapEngine.h +2 -2
- data/platform/shared/common/map/MapEngine.cpp +37 -0
- data/platform/shared/common/map/MapEngine.h +5 -0
- data/platform/shared/db/DBAdapter.cpp +113 -81
- data/platform/shared/db/DBAdapter.h +21 -5
- data/platform/shared/db/DBAttrManager.cpp +2 -2
- data/platform/shared/db/DBResult.h +28 -0
- data/platform/shared/net/AsyncHttp.cpp +48 -48
- data/platform/shared/net/AsyncHttp.h +15 -12
- data/platform/shared/net/CURLNetRequest.cpp +27 -105
- data/platform/shared/net/CURLNetRequest.h +8 -15
- data/platform/shared/net/INetRequest.cpp +122 -0
- data/platform/shared/net/INetRequest.h +96 -23
- data/platform/shared/net/ssl.cpp +1 -1
- data/platform/shared/ruby/ext/calendar/calendar.i +2 -2
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +30 -3
- data/platform/shared/rubyext/GeoLocation.cpp +4 -5
- data/platform/shared/rubyext/GeoLocation.h +4 -4
- data/platform/shared/rubyext/RhoAppAdapter.cpp +1 -1
- data/platform/shared/rubyext/System.cpp +3 -0
- data/platform/shared/sync/ClientRegister.cpp +6 -9
- data/platform/shared/sync/ClientRegister.h +8 -6
- data/platform/shared/sync/SyncEngine.cpp +54 -30
- data/platform/shared/sync/SyncEngine.h +9 -11
- data/platform/shared/sync/SyncNotify.cpp +19 -14
- data/platform/shared/sync/SyncNotify.h +5 -12
- data/platform/shared/sync/SyncSource.cpp +53 -76
- data/platform/shared/sync/SyncSource.h +5 -4
- data/platform/shared/sync/SyncThread.cpp +5 -7
- data/platform/shared/sync/SyncThread.h +2 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +43 -39
- data/platform/wm/build/wm.rake +19 -17
- data/platform/wm/rhodes/AppManager.cpp +4 -4
- data/platform/wm/rhodes/MainWindow.cpp +0 -1
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +4 -0
- data/platform/wm/rhodes/Vibrate.cpp +2 -2
- data/platform/wm/rhodes/Vibrate.h +1 -1
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -5
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +3 -3
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +24 -10
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +49 -25
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +16 -2
- data/platform/wm/rhodes/rhodes.vcproj +77 -85
- data/platform/wm/tools/detool/detool.cpp +16 -6
- data/rakefile.rb +9 -5
- data/res/build-tools/detool.exe +0 -0
- data/rhodes.gemspec +2 -2
- data/spec/phone_spec/app/spec/blobsync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/events_spec.rb +13 -2
- data/spec/phone_spec/app/spec/mapview_spec.rb +2 -2
- data/spec/phone_spec/app/spec/nativebar_spec.rb +3 -3
- data/spec/phone_spec/app/spec/navbar_spec.rb +3 -3
- data/spec/phone_spec/app/spec/rho_spec.rb +1 -1
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +1 -1
- data/spec/phone_spec/app/spec/syncengine_spec.rb +219 -0
- data/spec/phone_spec/build.yml +1 -0
- metadata +15 -8
- data/platform/wm/rhodes/rho/net/NetRequest.cpp +0 -89
- data/platform/wm/rhodes/rho/net/NetRequest.h +0 -45
@@ -278,7 +278,9 @@ VALUE event_fetch_by_id(const char *eid)
|
|
278
278
|
#endif
|
279
279
|
}
|
280
280
|
|
281
|
-
|
281
|
+
static NSString* return_string = nil;
|
282
|
+
|
283
|
+
const char* event_save(VALUE rEvent)
|
282
284
|
{
|
283
285
|
calendar_check();
|
284
286
|
|
@@ -290,9 +292,17 @@ void event_save(VALUE rEvent)
|
|
290
292
|
NSError *err;
|
291
293
|
BOOL saved = [eventStore saveEvent:event span:EKSpanFutureEvents error:&err];
|
292
294
|
|
293
|
-
if (
|
295
|
+
if (saved) {
|
296
|
+
return_string = event.eventIdentifier;
|
297
|
+
}
|
298
|
+
else {
|
294
299
|
rb_raise(rb_eRuntimeError, "Event save failed: %s", [[err localizedDescription] UTF8String]);
|
300
|
+
}
|
295
301
|
#endif
|
302
|
+
if (return_string != nil) {
|
303
|
+
return [return_string UTF8String];
|
304
|
+
}
|
305
|
+
return NULL;
|
296
306
|
}
|
297
307
|
|
298
308
|
void event_delete(const char *eid)
|
@@ -14,19 +14,20 @@
|
|
14
14
|
#define NOBAR_TYPE 2
|
15
15
|
#define VTABBAR_TYPE 3
|
16
16
|
|
17
|
-
#define NATIVE_BAR_PROPERTIES
|
18
|
-
#define NATIVE_BAR_ITEMS
|
17
|
+
#define NATIVE_BAR_PROPERTIES @"properties"
|
18
|
+
#define NATIVE_BAR_ITEMS @"items"
|
19
19
|
|
20
|
-
#define NATIVE_BAR_BACKGOUND_COLOR
|
20
|
+
#define NATIVE_BAR_BACKGOUND_COLOR @"bkg_color"
|
21
21
|
|
22
|
-
#define NATIVE_BAR_ITEM_LABEL
|
23
|
-
#define NATIVE_BAR_ITEM_ACTION
|
24
|
-
#define NATIVE_BAR_ITEM_ICON
|
25
|
-
#define NATIVE_BAR_ITEM_RELOAD
|
26
|
-
#define NATIVE_BAR_ITEM_COLORED_ICON
|
27
|
-
#define NATIVE_BAR_ITEM_SELECTED_COLOR
|
28
|
-
#define NATIVE_BAR_ITEM_DISABLED
|
29
|
-
#define NATIVE_BAR_ITEM_WEB_BACKGROUND_COLOR
|
22
|
+
#define NATIVE_BAR_ITEM_LABEL @"label"
|
23
|
+
#define NATIVE_BAR_ITEM_ACTION @"action"
|
24
|
+
#define NATIVE_BAR_ITEM_ICON @"icon"
|
25
|
+
#define NATIVE_BAR_ITEM_RELOAD @"reload"
|
26
|
+
#define NATIVE_BAR_ITEM_COLORED_ICON @"colored_icon"
|
27
|
+
#define NATIVE_BAR_ITEM_SELECTED_COLOR @"selected_color"
|
28
|
+
#define NATIVE_BAR_ITEM_DISABLED @"disabled"
|
29
|
+
#define NATIVE_BAR_ITEM_WEB_BACKGROUND_COLOR @"web_bkg_color"
|
30
|
+
#define NATIVE_BAR_ITEM_USE_CURRENT_VIEW_FOR_TAB @"use_current_view_for_tab"
|
30
31
|
|
31
32
|
/*
|
32
33
|
|
@@ -65,6 +65,7 @@ static int started = 0;
|
|
65
65
|
started = 1;
|
66
66
|
break;
|
67
67
|
case TABBAR_TYPE: {
|
68
|
+
[[Rhodes sharedInstance] hideSplash];
|
68
69
|
view = [[TabbedMainView alloc] initWithMainView:mainView parent:w bar_info:parameters];
|
69
70
|
started = 1;
|
70
71
|
[r setMainView:view];
|
@@ -72,7 +73,7 @@ static int started = 0;
|
|
72
73
|
}
|
73
74
|
break;
|
74
75
|
case VTABBAR_TYPE: {
|
75
|
-
|
76
|
+
[[Rhodes sharedInstance] hideSplash];
|
76
77
|
BOOL is_iPad = NO;
|
77
78
|
{
|
78
79
|
NSString *model = [[UIDevice currentDevice] model]; // "iPad ..."
|
@@ -196,6 +197,7 @@ void create_nativebar_innner(int bar_type, rho_param *p)
|
|
196
197
|
//const char *selected_color_enable = NULL;
|
197
198
|
const char *disabled = NULL;
|
198
199
|
const char* web_bkg_color = NULL;
|
200
|
+
const char* use_current_view_for_tab = NULL;
|
199
201
|
|
200
202
|
BOOL skip_item = NO;
|
201
203
|
for (int j = 0, lim = hash->v.hash->size; j < lim; ++j) {
|
@@ -229,17 +231,24 @@ void create_nativebar_innner(int bar_type, rho_param *p)
|
|
229
231
|
disabled = value->v.string;
|
230
232
|
else if (strcasecmp(name, "web_bkg_color") == 0)
|
231
233
|
web_bkg_color = value->v.string;
|
234
|
+
else if (strcasecmp(name, "use_current_view_for_tab") == 0) {
|
235
|
+
use_current_view_for_tab = value->v.string;
|
236
|
+
if (strcasecmp(use_current_view_for_tab, "true") == 0) {
|
237
|
+
action = "none";
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
232
241
|
}
|
233
242
|
|
234
243
|
if (label == NULL && bar_type == TOOLBAR_TYPE)
|
235
244
|
label = "";
|
236
245
|
|
237
|
-
if ((label == NULL || action == NULL) && (!skip_item)) {
|
246
|
+
if ((label == NULL || (action == NULL)) && (!skip_item)) {
|
238
247
|
RAWLOG_ERROR("Illegal argument for create_nativebar");
|
239
248
|
return;
|
240
249
|
}
|
241
250
|
if (!skip_item) {
|
242
|
-
NSMutableDictionary* item = [NSMutableDictionary dictionaryWithCapacity:
|
251
|
+
NSMutableDictionary* item = [NSMutableDictionary dictionaryWithCapacity:10];
|
243
252
|
|
244
253
|
[item setObject:[NSString stringWithUTF8String:label] forKey:NATIVE_BAR_ITEM_LABEL];
|
245
254
|
[item setObject:[NSString stringWithUTF8String:action] forKey:NATIVE_BAR_ITEM_ACTION];
|
@@ -253,6 +262,7 @@ void create_nativebar_innner(int bar_type, rho_param *p)
|
|
253
262
|
if (web_bkg_color != NULL) {
|
254
263
|
[item setObject:[NSString stringWithUTF8String:web_bkg_color] forKey:NATIVE_BAR_ITEM_WEB_BACKGROUND_COLOR];
|
255
264
|
}
|
265
|
+
[item setObject:[NSString stringWithUTF8String:(use_current_view_for_tab ? use_current_view_for_tab : "false")] forKey:NATIVE_BAR_ITEM_USE_CURRENT_VIEW_FOR_TAB];
|
256
266
|
|
257
267
|
[items addObject:item];
|
258
268
|
}
|
@@ -33,6 +33,40 @@ static BOOL app_created = NO;
|
|
33
33
|
@end
|
34
34
|
|
35
35
|
|
36
|
+
@interface RhoFullScreenEnableTask : NSObject {}
|
37
|
+
+ (void)run;
|
38
|
+
@end
|
39
|
+
|
40
|
+
@implementation RhoFullScreenEnableTask
|
41
|
+
+ (void)run {
|
42
|
+
#ifdef __IPHONE_3_2
|
43
|
+
[[Rhodes application] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
|
44
|
+
#else
|
45
|
+
[[Rhodes application] setStatusBarHidden:YES animated:YES];
|
46
|
+
#endif
|
47
|
+
[[[[Rhodes sharedInstance] mainView] view] setFrame:[Rhodes applicationFrame]];
|
48
|
+
}
|
49
|
+
@end
|
50
|
+
|
51
|
+
@interface RhoFullScreenDisableTask : NSObject {}
|
52
|
+
+ (void)run;
|
53
|
+
@end
|
54
|
+
|
55
|
+
@implementation RhoFullScreenDisableTask
|
56
|
+
+ (void)run {
|
57
|
+
#ifdef __IPHONE_3_2
|
58
|
+
[[Rhodes application] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
|
59
|
+
#else
|
60
|
+
[[Rhodes application] setStatusBarHidden:NO animated:YES];
|
61
|
+
#endif
|
62
|
+
[[[[Rhodes sharedInstance] mainView] view] setFrame:[Rhodes applicationFrame]];
|
63
|
+
}
|
64
|
+
@end
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
36
70
|
@implementation Rhodes
|
37
71
|
|
38
72
|
@synthesize window, player, cookies, signatureDelegate, nvDelegate;
|
@@ -51,20 +85,24 @@ static Rhodes *instance = NULL;
|
|
51
85
|
}
|
52
86
|
|
53
87
|
+ (CGRect)applicationFrame {
|
54
|
-
CGRect frame = [[UIScreen mainScreen]
|
55
|
-
CGRect sbFrame = [[UIApplication sharedApplication] statusBarFrame];
|
56
|
-
frame.origin.y += sbFrame.size.height;
|
57
|
-
frame.size.height -= sbFrame.size.height;
|
88
|
+
CGRect frame = [[UIScreen mainScreen] applicationFrame];
|
89
|
+
//CGRect sbFrame = [[UIApplication sharedApplication] statusBarFrame];
|
90
|
+
//frame.origin.y += sbFrame.size.height;
|
91
|
+
//frame.size.height -= sbFrame.size.height;
|
58
92
|
return frame;
|
59
93
|
}
|
60
94
|
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
61
99
|
+ (void)setStatusBarHidden:(BOOL)v {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
100
|
+
if (v) {
|
101
|
+
[Rhodes performOnUiThread:[RhoFullScreenEnableTask class] wait:NO];
|
102
|
+
}
|
103
|
+
else {
|
104
|
+
[Rhodes performOnUiThread:[RhoFullScreenDisableTask class] wait:NO];
|
105
|
+
}
|
68
106
|
}
|
69
107
|
|
70
108
|
|
@@ -43,6 +43,7 @@
|
|
43
43
|
|
44
44
|
- (id)initWithMainView:(id<RhoMainView>)v parent:(UIWindow*)p;
|
45
45
|
- (id)initWithMainView:(id<RhoMainView>)v parent:(UIWindow*)p bar_info:(NSDictionary*)bar_info;
|
46
|
+
- (id)initWithParentView:(UIView *)p frame:(CGRect)frame webview:(UIWebView*)webview;
|
46
47
|
- (id)initWithParentView:(UIView *)p frame:(CGRect)frame;
|
47
48
|
- (id)initWithParentView:(UIView *)p frame:(CGRect)frame web_bkg_color:(UIColor*)web_bkg_color;
|
48
49
|
|
@@ -397,7 +397,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
|
|
397
397
|
|
398
398
|
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
399
399
|
{
|
400
|
-
if ([
|
400
|
+
if ([[UIApplication sharedApplication] statusBarOrientation] == fromInterfaceOrientation) {
|
401
401
|
return;
|
402
402
|
}
|
403
403
|
int width = rho_sys_get_screen_width();
|
@@ -504,6 +504,12 @@ static BOOL makeHiddenUntilLoadContent = YES;
|
|
504
504
|
return [self initWithMainView:v parent:p bar_info:nil];
|
505
505
|
}
|
506
506
|
|
507
|
+
- (id)initWithParentView:(UIView *)p frame:(CGRect)frame webview:(UIWebView*)webview {
|
508
|
+
id result = [self init:p webView:webview frame:frame bar_info:nil web_bkg_color:nil];
|
509
|
+
return result;
|
510
|
+
}
|
511
|
+
|
512
|
+
|
507
513
|
- (id)initWithMainView:(id<RhoMainView>)v parent:(UIWindow*)p bar_info:(NSDictionary*)bar_info {
|
508
514
|
CGRect frame = [[v view] frame];
|
509
515
|
frame.origin.x = 0;
|
@@ -183,6 +183,9 @@
|
|
183
183
|
}
|
184
184
|
|
185
185
|
- (void)setSelection:(int)index {
|
186
|
+
if ((index < 0) || (index >= [self.itemsData count])) {
|
187
|
+
return;
|
188
|
+
}
|
186
189
|
NSIndexPath* path = [NSIndexPath indexPathForRow:index inSection:0];
|
187
190
|
[self performSelectorOnMainThread:@selector(setSelectionCommand:) withObject:path waitUntilDone:NO];
|
188
191
|
}
|
@@ -147,9 +147,17 @@
|
|
147
147
|
return YES;
|
148
148
|
}
|
149
149
|
|
150
|
+
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
151
|
+
{
|
152
|
+
[[self getSimpleView:-1] didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
153
|
+
}
|
154
|
+
|
150
155
|
|
151
156
|
|
152
157
|
- (SimpleMainView*) getSimpleView:(int)index {
|
158
|
+
if ((index < 0) || (index >= [self.itemsData count])) {
|
159
|
+
index = -1;
|
160
|
+
}
|
153
161
|
if (index == -1) {
|
154
162
|
index = self.tabindex;
|
155
163
|
}
|
@@ -222,9 +230,6 @@
|
|
222
230
|
}
|
223
231
|
}
|
224
232
|
SimpleMainView* cur_v = [self getSimpleView:tabindex];
|
225
|
-
if (cur_v == new_v) {
|
226
|
-
return;
|
227
|
-
}
|
228
233
|
tabindex = index;
|
229
234
|
RhoRightItem *ri = [self.itemsData objectAtIndex:tabindex];
|
230
235
|
if (!ri.loaded || ri.reload) {
|
@@ -232,14 +237,14 @@
|
|
232
237
|
rho_rhodesapp_load_url(s);
|
233
238
|
ri.loaded = YES;
|
234
239
|
}
|
240
|
+
if (cur_v == new_v) {
|
241
|
+
return;
|
242
|
+
}
|
235
243
|
CGRect myframe = self.view.bounds;
|
236
244
|
new_v.view.frame = myframe;
|
237
245
|
[cur_v.view removeFromSuperview];
|
238
246
|
[self.view addSubview:new_v.view];
|
239
247
|
[self.view setNeedsLayout];
|
240
|
-
//[self.view layoutSubviews];
|
241
|
-
//[self.view.superview setNeedsLayout];
|
242
|
-
//[new_v.view setNeedsDisplay];
|
243
248
|
}
|
244
249
|
|
245
250
|
- (void)switchTab:(int)index {
|
@@ -162,6 +162,14 @@
|
|
162
162
|
}
|
163
163
|
*/
|
164
164
|
|
165
|
+
|
166
|
+
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
167
|
+
{
|
168
|
+
[[self getRightViewController] didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
|
165
173
|
- (RightViewController*)getRightViewController {
|
166
174
|
RightViewController* rvc = (RightViewController*)[self.viewControllers objectAtIndex:1];
|
167
175
|
return rvc;
|
@@ -343,6 +343,8 @@
|
|
343
343
|
NSMutableArray *tabs = [[NSMutableArray alloc] initWithCapacity:count];
|
344
344
|
|
345
345
|
NSString *initUrl = nil;
|
346
|
+
BOOL is_load_initial_url = YES;
|
347
|
+
int tab_to_initial_select = -1;
|
346
348
|
|
347
349
|
for (int i = 0; i < count; ++i) {
|
348
350
|
|
@@ -357,8 +359,17 @@
|
|
357
359
|
NSString *disabled = (NSString*)[item objectForKey:NATIVE_BAR_ITEM_DISABLED];
|
358
360
|
|
359
361
|
NSString *web_bkg_color = (NSString*)[item objectForKey:NATIVE_BAR_ITEM_WEB_BACKGROUND_COLOR];
|
362
|
+
|
363
|
+
NSString *use_current_view_for_tab = (NSString*)[item objectForKey:NATIVE_BAR_ITEM_USE_CURRENT_VIEW_FOR_TAB];
|
360
364
|
|
361
365
|
|
366
|
+
BOOL is_use_current_view_for_tab = NO;
|
367
|
+
if (use_current_view_for_tab != nil) {
|
368
|
+
if ([use_current_view_for_tab caseInsensitiveCompare:@"true"] == NSOrderedSame) {
|
369
|
+
is_use_current_view_for_tab = YES;
|
370
|
+
}
|
371
|
+
}
|
372
|
+
|
362
373
|
if (!initUrl)
|
363
374
|
initUrl = url;
|
364
375
|
|
@@ -366,7 +377,20 @@
|
|
366
377
|
RhoTabBarData *td = [[RhoTabBarData alloc] init];
|
367
378
|
td.url = url;
|
368
379
|
td.reload = [reload isEqualToString:@"true"];
|
380
|
+
td.loaded = is_use_current_view_for_tab;
|
381
|
+
|
382
|
+
if (is_use_current_view_for_tab) {
|
383
|
+
td.url = [v currentLocation:-1];
|
384
|
+
}
|
385
|
+
|
369
386
|
SimpleMainView *subController = nil;
|
387
|
+
|
388
|
+
if (is_use_current_view_for_tab) {
|
389
|
+
web_bkg_color = nil;
|
390
|
+
is_load_initial_url = NO;
|
391
|
+
tab_to_initial_select = i;
|
392
|
+
}
|
393
|
+
|
370
394
|
if (web_bkg_color != nil) {
|
371
395
|
int bkgc = [web_bkg_color intValue];
|
372
396
|
int cR = (bkgc & 0xFF0000) >> 16;
|
@@ -377,7 +401,12 @@
|
|
377
401
|
subController = [[SimpleMainView alloc] initWithParentView:tabbar.view frame:childFrame web_bkg_color:bc];
|
378
402
|
}
|
379
403
|
else {
|
380
|
-
|
404
|
+
if (is_use_current_view_for_tab) {
|
405
|
+
subController = [[SimpleMainView alloc] initWithParentView:tabbar.view frame:childFrame webview:[v detachWebView]];
|
406
|
+
}
|
407
|
+
else {
|
408
|
+
subController = [[SimpleMainView alloc] initWithParentView:tabbar.view frame:childFrame];
|
409
|
+
}
|
381
410
|
}
|
382
411
|
|
383
412
|
|
@@ -438,9 +467,13 @@
|
|
438
467
|
self.tabbarData = tabs;
|
439
468
|
[tabs release];
|
440
469
|
|
441
|
-
|
470
|
+
if (initUrl && is_load_initial_url) {
|
442
471
|
[self navigateRedirect:initUrl tab:0];
|
443
|
-
|
472
|
+
}
|
473
|
+
if (tab_to_initial_select >= 0) {
|
474
|
+
tabbar.selectedIndex = tab_to_initial_select;
|
475
|
+
}
|
476
|
+
|
444
477
|
return self;
|
445
478
|
}
|
446
479
|
|
@@ -465,6 +498,9 @@
|
|
465
498
|
}
|
466
499
|
|
467
500
|
- (SimpleMainView*)subView:(int)index {
|
501
|
+
if (index == -1) {
|
502
|
+
index = [self activeTab];
|
503
|
+
}
|
468
504
|
return (SimpleMainView*)[tabbar.viewControllers objectAtIndex:index];
|
469
505
|
}
|
470
506
|
|
data/platform/iphone/Info.plist
CHANGED
@@ -52,6 +52,7 @@
|
|
52
52
|
5C98174E0FBC4FCE002597A5 /* irhoclassfactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C98174B0FBC4FCE002597A5 /* irhoclassfactory.h */; };
|
53
53
|
5CA2DE9011B01EF000B868D5 /* ThreadQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CA2DE8E11B01EF000B868D5 /* ThreadQueue.cpp */; };
|
54
54
|
5CA2DE9111B01EF000B868D5 /* ThreadQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CA2DE8F11B01EF000B868D5 /* ThreadQueue.h */; };
|
55
|
+
5CB821AE1312487100778441 /* INetRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CB821AD1312487000778441 /* INetRequest.cpp */; };
|
55
56
|
5CBD462A1087399700107D0D /* URI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CBD46271087399700107D0D /* URI.cpp */; };
|
56
57
|
5CBD462B1087399700107D0D /* URI.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBD46281087399700107D0D /* URI.h */; };
|
57
58
|
5CCD7EBC116CE2D5005E6CA3 /* AppMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CCD7EBA116CE2D5005E6CA3 /* AppMenu.cpp */; };
|
@@ -122,6 +123,7 @@
|
|
122
123
|
5C98174B0FBC4FCE002597A5 /* irhoclassfactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = irhoclassfactory.h; path = ../../shared/common/irhoclassfactory.h; sourceTree = SOURCE_ROOT; };
|
123
124
|
5CA2DE8E11B01EF000B868D5 /* ThreadQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadQueue.cpp; path = ../../shared/common/ThreadQueue.cpp; sourceTree = SOURCE_ROOT; };
|
124
125
|
5CA2DE8F11B01EF000B868D5 /* ThreadQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadQueue.h; path = ../../shared/common/ThreadQueue.h; sourceTree = SOURCE_ROOT; };
|
126
|
+
5CB821AD1312487000778441 /* INetRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = INetRequest.cpp; path = ../../shared/net/INetRequest.cpp; sourceTree = SOURCE_ROOT; };
|
125
127
|
5CBD46271087399700107D0D /* URI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = URI.cpp; path = ../../shared/net/URI.cpp; sourceTree = SOURCE_ROOT; };
|
126
128
|
5CBD46281087399700107D0D /* URI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URI.h; path = ../../shared/net/URI.h; sourceTree = SOURCE_ROOT; };
|
127
129
|
5CCD7EBA116CE2D5005E6CA3 /* AppMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppMenu.cpp; path = ../../shared/common/AppMenu.cpp; sourceTree = SOURCE_ROOT; };
|
@@ -282,6 +284,7 @@
|
|
282
284
|
5CBD46251087397B00107D0D /* net */ = {
|
283
285
|
isa = PBXGroup;
|
284
286
|
children = (
|
287
|
+
5CB821AD1312487000778441 /* INetRequest.cpp */,
|
285
288
|
BDFCB13B112EE2B500AE3724 /* ssl.cpp */,
|
286
289
|
BDFCB13C112EE2B500AE3724 /* ssl.h */,
|
287
290
|
5C8EE85A11220E9E0005C20D /* AsyncHttp.cpp */,
|
@@ -439,6 +442,7 @@
|
|
439
442
|
5C2CE15C122ACA9E005EDBC4 /* RhoAppAdapter.cpp in Sources */,
|
440
443
|
FA5F58DF12ADDA6D00C7613A /* app_build_configs.c in Sources */,
|
441
444
|
5CE03CCC12DB7E990058B474 /* sqlite3.c in Sources */,
|
445
|
+
5CB821AE1312487100778441 /* INetRequest.cpp in Sources */,
|
442
446
|
);
|
443
447
|
runOnlyForDeploymentPostprocessing = 0;
|
444
448
|
};
|
@@ -887,7 +887,7 @@
|
|
887
887
|
);
|
888
888
|
runOnlyForDeploymentPostprocessing = 0;
|
889
889
|
shellPath = /bin/sh;
|
890
|
-
shellScript = "source ~/.profile\ncd ../../\nrake build:iphone:rhobundle";
|
890
|
+
shellScript = "source ~/.profile\ncd ${SRCROOT}\ncd ../../\nrake build:iphone:rhobundle";
|
891
891
|
};
|
892
892
|
5C61F2BD1022321A0013E321 /* Move alerts to root of app */ = {
|
893
893
|
isa = PBXShellScriptBuildPhase;
|
@@ -915,7 +915,7 @@
|
|
915
915
|
);
|
916
916
|
runOnlyForDeploymentPostprocessing = 0;
|
917
917
|
shellPath = /bin/sh;
|
918
|
-
shellScript = "RHO_SOURCE_DIR=${
|
918
|
+
shellScript = "RHO_SOURCE_DIR=${SRCROOT}/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}";
|
919
919
|
};
|
920
920
|
FA4207711277930A00BDE415 /* Copy Loading images */ = {
|
921
921
|
isa = PBXShellScriptBuildPhase;
|
@@ -929,7 +929,7 @@
|
|
929
929
|
);
|
930
930
|
runOnlyForDeploymentPostprocessing = 0;
|
931
931
|
shellPath = /bin/sh;
|
932
|
-
shellScript = "RHO_SOURCE_DIR=${
|
932
|
+
shellScript = "RHO_SOURCE_DIR=${SRCROOT}\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";
|
933
933
|
};
|
934
934
|
/* End PBXShellScriptBuildPhase section */
|
935
935
|
|
@@ -67,7 +67,7 @@ void rho_syncclient_processmodels(RHOM_MODEL* pModels, int nModels)
|
|
67
67
|
db::CDBAdapter& oUserDB = db::CDBAdapter::getUserDB();
|
68
68
|
int nStartModelID = 1;
|
69
69
|
{
|
70
|
-
|
70
|
+
IDBResult res = oUserDB.executeSQL("SELECT MAX(source_id) AS maxid FROM sources");
|
71
71
|
if ( !res.isEnd() )
|
72
72
|
nStartModelID = res.getIntByIdx(0)+2;
|
73
73
|
}
|
@@ -75,8 +75,8 @@ void rho_syncclient_processmodels(RHOM_MODEL* pModels, int nModels)
|
|
75
75
|
for ( int i = 0; i < nModels; i++ )
|
76
76
|
{
|
77
77
|
RHOM_MODEL& model = pModels[i];
|
78
|
-
|
79
|
-
model.name)
|
78
|
+
IDBResult res = oUserDB.executeSQL("SELECT sync_priority,source_id,partition, sync_type, schema_version, associations, blob_attribs FROM sources WHERE name=?",
|
79
|
+
model.name);
|
80
80
|
|
81
81
|
if ( !res.isEnd() )
|
82
82
|
{
|
@@ -122,7 +122,7 @@ void rho_syncclient_init(RHOM_MODEL* pModels, int nModels)
|
|
122
122
|
rho_db_init_attr_manager();
|
123
123
|
|
124
124
|
LOG(INFO) + "Starting sync engine...";
|
125
|
-
CSyncThread::Create(
|
125
|
+
CSyncThread::Create();
|
126
126
|
|
127
127
|
}
|
128
128
|
|
@@ -241,14 +241,14 @@ unsigned long rhom_load_item_by_object(db::CDBAdapter& db, const String& src_nam
|
|
241
241
|
if (!isSchemaSrc)
|
242
242
|
{
|
243
243
|
String sql = "SELECT attrib,value FROM object_values WHERE object=? AND source_id=?";
|
244
|
-
|
244
|
+
IDBResult res1 = db.executeSQL(sql.c_str(), szObject, nSrcID);
|
245
245
|
item = rhom_make_object(res1, nSrcID, isSchemaSrc);
|
246
246
|
if (item)
|
247
247
|
rho_syncclient_hash_put(item, "object", szObject.c_str() );
|
248
248
|
}else
|
249
249
|
{
|
250
250
|
String sql = "SELECT * FROM " + src_name + " WHERE object=? OFFSET 0 LIMIT 1";
|
251
|
-
|
251
|
+
IDBResult res1 = db.executeSQL(sql.c_str(), szObject);
|
252
252
|
item = rhom_make_object(res1, nSrcID, isSchemaSrc);
|
253
253
|
}
|
254
254
|
|
@@ -259,7 +259,7 @@ unsigned long rho_syncclient_find(const char* szModel,const char* szObject )
|
|
259
259
|
{
|
260
260
|
String src_name = szModel;
|
261
261
|
|
262
|
-
|
262
|
+
IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT source_id, partition, schema, sync_type from sources WHERE name=?", src_name);
|
263
263
|
if ( res.isEnd())
|
264
264
|
{
|
265
265
|
//TODO: report error - unknown source
|
@@ -279,7 +279,7 @@ unsigned long rhom_find(const char* szModel, unsigned long hash, int nCount )
|
|
279
279
|
{
|
280
280
|
String src_name = szModel;
|
281
281
|
|
282
|
-
|
282
|
+
IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT source_id, partition, schema, sync_type from sources WHERE name=?", src_name) );
|
283
283
|
if ( res.isEnd())
|
284
284
|
{
|
285
285
|
//TODO: report error - unknown source
|
@@ -331,7 +331,7 @@ unsigned long rhom_find(const char* szModel, unsigned long hash, int nCount )
|
|
331
331
|
}
|
332
332
|
}
|
333
333
|
|
334
|
-
|
334
|
+
IDBResult res1 = db.executeSQLEx(sql.c_str(), arValues ) );
|
335
335
|
|
336
336
|
if ( nCount == 1 )
|
337
337
|
{
|
@@ -363,7 +363,7 @@ unsigned long rho_syncclient_find_first(const char* szModel, unsigned long hash
|
|
363
363
|
void rho_syncclient_start_bulkupdate(const char* szModel)
|
364
364
|
{
|
365
365
|
String src_name = szModel;
|
366
|
-
|
366
|
+
IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT partition from sources WHERE name=?", src_name);
|
367
367
|
if ( res.isEnd())
|
368
368
|
{
|
369
369
|
//TODO: report error - unknown source
|
@@ -378,7 +378,7 @@ void rho_syncclient_start_bulkupdate(const char* szModel)
|
|
378
378
|
void rho_syncclient_stop_bulkupdate(const char* szModel)
|
379
379
|
{
|
380
380
|
String src_name = szModel;
|
381
|
-
|
381
|
+
IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT partition from sources WHERE name=?", src_name);
|
382
382
|
if ( res.isEnd())
|
383
383
|
{
|
384
384
|
//TODO: report error - unknown source
|
@@ -398,7 +398,7 @@ void rho_syncclient_itemdestroy( const char* szModel, unsigned long hash )
|
|
398
398
|
String obj = hashObject.get("object");
|
399
399
|
String update_type="delete";
|
400
400
|
|
401
|
-
|
401
|
+
IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT source_id, partition, schema, sync_type from sources WHERE name=?", src_name);
|
402
402
|
if ( res.isEnd())
|
403
403
|
{
|
404
404
|
//TODO: report error - unknown source
|
@@ -419,12 +419,12 @@ void rho_syncclient_itemdestroy( const char* szModel, unsigned long hash )
|
|
419
419
|
|
420
420
|
if ( isSchemaSrc )
|
421
421
|
{
|
422
|
-
|
422
|
+
IDBResult attrsList = db.executeSQL( ("SELECT * FROM " + tableName + " WHERE object=?").c_str(), obj);
|
423
423
|
if ( !attrsList.isEnd() )
|
424
424
|
item = rhom_make_object(attrsList,nSrcID,isSchemaSrc);
|
425
425
|
}else
|
426
426
|
{
|
427
|
-
|
427
|
+
IDBResult attrsList = db.executeSQL( ("SELECT attrib, value FROM " + tableName + " WHERE object=? and source_id=?").c_str(), obj, nSrcID);
|
428
428
|
if ( !attrsList.isEnd() )
|
429
429
|
item = rhom_make_object(attrsList,nSrcID,isSchemaSrc);
|
430
430
|
}
|
@@ -434,8 +434,8 @@ void rho_syncclient_itemdestroy( const char* szModel, unsigned long hash )
|
|
434
434
|
|
435
435
|
if ( isSyncSrc )
|
436
436
|
{
|
437
|
-
|
438
|
-
obj, "create", 0)
|
437
|
+
IDBResult resCreateType = db.executeSQL("SELECT update_type FROM changed_values WHERE object=? and update_type=? and sent=?",
|
438
|
+
obj, "create", 0);
|
439
439
|
|
440
440
|
db.executeSQL("DELETE FROM changed_values WHERE object=? and sent=?", obj, 0);
|
441
441
|
|
@@ -472,7 +472,7 @@ void rho_syncclient_save( const char* szModel, unsigned long hash )
|
|
472
472
|
Hashtable<String, String>& hashObject = *((Hashtable<String, String>*)hash);
|
473
473
|
String src_name = szModel;
|
474
474
|
|
475
|
-
|
475
|
+
IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT source_id, partition, schema, sync_type from sources WHERE name=?", src_name);
|
476
476
|
if ( res.isEnd())
|
477
477
|
{
|
478
478
|
//TODO: report error - unknown source
|
@@ -504,13 +504,13 @@ void rho_syncclient_save( const char* szModel, unsigned long hash )
|
|
504
504
|
arValues.addElement(obj);
|
505
505
|
arValues.addElement(convertToStringA(nSrcID));
|
506
506
|
}
|
507
|
-
|
507
|
+
IDBResult res1 = db.executeSQLEx(sql.c_str(), arValues );
|
508
508
|
if (!res1.isEnd())
|
509
509
|
{
|
510
510
|
if (isSyncSrc)
|
511
511
|
{
|
512
|
-
|
513
|
-
obj, nSrcID, 0 )
|
512
|
+
IDBResult resUpdateType = db.executeSQL( "SELECT update_type FROM changed_values WHERE object=? and source_id=? and sent=?",
|
513
|
+
obj, nSrcID, 0 );
|
514
514
|
if (!resUpdateType.isEnd())
|
515
515
|
update_type = resUpdateType.getStringByIdx(0);
|
516
516
|
else
|
@@ -553,8 +553,8 @@ void rho_syncclient_save( const char* szModel, unsigned long hash )
|
|
553
553
|
{
|
554
554
|
if (isSyncSrc)
|
555
555
|
{
|
556
|
-
|
557
|
-
obj, key, nSrcID, 0 )
|
556
|
+
IDBResult resUpdateType = db.executeSQL( "SELECT update_type FROM changed_values WHERE object=? and attrib=? and source_id=? and sent=?",
|
557
|
+
obj, key, nSrcID, 0 );
|
558
558
|
if (!resUpdateType.isEnd())
|
559
559
|
{
|
560
560
|
fields.put("update_type", resUpdateType.getStringByIdx(0) );
|
@@ -595,7 +595,7 @@ void rho_syncclient_create_object(const char* szModel, unsigned long hash)
|
|
595
595
|
Hashtable<String, String>& hashObject = *((Hashtable<String, String>*)hash);
|
596
596
|
String src_name = szModel;
|
597
597
|
|
598
|
-
|
598
|
+
IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT source_id, partition, schema, sync_type from sources WHERE name=?", src_name);
|
599
599
|
if ( res.isEnd())
|
600
600
|
{
|
601
601
|
//TODO: report error - unknown source
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
namespace rho {
|
4
4
|
namespace net{
|
5
|
-
struct
|
5
|
+
struct INetRequestImpl;
|
6
6
|
struct ISSL;
|
7
7
|
}
|
8
8
|
|
@@ -20,14 +20,16 @@ struct IRhoClassFactory
|
|
20
20
|
{
|
21
21
|
virtual ~IRhoClassFactory(void){;}
|
22
22
|
|
23
|
-
virtual net::INetRequest* createNetRequest() = 0;
|
24
23
|
virtual IRhoThreadImpl* createThreadImpl() = 0;
|
25
24
|
virtual net::ISSL* createSSLEngine() = 0;
|
26
25
|
|
27
26
|
virtual IRhoCrypt* createRhoCrypt() = 0;
|
28
|
-
};
|
29
27
|
|
30
|
-
|
28
|
+
virtual net::INetRequestImpl* createNetRequestImpl() = 0;
|
29
|
+
};
|
31
30
|
|
32
31
|
}
|
33
32
|
}
|
33
|
+
|
34
|
+
rho::common::IRhoClassFactory* rho_get_RhoClassFactory();
|
35
|
+
|