* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
- * the License.
+ * the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
/**
* SECTION:hildon-wizard-dialog
* @short_description: A widget to create a guided installation
- * process wizard
+ * process wizard.
*
* #HildonWizardDialog is a widget to create a guided installation
* process. The dialog has four standard buttons, previous, next,
* Response buttons are dimmed/undimmed automatically and the standard
* icon is shown/hidden in response to page navigation. The notebook
* widget provided by users contains the actual wizard pages.
+ *
+ * Using of the API is very simple, it has only one function to create it
+ * and the rest of it is handled by developers notebook.
+ * Also the response is returned, either cancel or finnish.
+ * Next and previous buttons are handled by the wizard dialog it self, by
+ * switching the page either forward or backward in the notebook.
*/
#ifdef HAVE_CONFIG_H
gtk_dialog_set_has_separator (dialog, FALSE);
priv->box = GTK_BOX (gtk_hbox_new (FALSE, 0));
- priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard", HILDON_ICON_SIZE_WIDG_WIZARD);
+ priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard", HILDON_ICON_SIZE_WIZARD);
/* Default values for user provided properties */
priv->notebook = NULL;
g_assert (priv);
+ current = gtk_notebook_current_page (notebook);
+
switch (response_id) {
case HILDON_WIZARD_DIALOG_PREVIOUS:
+ --current;
+ is_last = (current == last);
+ is_first = (current == 0);
+ make_buttons_sensitive (wizard_dialog,
+ !is_first, !is_first, !is_last);
gtk_notebook_prev_page (notebook); /* go to previous page */
break;
case HILDON_WIZARD_DIALOG_NEXT:
+ ++current;
+ is_last = (current == last);
+ is_first = (current == 0);
+ make_buttons_sensitive (wizard_dialog,
+ !is_first, !is_first, !is_last);
gtk_notebook_next_page (notebook); /* go to next page */
break;
is_last = current == last;
is_first = current == 0;
- /* If first page, previous and finish are disabled,
- if last page, next is disabled */
- make_buttons_sensitive (wizard_dialog,
- !is_first, !is_first, !is_last);
-
/* Don't let the dialog close */
g_signal_stop_emission_by_name (wizard_dialog, "response");