rhodes 2.0.0.beta7 → 2.0.0.beta8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +20 -1
- data/bin/rhodes-setup +6 -2
- data/lib/extensions/digest/ext/Rakefile +2 -2
- data/lib/framework/rho/render.rb +2 -0
- data/lib/framework/rho/rho.rb +159 -95
- data/lib/framework/rho/rhoapplication.rb +24 -5
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhom/rhom_model.rb +32 -23
- data/lib/framework/rhom/rhom_object_factory.rb +2 -2
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/jni/src/callbacks.cpp +8 -1
- data/platform/android/Rhodes/jni/src/mapview.cpp +4 -1
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +5 -1
- data/platform/android/Rhodes/jni/src/webview.cpp +3 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +3 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +1 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +3 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +24 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +7 -2
- data/platform/android/build/android.rake +11 -38
- data/platform/android/build/androidcommon.rb +50 -2
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/android/build/libsqlite_build.files +1 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +2 -1
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -5
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +3 -6
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +4 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +12 -35
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +2 -1
- data/platform/iphone/Classes/DateTimePickerDelegate.m +4 -4
- data/platform/iphone/Classes/NativeBar.m +12 -6
- data/platform/iphone/Classes/NavBar.m +1 -1
- data/platform/iphone/Classes/RhoMainView.h +4 -1
- data/platform/iphone/Classes/Rhodes.h +6 -2
- data/platform/iphone/Classes/Rhodes.m +23 -3
- data/platform/iphone/Classes/SimpleMainView.h +3 -7
- data/platform/iphone/Classes/SimpleMainView.m +108 -54
- data/platform/iphone/Classes/TabbedMainView.h +3 -2
- data/platform/iphone/Classes/TabbedMainView.m +21 -10
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +8 -0
- data/platform/shared/common/IRhoClassFactory.h +1 -0
- data/platform/shared/common/RhodesApp.cpp +7 -2
- data/platform/shared/common/ThreadQueue.cpp +110 -0
- data/platform/shared/common/ThreadQueue.h +75 -0
- data/platform/shared/logging/RhoLogCat.h +4 -0
- data/platform/shared/net/AsyncHttp.cpp +134 -135
- data/platform/shared/net/AsyncHttp.h +74 -33
- data/platform/shared/net/HttpServer.cpp +7 -1
- data/platform/shared/ruby/thread.c +4 -0
- data/platform/shared/ruby/thread_win32.c +9 -8
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +26 -5
- data/platform/shared/rubyJVM/src/com/rho/net/INetworkAccess.java +0 -2
- data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +4 -13
- data/platform/shared/rubyJVM/src/com/rho/net/URI.java +2 -2
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +3 -3
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/ObjectFactory.java +12 -2
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyString.java +6 -3
- data/platform/shared/rubyJVM/src/javolution/util/FastTable.java +12 -2
- data/platform/shared/sync/SyncEngine.cpp +15 -3
- data/platform/shared/sync/SyncEngine.h +1 -1
- data/platform/shared/sync/SyncThread.cpp +18 -101
- data/platform/shared/sync/SyncThread.h +30 -22
- data/platform/wm/RhoLib/RhoLib.vcproj +8 -0
- data/platform/wm/rhodes/Rhodes.cpp +143 -1
- data/platform/wm/rhodes/memory_helper.cpp +273 -0
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.cpp +1 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +46 -3
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +29 -1
- data/res/build-tools/db/syncdb.schema +1 -0
- data/res/generators/rhogen.rb +1 -1
- data/rhodes.gemspec +2 -2
- metadata +23 -6
- data/Manifest.txt +0 -5289
- data/rhobuild.yml +0 -37
@@ -35,10 +35,6 @@ ANDROID_PERMISSIONS = {
|
|
35
35
|
'vibrate' => 'VIBRATE'
|
36
36
|
}
|
37
37
|
|
38
|
-
def get_sources(name)
|
39
|
-
File.read(File.join($builddir, name + '_build.files')).split("\n")
|
40
|
-
end
|
41
|
-
|
42
38
|
def set_app_name_android(newname)
|
43
39
|
puts "set_app_name"
|
44
40
|
$stdout.flush
|
@@ -446,7 +442,7 @@ namespace "build" do
|
|
446
442
|
objdir = $objdir["sqlite"]
|
447
443
|
libname = $libname["sqlite"]
|
448
444
|
|
449
|
-
|
445
|
+
cc_build 'libsqlite', objdir, ["-I#{srcdir}"] or exit 1
|
450
446
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
451
447
|
end
|
452
448
|
|
@@ -468,9 +464,7 @@ namespace "build" do
|
|
468
464
|
args << "-I#{srcdir}/../include"
|
469
465
|
args << "-I#{srcdir}"
|
470
466
|
|
471
|
-
|
472
|
-
cc_compile f, objdir, args or exit 1
|
473
|
-
end
|
467
|
+
cc_build 'libcurl', objdir, args or exit 1
|
474
468
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
475
469
|
end
|
476
470
|
|
@@ -486,10 +480,7 @@ namespace "build" do
|
|
486
480
|
args << "-I#{srcdir}/.."
|
487
481
|
args << "-I#{srcdir}/../sqlite"
|
488
482
|
|
489
|
-
|
490
|
-
cc_compile f, objdir, args or exit 1
|
491
|
-
end
|
492
|
-
|
483
|
+
cc_build 'libruby', objdir, args or exit 1
|
493
484
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
494
485
|
end
|
495
486
|
|
@@ -503,10 +494,7 @@ namespace "build" do
|
|
503
494
|
args << "-D__NEW__" if USE_STLPORT
|
504
495
|
args << "-I#{$stlport_includes}" if USE_STLPORT
|
505
496
|
|
506
|
-
|
507
|
-
get_sources('libjson').each do |f|
|
508
|
-
cc_compile f, objdir, args or exit 1
|
509
|
-
end
|
497
|
+
cc_build 'libjson', objdir, args or exit 1
|
510
498
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
511
499
|
end
|
512
500
|
|
@@ -532,9 +520,7 @@ namespace "build" do
|
|
532
520
|
args << "-fno-rtti"
|
533
521
|
args << "-fno-exceptions"
|
534
522
|
|
535
|
-
|
536
|
-
cc_compile f, objdir, args or exit 1
|
537
|
-
end
|
523
|
+
cc_build 'libstlport', objdir, args or exit 1
|
538
524
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
539
525
|
end
|
540
526
|
end
|
@@ -549,9 +535,7 @@ namespace "build" do
|
|
549
535
|
args << "-D__NEW__" if USE_STLPORT
|
550
536
|
args << "-I#{$stlport_includes}" if USE_STLPORT
|
551
537
|
|
552
|
-
|
553
|
-
cc_compile f, objdir, args or exit 1
|
554
|
-
end
|
538
|
+
cc_build 'librholog', objdir, args or exit 1
|
555
539
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
556
540
|
end
|
557
541
|
|
@@ -564,9 +548,7 @@ namespace "build" do
|
|
564
548
|
args << "-D__NEW__" if USE_STLPORT
|
565
549
|
args << "-I#{$stlport_includes}" if USE_STLPORT
|
566
550
|
|
567
|
-
|
568
|
-
cc_compile f, objdir, args or exit 1
|
569
|
-
end
|
551
|
+
cc_build 'librhomain', objdir, args or exit 1
|
570
552
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
571
553
|
end
|
572
554
|
|
@@ -579,10 +561,7 @@ namespace "build" do
|
|
579
561
|
args << "-D__NEW__" if USE_STLPORT
|
580
562
|
args << "-I#{$stlport_includes}" if USE_STLPORT
|
581
563
|
|
582
|
-
|
583
|
-
get_sources('librhocommon').each do |f|
|
584
|
-
cc_compile f, objdir, args or exit 1
|
585
|
-
end
|
564
|
+
cc_build 'librhocommon', objdir, args or exit 1
|
586
565
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
587
566
|
end
|
588
567
|
|
@@ -597,9 +576,7 @@ namespace "build" do
|
|
597
576
|
args << "-D__NEW__" if USE_STLPORT
|
598
577
|
args << "-I#{$stlport_includes}" if USE_STLPORT
|
599
578
|
|
600
|
-
|
601
|
-
cc_compile f, objdir, args or exit 1
|
602
|
-
end
|
579
|
+
cc_build 'librhodb', objdir, args or exit 1
|
603
580
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
604
581
|
end
|
605
582
|
|
@@ -614,9 +591,7 @@ namespace "build" do
|
|
614
591
|
args << "-D__NEW__" if USE_STLPORT
|
615
592
|
args << "-I#{$stlport_includes}" if USE_STLPORT
|
616
593
|
|
617
|
-
|
618
|
-
cc_compile f, objdir, args or exit 1
|
619
|
-
end
|
594
|
+
cc_build 'librhosync', objdir, args or exit 1
|
620
595
|
cc_ar libname, Dir.glob(objdir + "/**/*.o") or exit 1
|
621
596
|
end
|
622
597
|
|
@@ -739,9 +714,7 @@ namespace "build" do
|
|
739
714
|
args << "-D__NEW__" if USE_STLPORT
|
740
715
|
args << "-I#{$stlport_includes}" if USE_STLPORT
|
741
716
|
|
742
|
-
|
743
|
-
cc_compile f, objdir, args or exit 1
|
744
|
-
end
|
717
|
+
cc_build 'librhodes', objdir, args or exit 1
|
745
718
|
|
746
719
|
deps = []
|
747
720
|
$libname.each do |k,v|
|
@@ -15,6 +15,24 @@ else
|
|
15
15
|
$ndkhost = `uname -s`.downcase!.chomp! + "-x86"
|
16
16
|
end
|
17
17
|
|
18
|
+
def num_cpus
|
19
|
+
if RUBY_PLATFORM =~ /linux/
|
20
|
+
num = `cat /proc/cpuinfo | grep processor | wc -l`
|
21
|
+
elsif RUBY_PLATFORM =~ /darwin/
|
22
|
+
num = `sysctl -n hw.ncpu`
|
23
|
+
elsif RUBY_PLATFORM =~ /w(in)?32/
|
24
|
+
num = ENV['NUMBER_OF_PROCESSORS']
|
25
|
+
else
|
26
|
+
num '1'
|
27
|
+
end
|
28
|
+
num.gsub!("\n", '')
|
29
|
+
num.to_i
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_sources(name)
|
33
|
+
File.read(File.join($builddir, name + '_build.files')).split("\n")
|
34
|
+
end
|
35
|
+
|
18
36
|
def setup_ndk(ndkpath,apilevel)
|
19
37
|
$ndkgccver = "unknown"
|
20
38
|
["4.4.0", "4.2.1"].each do |ver|
|
@@ -163,6 +181,36 @@ def cc_compile(filename, objdir, additional = nil)
|
|
163
181
|
cc_run(ccbin, args)
|
164
182
|
end
|
165
183
|
|
184
|
+
def cc_build(name, objdir, additional = nil)
|
185
|
+
jobs = num_cpus
|
186
|
+
jobs += 1 if jobs > 1
|
187
|
+
|
188
|
+
srcs = []
|
189
|
+
jobs.times.each { |x| srcs << [] }
|
190
|
+
sources = get_sources(name)
|
191
|
+
sources.each do |src|
|
192
|
+
idx = sources.index(src)%jobs
|
193
|
+
srcs[idx] << src
|
194
|
+
end
|
195
|
+
|
196
|
+
ths = []
|
197
|
+
jobs.times.each do |x|
|
198
|
+
ths << Thread.new do
|
199
|
+
srcs[x].each do |src|
|
200
|
+
cc_compile src, objdir, additional or return 1
|
201
|
+
end
|
202
|
+
0
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
ret = 0
|
207
|
+
ths.each do |th|
|
208
|
+
v = th.value
|
209
|
+
ret = v unless v == 0
|
210
|
+
end
|
211
|
+
ret
|
212
|
+
end
|
213
|
+
|
166
214
|
def cc_ar(libname, objects)
|
167
215
|
return true if FileUtils.uptodate? libname, objects
|
168
216
|
cc_run($arbin, ["crs", libname] + objects)
|
@@ -197,10 +245,10 @@ def cc_link(outname, objects, additional = nil, deps = nil)
|
|
197
245
|
end
|
198
246
|
args += $cxxlibs
|
199
247
|
$libgcc = `#{$gccbin} -mthumb-interwork -print-file-name=libgcc.a`.gsub("\n", "") if $libgcc.nil?
|
200
|
-
args << $libgcc
|
248
|
+
args << $libgcc if $ndkgccver != "4.2.1"
|
201
249
|
args << "#{$ndksysroot}/usr/lib/libc.so"
|
202
250
|
args << "#{$ndksysroot}/usr/lib/libm.so"
|
203
|
-
args << $libgcc
|
251
|
+
args << $libgcc if $ndkgccver == "4.2.1"
|
204
252
|
cc_run($gccbin, args)
|
205
253
|
end
|
206
254
|
|
@@ -3,6 +3,7 @@ platform/shared/common/PosixThreadImpl.cpp
|
|
3
3
|
platform/shared/common/RhoConf.cpp
|
4
4
|
platform/shared/common/RhoFile.cpp
|
5
5
|
platform/shared/common/RhoThread.cpp
|
6
|
+
platform/shared/common/ThreadQueue.cpp
|
6
7
|
platform/shared/common/SplashScreen.cpp
|
7
8
|
platform/shared/common/Tokenizer.cpp
|
8
9
|
platform/shared/common/AppMenu.cpp
|
@@ -0,0 +1 @@
|
|
1
|
+
platform/shared/sqlite/sqlite3.c
|
@@ -7,6 +7,7 @@ import net.rim.device.api.system.Application;
|
|
7
7
|
import javax.microedition.io.HttpConnection;
|
8
8
|
import javax.microedition.io.InputConnection;
|
9
9
|
|
10
|
+
import com.rho.RhodesApp;
|
10
11
|
import com.rho.net.URI;
|
11
12
|
|
12
13
|
import rhomobile.Utilities;
|
@@ -54,7 +55,7 @@ public class BrowserAdapter5 implements IBrowserAdapter
|
|
54
55
|
throws Exception
|
55
56
|
{
|
56
57
|
String url = request.getURL();
|
57
|
-
if (
|
58
|
+
if ( RhodesApp.getInstance().isRhodesAppUrl(url) || URI.isLocalData(url))
|
58
59
|
{
|
59
60
|
HttpConnection connection = Utilities.makeConnection(url, request.getHeaders(), null, null);
|
60
61
|
|
@@ -76,8 +76,6 @@ public class BrowserAdapter implements RenderingApplication, IBrowserAdapter
|
|
76
76
|
|
77
77
|
UrlRequestedEvent urlRequestedEvent = (UrlRequestedEvent) event;
|
78
78
|
String absoluteUrl = urlRequestedEvent.getURL();
|
79
|
-
//if ( !absoluteUrl.startsWith(_httpRoot) )
|
80
|
-
// absoluteUrl = _httpRoot + absoluteUrl.substring(_httpRoot.length()-5);
|
81
79
|
|
82
80
|
if ( urlRequestedEvent.getPostData() == null ||
|
83
81
|
urlRequestedEvent.getPostData().length == 0 )
|
@@ -138,8 +136,6 @@ public class BrowserAdapter implements RenderingApplication, IBrowserAdapter
|
|
138
136
|
// MSIE, Mozilla, and Opera all send the original
|
139
137
|
// request's Referer as the Referer for the new
|
140
138
|
// request.
|
141
|
-
//if ( !absoluteUrl.startsWith(_httpRoot) )
|
142
|
-
// absoluteUrl = _httpRoot + absoluteUrl.substring(_httpRoot.length()-5);
|
143
139
|
|
144
140
|
m_app.addToHistory(absoluteUrl,referrer);
|
145
141
|
Object eventSource = e.getSource();
|
@@ -257,7 +253,7 @@ public class BrowserAdapter implements RenderingApplication, IBrowserAdapter
|
|
257
253
|
{
|
258
254
|
if (referrer == null || URI.isLocalData(url) || !m_bLoadImageAsync)
|
259
255
|
{
|
260
|
-
boolean bLocalHost =
|
256
|
+
boolean bLocalHost = RhodesApp.getInstance().isRhodesAppUrl(url);
|
261
257
|
if ( bLocalHost && m_connResource!= null)
|
262
258
|
{
|
263
259
|
com.rho.net.RhoConnection rhoConn = (com.rho.net.RhoConnection)((com.rho.net.bb.NativeBBHttpConnection)m_connResource).getNativeConnection();
|
@@ -13,6 +13,7 @@ import com.rho.BBVersionSpecific;
|
|
13
13
|
import com.rho.RhoEmptyLogger;
|
14
14
|
import com.rho.RhoLogger;
|
15
15
|
import com.rho.RhoConf;
|
16
|
+
import com.rho.RhodesApp;
|
16
17
|
import com.rho.net.bb.BBHttpConnection;
|
17
18
|
import net.rim.device.api.servicebook.ServiceRecord;
|
18
19
|
import net.rim.device.api.servicebook.ServiceBook;
|
@@ -28,12 +29,8 @@ public class NetworkAccess implements INetworkAccess {
|
|
28
29
|
private static boolean bes = true;
|
29
30
|
private static long m_nMaxPacketSize = 0;
|
30
31
|
|
31
|
-
public
|
32
|
+
public void configure()
|
32
33
|
{
|
33
|
-
return "http://localhost:8080/";
|
34
|
-
}
|
35
|
-
|
36
|
-
public void configure() {
|
37
34
|
networkConfigured = false;
|
38
35
|
bes = false;
|
39
36
|
URLsuffix = null;
|
@@ -156,7 +153,7 @@ public class NetworkAccess implements INetworkAccess {
|
|
156
153
|
|
157
154
|
public IHttpConnection connect(String url, boolean ignoreSuffixOnSim) throws IOException
|
158
155
|
{
|
159
|
-
if (
|
156
|
+
if ( RhodesApp.getInstance().isRhodesAppUrl(url) )
|
160
157
|
{
|
161
158
|
URI uri = new URI(url);
|
162
159
|
return new RhoConnection(uri);
|
@@ -109,8 +109,10 @@ public class System {
|
|
109
109
|
});
|
110
110
|
klass.getSingletonClass().defineMethod("exit", new RubyNoArgMethod() {
|
111
111
|
protected RubyValue run(RubyValue receiver, RubyBlock block) {
|
112
|
-
RhodesApplication.getInstance().
|
113
|
-
|
112
|
+
synchronized(RhodesApplication.getInstance().getEventLock()) {
|
113
|
+
RhodesApplication.getInstance().close();
|
114
|
+
return RubyConstant.QNIL;
|
115
|
+
}
|
114
116
|
}
|
115
117
|
});
|
116
118
|
}
|
@@ -112,34 +112,15 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
112
112
|
public boolean trackwheelUnclick(int status, int time) {return false;}
|
113
113
|
}
|
114
114
|
|
115
|
-
boolean isExternalUrl(String strUrl)
|
116
|
-
{
|
117
|
-
return strUrl.startsWith("http://") || strUrl.startsWith("https://") ||
|
118
|
-
strUrl.startsWith("javascript:") || strUrl.startsWith("mailto:")
|
119
|
-
|| strUrl.startsWith("tel:")|| strUrl.startsWith("wtai:");
|
120
|
-
}
|
121
|
-
|
122
|
-
String canonicalizeURL( String url ){
|
123
|
-
if ( url == null || url.length() == 0 )
|
124
|
-
return "";
|
125
|
-
|
126
|
-
url.replace('\\', '/');
|
127
|
-
if ( !url.startsWith(_httpRoot) && !isExternalUrl(url) )
|
128
|
-
url = FilePath.join(_httpRoot,url);
|
129
|
-
|
130
|
-
return url;
|
131
|
-
}
|
132
|
-
|
133
115
|
public void navigateUrl(String url){
|
134
116
|
PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread(
|
135
|
-
|
117
|
+
RHODESAPP().canonicalizeRhoUrl(url), null, null, null);
|
136
118
|
thread.start();
|
137
119
|
}
|
138
120
|
|
139
|
-
public String getPathForMenuItem(String url)
|
140
|
-
|
141
|
-
|
142
|
-
return url;
|
121
|
+
public String getPathForMenuItem(String url)
|
122
|
+
{
|
123
|
+
return RHODESAPP().canonicalizeRhoUrl(url);
|
143
124
|
}
|
144
125
|
|
145
126
|
public void addMenuItem(String label, String value){
|
@@ -160,7 +141,7 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
160
141
|
|
161
142
|
public void postUrl(String url, String body, HttpHeaders headers, Runnable callback){
|
162
143
|
PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread(
|
163
|
-
|
144
|
+
RHODESAPP().canonicalizeRhoUrl(url), headers, body.getBytes(), null, callback);
|
164
145
|
thread.setInternalRequest(true);
|
165
146
|
thread.start();
|
166
147
|
}
|
@@ -188,7 +169,7 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
188
169
|
}
|
189
170
|
public void postUrlWithCallback(String url, String body, HttpHeaders headers, NetCallback netCallback){
|
190
171
|
PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread(
|
191
|
-
|
172
|
+
RHODESAPP().canonicalizeRhoUrl(url), headers, body.getBytes(), null);
|
192
173
|
thread.setNetCallback(netCallback);
|
193
174
|
thread.start();
|
194
175
|
}
|
@@ -263,8 +244,9 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
263
244
|
strUrl = removeSemicolon(strUrl);
|
264
245
|
refferer = removeSemicolon(refferer);
|
265
246
|
|
266
|
-
|
267
|
-
|
247
|
+
strUrl = RHODESAPP().canonicalizeRhoUrl(strUrl);
|
248
|
+
// if ( !strUrl.startsWith(_httpRoot) && !isExternalUrl(strUrl) )
|
249
|
+
// strUrl = _httpRoot + (strUrl.startsWith("/") ? strUrl.substring(1) : strUrl);
|
268
250
|
|
269
251
|
int nPos = -1;
|
270
252
|
for( int i = 0; i < _history.size(); i++ ){
|
@@ -356,8 +338,6 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
356
338
|
|
357
339
|
private Vector _history;
|
358
340
|
|
359
|
-
private final String _httpRoot = "http://localhost:8080/";
|
360
|
-
|
361
341
|
private static boolean m_isFullBrowser = false;
|
362
342
|
|
363
343
|
private static PushListeningThread _pushListeningThread = null;
|
@@ -1109,13 +1089,10 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
1109
1089
|
navigateUrl((String)_history.lastElement());
|
1110
1090
|
}
|
1111
1091
|
|
1112
|
-
void navigateHome()
|
1092
|
+
void navigateHome()
|
1093
|
+
{
|
1113
1094
|
String strHomePage = RhoRuby.getStartPage();
|
1114
|
-
String strStartPage =
|
1115
|
-
if ( strHomePage != null && strHomePage.length() > 0 )
|
1116
|
-
{
|
1117
|
-
strStartPage = _httpRoot.substring(0, _httpRoot.length()-1) + strHomePage;
|
1118
|
-
}
|
1095
|
+
String strStartPage = RhodesApp.getInstance().canonicalizeRhoUrl(strHomePage);
|
1119
1096
|
|
1120
1097
|
_history.removeAllElements();
|
1121
1098
|
_history.addElement(strStartPage);
|
@@ -11,6 +11,7 @@ import net.rim.device.api.io.http.HttpProtocolConstants;
|
|
11
11
|
import net.rim.device.api.util.StringUtilities;
|
12
12
|
|
13
13
|
import com.rho.RhoClassFactory;
|
14
|
+
import com.rho.RhodesApp;
|
14
15
|
import com.rho.net.URI;
|
15
16
|
import com.rho.net.IHttpConnection;
|
16
17
|
import com.rho.net.bb.NativeBBHttpConnection;
|
@@ -30,7 +31,7 @@ public class Utilities {
|
|
30
31
|
|
31
32
|
if ( conn == null )
|
32
33
|
{
|
33
|
-
if (
|
34
|
+
if ( RhodesApp.getInstance().isRhodesAppUrl(url) )
|
34
35
|
{
|
35
36
|
URI uri = new URI(url);
|
36
37
|
conn = new NativeBBHttpConnection( new RhoConnection(uri) );
|
@@ -71,7 +71,10 @@
|
|
71
71
|
|
72
72
|
// Create the picker
|
73
73
|
if (self.pickerView == nil) {
|
74
|
-
|
74
|
+
CGRect frame = parentFrame;
|
75
|
+
frame.size.height = 220;
|
76
|
+
frame.origin.y = parentFrame.origin.y + parentFrame.size.height - frame.size.height;
|
77
|
+
self.pickerView = [[UIDatePicker alloc] initWithFrame:frame];
|
75
78
|
}
|
76
79
|
|
77
80
|
if (self.pickerView.superview == nil) {
|
@@ -97,9 +100,6 @@
|
|
97
100
|
|
98
101
|
//CGSize pickerSize = CGSizeMake(parentFrame.size.width, parentFrame.size.height/2);
|
99
102
|
CGSize pickerSize = [pickerView sizeThatFits:pickerView.frame.size];
|
100
|
-
pickerSize.width = parentFrame.size.width;
|
101
|
-
if (pickerSize.height > parentFrame.size.height)
|
102
|
-
pickerSize.height = parentFrame.size.height;
|
103
103
|
CGRect pickerFrame = CGRectMake(parentFrame.origin.x,
|
104
104
|
parentFrame.origin.y + parentFrame.size.height - pickerSize.height,
|
105
105
|
pickerSize.width,
|
@@ -27,26 +27,32 @@
|
|
27
27
|
[value getValue:&type];
|
28
28
|
|
29
29
|
id view = nil;
|
30
|
+
|
31
|
+
Rhodes *r = [Rhodes sharedInstance];
|
32
|
+
//UIWindow *window = [[Rhodes sharedInstance] rootWindow];
|
33
|
+
//CGRect frame = [Rhodes applicationFrame];
|
30
34
|
|
31
|
-
|
32
|
-
CGRect frame = [Rhodes applicationFrame];
|
35
|
+
id mainView = [r mainView];
|
33
36
|
|
34
37
|
switch (type) {
|
35
38
|
case NOBAR_TYPE:
|
36
|
-
view = [[SimpleMainView alloc] initWithParentView:window frame:frame];
|
39
|
+
//view = [[SimpleMainView alloc] initWithParentView:window frame:frame];
|
40
|
+
view = [[SimpleMainView alloc] initWithMainView:mainView];
|
37
41
|
break;
|
38
42
|
case TOOLBAR_TYPE:
|
39
|
-
view = [[SimpleMainView alloc] initWithParentView:window frame:frame toolbar:items];
|
43
|
+
//view = [[SimpleMainView alloc] initWithParentView:window frame:frame toolbar:items];
|
44
|
+
view = [[SimpleMainView alloc] initWithMainView:mainView toolbar:items];
|
40
45
|
break;
|
41
46
|
case TABBAR_TYPE:
|
42
|
-
view = [[TabbedMainView alloc] initWithParentView:window frame:frame items:items];
|
47
|
+
//view = [[TabbedMainView alloc] initWithParentView:window frame:frame items:items];
|
48
|
+
view = [[TabbedMainView alloc] initWithMainView:mainView tabs:items];
|
43
49
|
break;
|
44
50
|
default:
|
45
51
|
RAWLOG_ERROR1("Unknown bar type passed: %d", type);
|
46
52
|
return;
|
47
53
|
}
|
48
54
|
|
49
|
-
[
|
55
|
+
[r setMainView:view];
|
50
56
|
[view release];
|
51
57
|
}
|
52
58
|
@end
|