Support for printer configuration
This commit is contained in:
@@ -111,11 +111,17 @@ SettingsPorts::onCurrentMachineChanged(int machineId)
|
||||
cbox[i]->setCurrentIndex(-1);
|
||||
cbox[i]->setCurrentIndex(selectedRows[i]);
|
||||
|
||||
auto *checkBox = findChild<QCheckBox *>(QString("checkBoxParallel%1").arg(i + 1));
|
||||
auto *checkBox = findChild<QCheckBox *>(QString("checkBoxParallel%1").arg(i + 1));
|
||||
auto *buttonCfg = findChild<QPushButton *>(QString("pushButtonConfigureLpt%1").arg(i + 1));
|
||||
if (checkBox != NULL)
|
||||
checkBox->setChecked(lpt_ports[i].enabled > 0);
|
||||
if (cbox[i] != NULL)
|
||||
if (cbox[i] != NULL) {
|
||||
cbox[i]->setEnabled(lpt_ports[i].enabled > 0);
|
||||
if (buttonCfg != NULL) {
|
||||
int lptDevice = cbox[i]->currentData().toInt();
|
||||
buttonCfg->setEnabled(lpt_device_has_config(lptDevice) && (lpt_ports[i].enabled > 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (SERIAL_MAX - 1); i++) {
|
||||
@@ -132,6 +138,86 @@ SettingsPorts::onCurrentMachineChanged(int machineId)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_comboBoxLpt1_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
int lptDevice = ui->comboBoxLpt1->currentData().toInt();
|
||||
|
||||
ui->pushButtonConfigureLpt1->setEnabled(lpt_device_has_config(lptDevice));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_pushButtonConfigureLpt1_clicked()
|
||||
{
|
||||
int lptDevice = ui->comboBoxLpt1->currentData().toInt();
|
||||
auto *device = lpt_device_getdevice(lptDevice);
|
||||
|
||||
DeviceConfig::ConfigureDevice(device, 1);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_comboBoxLpt2_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
int lptDevice = ui->comboBoxLpt2->currentData().toInt();
|
||||
|
||||
ui->pushButtonConfigureLpt2->setEnabled(lpt_device_has_config(lptDevice));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_pushButtonConfigureLpt2_clicked()
|
||||
{
|
||||
int lptDevice = ui->comboBoxLpt2->currentData().toInt();
|
||||
auto *device = lpt_device_getdevice(lptDevice);
|
||||
|
||||
DeviceConfig::ConfigureDevice(device, 1);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_comboBoxLpt3_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
int lptDevice = ui->comboBoxLpt3->currentData().toInt();
|
||||
|
||||
ui->pushButtonConfigureLpt3->setEnabled(lpt_device_has_config(lptDevice));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_pushButtonConfigureLpt3_clicked()
|
||||
{
|
||||
int lptDevice = ui->comboBoxLpt3->currentData().toInt();
|
||||
auto *device = lpt_device_getdevice(lptDevice);
|
||||
|
||||
DeviceConfig::ConfigureDevice(device, 1);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_comboBoxLpt4_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
int lptDevice = ui->comboBoxLpt4->currentData().toInt();
|
||||
|
||||
ui->pushButtonConfigureLpt4->setEnabled(lpt_device_has_config(lptDevice));
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_pushButtonConfigureLpt4_clicked()
|
||||
{
|
||||
int lptDevice = ui->comboBoxLpt4->currentData().toInt();
|
||||
auto *device = lpt_device_getdevice(lptDevice);
|
||||
|
||||
DeviceConfig::ConfigureDevice(device, 1);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsPorts::on_checkBoxParallel1_stateChanged(int state)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,15 @@ public slots:
|
||||
void onCurrentMachineChanged(int machineId);
|
||||
|
||||
private slots:
|
||||
void on_comboBoxLpt1_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureLpt1_clicked();
|
||||
void on_comboBoxLpt2_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureLpt2_clicked();
|
||||
void on_comboBoxLpt3_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureLpt3_clicked();
|
||||
void on_comboBoxLpt4_currentIndexChanged(int index);
|
||||
void on_pushButtonConfigureLpt4_clicked();
|
||||
|
||||
void on_checkBoxParallel1_stateChanged(int state);
|
||||
void on_checkBoxParallel2_stateChanged(int state);
|
||||
void on_checkBoxParallel3_stateChanged(int state);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -27,7 +27,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<layout class="QGridLayout" name="gridLayoutLptDevs">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelLpt1">
|
||||
<property name="text">
|
||||
@@ -35,13 +35,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="comboBoxLpt1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pushButtonConfigureLpt1">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelLpt2">
|
||||
<property name="text">
|
||||
@@ -49,13 +62,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="comboBoxLpt2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pushButtonConfigureLpt2">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelLpt3">
|
||||
<property name="text">
|
||||
@@ -63,13 +89,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="comboBoxLpt3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pushButtonConfigureLpt3">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelLpt4">
|
||||
<property name="text">
|
||||
@@ -77,13 +116,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="3" column="2">
|
||||
<widget class="QComboBox" name="comboBoxLpt4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QPushButton" name="pushButtonConfigureLpt4">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
|
||||
Reference in New Issue
Block a user