After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 527466 - gtk_assistant_set_current_page records wrong visited page
gtk_assistant_set_current_page records wrong visited page
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.13.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-04-11 02:26 UTC by Marcus Brinkmann
Modified: 2008-04-11 17:23 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Test program to reproduce gtk_assistant_set_current_page() bug. (1.24 KB, text/x-csrc)
2008-04-11 02:27 UTC, Marcus Brinkmann
  Details
Patch to fix gtk_assistant_set_current_page bug (654 bytes, patch)
2008-04-11 02:28 UTC, Marcus Brinkmann
committed Details | Review

Description Marcus Brinkmann 2008-04-11 02:26:35 UTC
Please describe the problem:
The function gtk_assistant_set_current_page records the next current page as the last visited page, instead of the actual current page.

Steps to reproduce:
See the attached example program.


Actual results:
Press "Enter" to activate the text entry, then click the back button.  An empty page is presented.

Expected results:
The first page of the assistant should be presented instead.

Does this happen every time?
Yes.

Other information:
See attached patch.

Note: The function gtk_assistant_set_current_page is intended to be used by custom buttons added to the action area.  This works to simulate the forward button, but it can not be used to simulate the back button, which affects the visited pages list differently (it removes rather than adds a page), and which needs to access the content of the visited pages list.

I suggest to add a mechanism to allow to trigger the default buttons in the action area programmatically.

Also, I want to suggest to implement a function similar to gtk_dialog_set_default_response.  In fact, I was kind of surprised that an assistant is not sub-classed from a dialog, but I am not an expert in toolkit design.
Comment 1 Marcus Brinkmann 2008-04-11 02:27:29 UTC
Created attachment 109034 [details]
Test program to reproduce gtk_assistant_set_current_page() bug.
Comment 2 Marcus Brinkmann 2008-04-11 02:28:02 UTC
Created attachment 109035 [details] [review]
Patch to fix gtk_assistant_set_current_page bug
Comment 3 Carlos Garnacho 2008-04-11 14:58:34 UTC
Good catch Marcus. Matthias, the patch looks right to me, it's ok to commit?
Comment 4 Matthias Clasen 2008-04-11 15:01:47 UTC
Yes, looks right. 

Please commit to both branches
Comment 5 Carlos Garnacho 2008-04-11 17:23:14 UTC
Thanks Matthias! I've just committed to trunk and gtk-2-12.

Marcus, I'd recommend you to open independent bugs for each issue you find, so it's easier to keep track of them. Regarding having the buttons marked as default, I've just opened #527583, Now I think this one can be closed :)