[gwget] 2009-06-15 David Sedeño <david alderia com>
- From: David Sedeño Fernández <davidsf src gnome org>
- To: svn-commits-list gnome org
- Subject: [gwget] 2009-06-15 David Sedeño <david alderia com>
- Date: Mon, 15 Jun 2009 15:38:37 -0400 (EDT)
commit 3d1ccf2fd4a4fadbb1ad79ffe697c80f731c4966
Author: David Sedeño <david alderia com>
Date: Mon Jun 15 21:38:15 2009 +0200
2009-06-15 David Sedeño <david alderia com>
* src/utils.{c,h}: Clean up run_dialog_information and run_dialog_error. Thanks to
Jaroslav Imrich <jaroslav imrich gmail com> for the patch.
ChangeLog | 5 +++++
src/utils.c | 29 +++++++++++++++--------------
src/utils.h | 4 ++--
3 files changed, 22 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 37eaf1e..60c0a7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-15 David Sedeño <david alderia com>
+
+ * src/utils.{c,h}: Clean up run_dialog_information and run_dialog_error. Thanks to
+ Jaroslav Imrich <jaroslav imrich gmail com> for the patch.
+
2009-06-01 David Sedeño <david alderia com>
* src/gwget-application-service.xml, src/gwget-application.{c,h}:
diff --git a/src/utils.c b/src/utils.c
index 99146b4..d880d98 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -48,21 +48,22 @@ run_dialog (gchar *title, gchar *message, gchar *cancel_message, gchar *action_m
return response;
}
-gint
+void
run_dialog_information(gchar *title, gchar *msg)
{
GtkWidget *dialog;
- gchar *mark;
- gint response;
-
- dialog = glade_xml_get_widget(xml,"dialog3");
- mark=g_strdup_printf("<span size=\"large\" weight=\"bold\">%s</span>",title);
- gtk_label_set_markup(GTK_LABEL(glade_xml_get_widget(xml,"title_label_inf")),mark);
- gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(xml,"msg_label_inf")),msg);
-
- response=gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_hide(GTK_WIDGET(dialog));
- return response;
+
+ dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (glade_xml_get_widget(xml, "main_window")),
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ "%s", msg);
+
+ gtk_window_set_title (GTK_WINDOW (dialog), title);
+
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+
+ gtk_widget_show (dialog);
}
void
@@ -74,9 +75,9 @@ run_dialog_error (gchar *title, gchar *message)
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
- title, message);
+ "%s", message);
- gtk_window_set_title (GTK_WINDOW (dialog), "");
+ gtk_window_set_title (GTK_WINDOW (dialog), title);
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
diff --git a/src/utils.h b/src/utils.h
index 96efbd7..e213551 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -20,9 +20,9 @@
#define _UTILS_H
-gint run_dialog(gchar *title, gchar *message, gchar *cancel_message, gchar *action_message);
+int run_dialog(gchar *title, gchar *message, gchar *cancel_message, gchar *action_message);
void run_dialog_error(gchar *title, gchar *msg);
-gint run_dialog_information(gchar *title, gchar *msg);
+void run_dialog_information(gchar *title, gchar *msg);
int check_url(char *str1, char *str2);
gboolean check_url_already_exists(gchar *checkurl);
gboolean check_server_already_exists(gchar *checkurl);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]