mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-07 16:17:38 +03:00
Rename settings activity
This commit is contained in:
parent
e32394fc81
commit
f8b64c6646
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "CalibreSettingsActivity.h"
|
#include "RemoteLibrarySettingsActivity.h"
|
||||||
#include "ClearCacheActivity.h"
|
#include "ClearCacheActivity.h"
|
||||||
#include "CrossPointSettings.h"
|
#include "CrossPointSettings.h"
|
||||||
#include "KOReaderSettingsActivity.h"
|
#include "KOReaderSettingsActivity.h"
|
||||||
@ -106,7 +106,7 @@ void CategorySettingsActivity::toggleCurrentSetting() {
|
|||||||
} else if (strcmp(setting.name, "Remote Library") == 0) {
|
} else if (strcmp(setting.name, "Remote Library") == 0) {
|
||||||
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||||
exitActivity();
|
exitActivity();
|
||||||
enterNewActivity(new CalibreSettingsActivity(renderer, mappedInput, [this] {
|
enterNewActivity(new RemoteLibrarySettingsActivity(renderer, mappedInput, [this] {
|
||||||
exitActivity();
|
exitActivity();
|
||||||
updateRequired = true;
|
updateRequired = true;
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CalibreSettingsActivity.h"
|
#include "RemoteLibrarySettingsActivity.h"
|
||||||
|
|
||||||
#include <GfxRenderer.h>
|
#include <GfxRenderer.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
@ -14,22 +14,22 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr int MENU_ITEMS = 3;
|
constexpr int MENU_ITEMS = 3;
|
||||||
const char* menuNames[MENU_ITEMS] = {"Server URL", "OPDS Path", "Connect as Wireless Device"};
|
const char* menuNames[MENU_ITEMS] = {"Server URL", "OPDS Path", "Connect Calibre as Wireless Device"};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void CalibreSettingsActivity::taskTrampoline(void* param) {
|
void RemoteLibrarySettingsActivity::taskTrampoline(void* param) {
|
||||||
auto* self = static_cast<CalibreSettingsActivity*>(param);
|
auto* self = static_cast<RemoteLibrarySettingsActivity*>(param);
|
||||||
self->displayTaskLoop();
|
self->displayTaskLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibreSettingsActivity::onEnter() {
|
void RemoteLibrarySettingsActivity::onEnter() {
|
||||||
ActivityWithSubactivity::onEnter();
|
ActivityWithSubactivity::onEnter();
|
||||||
|
|
||||||
renderingMutex = xSemaphoreCreateMutex();
|
renderingMutex = xSemaphoreCreateMutex();
|
||||||
selectedIndex = 0;
|
selectedIndex = 0;
|
||||||
updateRequired = true;
|
updateRequired = true;
|
||||||
|
|
||||||
xTaskCreate(&CalibreSettingsActivity::taskTrampoline, "CalibreSettingsTask",
|
xTaskCreate(&RemoteLibrarySettingsActivity::taskTrampoline, "RemoteLibrarySettingsTask",
|
||||||
4096, // Stack size
|
4096, // Stack size
|
||||||
this, // Parameters
|
this, // Parameters
|
||||||
1, // Priority
|
1, // Priority
|
||||||
@ -37,7 +37,7 @@ void CalibreSettingsActivity::onEnter() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibreSettingsActivity::onExit() {
|
void RemoteLibrarySettingsActivity::onExit() {
|
||||||
ActivityWithSubactivity::onExit();
|
ActivityWithSubactivity::onExit();
|
||||||
|
|
||||||
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||||
@ -49,7 +49,7 @@ void CalibreSettingsActivity::onExit() {
|
|||||||
renderingMutex = nullptr;
|
renderingMutex = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibreSettingsActivity::loop() {
|
void RemoteLibrarySettingsActivity::loop() {
|
||||||
if (subActivity) {
|
if (subActivity) {
|
||||||
subActivity->loop();
|
subActivity->loop();
|
||||||
return;
|
return;
|
||||||
@ -76,7 +76,7 @@ void CalibreSettingsActivity::loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibreSettingsActivity::handleSelection() {
|
void RemoteLibrarySettingsActivity::handleSelection() {
|
||||||
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||||
|
|
||||||
if (selectedIndex == 0) {
|
if (selectedIndex == 0) {
|
||||||
@ -142,7 +142,7 @@ void CalibreSettingsActivity::handleSelection() {
|
|||||||
xSemaphoreGive(renderingMutex);
|
xSemaphoreGive(renderingMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibreSettingsActivity::displayTaskLoop() {
|
void RemoteLibrarySettingsActivity::displayTaskLoop() {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (updateRequired && !subActivity) {
|
if (updateRequired && !subActivity) {
|
||||||
updateRequired = false;
|
updateRequired = false;
|
||||||
@ -154,7 +154,7 @@ void CalibreSettingsActivity::displayTaskLoop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibreSettingsActivity::render() {
|
void RemoteLibrarySettingsActivity::render() {
|
||||||
renderer.clearScreen();
|
renderer.clearScreen();
|
||||||
|
|
||||||
const auto pageWidth = renderer.getScreenWidth();
|
const auto pageWidth = renderer.getScreenWidth();
|
||||||
@ -8,14 +8,14 @@
|
|||||||
#include "activities/ActivityWithSubactivity.h"
|
#include "activities/ActivityWithSubactivity.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submenu for Calibre settings.
|
* Submenu for RemoteLibrary settings.
|
||||||
* Shows Calibre Web URL and Calibre Wireless Device options.
|
* Shows RemoteLibrary Web URL and Calibre Wireless Device options.
|
||||||
*/
|
*/
|
||||||
class CalibreSettingsActivity final : public ActivityWithSubactivity {
|
class RemoteLibrarySettingsActivity final : public ActivityWithSubactivity {
|
||||||
public:
|
public:
|
||||||
explicit CalibreSettingsActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
|
explicit RemoteLibrarySettingsActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
|
||||||
const std::function<void()>& onBack)
|
const std::function<void()>& onBack)
|
||||||
: ActivityWithSubactivity("CalibreSettings", renderer, mappedInput), onBack(onBack) {}
|
: ActivityWithSubactivity("RemoteLibrarySettings", renderer, mappedInput), onBack(onBack) {}
|
||||||
|
|
||||||
void onEnter() override;
|
void onEnter() override;
|
||||||
void onExit() override;
|
void onExit() override;
|
||||||
Loading…
Reference in New Issue
Block a user