mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 16:57:31 +01:00
[code] Cleaned Script and ScriptStore classes, created accordion.h
A Script object now contains its AutoImport marker, its name and its content. The ScripStore methods have better names and the optimization is cleaner. Change-Id: I1b21af2d23f1c9a34f984309512b0c01b2f1c320
This commit is contained in:
@@ -89,7 +89,7 @@ void MenuController::renameScriptAtIndex(int i) {
|
||||
}
|
||||
|
||||
void MenuController::deleteScriptAtIndex(int i) {
|
||||
m_scriptStore->deleteScript(i);
|
||||
m_scriptStore->deleteScriptAtIndex(i);
|
||||
m_selectableTableView.reloadData();
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ int MenuController::typeAtLocation(int i, int j) {
|
||||
void MenuController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
if (index < m_scriptStore->numberOfScripts()) {
|
||||
EvenOddEditableTextCell * myCell = static_cast<EvenOddEditableTextCell *>(cell);
|
||||
myCell->editableTextCell()->textField()->setText(m_scriptStore->nameOfScript(index));
|
||||
myCell->editableTextCell()->textField()->setText(m_scriptStore->scriptAtIndex(index).name());
|
||||
myCell->setEven(index%2 == 0);
|
||||
} else {
|
||||
assert(index == m_scriptStore->numberOfScripts());
|
||||
@@ -169,7 +169,7 @@ bool MenuController::textFieldDidReceiveEvent(TextField * textField, Ion::Events
|
||||
}
|
||||
|
||||
bool MenuController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
|
||||
if (m_scriptStore->renameScript(m_selectableTableView.selectedRow(), text)) {
|
||||
if (m_scriptStore->renameScriptAtIndex(m_selectableTableView.selectedRow(), text)) {
|
||||
int currentRow = m_selectableTableView.selectedRow();
|
||||
if (event == Ion::Events::Down && currentRow < numberOfRows() - 1) {
|
||||
m_selectableTableView.selectCellAtLocation(m_selectableTableView.selectedColumn(), currentRow + 1);
|
||||
|
||||
Reference in New Issue
Block a user