From 5b0cc63c723feffb482f970347f637643456fd1a Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 5 Aug 2015 01:43:30 +0200 Subject: [PATCH] Implemented GUI file dialog --- .../samplesource/filesource/filesourcegui.cpp | 13 ++++- .../samplesource/filesource/filesourcegui.h | 1 + .../samplesource/filesource/filesourcegui.ui | 56 ++++++++++++++++++- 3 files changed, 67 insertions(+), 3 deletions(-) diff --git a/plugins/samplesource/filesource/filesourcegui.cpp b/plugins/samplesource/filesource/filesourcegui.cpp index f70c244ac..b8636fd9a 100644 --- a/plugins/samplesource/filesource/filesourcegui.cpp +++ b/plugins/samplesource/filesource/filesourcegui.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include "ui_filesourcegui.h" #include "plugin/pluginapi.h" #include "gui/colormapper.h" @@ -181,5 +182,15 @@ void FileSourceGui::updateHardware() void FileSourceGui::on_play_toggled(bool checked) { - +} + +void FileSourceGui::on_showFileDialog_clicked(bool checked) +{ + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open I/Q record file"), ".", tr("SDR I/Q Files (*.sdriq)")); + if (fileName != "") { + m_settings.m_fileName = fileName; + ui->fileNameText->setText(m_settings.m_fileName); + sendSettings(); + } } diff --git a/plugins/samplesource/filesource/filesourcegui.h b/plugins/samplesource/filesource/filesourcegui.h index a763bd246..e1caaf5d4 100644 --- a/plugins/samplesource/filesource/filesourcegui.h +++ b/plugins/samplesource/filesource/filesourcegui.h @@ -70,6 +70,7 @@ private: private slots: void on_playLoop_toggled(bool checked); void on_play_toggled(bool checked); + void on_showFileDialog_clicked(bool checked); }; #endif // INCLUDE_FILESOURCEGUI_H diff --git a/plugins/samplesource/filesource/filesourcegui.ui b/plugins/samplesource/filesource/filesourcegui.ui index 382bb1968..29623e335 100644 --- a/plugins/samplesource/filesource/filesourcegui.ui +++ b/plugins/samplesource/filesource/filesourcegui.ui @@ -7,7 +7,7 @@ 0 0 198 - 88 + 133 @@ -106,6 +106,58 @@ + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + + + + + :/preset-load.png:/preset-load.png + + + + + + + false + + + + 8 + + + + ... + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + Qt::Horizontal + + + @@ -212,7 +264,7 @@ :/play.png :/pause.png :/play.png - :/pause.png:/pause.png + :/pause.png:/play.png