GNOME Bugzilla – Bug 567260
Migrate from GnomeDruid to GtkAssistant
Last modified: 2013-09-13 01:04:24 UTC
See http://www.mail-archive.com/evolution-hackers@gnome.org/msg01635.html http://library.gnome.org/devel/gtk/stable/gtk-migrating-GtkAssistant.html http://live.gnome.org/LibgnomeMustDie $:andre\> grep -r gnome_druid . ./plugins/backup-restore/backup-restore.c: gnome_druid_set_show_finish (druid, state); gnome_druid_set_buttons_sensitive (druid, TRUE, FALSE, TRUE, TRUE); gnome_druid_set_buttons_sensitive (druid, TRUE, TRUE, TRUE, TRUE); gnome_druid_set_buttons_sensitive (druid, TRUE, TRUE, TRUE, TRUE); gnome_druid_set_buttons_sensitive (druid, TRUE, FALSE, TRUE, TRUE); page = gnome_druid_page_standard_new_with_vals (_("Restore from backup"), NULL, NULL); gnome_druid_append_page (GNOME_DRUID (hook_data->parent), GNOME_DRUID_PAGE (page)); ./plugins/startup-wizard/startup-wizard.c: gnome_druid_page_edge_set_title (start_page, _("Welcome")); gnome_druid_page_edge_set_text (start_page, _("" page = gnome_druid_page_standard_new_with_vals (_("Timezone"), NULL, NULL); gnome_druid_append_page (GNOME_DRUID (hook_data->parent), GNOME_DRUID_PAGE (page)); page = gnome_druid_page_standard_new_with_vals (_("Importing files"), NULL, NULL); gnome_druid_append_page (GNOME_DRUID (hook_data->parent), GNOME_DRUID_PAGE (page)); ./plugins/groupwise-features/install-shared.c: title_page = GNOME_DRUID_PAGE_EDGE (gnome_druid_page_edge_new_with_vals(GNOME_EDGE_START, TRUE, _("Install the shared folder"), start_message, NULL, NULL, NULL)); wizard = GNOME_DRUID (gnome_druid_new_with_window (_("Shared Folder Installation"), NULL, TRUE, (GtkWidget**)(&window))); gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(title_page)); ./e-util/e-config.c: gnome_druid_set_page((GnomeDruid *)ec->widget, (GnomeDruidPage *)wn->frame); gnome_druid_set_page((GnomeDruid *)ec->widget, (GnomeDruidPage *)wn->frame); root = druid = gnome_druid_new(); page = gnome_druid_page_edge_new(item->type == E_CONFIG_PAGE_START?GNOME_EDGE_START:GNOME_EDGE_FINISH); gnome_druid_page_edge_set_title((GnomeDruidPageEdge *)page, translated_label); gnome_druid_insert_page((GnomeDruid *)druid, pagenode?(GnomeDruidPage *)pagenode->frame:NULL, (GnomeDruidPage *)page); w = gnome_druid_page_standard_new(); gnome_druid_page_standard_set_title((GnomeDruidPageStandard *)w, translated_label); gnome_druid_insert_page((GnomeDruid *)druid, pagenode?(GnomeDruidPage *)pagenode->frame:NULL, (GnomeDruidPage *)w); gnome_druid_set_page((GnomeDruid *)emp->widget, (GnomeDruidPage *)emp->priv->druid_page->frame); gnome_druid_set_page((GnomeDruid *)emp->widget, (GnomeDruidPage *)emp->priv->druid_page->frame); ./shell/e-shell-importer.c: gnome_druid_set_buttons_sensitive(GNOME_DRUID (data->druid), TRUE, fileok, TRUE, FALSE); gnome_druid_set_buttons_sensitive(druid, TRUE, FALSE, TRUE, FALSE); gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->finish)); gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->intelligent)); gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->filedialog)); gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->intelligent)); gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->destdialog)); gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->typedialog)); gnome_druid_page_edge_set_logo (data->start, icon); gnome_druid_page_standard_set_logo (GNOME_DRUID_PAGE_STANDARD (data->typedialog), icon); gnome_druid_page_standard_set_logo (GNOME_DRUID_PAGE_STANDARD (data->intelligent), icon); gnome_druid_page_standard_set_logo (GNOME_DRUID_PAGE_STANDARD (data->filedialog), icon); gnome_druid_page_edge_set_logo (data->finish, icon); ./mail/em-account-editor.c: gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page); gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page); gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page); gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page); gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)w);
I have done this in Anjuta. It was not very easy as each page is generated dynamically based on the user inputs on all previous pages. The best solution that I have found is to add a progress page between each page of the wizard. Then move the work done in the "next" handler of GnomeDruid in the "prepare" handler of these additional progress page. I have removed all work done in the "back" handler of GnomeDruid.
and to cover my grep's for headers: ./e-util/e-import.c: #include <libgnomeui/gnome-druid.h> ./e-util/e-import.c: #include <libgnomeui/gnome-druid-page-standard.h> ./e-util/e-import.c: #include <libgnomeui/gnome-druid-page-edge.h> ./e-util/e-config.c: #include <libgnomeui/gnome-druid.h> ./e-util/e-config.c: #include <libgnomeui/gnome-druid-page-standard.h> ./e-util/e-config.c: #include <libgnomeui/gnome-druid-page-edge.h> ./shell/e-shell-importer.c: #include <libgnomeui/gnome-druid.h> ./shell/e-shell-importer.c: #include <libgnomeui/gnome-druid-page-edge.h> ./shell/e-shell-importer.c: #include <libgnomeui/gnome-druid-page-standard.h>
garr. someone shot me. plus: ./mail/em-account-editor.c:#include <libgnomeui/gnome-druid.h> ./mail/em-account-editor.c:#include <libgnomeui/gnome-druid-page-standard.h>
abharath, chen said you might work on this?
See http://library.gnome.org/devel/gtk/stable/gtk-migrating-GtkAssistant.html
Would prefer this be done on the kill-bonobo branch, or else after it's merged. Note, this has to happen before the GtkBuilder migration. See bug #589153 comment #2.
So, to have this completely listed once again: $:andre\> grep -r "include <libgnomeui/gnome-druid" . ./plugins/backup-restore/backup-restore.c:#include <libgnomeui/gnome-druid.h> ./plugins/backup-restore/backup-restore.c:#include <libgnomeui/gnome-druid-page-standard.h> ./plugins/startup-wizard/startup-wizard.c:#include <libgnomeui/gnome-druid.h> ./plugins/startup-wizard/startup-wizard.c:#include <libgnomeui/gnome-druid-page-edge.h> ./plugins/startup-wizard/startup-wizard.c:#include <libgnomeui/gnome-druid-page-standard.h> ./plugins/groupwise-features/install-shared.c:#include <libgnomeui/gnome-druid.h> ./plugins/groupwise-features/install-shared.c:#include <libgnomeui/gnome-druid-page-edge.h> ./e-util/e-import.c:#include <libgnomeui/gnome-druid.h> ./e-util/e-import.c:#include <libgnomeui/gnome-druid-page-standard.h> ./e-util/e-import.c:#include <libgnomeui/gnome-druid-page-edge.h> ./e-util/e-config.c:#include <libgnomeui/gnome-druid.h> ./e-util/e-config.c:#include <libgnomeui/gnome-druid-page-standard.h> ./e-util/e-config.c:#include <libgnomeui/gnome-druid-page-edge.h> ./shell/e-shell-importer.c:#include <libgnomeui/gnome-druid.h> ./shell/e-shell-importer.c:#include <libgnomeui/gnome-druid-page-edge.h> ./shell/e-shell-importer.c:#include <libgnomeui/gnome-druid-page-standard.h> ./mail/em-account-editor.c:#include <libgnomeui/gnome-druid.h> ./mail/em-account-editor.c:#include <libgnomeui/gnome-druid-page-standard.h>
Created attachment 140679 [details] [review] proposed evo (kb) patch (part 1) for evolution (kill-bonobo); the easy parts, shell/e-shell-importer.c, plugins/groupwise-features/install-shared.c, e-util/e-import.c done. The groupwise part I couldn't test, because it seems to be disabled and moreover I do not have groupwise. I hope someone having it will finish it. Note I dropped import.glade. There lefts all related to EConfig, thus: e-util/e-config.c mail/em-account-editor.c plugins/backup-restore/backup-restore.c plugins/startup-wizard/startup-wizard.c I plan to remove the druid widget from mail-config.glade, mainly because it's hard to edit in glade editor, and, of course, because it contains only two widgets per page, which doesn't worth it to maintain in a glade. Or do you think it's a wrong idea?
(In reply to comment #8) > I plan to remove the druid widget from mail-config.glade, mainly because it's > hard to edit in glade editor, and, of course, because it contains only two > widgets per page, which doesn't worth it to maintain in a glade. Or do you > think it's a wrong idea? +1! I think your approach is spot on and I'm happy to see import.glade killed. I'll get this merged into kill-bonobo asap.
Patch looks peachy. Importer works fine with a couple nitpicks: assistant window should not have a title and should be centered over the main window. But we can address that in part 2. Committed to kill-bonobo: http://git.gnome.org/cgit/evolution/commit/?h=kill-bonobo&id=260c0c8e1eabeefd3d364f62114b4aa8d2b0028e
Created attachment 141080 [details] [review] proposed evo (kb) patch (part 2 - final) for evolution (kill-bonobo); final patch, removes all the "druid" words from sources.
Awesome! Patch applies and compiles cleanly, and I assume it basically works. I'm going to commit this now since GnomeDruid is blocking so many other things. If there's issues we can fix them as we find them. http://git.gnome.org/cgit/evolution/commit/?h=kill-bonobo&id=de528db6c18b7ecee83bb8b52850d935c1244ebf Nice work!