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