Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 15224 → Rev 15225

/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
142,18 → 142,17
exportBack->setToolTip( tr("Adds the Page itself as background to the SVG."));
exportBack->setChecked(false);
openDia->addWidgets(exportBack);
if (openDia->exec())
{
fileName = openDia->selectedFile();
QFileInfo fi(fileName);
QString baseDir = fi.absolutePath();
if (compress->isChecked())
fileName = baseDir + "/" + fi.baseName() + ".svgz";
else
fileName = baseDir + "/" + fi.baseName() + ".svg";
}
if (!openDia->exec())
return true;
fileName = openDia->selectedFile();
QFileInfo fi(fileName);
QString baseDir = fi.absolutePath();
if (compress->isChecked())
fileName = baseDir + "/" + fi.baseName() + ".svgz";
else
return true;
fileName = baseDir + "/" + fi.baseName() + ".svg";
 
SVGOptions Options;
Options.inlineImages = inlineImages->isChecked();
Options.exportPageBackground = exportBack->isChecked();
160,24 → 159,21
Options.compressFile = compress->isChecked();
openDia.clear();
 
if (!fileName.isEmpty())
if (fileName.isEmpty())
return true;
prefs->set("wdir", fileName.left(fileName.lastIndexOf("/")));
QFile f(fileName);
if (f.exists())
{
prefs->set("wdir", fileName.left(fileName.lastIndexOf("/")));
QFile f(fileName);
if (f.exists())
{
int exit = QMessageBox::warning(doc->scMW(), CommonStrings::trWarning,
QObject::tr("Do you really want to overwrite the file:\n%1 ?").arg(fileName),
QMessageBox::Yes | QMessageBox::No);
if (exit == QMessageBox::No)
return true;
}
SVGExPlug *dia = new SVGExPlug(doc);
dia->doExport(fileName, Options);
delete dia;
int exit = QMessageBox::warning(doc->scMW(), CommonStrings::trWarning,
QObject::tr("Do you really want to overwrite the file:\n%1 ?").arg(fileName),
QMessageBox::Yes | QMessageBox::No);
if (exit == QMessageBox::No)
return true;
}
else
return true;
SVGExPlug *dia = new SVGExPlug(doc);
dia->doExport(fileName, Options);
delete dia;
}
return true;
}