Merge branches master and bean shell, fix some bugs

This commit is contained in:
Victor Shcherb 2011-06-09 10:06:54 +02:00
commit 1e4d84967b
6 changed files with 54 additions and 34 deletions

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.osmand.plus" android:installLocation="auto" android:versionName="0.6.4" android:versionCode="33">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="false" android:name=".activities.OsmandApplication" android:description="@string/app_description">
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
<activity android:name=".activities.MainMenuActivity"
android:label="@string/app_name">
<intent-filter>

View file

@ -114,7 +114,7 @@
<!-- Compiles this project's .java files into .class files. -->
<target name="compile" depends="-resource-src, -aidl, -pre-compile" description="Compiles project's .java files into .class files">
<target name="compile" depends="-pre-build, -resource-src, -aidl, -pre-compile" description="Compiles project's .java files into .class files">
<if condition="${manifest.hasCode}">
<then>
<!-- If android rules are used for a test project, its classpath should include

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<string name="warning_tile_layer_not_downloadable">Map layer {0} is not downloadable by the application, please try to reinstall it.</string>
<string name="warning_tile_layer_not_downloadable">Map layer %1$s is not downloadable by the application, please try to reinstall it.</string>
<string name="overlay_transparency_descr">Modify overlay transparency</string>
<string name="overlay_transparency">Overlay transparency</string>
<string name="map_transparency_descr">Modify base map transparency</string>

View file

@ -551,42 +551,62 @@ public class OsmandSettings {
return TileSourceManager.getMapnikSource();
}
public ITileSource getTileSourceByName(String tileName, boolean warnWhenSelected) {
if(tileName == null || tileName.length() == 0){
return null;
}
List<TileSourceTemplate> list = TileSourceManager.getKnownSourceTemplates();
File tPath = extendOsmandPath(ResourceManager.TILES_PATH);
File dir = new File(tPath, tileName);
if(dir.exists()){
if(tileName.endsWith(SQLiteTileSource.EXT)){
return new SQLiteTileSource(dir, list);
} else if (dir.isDirectory() && !dir.getName().startsWith(".")) {
TileSourceTemplate t = TileSourceManager.createTileSourceTemplate(dir);
if(!t.isRuleAcceptable()){
Toast.makeText(ctx,
ctx.getString(R.string.warning_tile_layer_not_downloadable, dir.getName()), Toast.LENGTH_SHORT).show();
}
if(!TileSourceManager.isTileSourceMetaInfoExist(dir)){
// try to find among other templates
List<TileSourceTemplate> templates = getInternetAvailableSourceTemplates();
if(templates != null){
list.addAll(templates);
}
private TileSourceTemplate checkAmongAvailableTileSources(File dir, List<TileSourceTemplate> list){
for (TileSourceTemplate l : list) {
if (l.getName().equals(tileName)) {
if (dir.getName().equals(l.getName())) {
try {
dir.mkdirs();
TileSourceManager.createMetaInfoFile(dir, l, true);
} catch (IOException e) {
}
return l;
}
}
return null;
}
public ITileSource getTileSourceByName(String tileName, boolean warnWhenSelected) {
if(tileName == null || tileName.length() == 0){
return null;
}
List<TileSourceTemplate> knownTemplates = TileSourceManager.getKnownSourceTemplates();
File tPath = extendOsmandPath(ResourceManager.TILES_PATH);
File dir = new File(tPath, tileName);
if (!dir.exists()) {
TileSourceTemplate ret = checkAmongAvailableTileSources(dir, knownTemplates);
if (ret != null) {
return ret;
}
// try to find among other templates
ret = checkAmongAvailableTileSources(dir, getInternetAvailableSourceTemplates());
if (ret != null) {
return ret;
}
} else if (tileName.endsWith(SQLiteTileSource.EXT)) {
return new SQLiteTileSource(dir, knownTemplates);
} else if (dir.isDirectory() && !dir.getName().startsWith(".")) {
TileSourceTemplate t = TileSourceManager.createTileSourceTemplate(dir);
if (warnWhenSelected && !t.isRuleAcceptable()) {
Toast.makeText(ctx, ctx.getString(R.string.warning_tile_layer_not_downloadable, dir.getName()), Toast.LENGTH_SHORT).show();
}
if (!TileSourceManager.isTileSourceMetaInfoExist(dir)) {
TileSourceTemplate ret = checkAmongAvailableTileSources(dir, knownTemplates);
if (ret != null) {
t = ret;
} else {
// try to find among other templates
ret = checkAmongAvailableTileSources(dir, getInternetAvailableSourceTemplates());
if (ret != null) {
t = ret;
}
}
return t;
}
return t;
}
return null;
}

View file

@ -32,7 +32,7 @@ do
## reset all previous changes in working tree
git checkout .
git reset HEAD --hard
git checkout $BRANCH
git checkout -f $BRANCH
git reset $GIT_ORIGIN_NAME/$BRANCH --hard
sed -e "s/\(APP_DESCRIPTION.*=.*\"\).*\(\".*\)/\1$SHORT_DATE $BRANCH\2/g" $VERSION_FILE > ${VERSION_FILE}.bak
mv ${VERSION_FILE}.bak ${VERSION_FILE}

View file

@ -2,8 +2,8 @@
DIRECTORY=$(cd `dirname $0` && pwd)
FTP_SITE=download.osmand.net
FTP_FOLDER=/home/osmand/www/night-builds
FTP_LATEST=/home/osmand/www/latest-night-build
FTP_FOLDER=/var/www-download/night-builds
FTP_LATEST=/var/www-download/latest-night-build
# FTP_USER in local.properties
# FTP_PWD= in local.properties
BUILD_DIR="$DIRECTORY"/builds