[gnome-packagekit] trivial: Do not override the about dialog hook, the default one seems to work fine



commit 33f3e6c2898c6a1747775b14b678f1fff6aff66c
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jun 23 09:10:37 2010 +0100

    trivial: Do not override the about dialog hook, the default one seems to work fine

 src/gpk-application.c |   46 ----------------------------------------------
 src/gpk-watch.c       |   33 ---------------------------------
 2 files changed, 0 insertions(+), 79 deletions(-)
---
diff --git a/src/gpk-application.c b/src/gpk-application.c
index 5d8eab7..15378aa 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -2742,45 +2742,6 @@ gpk_application_entry_text_icon_press_cb (GtkEntry *entry, GtkEntryIconPosition
 }
 
 /**
- *  * gpk_application_about_dialog_url_cb:
- *   **/
-static void
-gpk_application_about_dialog_url_cb (GtkAboutDialog *about, const char *address, gpointer data)
-{
-	GError *error = NULL;
-	gboolean ret;
-
-	GdkScreen *gscreen;
-	GtkWidget *error_dialog;
-	gchar *url;
-	gchar *protocol = (gchar*) data;
-
-	if (protocol != NULL)
-		url = g_strconcat (protocol, address, NULL);
-	else
-		url = g_strdup (address);
-
-	gscreen = gtk_window_get_screen (GTK_WINDOW (about));
-
-	ret = gtk_show_uri (gscreen, url, gtk_get_current_event_time (), &error);
-
-	if (!ret) {
-		error_dialog = gtk_message_dialog_new (GTK_WINDOW (about),
-						       GTK_DIALOG_MODAL,
-						       GTK_MESSAGE_INFO,
-						       GTK_BUTTONS_OK,
-						       /* TRANSLATORS: packaging problem, failed to show link */
-						       _("Failed to show url"));
-		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (error_dialog),
-							  "%s", error->message);
-		gtk_dialog_run (GTK_DIALOG (error_dialog));
-		gtk_widget_destroy (error_dialog);
-		g_error_free (error);
-	}
-	g_free (url);
-}
-
-/**
  * gpk_application_menu_help_cb:
  **/
 static void
@@ -2795,7 +2756,6 @@ gpk_application_menu_help_cb (GtkAction *action, GpkApplication *application)
 static void
 gpk_application_menu_about_cb (GtkAction *action, GpkApplication *application)
 {
-	static gboolean been_here = FALSE;
 	GtkWidget *main_window;
 	const char *authors[] = {
 		"Richard Hughes <richard hughsie com>",
@@ -2833,12 +2793,6 @@ gpk_application_menu_about_cb (GtkAction *action, GpkApplication *application)
 	license_trans = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n",
 				     _(license[2]), "\n\n", _(license[3]), "\n",  NULL);
 
-	if (!been_here) {
-		been_here = TRUE;
-		gtk_about_dialog_set_url_hook (gpk_application_about_dialog_url_cb, NULL, NULL);
-		gtk_about_dialog_set_email_hook (gpk_application_about_dialog_url_cb, (gpointer) "mailto:";, NULL);
-	}
-
 	/* use parent */
 	main_window = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "window_manager"));
 
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index 79f42e8..2a514a5 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -404,36 +404,6 @@ gpk_watch_libnotify_cb (NotifyNotification *notification, gchar *action, gpointe
 #endif
 
 /**
- * gpk_watch_about_dialog_url_cb:
- **/
-static void
-gpk_watch_about_dialog_url_cb (GtkAboutDialog *about, const char *address, gpointer data)
-{
-	GError *error = NULL;
-	gboolean ret;
-	GdkScreen *gscreen;
-	gchar *url;
-	gchar *protocol = (gchar*) data;
-
-	if (protocol != NULL)
-		url = g_strconcat (protocol, address, NULL);
-	else
-		url = g_strdup (address);
-
-	gscreen = gtk_window_get_screen (GTK_WINDOW (about));
-
-	ret = gtk_show_uri (gscreen, url, gtk_get_current_event_time (), &error);
-
-	if (!ret) {
-		/* TRANSLATORS: We couldn't launch the tool, normally a packaging problem */
-		gpk_error_dialog (_("Internal error"), _("Failed to show url"), error->message);
-		g_error_free (error);
-	}
-
-	g_free (url);
-}
-
-/**
  * gpk_watch_show_about_cb:
  **/
 static void
@@ -470,9 +440,6 @@ gpk_watch_show_about_cb (GtkMenuItem *item, gpointer data)
 	license_trans = g_strconcat (_(license[0]), "", _(license[1]), "",
 				     _(license[2]), "", _(license[3]), "",  NULL);
 
-	gtk_about_dialog_set_url_hook (gpk_watch_about_dialog_url_cb, NULL, NULL);
-	gtk_about_dialog_set_email_hook (gpk_watch_about_dialog_url_cb, (gpointer) "mailto:";, NULL);
-
 	gtk_window_set_default_icon_name (GPK_ICON_SOFTWARE_LOG);
 	gtk_show_about_dialog (NULL,
 			       "version", VERSION,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]