Split Insert triplet button, and add mode menus
The "insert before" and "insert after" buttons will drop a menu to select the new triplet mode, allowing triplets with different modes to be inserted with one less mouse click. The "insert copy" button still does the old behaviour of inserting a copy of the currently selected triplet.
This commit is contained in:
18
x26model.cpp
18
x26model.cpp
@@ -797,13 +797,6 @@ QVariant X26Model::headerData(int section, Qt::Orientation orientation, int role
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool X26Model::insertFirstRow()
|
||||
{
|
||||
m_parentMainWidget->document()->undoStack()->push(new InsertTripletCommand(m_parentMainWidget->document(), this, 0, 1, X26Triplet(63, 31, 7)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool X26Model::insertRows(int row, int count, const QModelIndex &parent)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
@@ -815,6 +808,17 @@ bool X26Model::insertRows(int row, int count, const QModelIndex &parent)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool X26Model::insertRows(int row, int count, const QModelIndex &parent, X26Triplet triplet)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
|
||||
if (m_parentMainWidget->document()->currentSubPage()->enhancements()->size() + count > m_parentMainWidget->document()->currentSubPage()->maxEnhancements())
|
||||
return false;
|
||||
|
||||
m_parentMainWidget->document()->undoStack()->push(new InsertTripletCommand(m_parentMainWidget->document(), this, row, count, triplet));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool X26Model::removeRows(int row, int count, const QModelIndex &index)
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
|
||||
Reference in New Issue
Block a user