Re-enable I/O device configurator.

This commit is contained in:
Alexandru Csete 2012-05-19 00:01:07 +02:00
parent 6e6f6bedb5
commit 5be10b6f3b
3 changed files with 34 additions and 46 deletions

View File

@ -963,6 +963,26 @@ void MainWindow::on_actionDSP_triggered(bool checked)
}
}
/*! \brief Action: I/O device configurator triggered.
*
* This slot is activated when the user selects "I/O Devices" in the
* menu. It activates the I/O configurator and if the user closes the
* configurator using the OK button, the new configuration is read and
* sent to the receiver.
*/
void MainWindow::on_actionIoConfig_triggered()
{
qDebug() << "Configure I/O devices.";
CIoConfig *ioconf = new CIoConfig(m_settings);
int confres = ioconf->exec();
if (confres == QDialog::Accepted)
loadConfig(m_settings->fileName());
delete ioconf;
}
/*! \brief Load configuration activated by user. */
void MainWindow::on_actionLoadSettings_triggered()
{
@ -1086,40 +1106,6 @@ void MainWindow::on_actionFullScreen_triggered(bool checked)
}
}
/*! \brief Action: I/O device configurator triggered.
*
* This slot is activated when the user selects "I/O Devices" in the
* menu. It activates the I/O configurator and if the user closes the
* configurator using the OK button, the new configuration is read and
* sent to the receiver.
*/
void MainWindow::on_actionIODevices_triggered()
{
QSettings settings;
QString cindev = settings.value("input").toString();
QString coutdev = settings.value("output").toString();
CIoConfig *ioconf = new CIoConfig();
int confres = ioconf->exec();
if (confres == QDialog::Accepted) {
QString nindev = settings.value("input").toString();
QString noutdev = settings.value("output").toString();
// we need to ensure that we don't reconfigure RX
// with the same device as the already used one because
// that can crash the receiver when using ALSA :(
if (cindev != nindev)
rx->set_input_device(nindev.toStdString());
if (coutdev != noutdev)
rx->set_output_device(noutdev.toStdString());
}
delete ioconf;
}
#define DATA_BUFFER_SIZE 48000

View File

@ -133,11 +133,11 @@ private slots:
/* menu and toolbar actions */
void on_actionDSP_triggered(bool checked);
void on_actionIoConfig_triggered();
void on_actionLoadSettings_triggered();
void on_actionSaveSettings_triggered();
void on_actionIqRec_triggered(bool checked);
void on_actionFullScreen_triggered(bool checked);
void on_actionIODevices_triggered();
void on_actionAFSK1200_triggered();
void on_actionBPSK1000_triggered();
void on_actionUserGroup_triggered();

View File

@ -14,7 +14,7 @@
<string>gqrx</string>
</property>
<property name="windowIcon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/scope-256.png</normaloff>:/icons/icons/scope-256.png</iconset>
</property>
<property name="dockOptions">
@ -134,6 +134,7 @@
</property>
<addaction name="actionDSP"/>
<addaction name="separator"/>
<addaction name="actionIoConfig"/>
<addaction name="actionLoadSettings"/>
<addaction name="actionSaveSettings"/>
<addaction name="separator"/>
@ -176,6 +177,7 @@
</attribute>
<addaction name="actionDSP"/>
<addaction name="separator"/>
<addaction name="actionIoConfig"/>
<addaction name="actionLoadSettings"/>
<addaction name="actionSaveSettings"/>
<addaction name="separator"/>
@ -218,7 +220,7 @@
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/power-off.svg</normaloff>:/icons/icons/power-off.svg</iconset>
</property>
<property name="text">
@ -247,7 +249,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/clock.svg</normaloff>:/icons/icons/clock.svg</iconset>
</property>
<property name="text">
@ -265,7 +267,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/record.svg</normaloff>:/icons/icons/record.svg</iconset>
</property>
<property name="text">
@ -289,12 +291,12 @@
<string>Start BPSK1000 decoder</string>
</property>
</action>
<action name="actionIODevices">
<action name="actionIoConfig">
<property name="enabled">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/flash.svg</normaloff>:/icons/icons/flash.svg</iconset>
</property>
<property name="text">
@ -309,7 +311,7 @@
</action>
<action name="actionUserGroup">
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/help.svg</normaloff>:/icons/icons/help.svg</iconset>
</property>
<property name="text">
@ -324,7 +326,7 @@
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/fullscreen.svg</normaloff>:/icons/icons/fullscreen.svg</iconset>
</property>
<property name="text">
@ -339,7 +341,7 @@
</action>
<action name="actionLoadSettings">
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/folder.svg</normaloff>:/icons/icons/folder.svg</iconset>
</property>
<property name="text">
@ -354,7 +356,7 @@
</action>
<action name="actionSaveSettings">
<property name="icon">
<iconset resource="icons.qrc">
<iconset resource="../../icons.qrc">
<normaloff>:/icons/icons/floppy.svg</normaloff>:/icons/icons/floppy.svg</iconset>
</property>
<property name="text">
@ -390,7 +392,7 @@
</customwidget>
</customwidgets>
<resources>
<include location="icons.qrc"/>
<include location="../../icons.qrc"/>
</resources>
<connections>
<connection>