Changes in GtkAssistant



Hi all,


Some changes in GtkAssistant done in Gtk 3.1.4 have broken Anjuta new project creation wizard. I haven't seen it before because I don't check it with the latest version of Gtk.

This wizard is composed of a starting page, several properties pages, a final page, a progress page and an error page.

The properties pages are created dynamically depending on the user answers on the previous page (the starting page or a previous properties page). Each properties page is generated by an external program so after each properties page, the progress page is displayed. When the new page is generated, the wizard automatically switch to this new properties page or the final page if no more informations are needed. If the user answers are wrong, the special error page is displayed. It could be a warning or an error. In this last case, the continue button is disabled.


Currently, the starting page, the error page, the progress page and the final page are created at the beginning and the properties pages are appended as needed. I'm using a custom page forwarding function to define the page order by example: starting (0), progress (1), properties 1 (4), progress (1), properties 2 (4), progress (1), final (3).

I have a special handler for the "prepare" signal. Basically if I need to "prepare" a progress page, it means that the user has filled the previous page. I'm checking the previous page eventually displaying the error page else I'm starting the generation of the new properties page.


I still have the following issues:

1. I cannot change the current page in the "prepare" signal handler anymore (needed in case of an error by example). It's due to this code:

static void
set_current_page (GtkAssistant *assistant,
                  gint          page_num)
{
   GtkAssistantPrivate *priv = assistant->priv;
priv->current_page = (GtkAssistantPage *)g_list_nth_data (priv->pages, page_num); g_signal_emit (assistant, signals [PREPARE], 0, priv->current_page->page);
   update_title_state (assistant);
   gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->content), page_num);

The handler will change correctly the current page but then it will return in the initial set_current_page function that will set the notebook page back to the initial page.

I can still do it by delaying the change of the current page from the "prepare" signal handler to an idle function handler but it's not so handy. Is it allowed to change the current page in the "prepare" signal handler? Or is there a better way to achieve this?


2. The progress and error page are not important for the user. Most of the time, he will complete the project wizard without seeing the error page by example. Is there a way to hide these pages from the left pane?

I could hide the corresponding widget but I don't think it will make a difference currently or should I do something else? I can really remove and add the page when needed but the previous GtkAssistant object was not working when doing this. I have tried a bit with the new one and it needs quite some changes in my code so I would like to be sure that it's the way to go.


3. The final page is displayed before the properties pages which is a bit strange. I could reorder them but it's more work. It is possible to define a custom "forwarding" function. But Is there a plan to define a custom order here too?

I can fix this by inserting the properties page just before the final page, so it's probably the smallest issue.


Regards,

Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]