View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015781 | Scribus | Styles | public | 2019-08-21 15:12 | 2019-09-21 16:31 |
Reporter | ale | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | new | Resolution | open | ||
Product Version | 1.5.6.svn | ||||
Summary | 0015781: list of styles in the style manager is not correctly updated when a style gets created | ||||
Description | in 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? | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
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()... |
|
Unable to reproduce, calling scripter's createParagraphStyle() update properly style manager here. |
|
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. |
|
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? |
|
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. |