Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inform user if offline theme isn't set #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aat-android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@
<string name ="error_integer_positive">"Weight must be between 1 and 999."</string>
<string name="error_long">Wrong input, only numbers are allowed.\n\"%s\"</string>
<string name ="error_met">"First Number must be between 0.0 to 20.0, followed by a space."</string>
<!-- needs translations -->
<string name ="error_no_map_file">"No map files found at "</string>


</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.util.ArrayList;

import ch.bailu.aat_lib.logger.AppLog;
import ch.bailu.aat_lib.preferences.map.SolidMapsForgeDirectory;
import ch.bailu.aat_lib.service.cache.ObjTileMapsForge;
import ch.bailu.foc.Foc;
Expand All @@ -26,9 +27,17 @@ public void configure(Foc mapDir, TileCache cache, XmlRenderTheme theme, String
try {
renderer = new Renderer(theme, cache, mapFiles);
} catch (Exception e) {
AppLog.e(renderer, e);
renderer = null;
}
}
else
{
/* I've defined a string resource for this (which needs translations)
* but I can't find a way to access a string resource from here.
*/
AppLog.e(this, "No map files found at " + mapDir.getPath());
}
}

public void destroy() {
Expand Down Expand Up @@ -60,8 +69,12 @@ public boolean supportsTile(Tile t) {
}

public void lockToRenderer(ObjTileMapsForge o) {
if (isConfigured() && themeID.equals(o.getThemeID())) {
renderer.addJob(o.getTile());
if (isConfigured()) {
if (themeID.equals(o.getThemeID())){
renderer.addJob(o.getTile());
} else {
AppLog.e("No valid theme for offline map - click on right edge and then on menu bars at top.");
}
}
}
}
Expand Down