Remaining incompatibilities
This commit is contained in:
@@ -183,7 +183,7 @@ void GlobalBookmarksActivity::renameSelected() {
|
|||||||
entry.bookmarks[bookmarkIndex].name.empty() ? getRowTitle(selectorIndex) : entry.bookmarks[bookmarkIndex].name;
|
entry.bookmarks[bookmarkIndex].name.empty() ? getRowTitle(selectorIndex) : entry.bookmarks[bookmarkIndex].name;
|
||||||
|
|
||||||
startActivityForResult(std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_RENAME), initial,
|
startActivityForResult(std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_RENAME), initial,
|
||||||
BookmarkStore::MAX_NAME_LENGTH, false),
|
BookmarkStore::MAX_NAME_LENGTH, InputType::Text),
|
||||||
[this, bookIndex, bookmarkIndex](const ActivityResult& result) {
|
[this, bookIndex, bookmarkIndex](const ActivityResult& result) {
|
||||||
if (!result.isCancelled) {
|
if (!result.isCancelled) {
|
||||||
const auto& kr = std::get<KeyboardResult>(result.data);
|
const auto& kr = std::get<KeyboardResult>(result.data);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void StarredPagesActivity::startRename() {
|
|||||||
const std::string initial =
|
const std::string initial =
|
||||||
all[renamingIndex].name.empty() ? getDefaultLabel(renamingIndex) : all[renamingIndex].name;
|
all[renamingIndex].name.empty() ? getDefaultLabel(renamingIndex) : all[renamingIndex].name;
|
||||||
startActivityForResult(std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_RENAME), initial,
|
startActivityForResult(std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_RENAME), initial,
|
||||||
BookmarkStore::MAX_NAME_LENGTH, false),
|
BookmarkStore::MAX_NAME_LENGTH, InputType::Text),
|
||||||
[this, renamingIndex](const ActivityResult& result) {
|
[this, renamingIndex](const ActivityResult& result) {
|
||||||
if (!result.isCancelled) {
|
if (!result.isCancelled) {
|
||||||
const auto& kr = std::get<KeyboardResult>(result.data);
|
const auto& kr = std::get<KeyboardResult>(result.data);
|
||||||
|
|||||||
@@ -114,71 +114,71 @@ void WeatherSettingsActivity::handleSelection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WeatherSettingsActivity::launchCitySearch() {
|
void WeatherSettingsActivity::launchCitySearch() {
|
||||||
startActivityForResult(
|
startActivityForResult(std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_WEATHER_SEARCH_CITY), "",
|
||||||
std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_WEATHER_SEARCH_CITY), "", 64, false),
|
64, InputType::Text),
|
||||||
[this](const ActivityResult& result) {
|
[this](const ActivityResult& result) {
|
||||||
if (result.isCancelled) return;
|
if (result.isCancelled) return;
|
||||||
|
|
||||||
const auto& kb = std::get<KeyboardResult>(result.data);
|
const auto& kb = std::get<KeyboardResult>(result.data);
|
||||||
if (kb.text.empty()) return;
|
if (kb.text.empty()) return;
|
||||||
|
|
||||||
// Need WiFi for geocoding
|
// Need WiFi for geocoding
|
||||||
if (WiFi.status() != WL_CONNECTED || WiFi.localIP() == IPAddress(0, 0, 0, 0)) {
|
if (WiFi.status() != WL_CONNECTED || WiFi.localIP() == IPAddress(0, 0, 0, 0)) {
|
||||||
startActivityForResult(std::make_unique<WifiSelectionActivity>(renderer, mappedInput),
|
startActivityForResult(std::make_unique<WifiSelectionActivity>(renderer, mappedInput),
|
||||||
[this, query = kb.text](const ActivityResult& wifiResult) {
|
[this, query = kb.text](const ActivityResult& wifiResult) {
|
||||||
if (wifiResult.isCancelled) return;
|
if (wifiResult.isCancelled) return;
|
||||||
searchResults = WeatherClient::searchCity(query);
|
searchResults = WeatherClient::searchCity(query);
|
||||||
showingSearchResults = !searchResults.empty();
|
showingSearchResults = !searchResults.empty();
|
||||||
selectedIndex = 0;
|
selectedIndex = 0;
|
||||||
requestUpdate();
|
requestUpdate();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
searchResults = WeatherClient::searchCity(kb.text);
|
searchResults = WeatherClient::searchCity(kb.text);
|
||||||
showingSearchResults = !searchResults.empty();
|
showingSearchResults = !searchResults.empty();
|
||||||
selectedIndex = 0;
|
selectedIndex = 0;
|
||||||
requestUpdate();
|
requestUpdate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void WeatherSettingsActivity::launchLatitudeEntry() {
|
void WeatherSettingsActivity::launchLatitudeEntry() {
|
||||||
std::string current = std::to_string(WEATHER_SETTINGS.getLatitude());
|
std::string current = std::to_string(WEATHER_SETTINGS.getLatitude());
|
||||||
startActivityForResult(
|
startActivityForResult(std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_WEATHER_LATITUDE),
|
||||||
std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_WEATHER_LATITUDE), current, 12, false),
|
current, 12, InputType::Text),
|
||||||
[this](const ActivityResult& result) {
|
[this](const ActivityResult& result) {
|
||||||
if (!result.isCancelled) {
|
if (!result.isCancelled) {
|
||||||
const auto& kb = std::get<KeyboardResult>(result.data);
|
const auto& kb = std::get<KeyboardResult>(result.data);
|
||||||
char* end = nullptr;
|
char* end = nullptr;
|
||||||
const float lat = strtof(kb.text.c_str(), &end);
|
const float lat = strtof(kb.text.c_str(), &end);
|
||||||
if (end != kb.text.c_str() && *end == '\0' && lat >= -90.0f && lat <= 90.0f) {
|
if (end != kb.text.c_str() && *end == '\0' && lat >= -90.0f && lat <= 90.0f) {
|
||||||
if (lat != WEATHER_SETTINGS.getLatitude()) {
|
if (lat != WEATHER_SETTINGS.getLatitude()) {
|
||||||
WEATHER_SETTINGS.setLocation(lat, WEATHER_SETTINGS.getLongitude(), "");
|
WEATHER_SETTINGS.setLocation(lat, WEATHER_SETTINGS.getLongitude(), "");
|
||||||
}
|
}
|
||||||
WEATHER_SETTINGS.saveToFile();
|
WEATHER_SETTINGS.saveToFile();
|
||||||
requestUpdate();
|
requestUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void WeatherSettingsActivity::launchLongitudeEntry() {
|
void WeatherSettingsActivity::launchLongitudeEntry() {
|
||||||
std::string current = std::to_string(WEATHER_SETTINGS.getLongitude());
|
std::string current = std::to_string(WEATHER_SETTINGS.getLongitude());
|
||||||
startActivityForResult(
|
startActivityForResult(std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_WEATHER_LONGITUDE),
|
||||||
std::make_unique<KeyboardEntryActivity>(renderer, mappedInput, tr(STR_WEATHER_LONGITUDE), current, 12, false),
|
current, 12, InputType::Text),
|
||||||
[this](const ActivityResult& result) {
|
[this](const ActivityResult& result) {
|
||||||
if (!result.isCancelled) {
|
if (!result.isCancelled) {
|
||||||
const auto& kb = std::get<KeyboardResult>(result.data);
|
const auto& kb = std::get<KeyboardResult>(result.data);
|
||||||
char* end = nullptr;
|
char* end = nullptr;
|
||||||
const float lon = strtof(kb.text.c_str(), &end);
|
const float lon = strtof(kb.text.c_str(), &end);
|
||||||
if (end != kb.text.c_str() && *end == '\0' && lon >= -180.0f && lon <= 180.0f) {
|
if (end != kb.text.c_str() && *end == '\0' && lon >= -180.0f && lon <= 180.0f) {
|
||||||
if (lon != WEATHER_SETTINGS.getLongitude()) {
|
if (lon != WEATHER_SETTINGS.getLongitude()) {
|
||||||
WEATHER_SETTINGS.setLocation(WEATHER_SETTINGS.getLatitude(), lon, "");
|
WEATHER_SETTINGS.setLocation(WEATHER_SETTINGS.getLatitude(), lon, "");
|
||||||
}
|
}
|
||||||
WEATHER_SETTINGS.saveToFile();
|
WEATHER_SETTINGS.saveToFile();
|
||||||
requestUpdate();
|
requestUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void WeatherSettingsActivity::toggleTempUnit() {
|
void WeatherSettingsActivity::toggleTempUnit() {
|
||||||
|
|||||||
Reference in New Issue
Block a user