changeset 29510:a6b08260d631

Break the developer information out into its own dialog. I also bolded a few headings that weren't previously bolded because I think they look better this way. Feel free to debate and tweak.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sat, 03 Oct 2009 19:18:18 +0000
parents b50ff312ac80
children 89a523641c64
files pidgin/gtkblist.c pidgin/gtkdialogs.c pidgin/gtkdialogs.h
diffstat 3 files changed, 92 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Sat Oct 03 18:54:58 2009 +0000
+++ b/pidgin/gtkblist.c	Sat Oct 03 19:18:18 2009 +0000
@@ -3436,7 +3436,8 @@
 	{ "/Help/sep1", NULL, NULL, 0, "<Separator>", NULL },
 	{ N_("/Help/_Build Information"), NULL, pidgin_dialogs_buildinfo, 0, "<Item>", NULL },
 	{ N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL },
-	{ N_("/Help/_Translators"), NULL, pidgin_dialogs_translators, 0, "<Item>", NULL },
+	{ N_("/Help/De_veloper Information"), NULL, pidgin_dialogs_developers, 0, "<Item>", NULL },
+	{ N_("/Help/_Translator Information"), NULL, pidgin_dialogs_translators, 0, "<Item>", NULL },
 	{ "/Help/sep2", NULL, NULL, 0, "<Separator>", NULL },
 	{ N_("/Help/_About"), NULL, pidgin_dialogs_about, 4,  "<StockItem>", GTK_STOCK_ABOUT },
 };
--- a/pidgin/gtkdialogs.c	Sat Oct 03 18:54:58 2009 +0000
+++ b/pidgin/gtkdialogs.c	Sat Oct 03 19:18:18 2009 +0000
@@ -48,6 +48,7 @@
 
 static GtkWidget *about = NULL;
 static GtkWidget *buildinfo = NULL;
+static GtkWidget *developer_info = NULL;
 static GtkWidget *translator_info = NULL;
 
 struct _PidginGroupMergeObject {
@@ -352,6 +353,13 @@
 	}
 }
 
+static void destroy_developer_info(void)
+{
+	if (developer_info != NULL)
+		gtk_widget_destroy(developer_info);
+	developer_info = NULL;
+}
+
 static void destroy_translator_info(void)
 {
 	if (translator_info != NULL)
@@ -500,30 +508,7 @@
 	g_string_append_printf(str, _("<FONT SIZE=\"4\">XMPP MUC:</FONT> "
 				"devel@conference.pidgin.im<BR><BR>"));
 
-	/* Current Developers */
-	g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>",
-						   _("Current Developers"));
-	add_developers(str, developers);
-	g_string_append(str, "<BR/>");
-
-	/* Crazy Patch Writers */
-	g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>",
-						   _("Crazy Patch Writers"));
-	add_developers(str, patch_writers);
-	g_string_append(str, "<BR/>");
-
-	/* Retired Developers */
-	g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>",
-						   _("Retired Developers"));
-	add_developers(str, retired_developers);
-	g_string_append(str, "<BR/>");
-
-	/* Retired Crazy Patch Writers */
-	g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>",
-						   _("Retired Crazy Patch Writers"));
-	add_developers(str, retired_patch_writers);
-	g_string_append(str, "<BR/>");
-
+	
 	gtk_imhtml_append_text(GTK_IMHTML(text), str->str, GTK_IMHTML_NO_SCROLL);
 	g_string_free(str, TRUE);
 
@@ -781,6 +766,86 @@
 	gtk_window_present(GTK_WINDOW(buildinfo));
 }
 
+void pidgin_dialogs_developers()
+{
+	GtkWidget *vbox;
+	GtkWidget *frame;
+	GtkWidget *text;
+	GtkWidget *button;
+	GtkTextIter iter;
+	GString *str;
+	char *tmp;
+	PidginBuddyList *buddylist;
+
+	if (about != NULL) {
+		gtk_window_present(GTK_WINDOW(about));
+		return;
+	}
+
+	tmp = g_strdup_printf(_("%s Developer Information"), PIDGIN_NAME);
+	developer_info = pidgin_create_dialog(tmp, PIDGIN_HIG_BORDER, "developer_info", TRUE);
+	g_free(tmp);
+	gtk_window_set_default_size(GTK_WINDOW(developer_info), 450, 450);
+
+	vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(developer_info), FALSE, PIDGIN_HIG_BORDER);
+
+	frame = pidgin_create_imhtml(FALSE, &text, NULL, NULL);
+	gtk_imhtml_set_format_functions(GTK_IMHTML(text), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY);
+	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+
+	str = g_string_sized_new(4096);
+
+	/* Current Developers */
+	g_string_append_printf(str, "<FONT SIZE=\"4\"><B>%s:</B></FONT><BR/>",
+						   _("Current Developers"));
+	add_developers(str, developers);
+	g_string_append(str, "<BR/>");
+
+	/* Crazy Patch Writers */
+	g_string_append_printf(str, "<FONT SIZE=\"4\"><B>%s:</B></FONT><BR/>",
+						   _("Crazy Patch Writers"));
+	add_developers(str, patch_writers);
+	g_string_append(str, "<BR/>");
+
+	/* Retired Developers */
+	g_string_append_printf(str, "<FONT SIZE=\"4\"><B>%s:</B></FONT><BR/>",
+						   _("Retired Developers"));
+	add_developers(str, retired_developers);
+	g_string_append(str, "<BR/>");
+
+	/* Retired Crazy Patch Writers */
+	g_string_append_printf(str, "<FONT SIZE=\"4\"><B>%s:</B></FONT><BR/>",
+						   _("Retired Crazy Patch Writers"));
+	add_developers(str, retired_patch_writers);
+	g_string_append(str, "<BR/>");
+
+	gtk_imhtml_append_text(GTK_IMHTML(text), str->str, GTK_IMHTML_NO_SCROLL);
+	g_string_free(str, TRUE);
+
+	gtk_text_buffer_get_start_iter(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), &iter);
+	gtk_text_buffer_place_cursor(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), &iter);
+
+	/* Close Button */
+	button = pidgin_dialog_add_button(GTK_DIALOG(developer_info), GTK_STOCK_CLOSE,
+	                G_CALLBACK(destroy_developer_info), about);
+
+	g_signal_connect(G_OBJECT(developer_info), "destroy",
+					 G_CALLBACK(destroy_developer_info), G_OBJECT(developer_info));
+
+	/* this makes the sizes not work? */
+	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+	gtk_widget_grab_default(button);
+
+	/* Let's give'em something to talk about -- woah woah woah */
+	buddylist = pidgin_blist_get_default_gtk_blist();
+	if (buddylist)
+		gtk_window_set_transient_for(GTK_WINDOW(developer_info),
+				GTK_WINDOW(buddylist->window));
+
+	gtk_widget_show_all(developer_info);
+	gtk_window_present(GTK_WINDOW(developer_info));
+}
+
 void pidgin_dialogs_translators()
 {
 	GtkWidget *vbox;
--- a/pidgin/gtkdialogs.h	Sat Oct 03 18:54:58 2009 +0000
+++ b/pidgin/gtkdialogs.h	Sat Oct 03 19:18:18 2009 +0000
@@ -34,6 +34,7 @@
 void pidgin_dialogs_destroy_all(void);
 void pidgin_dialogs_about(void);
 void pidgin_dialogs_buildinfo(void);
+void pidgin_dialogs_developers(void);
 void pidgin_dialogs_translators(void);
 void pidgin_dialogs_im(void);
 void pidgin_dialogs_im_with_user(PurpleAccount *, const char *);