g_key_file_free (kfile);
}
+gint
+solipa_message_dialog (GtkWidget *transient,
+ GtkMessageType type,
+ GtkButtonsType buttons,
+ const gchar *message_text)
+{
+ gint risp;
+ GtkWidget *dialog;
+
+ g_return_val_if_fail (GTK_IS_WINDOW (transient), GTK_RESPONSE_NONE);
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (transient),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ type,
+ buttons,
+ message_text);
+ risp = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+
+ return risp;
+}
+
+GtkWidget
+*solipa_info_bar (GtkMessageType type, const gchar *message_text)
+{
+ GtkWidget *infobar;
+ GtkWidget *hbox;
+ GtkWidget *img;
+ GtkWidget *lbl;
+
+ gchar *stock;
+
+ hbox = gtk_hbox_new (FALSE, 5);
+ switch (type)
+ {
+ case GTK_MESSAGE_INFO:
+ stock = g_strdup ("gtk-dialog-info");
+ break;
+
+ case GTK_MESSAGE_WARNING:
+ stock = g_strdup ("gtk-dialog-warning");
+ break;
+
+ case GTK_MESSAGE_QUESTION:
+ stock = g_strdup ("gtk-dialog-question");
+ break;
+
+ case GTK_MESSAGE_ERROR:
+ stock = g_strdup ("gtk-dialog-error");
+ break;
+
+ default:
+ stock = g_strdup ("gtk-dialog-info");
+ break;
+ }
+
+ img = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
+ gtk_box_pack_start (GTK_BOX (hbox), img, FALSE, FALSE, 0);
+ lbl = gtk_label_new (message_text);
+ gtk_box_pack_start (GTK_BOX (hbox), lbl, TRUE, TRUE, 0);
+ infobar = gtk_info_bar_new ();
+ gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar))), hbox);
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), type);
+
+ gtk_widget_show (hbox);
+ gtk_widget_show (img);
+ gtk_widget_show (lbl);
+
+ return infobar;
+}
+
/**
* This function is copied from
* http://bugzilla.gnome.org/show_bug.cgi?id=524831.
void solipa_save_window_position (const gchar *app_name, GtkWidget *widget, const gchar *widget_name);
void solipa_load_window_position (const gchar *app_name, GtkWidget *widget, const gchar *widget_name);
+gint solipa_message_dialog (GtkWidget *transient,
+ GtkMessageType type,
+ GtkButtonsType buttons,
+ const gchar *message_text);
+
+GtkWidget *solipa_info_bar (GtkMessageType type, const gchar *message_text);
+
gchar *g_mkdtemp (gchar *tmpl);