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" <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"> 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" <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" <activity android:name=".activities.MainMenuActivity"
android:label="@string/app_name"> android:label="@string/app_name">
<intent-filter> <intent-filter>

View file

@ -114,7 +114,7 @@
<!-- Compiles this project's .java files into .class files. --> <!-- 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}"> <if condition="${manifest.hasCode}">
<then> <then>
<!-- If android rules are used for a test project, its classpath should include <!-- 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"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources> <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_descr">Modify overlay transparency</string>
<string name="overlay_transparency">Overlay transparency</string> <string name="overlay_transparency">Overlay transparency</string>
<string name="map_transparency_descr">Modify base map transparency</string> <string name="map_transparency_descr">Modify base map transparency</string>

View file

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

View file

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

View file

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