1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-10 10:33:29 -05:00

RTLSDR GUI file record: right click to choose file

This commit is contained in:
f4exb 2020-04-01 08:44:51 +02:00
parent 597633009c
commit 71e65c4e9c
3 changed files with 32 additions and 1 deletions

View File

@ -17,6 +17,7 @@
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <QFileDialog>
#include "rtlsdrgui.h" #include "rtlsdrgui.h"
@ -69,6 +70,9 @@ RTLSDRGui::RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent) :
CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop); CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
CRightClickEnabler *fileRecordRightClickEnabler = new CRightClickEnabler(ui->record);
connect(fileRecordRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openFileRecordDialog(const QPoint &)));
} }
RTLSDRGui::~RTLSDRGui() RTLSDRGui::~RTLSDRGui()
@ -576,3 +580,29 @@ void RTLSDRGui::openDeviceSettingsDialog(const QPoint& p)
sendSettings(); sendSettings();
} }
void RTLSDRGui::openFileRecordDialog(const QPoint& p)
{
QFileDialog fileDialog(
this,
tr("Save I/Q record file"),
m_settings.m_fileRecordName,
tr("SDR I/Q Files (*.sdriq)")
);
fileDialog.setOptions(QFileDialog::DontUseNativeDialog);
fileDialog.setFileMode(QFileDialog::AnyFile);
fileDialog.move(p);
QStringList fileNames;
if (fileDialog.exec())
{
fileNames = fileDialog.selectedFiles();
if (fileNames.size() > 0)
{
m_settings.m_fileRecordName = fileNames.at(0);
sendSettings();
}
}
}

View File

@ -98,6 +98,7 @@ private slots:
void on_transverter_clicked(); void on_transverter_clicked();
void on_sampleRateMode_toggled(bool checked); void on_sampleRateMode_toggled(bool checked);
void openDeviceSettingsDialog(const QPoint& p); void openDeviceSettingsDialog(const QPoint& p);
void openFileRecordDialog(const QPoint& p);
void updateHardware(); void updateHardware();
void updateStatus(); void updateStatus();
}; };

View File

@ -74,7 +74,7 @@
<item> <item>
<widget class="ButtonSwitch" name="record"> <widget class="ButtonSwitch" name="record">
<property name="toolTip"> <property name="toolTip">
<string>Toggle record I/Q samples from device</string> <string>Left: toggle record I/Q samples from device - Right: select output file</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>