1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-13 03:41:47 -05:00

Implemented GUI file dialog

This commit is contained in:
f4exb 2015-08-05 01:43:30 +02:00
parent 5dc5485b86
commit 5b0cc63c72
3 changed files with 67 additions and 3 deletions

View File

@ -19,6 +19,7 @@
#include <QTime>
#include <QDateTime>
#include <QString>
#include <QFileDialog>
#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();
}
}

View File

@ -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

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>198</width>
<height>88</height>
<height>133</height>
</rect>
</property>
<property name="sizePolicy">
@ -106,6 +106,58 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="fileSelectionLayout">
<item>
<widget class="QPushButton" name="showFileDialog">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/preset-load.png</normaloff>:/preset-load.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fileNameText">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>...</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_file">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="rateTimeLayout">
<item>
@ -212,7 +264,7 @@
<activeoff>:/play.png</activeoff>
<activeon>:/pause.png</activeon>
<selectedoff>:/play.png</selectedoff>
<selectedon>:/pause.png</selectedon>:/pause.png</iconset>
<selectedon>:/pause.png</selectedon>:/play.png</iconset>
</property>
<property name="iconSize">
<size>