Disabling svg-non-supported-features warning for script

Previous topic - Next topic

Tommel

Hi,

I'm using a script to import svg files created in Inkscape, changing colors and saving it to a CMYK pdf.
Everything works great. But the problem that stops the script from working automaticly is the warning message that shows up when importing a svg to scribus.

So I need a possibilty to either close the warning, when it shows up or even better stop it from showing.
Do I have any possibility to do that?

Thank you very much!

Nermander

The easiest way to make sure it doesn't appear would be to make sure the SVGs don't contain any unsupported features.

But of course it's hard to know what the problem features are since the dialog doesn't mention them....

Tommel

Yea probably :D

But I made some tests and even a blank white svg with a black box on it saved as "Plain svg" in Inkscape causes this warning to show up!

a.l.e

hi,

it should not be too hard to find the relevant part of code, and create a patch that tests for scribus being in script mode...

you might give it a try :-)

a.l.e

Tommel

I'm not sure what you suppose to do.

Do you think of a Pyqt startup extension script, or recompiling the svgimplugin.dll or even recompiling scribus?

a.l.e

you will need a patch to the c++ code of scribus, probably both in the part of the script-plugin that manages the svg import and in the main code doing the svg import.

the hardest part will be to find where it is in the code and -- eventually -- to find a similar switch for another functionality.
what you have to do, is to find out if you're in script mode and if it's the case not show the dialog at all. eventually, you could print a warning to standard output.

and, then, you will have to recompile scribus, of course. and submit the patch to the but report system :-)

if you're used to read python and other languages, it could be a rather simple patch to create.

Tommel

Hi,

I downloaded the Scribus 1.4.4 source and found this in the "svgplugin.cpp":

if (dia->importCanceled)
{
if (dia->importFailed)
QMessageBox::warning(mw, CommonStrings::trWarning, tr("The file could not be imported"), 1, 0, 0);
else if (dia->unsupported)
QMessageBox::warning(mw, CommonStrings::trWarning, tr("SVG file contains some unsupported features"), 1, 0, 0);
}


Deleting the messageboxes from the code and recompiling the dll should help.

Finding this was the rather simple task, but I have no idea what I have to do to get a new "svgimplugin.dll" from this "svgplugin.cpp". (I'm not a programmer)

a.l.e

hi

you will have to recompile scribus.

for this, you will need to use linux or os x.

once the patch has been accepted and the next release is out, you will be able to use the modified behavior on windows, too.

your question has been discussed on the mailing list, too and it seems that the change you need has already been programmed for the development version that will -- at some time in a not too close future -- lead to scribus 1.6.

so, for now (and for this feature) you will need to use scribus in a linux virtual machine (and do the patch by simply removing the lines you pasted) or click on the message box.

sorry, for the bad news...
a.l.e

Tommel

Ok,
thank you very much for your help. Lets see if I can manage do get this done.

All this would not be necessary if scribus would properly import a pdf that is exported from inkscape. Scribus destroys a logo, that is included as vector graphics.
It works porperly when importing the svg - but the messagebox does cause the problem here.