Clean QT Floppy/CD-ROM UI
This commit is contained in:
@@ -359,9 +359,9 @@ SettingsFloppyCDROM::on_comboBoxSpeed_activated(int index)
|
||||
void
|
||||
SettingsFloppyCDROM::on_comboBoxBus_activated(int)
|
||||
{
|
||||
auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0);
|
||||
auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0);
|
||||
uint8_t bus_type = ui->comboBoxBus->currentData().toUInt();
|
||||
int cdromIdx = ui->tableViewCDROM->selectionModel()->currentIndex().data().toInt();
|
||||
int cdromIdx = ui->tableViewCDROM->selectionModel()->currentIndex().data().toInt();
|
||||
|
||||
Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
|
||||
Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
|
||||
@@ -384,9 +384,9 @@ SettingsFloppyCDROM::on_comboBoxBus_activated(int)
|
||||
auto *modelType = ui->comboBoxCDROMType->model();
|
||||
int removeRows = modelType->rowCount();
|
||||
|
||||
uint32_t j = 0;
|
||||
int selectedTypeRow = 0;
|
||||
int eligibleRows = 0;
|
||||
uint32_t j = 0;
|
||||
int selectedTypeRow = 0;
|
||||
int eligibleRows = 0;
|
||||
while (cdrom_drive_types[j].bus_type != BUS_TYPE_NONE) {
|
||||
if (((bus_type == CDROM_BUS_ATAPI) || (bus_type == CDROM_BUS_SCSI)) &&
|
||||
((cdrom_drive_types[j].bus_type == bus_type) ||
|
||||
@@ -414,11 +414,10 @@ void
|
||||
SettingsFloppyCDROM::enableCurrentlySelectedChannel()
|
||||
{
|
||||
const auto *item_model = qobject_cast<QStandardItemModel*>(ui->comboBoxChannel->model());
|
||||
const auto index = ui->comboBoxChannel->currentIndex();
|
||||
auto *item = item_model->item(index);
|
||||
if(item) {
|
||||
const auto index = ui->comboBoxChannel->currentIndex();
|
||||
auto *item = item_model->item(index);
|
||||
if(item)
|
||||
item->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -449,9 +448,9 @@ SettingsFloppyCDROM::on_comboBoxCDROMType_activated(int)
|
||||
ui->tableViewCDROM->resizeColumnsToContents();
|
||||
ui->tableViewCDROM->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
|
||||
int speed = cdrom_get_speed(type);
|
||||
int speed = cdrom_get_speed(type);
|
||||
if (speed == -1) {
|
||||
speed = ui->comboBoxSpeed->currentData().toUInt();
|
||||
speed = ui->comboBoxSpeed->currentData().toUInt();
|
||||
ui->comboBoxSpeed->setEnabled(true);
|
||||
} else
|
||||
ui->comboBoxSpeed->setEnabled(false);
|
||||
|
||||
@@ -19,17 +19,20 @@ public:
|
||||
|
||||
signals:
|
||||
void cdromChannelChanged();
|
||||
|
||||
private slots:
|
||||
void on_comboBoxCDROMType_activated(int index);
|
||||
void on_comboBoxChannel_activated(int index);
|
||||
void on_comboBoxBus_activated(int index);
|
||||
void on_comboBoxSpeed_activated(int index);
|
||||
void on_comboBoxBus_currentIndexChanged(int index);
|
||||
void on_comboBoxFloppyType_activated(int index);
|
||||
void on_checkBoxCheckBPB_stateChanged(int arg1);
|
||||
void on_checkBoxTurboTimings_stateChanged(int arg1);
|
||||
void onFloppyRowChanged(const QModelIndex ¤t);
|
||||
void on_comboBoxFloppyType_activated(int index);
|
||||
void on_checkBoxTurboTimings_stateChanged(int arg1);
|
||||
void on_checkBoxCheckBPB_stateChanged(int arg1);
|
||||
|
||||
void onCDROMRowChanged(const QModelIndex ¤t);
|
||||
void on_comboBoxBus_activated(int index);
|
||||
void on_comboBoxBus_currentIndexChanged(int index);
|
||||
void on_comboBoxChannel_activated(int index);
|
||||
void on_comboBoxSpeed_activated(int index);
|
||||
void on_comboBoxCDROMType_activated(int index);
|
||||
|
||||
|
||||
private:
|
||||
Ui::SettingsFloppyCDROM *ui;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="labelFloppy">
|
||||
<property name="text">
|
||||
<string>Floppy drives:</string>
|
||||
</property>
|
||||
@@ -68,7 +68,7 @@
|
||||
<widget class="QWidget" name="floppyControls" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="labelFloppyType">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
@@ -99,7 +99,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<widget class="QLabel" name="labelCDROM">
|
||||
<property name="text">
|
||||
<string>CD-ROM drives:</string>
|
||||
</property>
|
||||
@@ -140,33 +140,12 @@
|
||||
<widget class="QWidget" name="cdControls" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QLabel" name="labelBus">
|
||||
<property name="text">
|
||||
<string>Bus:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Channel:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBoxBus">
|
||||
<property name="maxVisibleItems">
|
||||
@@ -174,6 +153,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="labelChannel">
|
||||
<property name="text">
|
||||
<string>Channel:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QComboBox" name="comboBoxChannel">
|
||||
<property name="maxVisibleItems">
|
||||
@@ -181,6 +167,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelSpeed">
|
||||
<property name="text">
|
||||
<string>Speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBoxSpeed">
|
||||
<property name="maxVisibleItems">
|
||||
@@ -188,6 +181,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelCDROMType">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="comboBoxCDROMType">
|
||||
<property name="maxVisibleItems">
|
||||
|
||||
Reference in New Issue
Block a user