--- /dev/null
+#include "config.h"
+
+#include <glib/gstdio.h>
+#include <gtk/gtk.h>
+
+#include "ui-maemo.h"
+#include "hildon-wrappers.h"
+#include "dialogs.h"
+
+/**
+ * Pop up a modal dialog box with simple error information in it.
+ */
+void
+popup_error(GtkWidget *window, const gchar *error)
+{
+GtkWidget *dialog;
+
+#ifdef WITH_HILDON
+dialog=hildon_note_new_information(GTK_WINDOW(window), error);
+#else
+dialog=gtk_message_dialog_new (GTK_WINDOW(window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, error);
+#endif
+gtk_dialog_run(GTK_DIALOG(dialog));
+gtk_widget_destroy(dialog);
+}
+
+gboolean
+dialog_confirm(GtkWidget *window, const gchar *msg)
+{
+GtkWidget *confirm;
+gboolean r;
+
+confirm=hildon_note_new_confirmation(GTK_WINDOW(window),msg);
+r=(GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) ? TRUE : FALSE;
+gtk_widget_destroy(confirm);
+return r;
+}
+
+GtkWidget *
+progress_dialog(GtkWidget *window, const gchar *title, GtkWidget *progress)
+{
+GtkWidget *dialog;
+
+dialog=gtk_dialog_new();
+gtk_window_set_title(GTK_WINDOW(dialog), title);
+gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
+gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
+#ifndef WITH_HILDON
+gtk_window_set_deletable(GTK_WINDOW(dialog), FALSE);
+#endif
+/* gtk_window_set_decorated(GTK_WINDOW(dialog), FALSE); */
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), gtk_label_new(title), TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), progress, TRUE, TRUE, 0);
+gtk_widget_show_all(dialog);
+return dialog;
+}
+
+void
+progress_dialog_remove(GtkWidget *dialog)
+{
+if (dialog)
+ gtk_widget_destroy(dialog);
+}
--- /dev/null
+#ifndef _DIALOGS_H
+#define _DIALOGS_H
+
+#include "config.h"
+
+#include <glib/gstdio.h>
+#include <gtk/gtk.h>
+
+#include "ui-maemo.h"
+#include "hildon-wrappers.h"
+
+void popup_error(GtkWidget * window, const gchar * error);
+gboolean dialog_confirm(GtkWidget *window, const gchar *msg);
+
+GtkWidget *progress_dialog(GtkWidget *window, const gchar *title, GtkWidget *progress);
+void progress_dialog_remove(GtkWidget *dialog);
+
+#endif