Merge pull request #543 from fokin33/refresh-button

add refresh button
This commit is contained in:
vshcherb 2013-11-14 11:17:13 -08:00
commit ecf3a8aea5
4 changed files with 17 additions and 2 deletions

View file

@ -1259,6 +1259,7 @@
<string name="announce_gpx_waypoints">Озвучивание маршрутных точек GPX</string>
<string name="osmodroid_mode_on">Остановить OsMoDroid</string>
<string name="osmodroid_mode_off">Запустить OsMoDroid</string>
<string name="osmodroid_refresh">Обновить каналы</string>
<string name="osb_author_or_password_not_specified">Пожалуйста, укажите в настройках пароль и имя пользователя OSM</string>
<string name="route_descr_map_location">Карта: </string>
<string name="osb_author_dialog_password">Пароль OSM (опционально)</string>

View file

@ -72,6 +72,7 @@
<string name="driving_region_uk">UK, India, Australia &amp; Others</string>
<string name="osmodroid_mode_on">Stop OsMoDroid</string>
<string name="osmodroid_mode_off">Start OsMoDroid</string>
<string name="osmodroid_refresh">Refresh channels</string>
<string name="announce_gpx_waypoints">Announce GPX waypoints</string>
<string name="speak_title">Announce&#8230;</string>
<string name="speak_descr">Configure to announce street names, traffic warnings (forced stops, speed bumps), speed camera warnings, speed limits</string>

View file

@ -42,5 +42,5 @@ String getObjectDescription(int layerId, int objectId);
String getObjectColor(int layerId, int objectId);
void refreshChannels();
}

View file

@ -42,7 +42,7 @@ public class OsMoDroidPlugin extends OsmandPlugin implements MonitoringInfoContr
@Override
public void channelsListUpdated() throws RemoteException {
if (activity != null && connected) {
log.debug("update channels");
for (OsMoDroidLayer myOsMoDroidLayer : osmoDroidLayerList) {
activity.getMapView().removeLayer(myOsMoDroidLayer);
}
@ -263,5 +263,18 @@ public class OsMoDroidPlugin extends OsmandPlugin implements MonitoringInfoContr
}
}
}).reg();
qa.item(R.string.osmodroid_refresh).icons(R.drawable.ic_action_grefresh_dark, R.drawable.ic_action_grefresh_light).listen(new OnContextMenuClick() {
@Override
public void onContextMenuClick(int itemId, int pos, boolean isChecked,
DialogInterface dialog) {
try {
mIRemoteService.refreshChannels();
} catch (RemoteException e) {
log.error(e.getMessage(), e);
}
}
}).reg();
}
}