Skip to content

Commit

Permalink
Add button to re-check duplicate commands
Browse files Browse the repository at this point in the history
  • Loading branch information
askepticaldreamer committed Feb 12, 2023
1 parent ae1b04a commit 4645273
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/common/SignalVectorModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class SignalVectorModel : public QAbstractTableModel,
this->rows_[row].items, this->rows_[row].original.get());
this->vector_->insert(item, vecRow, this);
}
emit dataChanged(index, index);

return true;
}
Expand Down
14 changes: 6 additions & 8 deletions src/widgets/settingspages/CommandPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ CommandPage::CommandPage()
Command{"/command", "I made a new command HeyGuys"});
});

QItemSelectionModel *selectionModel =
this->view->getTableView()->selectionModel();
QObject::connect(
selectionModel, &QItemSelectionModel::currentChanged, this,
[this](const QModelIndex &current, const QModelIndex &previous) {
this->checkCommandDuplicates();
});

// TODO: asyncronously check path
if (QFile(c1settingsPath()).exists())
{
Expand Down Expand Up @@ -96,6 +88,12 @@ CommandPage::CommandPage()
this->duplicateCommandWarning->setStyleSheet("color: yellow");
this->checkCommandDuplicates();

QPushButton *checkDuplicates = new QPushButton("Check Duplicates");
this->view->addCustomButton(checkDuplicates);
QObject::connect(checkDuplicates, &QPushButton::clicked, this, [this] {
this->checkCommandDuplicates();
});

// ---- end of layout
this->commandsEditTimer_.setSingleShot(true);
}
Expand Down

0 comments on commit 4645273

Please sign in to comment.