Can I modify Multiple Duplicate?

Previous topic - Next topic

Hopestation

Hi.

I have looked at ScribusGenerator for producing multiple Business Cards.

The examples show how to produce one card per sheet. I can't work out how to get the number of cards on my sheet to equal the number of records in my csv file.

It seems that I need to incorporate some of the functions of Multiple Duplicate into ScribusGenerator. Also, I would like to add more fields into the form to give the spacings of the cards with respect to the top and sides.

I have looked in Scribus's Lib directory and can't find Multiple Duplicate there. Is it available under a different name?

Thanks


a.l.e

hi

if you want to find out where things are done in scribus, the simplest approach is to go for the labels:

- search for the "Multiple Duplicate" that you find in the menu (just take care that the underlined items break the string)
- it will telly you that the menu is registered as "itemMulDuplicate" in the action manager (actionmanager.cpp) and that the dialog is defined in ui/multipleduplicate.ui
- if you have a look in actionmanager.cpp, you will find that itemMulDulicate defines a signal that calls mainWindow::duplicateItemMulti(), mainWindow being defined in the matching .h file and being of type ScribusMainWindow, which is defind in scribus.cpp (you can find out, by searching for "ScribusMainWindow::".
- on the other side, if you look in the ui/ directory, you will find out that there are also a .cpp an .h file in there with the same name.

voilà, i guess that now you have all the clues to get started!

don't hesitate to ask further questions and -- if you succeed -- propose a patch for improving the dialog!

Hopestation

Thanks for your help.

Unfortunately, as a newcomer, I didn't understand any of it.

I went to my programs(86)/Scribus 1.4.6 directory and searched for *.cpp.

Nothing was found.

I am using Windows 10. Do your instructions apply to any OS?

Can you explain in greater for a dummy please?

Thanks

a.l.e

hey,

well, welcome, then :-)

basically, if you want to tweak scribus, you need first to get its source code.
you cannot modify the application as it is in the programs(86) directory.

so, let's get to the next hard fact: compiling scribus on windows is harder than it should.
and harder than on any other platform.

can you get a linux computer or an apple one?

if not, this is one of many tutorials explaining how to install ubuntu in a virtualbox on windows:

http://askubuntu.com/questions/142549/how-to-install-ubuntu-on-virtualbox

of course, you will want the latest version of ubuntu, not the 12.4 one.

once you got there, you will be ready for the next step :-)

sorry, that i have to be short... but, maybe, someone will give you more clues...

Hopestation

I've got Linux Mint17.2 on another computer, so I'm ready to go.

I looked up Scribus Source Code and found:

    https://sourceforge.net/projects/scribus/files/

This has a variety of files to download. "scribus" has the larges number of downloads.

Do I need just this one, some or all of them?

Thanks.

a.l.e

you need to get the files from the scribus svn repository

svn://scribus.net/

or from the github mirror

https://github.com/scribusproject/scribus


here is a (way too long) tutorial for getting the scribus code from svn and get it to compile on a linux computer:

https://wiki.scribus.net/canvas/Building_SVN_versions_with_CMake

try to start there and we will be ready for further questions!
a.l.e

Hopestation

Hi.

I now have a directory: scribus14x. This includes scribus/ui.

I have found actionmanager.cpp

I have searched for *muldup* in this directory and in scribus14x without success.

Where do I go from here?

a.l.e

ehm ehm... if you make changes to scribus, you should make them to the trunk, that is the 1.5svn branch...

i don't think that the team welcomes patches (that are not pure bug fixes) for 1.4 anymore (or, better said, i hope that the team does not welcome them anymore...)

the future is bright, the future is scribus 1.6 :-)

Hopestation

Things are going much further than I expected.

I hoped to see the code that was used to duplicate items on the page and then incorporate part of it into a revision of Scribus Generator, where I could replace the manually entered number of items with the number of records in the csv file.

It was never my intention to try to improve on the internal coding of Scribus as it is way beyond my abilities. I write small programs in Lazarus, so understand the fundamentals of programming and most languages are fairly similar. I just needed to see how it was done in C++, so that I could convert it to Python.

If you can explain where I can find the code for duplicateItemMulti I can take it from there or decide it is beyond me.

Thanks.

a.l.e

of course, not everybody must learn programing in c++!

there are things in life that are much sexier and easier :-)

but if you need help, we're here and try to do our best!

that being said, i don't think that you need to have a look at the c++ code to create a script for multiple duplication, but, since you're asking:

scribus/ui/multipleduplicate.*

which you can browse on github as

https://github.com/scribusproject/scribus/blob/master/scribus/ui/multipleduplicate.cpp


and, on the other side, creating a prototype in python might help the team to find out how to improve the multiple duplication dialog!

Hopestation

Once more, thanks for your help.

I've downloaded the file and I will see what I can do with it.

If I succeed I will report it in this post.