37 lines
980 B
C
37 lines
980 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "OpdsServerStore.h"
|
||
|
|
#include "activities/Activity.h"
|
||
|
|
#include "util/ButtonNavigator.h"
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Edit screen for a single OPDS server.
|
||
|
|
* Shows Name, URL, Username, Password fields and a Delete option.
|
||
|
|
* Used for both adding new servers and editing existing ones.
|
||
|
|
*/
|
||
|
|
class OpdsSettingsActivity final : public Activity {
|
||
|
|
public:
|
||
|
|
/**
|
||
|
|
* @param serverIndex Index into OpdsServerStore, or -1 for a new server
|
||
|
|
*/
|
||
|
|
explicit OpdsSettingsActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, int serverIndex = -1)
|
||
|
|
: Activity("OpdsSettings", renderer, mappedInput), serverIndex(serverIndex) {}
|
||
|
|
|
||
|
|
void onEnter() override;
|
||
|
|
void onExit() override;
|
||
|
|
void loop() override;
|
||
|
|
void render(RenderLock&&) override;
|
||
|
|
|
||
|
|
private:
|
||
|
|
ButtonNavigator buttonNavigator;
|
||
|
|
|
||
|
|
size_t selectedIndex = 0;
|
||
|
|
int serverIndex;
|
||
|
|
OpdsServer editServer;
|
||
|
|
bool isNewServer = false;
|
||
|
|
|
||
|
|
int getMenuItemCount() const;
|
||
|
|
void handleSelection();
|
||
|
|
void saveServer();
|
||
|
|
};
|