[Goodies-commits] r5877 - in xfce4-dict/trunk: . lib

Enrico Troeger enrico at xfce.org
Thu Oct 30 18:46:27 CET 2008


Author: enrico
Date: 2008-10-30 17:46:27 +0000 (Thu, 30 Oct 2008)
New Revision: 5877

Modified:
   xfce4-dict/trunk/ChangeLog
   xfce4-dict/trunk/lib/gui.c
   xfce4-dict/trunk/lib/prefs.c
Log:
Use a stock GTK about dialog.

Modified: xfce4-dict/trunk/ChangeLog
===================================================================
--- xfce4-dict/trunk/ChangeLog	2008-10-30 16:47:00 UTC (rev 5876)
+++ xfce4-dict/trunk/ChangeLog	2008-10-30 17:46:27 UTC (rev 5877)
@@ -1,3 +1,8 @@
+2008-10-30  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * Use a stock GTK about dialog.
+
+
 2008-10-29  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * Always clear the spell check dictionary list in the prefs dialog,

Modified: xfce4-dict/trunk/lib/gui.c
===================================================================
--- xfce4-dict/trunk/lib/gui.c	2008-10-30 16:47:00 UTC (rev 5876)
+++ xfce4-dict/trunk/lib/gui.c	2008-10-30 17:46:27 UTC (rev 5877)
@@ -625,26 +625,41 @@
 }
 
 
-void dict_gui_about_dialog(GtkWidget *widget, DictData *dd)
+static void about_activate_link(GtkAboutDialog *about, const gchar *ref, gpointer data)
 {
-	GtkWidget *dialog;
-	XfceAboutInfo *info;
+	gchar *cmd = g_strconcat("xdg-open ", ref, NULL);
+	g_spawn_command_line_async(cmd, NULL);
+	g_free(cmd);
+}
 
-	info = xfce_about_info_new("xfce4-dict", VERSION,
-							   _("A client program to query different dictionaries."),
-							   XFCE_COPYRIGHT_TEXT("2006-2008", "Enrico Tröger"),
-							   XFCE_LICENSE_GPL);
 
-	xfce_about_info_add_credit(info, "Enrico Tröger", "enrico(dot)troeger(at)uvena(dot)de", _("Developer"));
-	xfce_about_info_set_homepage(info, "http://goodies.xfce.org/projects/applications/xfce4-dict");
+void dict_gui_about_dialog(GtkWidget *widget, DictData *dd)
+{
+	const gchar *authors[]= { "Enrico Tröger <enrico at xfce.org>", NULL };
+	const gchar *title = _("Xfce4 Dictionary");
+	GdkPixbuf *logo = gdk_pixbuf_new_from_inline(-1, dict_icon_data, FALSE, NULL);
 
-	dialog = xfce_about_dialog_new_with_values(
-		GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), info, dd->icon);
-	g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), NULL);
-	gtk_window_set_title(GTK_WINDOW(dialog), "Xfce4 Dictionary");
-	gtk_dialog_run(GTK_DIALOG(dialog));
+	gtk_about_dialog_set_email_hook(about_activate_link, NULL, NULL);
+	gtk_about_dialog_set_url_hook(about_activate_link, NULL, NULL);
+	gtk_show_about_dialog(GTK_WINDOW(dd->window),
+		"destroy-with-parent", TRUE,
+		"authors", authors,
+		"comments", _("A client program to query different dictionaries."),
+		"copyright", _("Copyright \302\251 2006-2008 Enrico Tröger"),
+		"website", "http://goodies.xfce.org/projects/applications/xfce4-dict",
+		"logo", logo,
+		"translator-credits", _("translator-credits"),
+		"license", XFCE_LICENSE_GPL,
+		"version", PACKAGE_VERSION,
+#if GTK_CHECK_VERSION(2,11,0)
+		"program-name", title,
+#else
+		"name", title,
+#endif
+		  NULL);
 
-	xfce_about_info_free(info);
+	if (logo != NULL)
+		g_object_unref(logo);
 }
 
 

Modified: xfce4-dict/trunk/lib/prefs.c
===================================================================
--- xfce4-dict/trunk/lib/prefs.c	2008-10-30 16:47:00 UTC (rev 5876)
+++ xfce4-dict/trunk/lib/prefs.c	2008-10-30 17:46:27 UTC (rev 5877)
@@ -274,7 +274,7 @@
 	GtkWidget *label1, *label2, *label3;
 
 	dialog = xfce_titled_dialog_new_with_buttons(
-		_("Preferences"), GTK_WINDOW(parent),
+		_("Xfce4 Dictionary Preferences"), GTK_WINDOW(parent),
 		GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
 		GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
 		NULL);




More information about the Goodies-commits mailing list