mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[apps/graph] [apps/sequence] Implement copy paste
Change-Id: I7e33e24565b18e771ec530c74fb2a74ade5c3c85
This commit is contained in:
@@ -220,7 +220,7 @@ bool ListController::handleEvent(Ion::Events::Event event) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if ((event.hasText() || event == Ion::Events::XNT)
|
||||
if ((event.hasText() || event == Ion::Events::XNT || event == Ion::Events::Paste)
|
||||
&& selectableTableView()->selectedColumn() == 1
|
||||
&& (selectableTableView()->selectedRow() != numberOfRows() - 1
|
||||
|| m_functionStore->numberOfFunctions() == m_functionStore->maxNumberOfFunctions())) {
|
||||
@@ -228,6 +228,11 @@ bool ListController::handleEvent(Ion::Events::Event event) {
|
||||
editExpression(function, event);
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::Copy && selectableTableView()->selectedColumn() == 1 &&
|
||||
(selectableTableView()->selectedRow() < numberOfRows() - 1 || m_functionStore->numberOfFunctions() == m_functionStore->maxNumberOfFunctions())) {
|
||||
Clipboard::sharedClipboard()->store(textForRow(selectableTableView()->selectedRow()));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -287,6 +292,11 @@ int ListController::functionIndexForRow(int j) {
|
||||
return j;
|
||||
}
|
||||
|
||||
const char * ListController::textForRow(int j) {
|
||||
Shared::Function * function = m_functionStore->functionAtIndex(functionIndexForRow(j));
|
||||
return function->text();
|
||||
}
|
||||
|
||||
void ListController::addEmptyFunction() {
|
||||
m_functionStore->addEmptyFunction();
|
||||
selectableTableView()->reloadData();
|
||||
|
||||
Reference in New Issue
Block a user