Skip to content

Commit

Permalink
fixed random table entry changing on selection
Browse files Browse the repository at this point in the history
  • Loading branch information
cpyarger committed May 18, 2020
1 parent 9f18de3 commit 250022e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion forms/configwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ void ConfigWindow::clearTable() {

void ConfigWindow::select(int row, int col)
{
dirty = true;
ui.lin_mtype->setText(ui.tableWidget->item(row, 0)->text());
ui.num_mchan->display(ui.tableWidget->item(row, 1)->text().toInt());
ui.checkBox->setChecked(QVariant(ui.tableWidget->item(row, 2)->text()).toBool());
Expand All @@ -103,7 +104,7 @@ void ConfigWindow::select(int row, int col)
ui.cb_param1->setCurrentText(ui.tableWidget->item(row, 5)->text());
ui.cb_param2->setCurrentText(ui.tableWidget->item(row, 6)->text());
ui.cb_param3->setCurrentText(ui.tableWidget->item(row, 7)->text());

dirty = false;
}
void ConfigWindow::AddRowFromHooks(int rc, std::string type, int index, bool bid,
std::string action, std::string command,
Expand Down Expand Up @@ -270,6 +271,8 @@ bool ConfigWindow::inrow(int x, QString mtype)


void ConfigWindow::sendToTable() {
if (!dirty) {

if (ui.tableWidget->rowCount() > 0) {

int rc =ui.tableWidget->selectedItems()[0]->row();
Expand All @@ -282,6 +285,7 @@ void ConfigWindow::sendToTable() {
ui.tableWidget->item(rc, 6)->setText(ui.cb_param2->currentText());
ui.tableWidget->item(rc, 7)->setText(ui.cb_param3->currentText());
}
}
}


Expand Down
2 changes: 1 addition & 1 deletion forms/configwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ConfigWindow : public QDialog{
std::string option3);
bool inrow(int x);
bool inrow(int x, QString mtype);

bool dirty;

private slots:

Expand Down
1 change: 1 addition & 0 deletions rtmidi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 2.8)
project(rtmidi)
option(PROJECT_VERSION 0.1)


if (WIN32)
Expand Down

0 comments on commit 250022e

Please sign in to comment.