Author Topic: Disabling svg-non-supported-features warning for script  (Read 3875 times)

Tommel

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Disabling svg-non-supported-features warning for script
« on: January 28, 2015, 11:51:02 am »
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

  • Hero Member
  • *****
  • Posts: 1296
  • Karma: 17
Re: Disabling svg-non-supported-features warning for script
« Reply #1 on: January 28, 2015, 02:29:00 pm »
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

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: Disabling svg-non-supported-features warning for script
« Reply #2 on: January 28, 2015, 03:45:10 pm »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1994
  • Karma: 26
    • the graphics lab
Re: Disabling svg-non-supported-features warning for script
« Reply #3 on: January 29, 2015, 05:38:55 pm »
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

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: Disabling svg-non-supported-features warning for script
« Reply #4 on: January 30, 2015, 12:31:36 pm »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1994
  • Karma: 26
    • the graphics lab
Re: Disabling svg-non-supported-features warning for script
« Reply #5 on: January 30, 2015, 12:47:56 pm »
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

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: Disabling svg-non-supported-features warning for script
« Reply #6 on: February 02, 2015, 10:53:16 am »
Hi,

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

Code: [Select]
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1994
  • Karma: 26
    • the graphics lab
Re: Disabling svg-non-supported-features warning for script
« Reply #7 on: February 02, 2015, 07:23:52 pm »
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

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: Disabling svg-non-supported-features warning for script
« Reply #8 on: February 03, 2015, 12:23:14 pm »
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.