Commit abe652b5 authored by David Narváez's avatar David Narváez

Fixing File Filters

Summary: BUG: 386856

Reviewers: #kde_edu, apol, aspotashev

Reviewed By: apol, aspotashev

Subscribers: aspotashev, apol

Tags: #kde_edu

Differential Revision: https://phabricator.kde.org/D9057
parent 94d01815
...@@ -55,7 +55,7 @@ QString AsyExporter::menuIcon() const ...@@ -55,7 +55,7 @@ QString AsyExporter::menuIcon() const
void AsyExporter::run( const KigPart& doc, KigWidget& w ) void AsyExporter::run( const KigPart& doc, KigWidget& w )
{ {
KigFileDialog* kfd = new KigFileDialog( KigFileDialog* kfd = new KigFileDialog(
QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n( "*.asy|Asymptote Documents (*.asy)" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n( "Asymptote Documents (*.asy)" ),
i18n( "Export as Asymptote script" ), &w ); i18n( "Export as Asymptote script" ), &w );
kfd->setOptionCaption( i18n( "Asymptote Options" ) ); kfd->setOptionCaption( i18n( "Asymptote Options" ) );
AsyExporterOptions* opts = new AsyExporterOptions( 0L ); AsyExporterOptions* opts = new AsyExporterOptions( 0L );
......
...@@ -535,7 +535,7 @@ void PSTricksExportImpVisitor::visit(const RationalBezierImp* imp) ...@@ -535,7 +535,7 @@ void PSTricksExportImpVisitor::visit(const RationalBezierImp* imp)
void LatexExporter::run( const KigPart& doc, KigWidget& w ) void LatexExporter::run( const KigPart& doc, KigWidget& w )
{ {
KigFileDialog* kfd = new KigFileDialog( KigFileDialog* kfd = new KigFileDialog(
QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n( "*.tex|Latex Documents (*.tex)" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n( "Latex Documents (*.tex)" ),
i18n( "Export as Latex" ), &w ); i18n( "Export as Latex" ), &w );
kfd->setOptionCaption( i18n( "Latex Options" ) ); kfd->setOptionCaption( i18n( "Latex Options" ) );
LatexExporterOptions* opts = new LatexExporterOptions( 0L ); LatexExporterOptions* opts = new LatexExporterOptions( 0L );
......
...@@ -56,7 +56,7 @@ QString SVGExporter::menuIcon() const ...@@ -56,7 +56,7 @@ QString SVGExporter::menuIcon() const
void SVGExporter::run( const KigPart& part, KigWidget& w ) void SVGExporter::run( const KigPart& part, KigWidget& w )
{ {
KigFileDialog* kfd = new KigFileDialog( KigFileDialog* kfd = new KigFileDialog(
QStandardPaths::writableLocation( QStandardPaths::PicturesLocation ), i18n( "*.svg|Scalable Vector Graphics (*.svg)" ), QStandardPaths::writableLocation( QStandardPaths::PicturesLocation ), i18n( "Scalable Vector Graphics (*.svg)" ),
i18n( "Export as SVG" ), &w ); i18n( "Export as SVG" ), &w );
kfd->setOptionCaption( i18n( "SVG Options" ) ); kfd->setOptionCaption( i18n( "SVG Options" ) );
SVGExporterOptions* opts = new SVGExporterOptions( 0L ); SVGExporterOptions* opts = new SVGExporterOptions( 0L );
......
...@@ -574,7 +574,7 @@ void XFigExportImpVisitor::visit(const OpenPolygonalImp* imp) ...@@ -574,7 +574,7 @@ void XFigExportImpVisitor::visit(const OpenPolygonalImp* imp)
void XFigExporter::run( const KigPart& doc, KigWidget& w ) void XFigExporter::run( const KigPart& doc, KigWidget& w )
{ {
KigFileDialog* kfd = new KigFileDialog( KigFileDialog* kfd = new KigFileDialog(
QStandardPaths::writableLocation( QStandardPaths::PicturesLocation ), i18n( "*.fig|XFig Documents (*.fig)" ), QStandardPaths::writableLocation( QStandardPaths::PicturesLocation ), i18n( "XFig Documents (*.fig)" ),
i18n( "Export as XFig File" ), &w ); i18n( "Export as XFig File" ), &w );
if ( !kfd->exec() ) if ( !kfd->exec() )
return; return;
......
...@@ -723,8 +723,7 @@ void KigPart::fileSave() ...@@ -723,8 +723,7 @@ void KigPart::fileSave()
bool KigPart::internalSaveAs() bool KigPart::internalSaveAs()
{ {
// this slot is connected to the KStandardAction::saveAs action... // this slot is connected to the KStandardAction::saveAs action...
QString formats = i18n( "*.kig|Kig Documents (*.kig)\n" QString formats = i18n( "Kig Documents (*.kig);;Compressed Kig Documents (*.kigz)" );
"*.kigz|Compressed Kig Documents (*.kigz)" );
QString currentDir = url().toLocalFile(); QString currentDir = url().toLocalFile();
if ( currentDir.isNull() ) if ( currentDir.isNull() )
......
...@@ -463,7 +463,7 @@ void TypesDialog::exportType() ...@@ -463,7 +463,7 @@ void TypesDialog::exportType()
types.push_back( macro ); types.push_back( macro );
} }
if (types.empty()) return; if (types.empty()) return;
QString file_name = QFileDialog::getSaveFileName( this, i18n( "Export Types" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n("*.kigt|Kig Types Files\n*|All Files") ); QString file_name = QFileDialog::getSaveFileName( this, i18n( "Export Types" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n("Kig Types Files (*.kigt);;All Files (*)") );
if ( file_name.isNull() ) if ( file_name.isNull() )
return; return;
QFile fi( file_name ); QFile fi( file_name );
...@@ -479,12 +479,12 @@ void TypesDialog::importTypes() ...@@ -479,12 +479,12 @@ void TypesDialog::importTypes()
{ {
//TODO : Do this through MIME types //TODO : Do this through MIME types
QStringList toolFilters; QStringList toolFilters;
toolFilters << i18n( "*.kigt|Kig Types Files" ); toolFilters << i18n( "Kig Types Files (*.kigt)" );
#ifdef WITH_GEOGEBRA #ifdef WITH_GEOGEBRA
toolFilters << i18n( "*.ggt|Geogebra Tool Files" ); toolFilters << i18n( "Geogebra Tool Files (*.ggt)" );
#endif //WITH_GEOGEBRA #endif //WITH_GEOGEBRA
toolFilters << i18n( "*|All Files" ); toolFilters << i18n( "All Files (*)" );
QStringList file_names = QFileDialog::getOpenFileNames( this, i18n( "Import Types" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), toolFilters.join( QLatin1String( "\n" ) ) ); QStringList file_names = QFileDialog::getOpenFileNames( this, i18n( "Import Types" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), toolFilters.join( QLatin1String( ";;" ) ) );
std::vector<Macro*> macros; std::vector<Macro*> macros;
for ( QStringList::const_iterator i = file_names.constBegin(); for ( QStringList::const_iterator i = file_names.constBegin();
......
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