Commit 3b124a6c authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: add .vlm at the end of the export file if needed.

parent 85fb567c
...@@ -264,10 +264,22 @@ void VLMDialog::addVLMItem() ...@@ -264,10 +264,22 @@ void VLMDialog::addVLMItem()
/* TODO : VOD are not exported to the file */ /* TODO : VOD are not exported to the file */
bool VLMDialog::exportVLMConf() bool VLMDialog::exportVLMConf()
{ {
QString saveVLMConfFileName = QFileDialog::getSaveFileName( QFileDialog* qfd = new QFileDialog( this, qtr( "Save VLM configuration as..." ),
this, qtr( "Save VLM configuration as..." ),
qfu( config_GetHomeDir() ), qfu( config_GetHomeDir() ),
qtr( "VLM conf (*.vlm);;All (*)" ) ); qtr( "VLM conf (*.vlm);;All (*)" ) );
qfd->setFileMode( QFileDialog::AnyFile );
qfd->setAcceptMode( QFileDialog::AcceptSave );
qfd->setConfirmOverwrite( true );
bool exported = false;
if( qfd->exec() == QDialog::Accepted )
{
QString saveVLMConfFileName = qfd->selectedFiles().first();
QString filter = qfd->selectedFilter();
// If *.vlm is selected, add .vlm at the end if needed
if( filter.contains( "VLM" ) && !saveVLMConfFileName.contains( ".vlm" ) )
saveVLMConfFileName.append( ".vlm" );
if( !saveVLMConfFileName.isEmpty() ) if( !saveVLMConfFileName.isEmpty() )
{ {
...@@ -275,9 +287,12 @@ bool VLMDialog::exportVLMConf() ...@@ -275,9 +287,12 @@ bool VLMDialog::exportVLMConf()
QString command = "save \"" + saveVLMConfFileName + "\""; QString command = "save \"" + saveVLMConfFileName + "\"";
vlm_ExecuteCommand( p_vlm , qtu( command ) , &message ); vlm_ExecuteCommand( p_vlm , qtu( command ) , &message );
vlm_MessageDelete( message ); vlm_MessageDelete( message );
return true; exported = true;
} }
return false; }
delete qfd;
return exported;
} }
void VLMDialog::mediasPopulator() void VLMDialog::mediasPopulator()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment