Mantis Issue Tracking for Scribus
· Hosting provided by / Øverby Consulting ·

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012425ScribusUndo/Redopublic2014-06-23 02:492015-11-06 14:55
Assigned To 
Platformx86_64OSopenSUSEOS Version13.1
Product Version1.5.0svn 
Target Version1.5.1Fixed in Version 
Summary0012425: Undo/Redo records wrong entries using the Guide Manager
DescriptionUndo/Redo records wrong entries using the Guide Manager
Steps To Reproduce0) Create a new document and make sure Windows > Action History is opened
1) Go to: Page > Manage Guides...
2) Add a Horizontal Guide (works also with Vertical)
You can notice that in Action History step 2 is not recorded
(there should be "Page X - Add vertical/horizontal guide").

3) Add a second Horizontal Guide
You can notice that a new entry "Page X - Remove horizontal/vertical guide" is added to Action History.

If you double click on one of the entered values to edit its value and keep pressed Tab, each time a new entry is added to Action History (basically "make" the the field editable then deselect it).
I must also say that it is quite "unfriendly" the way guides are added: to apply the guide you need to deselect the field and I don't get why the Add should not do that (instead adds another guide).
Example: when the field is in "edit" mode Add applies the guide (as when the field is deselected), if not adds a new guide.
Additional InformationScribus 1.5.0.svn (19265)

Another bug related to Guide Manager/Action History: 0012308
Attached Filesdiff file icon 12425_patch.diff [^] (5,498 bytes) 2015-10-26 06:16 [Show Content]
diff file icon second_try.diff [^] (7,021 bytes) 2015-10-27 12:49 [Show Content]

- Relationships
related to 0012308confirmed Undo/Redo records useless entries deleting guides from Guide Manager 
child of 0012500acknowledged Metabug: Undo/Redo (1.5.0.svn) 
child of 0002935acknowledgedsubik Metabug: Guide Dialog 

-  Notes
Kunda (manager)
2014-07-19 14:28

Confirmed on 1.5svn r19352
I find that in the "Guide Manager" pressing 'Add' redundantly 2-3 times triggers
'Page X - Remove horizontal/vertical guide' in Action windows

I also agree with FirasH's UX feedback. 'Add' could automagically trigger a new guide without having to deselect the guide that was just added. This way if people are adding several guides they can add a group of them and then individually edit them.
Fahad (reporter)
2015-10-26 06:16

It seems that guide manager not being integrated well with Undo Manager. There are many UndoTransactions not implemented yet.

Please find my patch to fix this bug. It does the following:

1- add UndoTransactions to following actions:
   - add Vertical guide
   - add Horizontal guide
   - delete Vertical guide
   - delete Horizontal guide
   - Move Vertical guide
   - Move Horizontal guide
2- when addHorButton_clicked() will add a new Horizontal Guide in action history and assign 0 value to it. I apply same behavior to addVerButton_clicked().

3- as requested here, this patch gives you the ability to create many guides that have 0 value, the you can edit them later.
JLuc (developer)
2015-10-26 20:58
edited on: 2015-10-26 21:01

Hello Fahad

I tested your patch and redo/undo situation has improved, and the UX is improved also.

But history management (undo/redo) doesnt behave as expected.

Example :
A- create guide (0)
B- set it to 10
C- create second guide
D- Undo
see : 2nd guide has disappeared : OK

E- Undo
see : 2nd guide is back there : wrong !

F- Undo = supposed to be back to original state
see : there is one guide left (the 2nd one, still 0)

Can you improve that ?

Fahad (reporter)
2015-10-27 12:29

The problem here is in :
void GuideManager::horizontalModel_valueChanged()
void GuideManager::horizontalModel_valueChanged()

I tried to modified valueChanged() signal to catch from & to values then I pass the info to horizontalModel_valueChanged() & horizontalModel_valueChanged() but without success.

I am stuck here & I need help or hints about what I should do.
Fahad (reporter)
2015-10-27 12:50

I attached my second try. It will redo whatever recorded but I couldn't figure out how to redraw all guides again in page view yet. I appreciate any help.
JLuc (developer)
2015-10-27 14:03

In the source code i read :

if (m_ScMW->doc->appMode != modeNormal)

wouldnt such calls help refresh view ?
JLuc (developer)
2015-11-04 20:30
edited on: 2015-11-04 20:34

Fahad : i tested the patch and it improves the situation but is still not OK.

To test, i created 3 guides

1) it happens quite often that the guide appearing on top of the list cannot be deleted

2) when undoing, a setting is changed and takes a strange value : it becomes 5.380 when i only did set rounded values.

3) coming back to supposed to be initial state, there still are 2 guides

How is it possible ?
It looks like either you did not test the patch carefully enough, or my source is wrong somewhere.

ale (manager)
2015-11-05 11:19

as discussed on irc: you should probably keep track of what happens.

i did not check the code, but you stated that the guide manager is removing all guides and then re-adds all of them.

depending on the place where the undo action is recorded/triggered this approach might very hard to get to work correctly.

you seem to move the recording to a different place. this might work, but might also break other ways of setting the guides.

the guides manager should probably track what is really happening and only apply the real changes to the page.

when you start editing a guide, you should probably find/create an id that helps you recognize which guide on the page has been changed.

removing all guides and recreating them is a good solution is you have no interaction with other subsystems. but as soon as you have one (like the undo) it's probably better to drop this (good and fast but) naive implementation and go for a real management of the resources.
JLuc (developer)
2015-11-06 14:55

Fahad PLEASE test your next patch carefully before submiting it.

- Issue History
Date Modified Username Field Change
2014-06-23 02:49 FirasH New Issue
2014-07-09 03:17 FirasH Relationship added child of 0012500
2014-07-19 14:28 Kunda Note Added: 0032832
2014-07-19 14:28 Kunda Status new => confirmed
2014-07-19 14:28 Kunda Target Version => 1.5.1
2014-07-19 14:28 Kunda Description Updated View Revisions
2014-07-19 14:28 Kunda Relationship added related to 0012308
2015-06-21 13:40 FirasH Relationship added child of 0002935
2015-06-21 13:42 FirasH Patch => No
2015-06-21 13:42 FirasH Severity minor => major
2015-10-26 06:16 Fahad Note Added: 0036935
2015-10-26 06:16 Fahad File Added: 12425_patch.diff
2015-10-26 08:53 Khaled Hosny Tag Attached: HOST-Oman
2015-10-26 17:27 JLuc Patch No => Yes
2015-10-26 20:58 JLuc Note Added: 0036951
2015-10-26 21:01 JLuc Note Edited: 0036951 View Revisions
2015-10-26 21:01 JLuc Note Edited: 0036951 View Revisions
2015-10-27 12:29 Fahad Note Added: 0036979
2015-10-27 12:49 Fahad File Added: second_try.diff
2015-10-27 12:50 Fahad Note Added: 0036980
2015-10-27 14:03 JLuc Note Added: 0036985
2015-11-04 20:30 JLuc Note Added: 0037223
2015-11-04 20:31 JLuc Note Edited: 0037223 View Revisions
2015-11-04 20:34 JLuc Note Edited: 0037223 View Revisions
2015-11-05 11:19 ale Note Added: 0037248
2015-11-05 13:23 Kunda Sticky Issue No => Yes
2015-11-06 14:55 JLuc Note Added: 0037282

Copyright © 2000 - 2015 MantisBT Team
Powered by Mantis Bugtracker