mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2025-01-10 08:55:36 +00:00
Clarify open/save
Give a gpi extension. Save with the given extension.
This commit is contained in:
parent
f2fd6096d6
commit
6c515a7807
2 changed files with 22 additions and 12 deletions
|
@ -44,8 +44,8 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags):
|
||||||
connect(pactAdd, SIGNAL(triggered()), SLOT(AddPlugin()));
|
connect(pactAdd, SIGNAL(triggered()), SLOT(AddPlugin()));
|
||||||
|
|
||||||
|
|
||||||
QAction *pactOpenFile = ptb -> addAction("Open File...");
|
QAction *pactOpenFile = ptb -> addAction("Open Media File...");
|
||||||
connect(pactOpenFile, SIGNAL(triggered()), SLOT(OpenFile()));
|
connect(pactOpenFile, SIGNAL(triggered()), SLOT(OpenMediaFile()));
|
||||||
|
|
||||||
ptb -> addSeparator();
|
ptb -> addSeparator();
|
||||||
|
|
||||||
|
@ -123,6 +123,9 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags):
|
||||||
QAction *pactOpen = pmenu -> addAction ("Open...", this, SLOT(Open()), QKeySequence::Open);
|
QAction *pactOpen = pmenu -> addAction ("Open...", this, SLOT(Open()), QKeySequence::Open);
|
||||||
addAction (pactOpen);
|
addAction (pactOpen);
|
||||||
|
|
||||||
|
QAction *pactOpenMediaFile = pmenu -> addAction ("Open Media File...", this, SLOT(OpenMediaFile()), QKeySequence::Open);
|
||||||
|
addAction (pactOpenMediaFile);
|
||||||
|
|
||||||
QAction *pactSave = pmenu -> addAction ("Save", this, SLOT(Save()), QKeySequence::Save);
|
QAction *pactSave = pmenu -> addAction ("Save", this, SLOT(Save()), QKeySequence::Save);
|
||||||
addAction (pactSave);
|
addAction (pactSave);
|
||||||
|
|
||||||
|
@ -136,8 +139,8 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags):
|
||||||
pmenu = menuBar() -> addMenu("&Graph");
|
pmenu = menuBar() -> addMenu("&Graph");
|
||||||
|
|
||||||
pmenu -> addAction(pactAdd);
|
pmenu -> addAction(pactAdd);
|
||||||
pmenu -> addAction(pactOpenFile);
|
pmenu -> addAction(pactOpenMediaFile);
|
||||||
pmenu -> addAction ("Open Uri...", this, SLOT(OpenUri()));
|
pmenu -> addAction ("Open Media Uri...", this, SLOT(OpenMediaUri()));
|
||||||
pmenu -> addSeparator();
|
pmenu -> addSeparator();
|
||||||
pmenu -> addAction(pactPlay);
|
pmenu -> addAction(pactPlay);
|
||||||
pmenu -> addAction(pactPause);
|
pmenu -> addAction(pactPause);
|
||||||
|
@ -186,11 +189,11 @@ void MainWindow::AddPlugin()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::OpenFile()
|
void MainWindow::OpenMediaFile()
|
||||||
{
|
{
|
||||||
QString dir = CustomSettings::lastIODirectory();
|
QString dir = CustomSettings::lastIODirectory();
|
||||||
|
|
||||||
QString path = QFileDialog::getOpenFileName(this, "Open File...", dir );
|
QString path = QFileDialog::getOpenFileName(this, "Open File...", dir);
|
||||||
if(!path.isEmpty())
|
if(!path.isEmpty())
|
||||||
{
|
{
|
||||||
gchar *uri = gst_filename_to_uri(path.toStdString().c_str(), NULL);
|
gchar *uri = gst_filename_to_uri(path.toStdString().c_str(), NULL);
|
||||||
|
@ -211,7 +214,7 @@ void MainWindow::OpenFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::OpenUri()
|
void MainWindow::OpenMediaUri()
|
||||||
{
|
{
|
||||||
QString uri = QInputDialog::getText(this, "Open Uri...", "Uri:");
|
QString uri = QInputDialog::getText(this, "Open Uri...", "Uri:");
|
||||||
|
|
||||||
|
@ -329,8 +332,15 @@ void MainWindow::Save()
|
||||||
{
|
{
|
||||||
if(m_fileName.isEmpty())
|
if(m_fileName.isEmpty())
|
||||||
SaveAs();
|
SaveAs();
|
||||||
else
|
else {
|
||||||
|
QFileInfo fileInfo(m_fileName);
|
||||||
|
if (fileInfo.completeSuffix().isEmpty() || fileInfo.completeSuffix() != "gpi")
|
||||||
|
m_fileName = m_fileName + ".gpi";
|
||||||
|
|
||||||
|
|
||||||
PipelineIE::Export(m_pGraph, m_fileName);
|
PipelineIE::Export(m_pGraph, m_fileName);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -338,7 +348,7 @@ void MainWindow::SaveAs()
|
||||||
{
|
{
|
||||||
QString dir = CustomSettings::lastIODirectory();
|
QString dir = CustomSettings::lastIODirectory();
|
||||||
|
|
||||||
QString path = QFileDialog::getSaveFileName(this, "Save As...", dir);
|
QString path = QFileDialog::getSaveFileName(this, "Save As...", dir, tr("*.gpi"));
|
||||||
|
|
||||||
if(!path.isEmpty())
|
if(!path.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -355,7 +365,7 @@ void MainWindow::Open()
|
||||||
{
|
{
|
||||||
QString dir = CustomSettings::lastIODirectory();
|
QString dir = CustomSettings::lastIODirectory();
|
||||||
|
|
||||||
QString path = QFileDialog::getOpenFileName(this, "Open...", dir);
|
QString path = QFileDialog::getOpenFileName(this, "Open...", dir, tr("GPI (*.gpi *.xpm);;All files (*.*)"));
|
||||||
|
|
||||||
if(!path.isEmpty())
|
if(!path.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,8 +29,8 @@ class MainWindow: public QMainWindow
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void AddPlugin();
|
void AddPlugin();
|
||||||
void OpenFile();
|
void OpenMediaFile();
|
||||||
void OpenUri();
|
void OpenMediaUri();
|
||||||
void Play();
|
void Play();
|
||||||
void Pause();
|
void Pause();
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
Loading…
Reference in a new issue