View Issue Details

IDProjectCategoryView StatusLast Update
0015781ScribusStylespublic2019-09-21 16:31
Reporterale Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status newResolutionopen 
Product Version1.5.6.svn 
Summary0015781: list of styles in the style manager is not correctly updated when a style gets created
Descriptionin the scripter's createparagraphstyle command there is a "strange" comment that hints to a bug in the style manager:

https://github.com/scribusproject/scribus/blob/master/scribus/plugins/scriptplugin/cmdstyle.cpp#L89

i would say that reloading the document should not be necessary!

the bottom line is that if i create a new paragraph style it gets added to the list in the text properties but not in the style manager.
does anybody know what the style manger is missing to behave correctly?
TagsNo tags attached.
PatchNo

Activities

ale

2019-08-21 15:46

manager   ~0046507

ok, i have a clue:

            m_ScMW->styleMgr()->setDoc(m_doc);
            paraStyleCombo->updateFormatList();

- the first one forces the stylemanager to reload the list of styles
- the second one does the same for the paragraph styles

using the first one leads to a dependency from the text palette or the scribusdoc to the stylemanager, which is not a nice thing.

it would be nice if:

- the style manager would have updateStyleList() function
- there would be a signal / slot for triggering the update and the rest of the code should not check if ScCore->usingGUI()...

jghali

2019-08-21 15:58

administrator   ~0046508

Unable to reproduce, calling scripter's createParagraphStyle() update properly style manager here.

ale

2019-08-21 18:25

manager   ~0046509

yep, it updates, but it only updates because the style manager is forced to reload the current document...
which does not seems to be the proper way to update a list of styles...

i'm currently writing "new" code that also updates the styles, and i would love to avoid sending an explicit call to the style manager.

ale

2019-09-21 16:11

manager   ~0046688

in my new table of contents, i'm letting the user create new styles from the document settings window.

i can then do "ScCore->primaryMainWindow()->styleMgr()->setDoc(scribusDoc);" to get the style manager to update the list of styles.
but i probably have no (practical) way to update the list of styles in the text palette.

there might be other parts of the code that needs to be updated.

don't you think that we should have a signal/slot strategy for managing the update of the list of styles?

ale

2019-09-21 16:31

manager   ~0046689

i can work on this, if somebody gives me
- the ok
- hints on what i should take of
- examples in scribus where such a design is already in use.

Issue History

Date Modified Username Field Change
2019-08-21 15:12 ale New Issue
2019-08-21 15:46 ale Note Added: 0046507
2019-08-21 15:58 jghali Note Added: 0046508
2019-08-21 18:25 ale Note Added: 0046509
2019-09-21 16:11 ale Note Added: 0046688
2019-09-21 16:31 ale Note Added: 0046689