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:
Srivats P 2016-05-18 21:33:26 +05:30
parent f3f970cb64
commit 29f840c91c
2 changed files with 11 additions and 2 deletions

View File

@ -812,6 +812,8 @@ void PortsWindow::on_actionOpen_Streams_triggered()
{
qDebug("Open Streams Action");
QStringList fileTypes = AbstractFileFormat::supportedFileTypes();
QString fileType;
QModelIndex current = tvPortList->selectionModel()->currentIndex();
static QString dirName;
QString fileName;
@ -824,7 +826,14 @@ void PortsWindow::on_actionOpen_Streams_triggered()
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())
goto _exit;

View File

@ -48,7 +48,7 @@ QDialog* AbstractFileFormat::saveOptionsDialog()
QStringList AbstractFileFormat::supportedFileTypes()
{
return QStringList()
<< "Ostinato (*)"
<< "Ostinato (*.ostm)"
<< "PCAP (*)"
<< "PDML (*.pdml)"
<< "PythonScript (*.py)";