This commit is contained in:
ts-korhonen
2022-02-03 19:18:08 +02:00
4 changed files with 8 additions and 9 deletions

View File

@@ -8,6 +8,8 @@ FileField::FileField(QWidget *parent) :
ui(new Ui::FileField) ui(new Ui::FileField)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->label, &QLineEdit::editingFinished, this, [this] () { emit fileSelected(ui->label->text()); });
} }
FileField::~FileField() FileField::~FileField()

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>354</width>
<height>300</height> <height>43</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -27,11 +27,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLineEdit" name="label"/>
<property name="text">
<string/>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton"> <widget class="QPushButton" name="pushButton">

View File

@@ -83,7 +83,7 @@ HarddiskDialog::HarddiskDialog(bool existing, QWidget *parent) :
ui->lineEditSize->setValidator(new QIntValidator()); ui->lineEditSize->setValidator(new QIntValidator());
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(ui->fileField, &FileField::fileSelected, this, [this] { if (!existing) connect(ui->fileField, &FileField::fileSelected, this, [this] {
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
}); });
} }
@@ -459,6 +459,7 @@ void HarddiskDialog::onExistingFileSelected(const QString &fileName) {
uint32_t cylinders = 0; uint32_t cylinders = 0;
int vhd_error = 0; int vhd_error = 0;
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
QFile file(fileName); QFile file(fileName);
if (! file.open(QIODevice::ReadOnly)) { if (! file.open(QIODevice::ReadOnly)) {
QMessageBox::critical(this, tr("Unable to read file"), tr("Make sure the file exists and is readable.")); QMessageBox::critical(this, tr("Unable to read file"), tr("Make sure the file exists and is readable."));
@@ -553,6 +554,7 @@ void HarddiskDialog::onExistingFileSelected(const QString &fileName) {
ui->lineEditSectors->setEnabled(true); ui->lineEditSectors->setEnabled(true);
ui->lineEditSize->setEnabled(true); ui->lineEditSize->setEnabled(true);
ui->comboBoxType->setEnabled(true); ui->comboBoxType->setEnabled(true);
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
} }
void HarddiskDialog::recalcSize() { void HarddiskDialog::recalcSize() {

View File

@@ -203,7 +203,6 @@ SettingsBusTracking::device_track(int set, uint8_t dev_type, int bus, int channe
int i, element; int i, element;
uint64_t mask; uint64_t mask;
uint8_t count = 0; uint8_t count = 0;
fprintf(stderr, "set: %d, dev_type: %hd, bus: %d, channel: %d\n", set, dev_type, bus, channel);
switch (bus) { switch (bus) {
case HDD_BUS_MFM: case HDD_BUS_MFM: