Implement bus tracking for hard disk creation dialog
This commit is contained in:
@@ -22,6 +22,7 @@ extern "C" {
|
|||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
|
|
||||||
#include "qt_harddrive_common.hpp"
|
#include "qt_harddrive_common.hpp"
|
||||||
|
#include "qt_settings_bus_tracking.hpp"
|
||||||
#include "qt_models_common.hpp"
|
#include "qt_models_common.hpp"
|
||||||
#include "qt_util.hpp"
|
#include "qt_util.hpp"
|
||||||
|
|
||||||
@@ -609,6 +610,7 @@ bool HarddiskDialog::checkAndAdjustCylinders() {
|
|||||||
|
|
||||||
|
|
||||||
void HarddiskDialog::on_comboBoxBus_currentIndexChanged(int index) {
|
void HarddiskDialog::on_comboBoxBus_currentIndexChanged(int index) {
|
||||||
|
int chanIdx = 0;
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -665,6 +667,27 @@ void HarddiskDialog::on_comboBoxBus_currentIndexChanged(int index) {
|
|||||||
ui->lineEditSectors->setValidator(new QIntValidator(1, max_sectors, this));
|
ui->lineEditSectors->setValidator(new QIntValidator(1, max_sectors, this));
|
||||||
|
|
||||||
Harddrives::populateBusChannels(ui->comboBoxChannel->model(), ui->comboBoxBus->currentData().toInt());
|
Harddrives::populateBusChannels(ui->comboBoxChannel->model(), ui->comboBoxBus->currentData().toInt());
|
||||||
|
switch (ui->comboBoxBus->currentData().toInt())
|
||||||
|
{
|
||||||
|
case HDD_BUS_MFM:
|
||||||
|
chanIdx = (Harddrives::busTrackClass->next_free_mfm_channel());
|
||||||
|
break;
|
||||||
|
case HDD_BUS_XTA:
|
||||||
|
chanIdx = (Harddrives::busTrackClass->next_free_xta_channel());
|
||||||
|
break;
|
||||||
|
case HDD_BUS_ESDI:
|
||||||
|
chanIdx = (Harddrives::busTrackClass->next_free_esdi_channel());
|
||||||
|
break;
|
||||||
|
case HDD_BUS_ATAPI:
|
||||||
|
case HDD_BUS_IDE:
|
||||||
|
chanIdx = (Harddrives::busTrackClass->next_free_ide_channel());
|
||||||
|
break;
|
||||||
|
case HDD_BUS_SCSI:
|
||||||
|
chanIdx = (Harddrives::busTrackClass->next_free_scsi_id());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->comboBoxChannel->setCurrentIndex(chanIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HarddiskDialog::on_lineEditSize_textEdited(const QString &text) {
|
void HarddiskDialog::on_lineEditSize_textEdited(const QString &text) {
|
||||||
|
Reference in New Issue
Block a user