1 /* modest-ui-wizard.c */
3 /* insert (c)/licensing information) */
6 #include <glade/glade.h>
7 #include <glib/gi18n.h>
12 #endif /*HAVE_CONFIG_H*/
14 #include "../modest-account-mgr.h"
16 #include "modest-ui-glade.h"
17 #include "modest-ui-wizard.h"
19 void wizard_missing_notification(GtkWindow *parent, gchar *info_message)
21 GtkWidget *DenyDialog;
23 DenyDialog=gtk_message_dialog_new(parent,
30 gtk_dialog_run(GTK_DIALOG(DenyDialog));
32 gtk_widget_destroy(DenyDialog);
35 gchar *gtk_combo_box_get_entry_text (GtkWidget *combobox)
37 /* Remember to free the returned variable after usage! */
39 GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(combobox));
44 if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combobox), &iter))
46 gtk_tree_model_get(GTK_TREE_MODEL(model),
56 gboolean advance_sanity_check(GtkWindow *parent, GladeXML *glade_xml, gint cp)
58 GtkDialog *DenyDialog;
64 if (strlen(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWMailboxnameEntry"))))==0)
67 * all calls to wizard_missing_notification lack the parent window.
69 wizard_missing_notification(NULL, "Please enter mailbox name");
72 bla=gtk_combo_box_get_active_text(GTK_COMBO_BOX(glade_xml_get_widget(glade_xml, "AWMailboxtypeComboBox")));
75 wizard_missing_notification(NULL, "Please select mailbox type");
86 void on_new_account1_activate (GtkMenuItem *menuitem,
91 ModestUIPrivate *priv;
92 GtkWidget *FinishButton;
93 GtkWidget *BackButton;
94 GtkWidget *NextButton;
95 GtkWidget *CancelButton;
100 gint finishallowed=0;
102 priv = MODEST_UI_GET_PRIVATE(MODEST_UI(user_data));
104 glade_xml = glade_xml_new(MODEST_GLADE, "account_wizard", NULL);
106 dialog = glade_xml_get_widget(glade_xml, "account_wizard");
108 gtk_widget_show_all(dialog);
110 FinishButton=glade_xml_get_widget(glade_xml, "AWFinishButton");
111 BackButton=glade_xml_get_widget(glade_xml, "AWBackButton");
112 NextButton=glade_xml_get_widget(glade_xml, "AWNextButton");
113 CancelButton=glade_xml_get_widget(glade_xml, "AWCancelButton");
114 Notebook=glade_xml_get_widget(glade_xml, "AWNotebook");
116 gtk_widget_set_sensitive(FinishButton, FALSE);
120 cp=gtk_notebook_get_current_page(GTK_NOTEBOOK(Notebook));
124 gtk_widget_set_sensitive(BackButton, FALSE);
127 gtk_widget_set_sensitive(BackButton, TRUE);
130 gtk_widget_set_sensitive(FinishButton, FALSE);
131 gtk_widget_set_sensitive(NextButton, TRUE);
134 gtk_widget_set_sensitive(FinishButton, TRUE);
135 gtk_widget_set_sensitive(NextButton, FALSE);
138 g_error("I'm on page %d of notebook AWNotebook, which shouldn't have happened. Pulling Emeregency breaks.", cp);
142 result=gtk_dialog_run(GTK_DIALOG(dialog));
147 if (advance_sanity_check(NULL, glade_xml, cp)==TRUE)
148 gtk_notebook_next_page(GTK_NOTEBOOK(Notebook));
151 gtk_notebook_prev_page(GTK_NOTEBOOK(Notebook));
155 while(result!=GTK_RESPONSE_DELETE_EVENT && result!=GTK_RESPONSE_ACCEPT && result!=GTK_RESPONSE_CANCEL);
157 if (result==GTK_RESPONSE_ACCEPT)
159 /* Do someting with the DATA from the widget */
162 gtk_widget_destroy(dialog);
163 g_object_unref(glade_xml);