+ gboolean prevent_response = FALSE;
+
+ /* Warn about unsaved changes: */
+ /* TODO: Actually detect whether changes were made. */
+ if (response_id == GTK_RESPONSE_CANCEL) {
+ GtkDialog *dialog = GTK_DIALOG (gtk_message_dialog_new (GTK_WINDOW (self),
+ (GtkDialogFlags)0,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK_CANCEL, /* TODO: These button names are ambiguous, and not specified in the UI specification. */
+ _("imum_nc_wizard_confirm_lose_changes") ));
+
+ const gint dialog_response = gtk_dialog_run (dialog);
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+
+ if (dialog_response != GTK_RESPONSE_OK)
+ prevent_response = TRUE;
+ }
+ /* Check for invalid input: */
+ else if (!check_data (self)) {
+ prevent_response = TRUE;
+ }
+
+ if (prevent_response) {
+ /* This is a nasty hack. murrayc. */
+ /* Don't let the dialog close */
+ g_signal_stop_emission_by_name (wizard_dialog, "response");
+ return;
+ }
+
+
+ if (response_id == GTK_RESPONSE_OK) {
+ /* Try to save the changes: */
+ const gboolean saved = save_configuration (self);
+ if (saved)
+ show_ok (GTK_WINDOW (self), _("mcen_ib_advsetup_settings_saved"));
+ else
+ show_error (GTK_WINDOW (self), _("mail_ib_setting_failed"));
+ }