|
@ -2,7 +2,7 @@ |
|
|
#include <exception>
|
|
|
#include <exception>
|
|
|
#include <sstream>
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
|
InputManager::InputManager(StorageEditor storageEditor) { |
|
|
|
|
|
|
|
|
InputManager::InputManager(std::shared_ptr<StorageEditor> storageEditor) { |
|
|
this->editor = storageEditor; |
|
|
this->editor = storageEditor; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -91,16 +91,16 @@ void InputManager::displayMainMenu() { |
|
|
switch(selectedOption) { |
|
|
switch(selectedOption) { |
|
|
case 1: { |
|
|
case 1: { |
|
|
InputManager::WareAndAmount x = displayAddWareDialog(); |
|
|
InputManager::WareAndAmount x = displayAddWareDialog(); |
|
|
editor.addWaren(x.ware, x.amount); |
|
|
|
|
|
|
|
|
editor->addWaren(x.ware, x.amount); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
case 2: { |
|
|
case 2: { |
|
|
InputManager::WareAndAmount x = displayRemoveWareDialog(); |
|
|
InputManager::WareAndAmount x = displayRemoveWareDialog(); |
|
|
editor.removeWaren(x.ware.getName(), x.amount); |
|
|
|
|
|
|
|
|
editor->removeWaren(x.ware.getName(), x.amount); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
case 3: { |
|
|
case 3: { |
|
|
std::vector<Ware> waren = this->editor.getWarenStorage().getAllWaren(); |
|
|
|
|
|
|
|
|
std::vector<Ware> waren = this->editor->getWarenStorage().getAllWaren(); |
|
|
displayWaren(waren); |
|
|
displayWaren(waren); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|