mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
undo/device: adjust device management infrastructure
We no longer need the remove infrastructure, and the edit nickname function becomes much more intuitive to use by passing in the dive computer for which we want to create a nickname instead of the internal index into the array of devices. This also removes / simplifies the device list update signals in the DiveListNotifier. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fbe17e620e
commit
e7a5ec46f5
6 changed files with 15 additions and 72 deletions
|
@ -12,24 +12,9 @@ struct device;
|
|||
// We put everything in a namespace, so that we can shorten names without polluting the global namespace
|
||||
namespace Command {
|
||||
|
||||
class RemoveDevice final : public Base {
|
||||
public:
|
||||
RemoveDevice(int index);
|
||||
private:
|
||||
// for undo
|
||||
device dev;
|
||||
|
||||
// for redo
|
||||
int index;
|
||||
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
bool workToBeDone() override;
|
||||
};
|
||||
|
||||
class EditDeviceNickname final : public Base {
|
||||
public:
|
||||
EditDeviceNickname(int index, const QString &nickname);
|
||||
EditDeviceNickname(const divecomputer *dc, const QString &nickname);
|
||||
private:
|
||||
// for redo and undo
|
||||
int index;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue