diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-04-28 23:40:42 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-04-28 23:40:42 +0800 |
commit | 13fca5100f1e28a538e7900d011714d94f6b1b10 (patch) | |
tree | 2034d837473c14f600987134d98f51f0a5ab3c5d /qmidiplayer-desktop/qmpsettingswindow.cpp | |
parent | 8eac5088101595422753030b1b259411d63f83a8 (diff) | |
download | QMidiPlayer-13fca5100f1e28a538e7900d011714d94f6b1b10.tar.xz |
Now it is possible to disable plugins in the plugin list.
Diffstat (limited to 'qmidiplayer-desktop/qmpsettingswindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpsettingswindow.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp index 985fb6e..d59d2be 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.cpp +++ b/qmidiplayer-desktop/qmpsettingswindow.cpp @@ -242,6 +242,12 @@ void qmpSettingsWindow::settingsUpdate() } settings->setValue("Behavior/SingleInstance",ui->cbPersistentfs->isChecked()?1:0); + + for(int i=0;i<ui->twPluginList->rowCount();++i) + settings->setValue( + QString("PluginSwitch/")+ui->twPluginList->item(i,1)->text(), + ((QCheckBox*)ui->twPluginList->cellWidget(i,0))->isChecked()?1:0); + settings->sync(); } @@ -294,3 +300,26 @@ void qmpSettingsWindow::on_cbAutoBS_stateChanged() { ui->lbBSMode->setText(ui->cbAutoBS->isChecked()?"Fallback bank select mode":"Bank select mode"); } + +void qmpSettingsWindow::updatePluginList(qmpPluginManager *pmgr) +{ + std::vector<qmpPlugin> *plugins=pmgr->getPlugins(); + for(unsigned i=0;i<plugins->size();++i) + { + ui->twPluginList->insertRow(i); + ui->twPluginList->setCellWidget(i,0,new QCheckBox("")); + if(settings->value(QString("PluginSwitch/")+QString(plugins->at(i).name.c_str()),0).toInt()) + {((QCheckBox*)ui->twPluginList->cellWidget(i,0))->setChecked(true);plugins->at(i).enabled=true;} + else + {((QCheckBox*)ui->twPluginList->cellWidget(i,0))->setChecked(false);plugins->at(i).enabled=false;} + ui->twPluginList->setItem(i,1,new QTableWidgetItem(plugins->at(i).name.c_str())); + ui->twPluginList->setItem(i,2,new QTableWidgetItem(plugins->at(i).version.c_str())); + ui->twPluginList->setItem(i,3,new QTableWidgetItem(plugins->at(i).path.c_str())); + for(int j=1;j<=3;++j) + ui->twPluginList->item(i,j)->setFlags(ui->twPluginList->item(i,j)->flags()^Qt::ItemIsEditable); + } + ui->twPluginList->setColumnWidth(0,22); + ui->twPluginList->setColumnWidth(1,192); + ui->twPluginList->setColumnWidth(2,64); + ui->twPluginList->setColumnWidth(3,128); +} |