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 576498 - [GSEAL] GtkAssistant seals members without adding accessors
[GSEAL] GtkAssistant seals members without adding accessors
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.20.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 596428
Blocks: 587418 597610
 
 
Reported: 2009-03-23 22:32 UTC by Cody Russell
Modified: 2011-02-04 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkAssistant: Add more details about buttons shown (1.95 KB, patch)
2010-10-30 19:15 UTC, Bastien Nocera
committed Details | Review
GtkAssistant: Add custom page type (5.95 KB, patch)
2010-10-30 19:15 UTC, Bastien Nocera
committed Details | Review

Description Cody Russell 2009-03-23 22:32:23 UTC
GtkAssistant has sealed several member widgets, but there does not appear to be new API for retrieving those widgets yet.

  GtkWidget *GSEAL (cancel);
  GtkWidget *GSEAL (forward);
  GtkWidget *GSEAL (back);
  GtkWidget *GSEAL (apply);
  GtkWidget *GSEAL (close);
  GtkWidget *GSEAL (last);
Comment 1 Bastien Nocera 2009-07-16 13:49:58 UTC
I have this problem in gnome-bluetooth's wizard, where I want more freedom as to which button(s) will be shown for a particular page. Currently I have to have a copy of the struct internally:

/* HACK, to access the GtkAssistant buttons */
struct RealGtkAssistant
{
        GtkWindow  parent;

        GtkWidget *cancel;
        GtkWidget *forward;
        GtkWidget *back;
        GtkWidget *apply;
        GtkWidget *close;
        GtkWidget *last;

        /*< private >*/
        GtkAssistantPrivate *priv;
};
typedef struct RealGtkAssistant RealGtkAssistant;
Comment 2 Matthias Clasen 2009-09-19 01:38:14 UTC
GtkAssistant is not really about the freedom to show arbitrary buttons; the idea here was that you specify the page sequence and some properties of each page, and let GTK+ take care of all the rest. 

Can you explain in some more detail what changes to the buttons you want to make ?
Comment 3 Bastien Nocera 2010-02-08 10:52:57 UTC
I don't want to show any buttons other than "Cancel" on some pages, as I do not want the user to be able to go back from a particular page.

This is what I do manually in prepare_idle_cb():
http://git.gnome.org/browse/gnome-bluetooth/tree/wizard/main.c#n430

For example, for the "Connecting" page (where we start poking at a device), we only want the "Cancel" button. The previous page is not available, neither should the forward page.

In some other cases, we do not want the ability to cancel, but only to exit early (the finishing page). Or the ability to not show any cancel or close button (for Simple Pairing, where we show a PIN on both Bluetooth devices and ask the user whether they match).
Comment 4 Javier Jardón (IRC: jjardon) 2010-04-13 14:26:57 UTC
Take a look to bug #596428 for a possible solution in the evolution case.
Comment 5 Javier Jardón (IRC: jjardon) 2010-06-03 22:44:33 UTC
@Bastian: Is the new api gtk_assistant_commit() enough for you needs?:

http://git.gnome.org/browse/gtk+/commit/?id=bb5c585777cede12bd1a7cf9fd1c5082e2debc22
Comment 6 Matthew Barnes 2010-06-04 12:47:21 UTC
Note that gtk_assistant_commit() permanently hides the Cancel button (the thought being once you commit it's too late to cancel), but you can always add a Cancel button for some cancellable I/O operation through gtk_assistant_add_action_button().

Bug #596428 also adds support for ending on a GTK_ASSISTANT_PAGE_PROGRESS -- the "support" being it's smart enough to hide the Forward button now.

I added this stuff for Evolution's import assistant.
Comment 7 Matthias Clasen 2010-06-26 22:38:09 UTC
If this is not sufficiently addressed yet, I would propose that we add a 'custom' page type, where buttons are entirely freeform. May need to add some forward/back functions then, to trigger the standard actions.
Comment 8 Tobias Mueller 2010-10-21 13:46:16 UTC
Bastien, Cody: Could you reopen this issue if you feel that it's not been addressed properly? Thanks in advance.
Comment 9 Bastien Nocera 2010-10-30 19:14:37 UTC
Turns out this isn't quite good enough for me to use in the bluetooth wizard.
Comment 10 Bastien Nocera 2010-10-30 19:15:03 UTC
Created attachment 173562 [details] [review]
GtkAssistant: Add more details about buttons shown

Add more documentation about which buttons will be shown for which
type of GtkAssistant page.
Comment 11 Bastien Nocera 2010-10-30 19:15:09 UTC
Created attachment 173563 [details] [review]
GtkAssistant: Add custom page type

The custom page type will not show any buttons by default, and
it is left to the application to add its own buttons instead.

The _next_page() and _previous_page() functions can be used
for the back and forward buttons used by the application.
Comment 12 Matthias Clasen 2010-10-31 00:35:25 UTC
Review of attachment 173563 [details] [review]:

Looks good to me. Add docs to the new functions, and its good to go.
Comment 13 Matthias Clasen 2010-10-31 00:38:57 UTC
Review of attachment 173562 [details] [review]:

Looks ok. I think we need to brush up the long desc with some information about the GtkAssistant design, ie that it decides about what buttons to show based on the provided page flow and page type information, together with some extra state information like 'completed' and 'committed' for each page.
Comment 14 Bastien Nocera 2010-10-31 16:09:02 UTC
Attachment 173562 [details] pushed as b5abd10 - GtkAssistant: Add more details about buttons shown
Attachment 173563 [details] pushed as cbbfd7b - GtkAssistant: Add custom page type