Use .ostm as default extension for Saved Stream(s) file and use it as default filter for open stream file
This commit is contained in:
parent
f3f970cb64
commit
29f840c91c
@ -812,6 +812,8 @@ void PortsWindow::on_actionOpen_Streams_triggered()
|
|||||||
{
|
{
|
||||||
qDebug("Open Streams Action");
|
qDebug("Open Streams Action");
|
||||||
|
|
||||||
|
QStringList fileTypes = AbstractFileFormat::supportedFileTypes();
|
||||||
|
QString fileType;
|
||||||
QModelIndex current = tvPortList->selectionModel()->currentIndex();
|
QModelIndex current = tvPortList->selectionModel()->currentIndex();
|
||||||
static QString dirName;
|
static QString dirName;
|
||||||
QString fileName;
|
QString fileName;
|
||||||
@ -824,7 +826,14 @@ void PortsWindow::on_actionOpen_Streams_triggered()
|
|||||||
|
|
||||||
Q_ASSERT(plm->isPort(current));
|
Q_ASSERT(plm->isPort(current));
|
||||||
|
|
||||||
fileName = QFileDialog::getOpenFileName(this, tr("Open Streams"), dirName);
|
// cannot open Python Scripts
|
||||||
|
fileTypes.removeAt(fileTypes.indexOf("PythonScript (*.py)"));
|
||||||
|
fileTypes.append("All files (*)");
|
||||||
|
if (fileTypes.size())
|
||||||
|
fileType = fileTypes.at(0);
|
||||||
|
|
||||||
|
fileName = QFileDialog::getOpenFileName(this, tr("Open Streams"),
|
||||||
|
dirName, fileTypes.join(";;"), &fileType);
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
goto _exit;
|
goto _exit;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ QDialog* AbstractFileFormat::saveOptionsDialog()
|
|||||||
QStringList AbstractFileFormat::supportedFileTypes()
|
QStringList AbstractFileFormat::supportedFileTypes()
|
||||||
{
|
{
|
||||||
return QStringList()
|
return QStringList()
|
||||||
<< "Ostinato (*)"
|
<< "Ostinato (*.ostm)"
|
||||||
<< "PCAP (*)"
|
<< "PCAP (*)"
|
||||||
<< "PDML (*.pdml)"
|
<< "PDML (*.pdml)"
|
||||||
<< "PythonScript (*.py)";
|
<< "PythonScript (*.py)";
|
||||||
|
Loading…
Reference in New Issue
Block a user