gok r2518 - in trunk: . gok



Author: gerdk
Date: Mon Jul 28 08:44:52 2008
New Revision: 2518
URL: http://svn.gnome.org/viewvc/gok?rev=2518&view=rev

Log:
2008-07-28  Gerd Kohlberger  <gerdk svn gnome org>

	Patch by Christian Kirbach. Fixes bug #435973.

	* gok/gok-keyboard.c: (gok_keyboard_about):
	Migrate to GtkAboutDialog.



Modified:
   trunk/ChangeLog
   trunk/gok/gok-keyboard.c

Modified: trunk/gok/gok-keyboard.c
==============================================================================
--- trunk/gok/gok-keyboard.c	(original)
+++ trunk/gok/gok-keyboard.c	Mon Jul 28 08:44:52 2008
@@ -3628,15 +3628,9 @@
  *
  **/
 void
-gok_keyboard_about (GokKey *pKey) 
+gok_keyboard_about (GokKey *pKey)
 {
-	static GtkWidget *about = NULL, *hbox = NULL;
-	GdkPixbuf	 *pixbuf = NULL;
-	GError		 *error = NULL;
-	gchar		 *file = NULL;
-	
-	
-	static const gchar *authors [] = {
+	static const gchar *authors[] = {
 		"David Bolter <david bolter utoronto ca>",
 		"Bill Haneman <bill haneman sun com>",
 		"Chris Ridpath <chris ridpath utoronto ca>",
@@ -3644,64 +3638,22 @@
 		"Gnome Accessibility <gnome-accessibility-devel gnome org>",
 		NULL
 	};
-	
-	const gchar *documenters[] = {
-		NULL
-	};
-	
-	const gchar *translator_credits = _("translator-credits");
-	
-	if (about) {
-		gtk_window_set_screen (
-			GTK_WINDOW (about),
-			gtk_widget_get_screen (GTK_WIDGET (gok_main_get_main_window ())));
-		gtk_window_present (GTK_WINDOW (about));
-		return;
-	}
-		
-	file = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_DATADIR, 
-					  "gok.png", 
-					  FALSE, NULL);
-	if (file) {
-		pixbuf = gdk_pixbuf_new_from_file (file, &error);
-		if (error) {
-		    g_warning (G_STRLOC ": cannot open %s: %s", file, error->message);
-		    g_error_free (error);
-		}
-		g_free (file);
-	}
-	
-	about = gnome_about_new (
-		_("GOK"), VERSION,
-		"Copyright (C) 2001-2003 Sun Microsystems, Copyright (C) 2001-2003 University of Toronto", 
-		_("Dynamic virtual keyboards for the GNOME desktop"),
-		authors,
-		documenters,
-		strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
-		pixbuf);
-	
-	/* stealing a hack from gnumeric */
-	hbox = gtk_hbox_new (TRUE, 0);
-	gtk_box_pack_start (GTK_BOX (hbox),
-		gnome_href_new ("http://www.gok.ca/credits.html";, _("Full Credits")),
-		FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about)->vbox),
-				hbox, TRUE, FALSE, 0);
-	gtk_widget_show_all (hbox);
-		
-	if (pixbuf)
-		gdk_pixbuf_unref (pixbuf);
-			
-	gtk_window_set_wmclass (GTK_WINDOW (about), "gok", "GOK");
-	gtk_window_set_screen (GTK_WINDOW (about),
-				   gtk_widget_get_screen (GTK_WIDGET (gok_main_get_main_window ())));
-	g_signal_connect (about, "destroy",
-			  G_CALLBACK (gtk_widget_destroyed),
-			  &about);
-	/* make it 'normal' to avoid occluding GOK main window */
-	gtk_window_set_type_hint (GTK_WINDOW (about), GDK_WINDOW_TYPE_HINT_NORMAL);
-	gtk_window_set_position (GTK_WINDOW (about), GTK_WIN_POS_CENTER);
-	gtk_widget_show (about);
+
+	gtk_show_about_dialog (GTK_WINDOW (gok_main_get_main_window ()),
+		"program-name", _("GOK"),
+		"version", VERSION,
+		"copyright", "Copyright (C) 2001-2008 Sun Microsystems\n"
+			     "Copyright (C) 2001-2008 University of Toronto",
+		"comments", _("Dynamic virtual keyboards for the GNOME desktop"),
+		"authors", authors,
+		"translator-credits", _("translator-credits"),
+		"website", "http://www.gok.ca/credits.html";,
+		"website-label", _("Full Credits"),
+		"logo-icon-name", "gok",
+		"title", _("About GOK"),
+		/* avoid occluding GOK main window */
+		"window-position", GTK_WIN_POS_CENTER,
+		NULL);
 }
 
 /**



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