rhodes 3.3.1 → 3.3.2.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -2
- data/Manifest.txt +20 -0
- data/Rakefile +2 -1
- data/doc/build.txt +9 -3
- data/doc/configuration.txt +5 -1
- data/doc/device-caps.txt +112 -27
- data/doc/extensions.txt +0 -51
- data/doc/generator.txt +6 -0
- data/doc/rhom.txt +3 -0
- data/doc/simulator.txt +57 -17
- data/doc/ui.txt +24 -27
- data/installer/RHOELEMENTS-EULA.txt +295 -0
- data/installer/Rakefile +75 -49
- data/installer/rhostudio-moto.nsi +534 -0
- data/installer/rhostudio.nsi +13 -4
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/barcode.m +3 -0
- data/lib/framework/rho/rhoapplication.rb +4 -0
- data/lib/framework/rho/rhoevent.rb +2 -3
- data/lib/framework/rho/rhoevent_c.rb +2 -2
- data/lib/framework/rho/rhofsconnector.rb +24 -2
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +3 -3
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +164 -90
- data/platform/android/Rhodes/jni/src/signature.cpp +13 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +76 -34
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +3 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +10 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +0 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Callout.java +6 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +7 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +46 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +29 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +2 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +10 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +3 -2
- data/platform/android/build/android.rake +6 -27
- data/platform/android/build/androidcommon.rb +1 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +26 -0
- data/platform/iphone/Classes/AppManager/AppManager.h +1 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +70 -12
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +1 -1
- data/platform/iphone/Classes/Event/Event.m +38 -3
- data/platform/iphone/Classes/Rhodes.m +3 -2
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +1 -1
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/rbuild/iphone.rake +8 -8
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqcorewlanbearer.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulatorMac.zip +0 -0
- data/platform/osx/build/osx.rake +1 -1
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
- data/platform/shared/common/RhoConf.cpp +15 -6
- data/platform/shared/common/RhoConf.h +6 -1
- data/platform/shared/common/RhodesApp.cpp +19 -6
- data/platform/shared/common/RhodesApp.h +4 -2
- data/platform/shared/common/RhodesAppBase.cpp +18 -10
- data/platform/shared/common/RhodesAppBase.h +6 -3
- data/platform/shared/common/map/GeocodingMapEngine.h +2 -2
- data/platform/shared/logging/RhoLogConf.cpp +14 -8
- data/platform/shared/logging/RhoLogConf.h +1 -0
- data/platform/shared/net/HttpServer.cpp +15 -3
- data/platform/shared/net/HttpServer.h +2 -1
- data/platform/shared/qt/curl/curl.pro +1 -1
- data/platform/shared/qt/rhodes/QtMainWindow.h +1 -1
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +2 -2
- data/platform/shared/qt/rhodes/main.cpp +2 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +1 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +11 -1
- data/platform/shared/sync/SyncNotify.cpp +1 -2
- data/platform/shared/sync/SyncNotify.h +2 -2
- data/platform/shared/sync/SyncThread.cpp +27 -12
- data/platform/shared/sync/SyncThread.h +2 -0
- data/platform/shared/unzip/unzip.cpp +3 -2
- data/platform/win32/RhoSimulator/Microsoft.VC80.CRT.manifest +8 -0
- data/platform/win32/RhoSimulator/Microsoft.VC80.OpenMP.manifest +7 -0
- data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
- data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
- data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
- data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
- data/platform/win32/RhoSimulator/libeay32.dll +0 -0
- data/platform/win32/RhoSimulator/msvcm80.dll +0 -0
- data/platform/win32/RhoSimulator/msvcp80.dll +0 -0
- data/platform/win32/RhoSimulator/msvcr80.dll +0 -0
- data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
- data/platform/win32/RhoSimulator/vcomp.dll +0 -0
- data/platform/wm/build/rhodes.nsi +316 -0
- data/platform/wm/build/wm.rake +57 -10
- data/platform/wm/rhodes/Rhodes.cpp +2 -1
- data/platform/wm/rhodes/rhodes.vcproj +2 -0
- data/platform/wm/tools/wmdc_connect.sln +20 -0
- data/platform/wm/tools/wmdc_connect/stdafx.cpp +27 -0
- data/platform/wm/tools/wmdc_connect/stdafx.h +35 -0
- data/platform/wm/tools/wmdc_connect/wmdc_connect.cpp +119 -0
- data/platform/wm/tools/wmdc_connect/wmdc_connect.vcproj +205 -0
- data/platform/wp7/RhoRubyExtGen/RhoAlert.cs +73 -0
- data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
- data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +8 -8
- data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +47 -6
- data/platform/wp7/RhoRubyLib/RhoRuby.cs +8 -0
- data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +5 -0
- data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +5 -0
- data/platform/wp7/RhoRubyLib/common/RhoParams.cs +2 -1
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +58 -37
- data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +37 -0
- data/platform/wp7/RhoRubyLib/db/DBAttrManager.cs +63 -1
- data/platform/wp7/RhoRubyLib/db/IDBStorage.cs +2 -0
- data/platform/wp7/RhoRubyLib/db/SqliteStorage.cs +27 -0
- data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +2 -2
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +4 -3
- data/platform/wp7/RhoRubyLib/rubyext/RhoAlert.cs +160 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +44 -12
- data/platform/wp7/RhoRubyLib/sync/ClientRegister.cs +4 -3
- data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +27 -32
- data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +31 -11
- data/platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs +6 -1
- data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +4 -0
- data/platform/wp7/RhoRubyLib/sync/SyncThread.cs +21 -15
- data/platform/wp7/build/wp.rake +6 -0
- data/rakefile.rb +2 -1
- data/res/build-tools/Coding4Fun.Phone.Controls.dll +0 -0
- data/res/build-tools/wmdc_connect.exe +0 -0
- data/res/generators/templates/spec/app/SpecRunner/index.erb +14 -13
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +10 -1
- data/version +1 -1
- metadata +26 -4
@@ -550,10 +550,11 @@ static Rhodes *instance = NULL;
|
|
550
550
|
[appManager configure];
|
551
551
|
|
552
552
|
const char *szRootPath = rho_native_rhopath();
|
553
|
+
const char *szUserPath = rho_native_rhouserpath();
|
553
554
|
NSLog(@"Init logconf");
|
554
|
-
|
555
|
+
rho_logconf_Init_with_separate_user_path(szRootPath, "", szUserPath);
|
555
556
|
NSLog(@"Create rhodes app");
|
556
|
-
|
557
|
+
rho_rhodesapp_create_with_separate_user_path(szRootPath, szUserPath);
|
557
558
|
app_created = YES;
|
558
559
|
|
559
560
|
rotationLocked = rho_conf_getBool("disable_screen_rotation");
|
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
|
87
87
|
- (void)useImage:(UIImage*)theImage {
|
88
|
-
NSString *folder = [[AppManager
|
88
|
+
NSString *folder = [[AppManager getDbPath] stringByAppendingPathComponent:@"/db-files"];
|
89
89
|
|
90
90
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
91
91
|
if (![fileManager fileExistsAtPath:folder])
|
data/platform/iphone/Info.plist
CHANGED
@@ -255,7 +255,7 @@ def prepare_production_plist (app_path, app_name)
|
|
255
255
|
$plist_title = app_name
|
256
256
|
$plist_subtitle = app_name
|
257
257
|
$plist_icon_url = "http://example.com/icon57.png"
|
258
|
-
$plist_ipa_url = "http://example.com/
|
258
|
+
$plist_ipa_url = "http://example.com/"+app_name+".ipa"
|
259
259
|
|
260
260
|
appname = $app_config["name"] ? $app_config["name"] : "rhorunner"
|
261
261
|
vendor = $app_config['vendor'] ? $app_config['vendor'] : "rhomobile"
|
@@ -267,10 +267,10 @@ def prepare_production_plist (app_path, app_name)
|
|
267
267
|
|
268
268
|
if !$app_config["iphone"].nil?
|
269
269
|
if !$app_config["iphone"]["production"].nil?
|
270
|
-
plist_title = $app_config["iphone"]["production"]["app_plist_title"] unless $app_config["iphone"]["production"]["app_plist_title"].nil?
|
271
|
-
plist_subtitle = $app_config["iphone"]["production"]["app_plist_subtitle"] unless $app_config["iphone"]["production"]["app_plist_subtitle"].nil?
|
272
|
-
plist_icon_url = $app_config["iphone"]["production"]["app_plist_icon_url"] unless $app_config["iphone"]["production"]["app_plist_icon_url"].nil?
|
273
|
-
plist_ipa_url = $app_config["iphone"]["production"]["app_plist_ipa_url"] unless $app_config["iphone"]["production"]["app_plist_ipa_url"].nil?
|
270
|
+
$plist_title = $app_config["iphone"]["production"]["app_plist_title"] unless $app_config["iphone"]["production"]["app_plist_title"].nil?
|
271
|
+
$plist_subtitle = $app_config["iphone"]["production"]["app_plist_subtitle"] unless $app_config["iphone"]["production"]["app_plist_subtitle"].nil?
|
272
|
+
$plist_icon_url = $app_config["iphone"]["production"]["app_plist_icon_url"] unless $app_config["iphone"]["production"]["app_plist_icon_url"].nil?
|
273
|
+
$plist_ipa_url = $app_config["iphone"]["production"]["app_plist_ipa_url"] unless $app_config["iphone"]["production"]["app_plist_ipa_url"].nil?
|
274
274
|
end
|
275
275
|
end
|
276
276
|
|
@@ -397,7 +397,7 @@ end
|
|
397
397
|
|
398
398
|
def restore_entitlements_file
|
399
399
|
enti_rho_name = File.join($config["build"]["iphonepath"], "Entitlements.plist")
|
400
|
-
if File.exists?
|
400
|
+
if File.exists?(enti_rho_name + '_bak')
|
401
401
|
puts 'restore Entitlements.plist ...'
|
402
402
|
rm_f enti_rho_name
|
403
403
|
cp (enti_rho_name + '_bak'), enti_rho_name
|
@@ -942,7 +942,7 @@ namespace "run" do
|
|
942
942
|
simapp = File.join($simdir, $emulator_version, "Applications")
|
943
943
|
|
944
944
|
|
945
|
-
rholog = simapp + "/" + $guid + "/Documents/
|
945
|
+
rholog = simapp + "/" + $guid + "/Library/Private Documents/rholog.txt"
|
946
946
|
puts "log_file=" + rholog
|
947
947
|
end
|
948
948
|
|
@@ -1068,7 +1068,7 @@ namespace "run" do
|
|
1068
1068
|
|
1069
1069
|
#>>>>>>>>>>
|
1070
1070
|
`echo "#{$applog}" > "#{$simrhodes}/Documents/rhologpath.txt"`
|
1071
|
-
rholog = simapp + "/" + $guid + "/Documents/
|
1071
|
+
rholog = simapp + "/" + $guid + "/Library/Private Documents/rholog.txt"
|
1072
1072
|
|
1073
1073
|
|
1074
1074
|
simpublic = simapp + "/" + $guid + "/Documents/apps/public"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<key>CFBundlePackageType</key>
|
8
8
|
<string>APPL</string>
|
9
9
|
<key>CFBundleGetInfoString</key>
|
10
|
-
<string>RhoSimulator 3.3.
|
10
|
+
<string>RhoSimulator 3.3.2.beta.1, Copyright 2010-2012 Rhomobile, Inc.</string>
|
11
11
|
<key>CFBundleSignature</key>
|
12
12
|
<string>????</string>
|
13
13
|
<key>CFBundleExecutable</key>
|
Binary file
|
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqcorewlanbearer.dylib
ADDED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib
CHANGED
Binary file
|
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib
CHANGED
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib
CHANGED
Binary file
|
Binary file
|
data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib
CHANGED
Binary file
|
Binary file
|
data/platform/osx/build/osx.rake
CHANGED
@@ -107,7 +107,7 @@ PRE_TARGETDEPS += #{$pre_targetdeps}
|
|
107
107
|
<key>CFBundlePackageType</key>
|
108
108
|
<string>APPL</string>
|
109
109
|
<key>CFBundleGetInfoString</key>
|
110
|
-
<string>RhoSimulator #{$rhodes_version}, Copyright 2010-
|
110
|
+
<string>RhoSimulator #{$rhodes_version}, Copyright 2010-2012 Rhomobile, Inc.</string>
|
111
111
|
<key>CFBundleSignature</key>
|
112
112
|
<string>@TYPEINFO@</string>
|
113
113
|
<key>CFBundleExecutable</key>
|
@@ -50,7 +50,7 @@ void RhoSettings::saveToFile(const char* szName)
|
|
50
50
|
saveChangesToString(strData);
|
51
51
|
|
52
52
|
CRhoFile oFile;
|
53
|
-
oFile.open( (
|
53
|
+
oFile.open( (getAppConfUserFilePath()+CONF_CHANGES).c_str(), common::CRhoFile::OpenForWrite);
|
54
54
|
oFile.write( strData.c_str(), strData.size() );
|
55
55
|
}
|
56
56
|
|
@@ -93,10 +93,10 @@ void RhoSettings::readChanges()
|
|
93
93
|
String strTimestamp;
|
94
94
|
CRhoFile::readStringFromFile((getConfFilePath()+CONF_TIMESTAMP).c_str(), strTimestamp);
|
95
95
|
|
96
|
-
if ( CRhoFile::isFileExist((
|
96
|
+
if ( CRhoFile::isFileExist((getAppConfUserFilePath()+CONF_CHANGES).c_str()) )
|
97
97
|
{
|
98
98
|
String strSettings;
|
99
|
-
CRhoFile::readStringFromFile((
|
99
|
+
CRhoFile::readStringFromFile((getAppConfUserFilePath()+CONF_CHANGES).c_str(), strSettings);
|
100
100
|
loadFromString( strSettings.c_str(), m_mapChangedValues );
|
101
101
|
|
102
102
|
String strOldTimestamp = "";
|
@@ -258,10 +258,18 @@ bool RhoSettings::isExist(const char* szName){
|
|
258
258
|
|
259
259
|
extern "C" {
|
260
260
|
|
261
|
-
void rho_conf_Init(const char* szRootPath)
|
261
|
+
void rho_conf_Init(const char* szRootPath)
|
262
|
+
{
|
263
|
+
rho_conf_Init_with_separate_user_path(szRootPath, szRootPath);
|
264
|
+
}
|
265
|
+
|
266
|
+
void rho_conf_Init_with_separate_user_path(const char* szRootPath, const char* szUserPath)
|
267
|
+
{
|
262
268
|
rho::common::CFilePath oRhoPath( szRootPath );
|
263
|
-
|
269
|
+
rho::common::CFilePath oUserPath( szUserPath );
|
270
|
+
|
264
271
|
RHOCONF().setAppConfFilePath(oRhoPath.makeFullPath(CONF_FILENAME).c_str());
|
272
|
+
RHOCONF().setAppConfUserFilePath(oUserPath.makeFullPath(CONF_FILENAME).c_str());
|
265
273
|
#ifdef RHODES_EMULATOR
|
266
274
|
rho::String strPath = rho::common::CFilePath::join( szRootPath, RHO_EMULATOR_DIR);
|
267
275
|
strPath = rho::common::CFilePath::join( strPath, CONF_FILENAME);
|
@@ -269,9 +277,10 @@ void rho_conf_Init(const char* szRootPath){
|
|
269
277
|
#else
|
270
278
|
RHOCONF().setConfFilePath(oRhoPath.makeFullPath(CONF_FILENAME).c_str());
|
271
279
|
#endif
|
272
|
-
|
280
|
+
|
273
281
|
RHOCONF().loadFromFile();
|
274
282
|
}
|
283
|
+
|
275
284
|
|
276
285
|
int rho_conf_getBool(const char* szName) {
|
277
286
|
return RHOCONF().getBool(szName) ? 1 : 0;
|
@@ -38,7 +38,7 @@ namespace common{
|
|
38
38
|
#define RHODBVERSION "DBVersion"
|
39
39
|
|
40
40
|
class RhoSettings{
|
41
|
-
String m_strConfFilePath, m_strAppConfFilePath;
|
41
|
+
String m_strConfFilePath, m_strAppConfFilePath, m_strAppConfUserPath;
|
42
42
|
Hashtable<String,String> m_mapValues;
|
43
43
|
Hashtable<String,String> m_mapChangedValues;
|
44
44
|
HashtablePtr<String,Vector<String>* > m_mapConflictedValues;
|
@@ -58,8 +58,12 @@ public:
|
|
58
58
|
|
59
59
|
const String& getConfFilePath()const{ return m_strConfFilePath;}
|
60
60
|
void setConfFilePath(const char* szConfFilePath){ m_strConfFilePath = szConfFilePath; }
|
61
|
+
|
61
62
|
const String& getAppConfFilePath()const{ return m_strAppConfFilePath;}
|
62
63
|
void setAppConfFilePath(const char* szConfFilePath){ m_strAppConfFilePath = szConfFilePath; }
|
64
|
+
|
65
|
+
const String& getAppConfUserFilePath()const{ return m_strAppConfUserPath;}
|
66
|
+
void setAppConfUserFilePath(const char* szUserPath){ m_strAppConfUserPath = szUserPath; }
|
63
67
|
|
64
68
|
void loadFromFile();
|
65
69
|
|
@@ -92,6 +96,7 @@ extern "C"{
|
|
92
96
|
#endif //__cplusplus
|
93
97
|
|
94
98
|
void rho_conf_Init(const char* szRootPath);
|
99
|
+
void rho_conf_Init_with_separate_user_path(const char* szRootPath, const char* szUserPath);
|
95
100
|
int rho_conf_getBool(const char* szName);
|
96
101
|
void rho_conf_setBool(const char* szName, bool value);
|
97
102
|
int rho_conf_getInt(const char* szName);
|
@@ -260,12 +260,12 @@ void CAppCallbacksQueue::processCommand(IQueueCommand* pCmd)
|
|
260
260
|
m_commands.clear();
|
261
261
|
}
|
262
262
|
|
263
|
-
/*static*/ CRhodesApp* CRhodesApp::Create(const String& strRootPath)
|
263
|
+
/*static*/ CRhodesApp* CRhodesApp::Create(const String& strRootPath, const String& strUserPath)
|
264
264
|
{
|
265
265
|
if ( m_pInstance != null)
|
266
266
|
return (CRhodesApp*)m_pInstance;
|
267
267
|
|
268
|
-
m_pInstance = new CRhodesApp(strRootPath);
|
268
|
+
m_pInstance = new CRhodesApp(strRootPath, strUserPath);
|
269
269
|
|
270
270
|
String push_pin = RHOCONF().getString("push_pin");
|
271
271
|
if(!push_pin.empty())
|
@@ -285,8 +285,8 @@ void CAppCallbacksQueue::processCommand(IQueueCommand* pCmd)
|
|
285
285
|
|
286
286
|
}
|
287
287
|
|
288
|
-
CRhodesApp::CRhodesApp(const String& strRootPath)
|
289
|
-
:CRhodesAppBase(strRootPath)
|
288
|
+
CRhodesApp::CRhodesApp(const String& strRootPath, const String& strUserPath)
|
289
|
+
:CRhodesAppBase(strRootPath, strUserPath)
|
290
290
|
{
|
291
291
|
m_bExit = false;
|
292
292
|
m_bDeactivationMode = false;
|
@@ -773,11 +773,12 @@ const String& CRhodesApp::getRhoMessage(int nError, const char* szName)
|
|
773
773
|
void CRhodesApp::initHttpServer()
|
774
774
|
{
|
775
775
|
String strAppRootPath = getRhoRootPath();
|
776
|
+
String strAppUserPath = getRhoUserPath();
|
776
777
|
#ifndef RHODES_EMULATOR
|
777
778
|
strAppRootPath += "apps";
|
778
779
|
#endif
|
779
780
|
|
780
|
-
m_httpServer = new net::CHttpServer(atoi(getFreeListeningPort()), strAppRootPath);
|
781
|
+
m_httpServer = new net::CHttpServer(atoi(getFreeListeningPort()), strAppRootPath, strAppUserPath);
|
781
782
|
m_httpServer->register_uri("/system/geolocation", rubyext::CGeoLocation::callback_geolocation);
|
782
783
|
m_httpServer->register_uri("/system/syncdb", callback_syncdb);
|
783
784
|
m_httpServer->register_uri("/system/redirect_to", callback_redirect_to);
|
@@ -1401,9 +1402,15 @@ int rho_http_snprintf(char *buf, size_t buflen, const char *fmt, ...)
|
|
1401
1402
|
|
1402
1403
|
void rho_rhodesapp_create(const char* szRootPath)
|
1403
1404
|
{
|
1404
|
-
rho::common::CRhodesApp::Create(szRootPath);
|
1405
|
+
rho::common::CRhodesApp::Create(szRootPath, szRootPath);
|
1405
1406
|
}
|
1406
1407
|
|
1408
|
+
void rho_rhodesapp_create_with_separate_user_path(const char* szRootPath, const char* szUserPath)
|
1409
|
+
{
|
1410
|
+
rho::common::CRhodesApp::Create(szRootPath, szUserPath);
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
|
1407
1414
|
void rho_rhodesapp_start()
|
1408
1415
|
{
|
1409
1416
|
RHODESAPP().startApp();
|
@@ -1453,6 +1460,12 @@ const char* rho_rhodesapp_getblobsdirpath()
|
|
1453
1460
|
{
|
1454
1461
|
return RHODESAPP().getBlobsDirPath().c_str();
|
1455
1462
|
}
|
1463
|
+
|
1464
|
+
const char* rho_rhodesapp_getuserrootpath()
|
1465
|
+
{
|
1466
|
+
return RHODESAPP().getRhoUserPath().c_str();
|
1467
|
+
}
|
1468
|
+
|
1456
1469
|
|
1457
1470
|
const char* rho_rhodesapp_getdbdirpath()
|
1458
1471
|
{
|
@@ -51,7 +51,7 @@ public:
|
|
51
51
|
|
52
52
|
private:
|
53
53
|
|
54
|
-
CRhodesApp(const String& strRootPath);
|
54
|
+
CRhodesApp(const String& strRootPath, const String& strUserPath);
|
55
55
|
boolean m_bExit, m_bRestartServer;
|
56
56
|
|
57
57
|
String m_strListeningPorts;
|
@@ -88,7 +88,7 @@ private:
|
|
88
88
|
public:
|
89
89
|
~CRhodesApp(void);
|
90
90
|
|
91
|
-
static CRhodesApp* Create(const String& strRootPath);
|
91
|
+
static CRhodesApp* Create(const String& strRootPath, const String& strUserPath);
|
92
92
|
static void Destroy();
|
93
93
|
static CRhodesApp* getInstance(){ return (CRhodesApp*)m_pInstance; }
|
94
94
|
void startApp();
|
@@ -188,6 +188,7 @@ extern "C" {
|
|
188
188
|
#endif //__cplusplus
|
189
189
|
|
190
190
|
void rho_rhodesapp_create(const char* szRootPath);
|
191
|
+
void rho_rhodesapp_create_with_separate_user_path(const char* szRootPath, const char* szUserPath);
|
191
192
|
void rho_rhodesapp_start();
|
192
193
|
void rho_rhodesapp_destroy();
|
193
194
|
|
@@ -203,6 +204,7 @@ const char* rho_rhodesapp_getloadingpagepath();
|
|
203
204
|
const char* rho_rhodesapp_getblobsdirpath();
|
204
205
|
const char* rho_rhodesapp_getdbdirpath();
|
205
206
|
const char* rho_rhodesapp_getapprootpath();
|
207
|
+
const char* rho_rhodesapp_getuserrootpath();
|
206
208
|
|
207
209
|
void rho_http_redirect(void* httpContext, const char* szUrl);
|
208
210
|
void rho_http_senderror(void* httpContext, int nError, const char* szMsg);
|
@@ -36,12 +36,12 @@ namespace common{
|
|
36
36
|
IMPLEMENT_LOGCLASS(CRhodesAppBase,"RhodesApp");
|
37
37
|
CRhodesAppBase* CRhodesAppBase::m_pInstance = 0;
|
38
38
|
|
39
|
-
/*static*/ CRhodesAppBase* CRhodesAppBase::Create(const String& strRootPath)
|
39
|
+
/*static*/ CRhodesAppBase* CRhodesAppBase::Create(const String& strRootPath, const String& strUserPath)
|
40
40
|
{
|
41
41
|
if ( m_pInstance != null)
|
42
42
|
return m_pInstance;
|
43
43
|
|
44
|
-
m_pInstance = new CRhodesAppBase(strRootPath);
|
44
|
+
m_pInstance = new CRhodesAppBase(strRootPath, strUserPath);
|
45
45
|
return m_pInstance;
|
46
46
|
}
|
47
47
|
|
@@ -53,9 +53,10 @@ CRhodesAppBase* CRhodesAppBase::m_pInstance = 0;
|
|
53
53
|
m_pInstance = 0;
|
54
54
|
}
|
55
55
|
|
56
|
-
CRhodesAppBase::CRhodesAppBase(const String& strRootPath) : CRhoThread()
|
56
|
+
CRhodesAppBase::CRhodesAppBase(const String& strRootPath, const String& strUserPath) : CRhoThread()
|
57
57
|
{
|
58
58
|
m_strRhoRootPath = strRootPath;
|
59
|
+
m_strAppUserPath = strUserPath;
|
59
60
|
|
60
61
|
initAppUrls();
|
61
62
|
}
|
@@ -63,14 +64,14 @@ CRhodesAppBase::CRhodesAppBase(const String& strRootPath) : CRhoThread()
|
|
63
64
|
void CRhodesAppBase::initAppUrls()
|
64
65
|
{
|
65
66
|
#ifndef RHODES_EMULATOR
|
66
|
-
m_strBlobsDirPath =
|
67
|
-
m_strDBDirPath =
|
67
|
+
m_strBlobsDirPath = getRhoUserPath() + "db/db-files";
|
68
|
+
m_strDBDirPath = getRhoUserPath() + "db";
|
68
69
|
|
69
70
|
m_strAppRootPath = getRhoRootPath() + "apps";
|
70
71
|
//m_strRhodesPath = "";
|
71
72
|
#else
|
72
|
-
m_strBlobsDirPath =
|
73
|
-
m_strDBDirPath =
|
73
|
+
m_strBlobsDirPath = getRhoUserPath() + RHO_EMULATOR_DIR"/db/db-files";
|
74
|
+
m_strDBDirPath = getRhoUserPath() + RHO_EMULATOR_DIR"/db";
|
74
75
|
|
75
76
|
m_strAppRootPath = getRhoRootPath();
|
76
77
|
#endif
|
@@ -79,7 +80,7 @@ void CRhodesAppBase::initAppUrls()
|
|
79
80
|
String CRhodesAppBase::getRelativeDBFilesPath(const String& strFilePath)
|
80
81
|
{
|
81
82
|
#ifndef RHODES_EMULATOR
|
82
|
-
String strDbFileRoot = getRhoRootPath();
|
83
|
+
String strDbFileRoot = getRhoUserPath();//getRhoRootPath();
|
83
84
|
#else
|
84
85
|
String strDbFileRoot = getRhoRootPath() + RHO_EMULATOR_DIR;
|
85
86
|
#endif
|
@@ -93,7 +94,7 @@ String CRhodesAppBase::getRelativeDBFilesPath(const String& strFilePath)
|
|
93
94
|
String CRhodesAppBase::resolveDBFilesPath(const String& strFilePath)
|
94
95
|
{
|
95
96
|
#ifndef RHODES_EMULATOR
|
96
|
-
String strDbFileRoot = getRhoRootPath();
|
97
|
+
String strDbFileRoot = getRhoUserPath();//getRhoRootPath();
|
97
98
|
#else
|
98
99
|
String strDbFileRoot = getRhoRootPath() + RHO_EMULATOR_DIR;
|
99
100
|
#endif
|
@@ -297,7 +298,7 @@ int rho_base64_decode(const char *src, int srclen, char *dst)
|
|
297
298
|
dst[out++] = '\0';
|
298
299
|
return out;
|
299
300
|
}
|
300
|
-
|
301
|
+
|
301
302
|
} //extern "C"
|
302
303
|
|
303
304
|
#if !defined(OS_ANDROID)
|
@@ -306,3 +307,10 @@ rho::String rho_sysimpl_get_phone_id()
|
|
306
307
|
return "";
|
307
308
|
}
|
308
309
|
#endif
|
310
|
+
|
311
|
+
#if !defined(OS_MACOSX) || defined(RHODES_EMULATOR)
|
312
|
+
const char* rho_native_rhouserpath()
|
313
|
+
{
|
314
|
+
return rho_native_rhopath();
|
315
|
+
}
|
316
|
+
#endif
|
@@ -47,18 +47,19 @@ protected:
|
|
47
47
|
|
48
48
|
static CRhodesAppBase* m_pInstance;
|
49
49
|
|
50
|
-
String m_strRhoRootPath, m_strBlobsDirPath, m_strDBDirPath, m_strAppRootPath;//, m_strRhodesPath;
|
50
|
+
String m_strRhoRootPath, m_strBlobsDirPath, m_strDBDirPath, m_strAppRootPath, m_strAppUserPath;//, m_strRhodesPath;
|
51
51
|
String m_strHomeUrl;
|
52
52
|
|
53
|
-
CRhodesAppBase(const String& strRootPath);
|
53
|
+
CRhodesAppBase(const String& strRootPath, const String& strUserPath);
|
54
54
|
public:
|
55
|
-
static CRhodesAppBase* Create(const String& strRootPath);
|
55
|
+
static CRhodesAppBase* Create(const String& strRootPath, const String& strUserPath);
|
56
56
|
static void Destroy();
|
57
57
|
static CRhodesAppBase* getInstance(){ return m_pInstance; }
|
58
58
|
|
59
59
|
String resolveDBFilesPath(const String& strFilePath);
|
60
60
|
String getRelativeDBFilesPath(const String& strFilePath);
|
61
61
|
const String& getRhoRootPath(){return m_strRhoRootPath;}
|
62
|
+
const String& getRhoUserPath(){return m_strAppUserPath;}
|
62
63
|
//const String& getRhodesPath(){return m_strRhodesPath;}
|
63
64
|
//void setRhodesPath(const String& path){m_strRhodesPath = path;}
|
64
65
|
const String& getAppRootPath(){return m_strAppRootPath;}
|
@@ -87,6 +88,8 @@ extern "C" {
|
|
87
88
|
#endif //__cplusplus
|
88
89
|
|
89
90
|
const char* rho_native_rhopath();
|
91
|
+
const char* rho_native_rhouserpath();
|
92
|
+
|
90
93
|
const char* rho_rhodesapp_getplatform();
|
91
94
|
//const char* rho_rhodesapp_getrhodespath();
|
92
95
|
void rho_file_recursive_createdir(const char* szPath, const char* szBasePath);
|