aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpdevpropdialog.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-07-01 00:13:56 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-07-01 00:13:56 +0800
commiteb82292b5d8818a5ef1a0c92e35390bd4e22674e (patch)
treeba0aa0171654fdb51af89460b11284c395f13597 /qmidiplayer-desktop/qmpdevpropdialog.cpp
parent19c89fc7baa299e523e152a14066ebc8ce23af21 (diff)
downloadQMidiPlayer-eb82292b5d8818a5ef1a0c92e35390bd4e22674e.tar.xz
Use splitter in preset selection dialog.
Device initialization settings are no longer lost if QMidiPlayer starts with the device disconnected.
Diffstat (limited to 'qmidiplayer-desktop/qmpdevpropdialog.cpp')
-rw-r--r--qmidiplayer-desktop/qmpdevpropdialog.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/qmidiplayer-desktop/qmpdevpropdialog.cpp b/qmidiplayer-desktop/qmpdevpropdialog.cpp
index 0159a63..150f54b 100644
--- a/qmidiplayer-desktop/qmpdevpropdialog.cpp
+++ b/qmidiplayer-desktop/qmpdevpropdialog.cpp
@@ -73,7 +73,16 @@ void qmpDevPropDialog::setupRow(const QString&dn,const QString&din)
if(s==QString::fromStdString(ds)){conn=true;break;}
((QCheckBox*)ui->twProps->cellWidget(r,1))->setChecked(conn);
});
- if(dn.length())cb->setCurrentText(dn);
+ if(dn.length())
+ {
+ cb->setCurrentText(dn);
+ if(cb->currentText()!=dn)
+ {
+ cb->setEditable(true);
+ cb->setCurrentText(dn);
+ cb->setEnabled(false);
+ }
+ }
emit cb->currentTextChanged(cb->currentText());
connect(pb,&QPushButton::clicked,this,[this,lb,fw]{
lb->setText(QFileDialog::getOpenFileUrl(this,"Select Device Initialization File",QUrl()).path());