pidgin.next.minor: 6d16c87c: Break the developer information out into...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sat Oct 3 16:50:46 EDT 2009


-----------------------------------------------------------------
Revision: 6d16c87c66437f14a859a11de95c39ec5b4a9ca6
Ancestor: 7a3c8fed5679b2ecaf977a9eea46980c9819513b
Author: rekkanoryo at pidgin.im
Date: 2009-10-03T19:18:18
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/6d16c87c66437f14a859a11de95c39ec5b4a9ca6

Modified files:
        pidgin/gtkblist.c pidgin/gtkdialogs.c pidgin/gtkdialogs.h

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	ffb4733dde51439ff794865fdbf7ae81a0bcb996
+++ pidgin/gtkblist.c	d1e33737375899d4200b7ead9d58505b7fc3e6a0
@@ -3436,7 +3436,8 @@ static GtkItemFactoryEntry blist_menu[] 
 	{ "/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 },
 };
============================================================
--- pidgin/gtkdialogs.c	a06d902af0305f00c5e1ab7cbf4c6d5461654e9c
+++ pidgin/gtkdialogs.c	f5b603966b41bd674537a5da345ac119f586f4dd
@@ -48,6 +48,7 @@ static GtkWidget *buildinfo = NULL;
 
 static GtkWidget *about = NULL;
 static GtkWidget *buildinfo = NULL;
+static GtkWidget *developer_info = NULL;
 static GtkWidget *translator_info = NULL;
 
 struct _PidginGroupMergeObject {
@@ -352,6 +353,13 @@ pidgin_dialogs_destroy_all()
 	}
 }
 
+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 @@ void pidgin_dialogs_about()
 	g_string_append_printf(str, _("<FONT SIZE=\"4\">XMPP MUC:</FONT> "
 				"devel at 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 @@ if (purple_plugins_find_with_id("core-tc
 	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;
============================================================
--- pidgin/gtkdialogs.h	e78f66445d82a27ddc6b6934c6e1814ed442b407
+++ pidgin/gtkdialogs.h	827d6e347ad1aa18549aac589d9c91caacdea6c1
@@ -34,6 +34,7 @@ void pidgin_dialogs_buildinfo(void);
 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 *);


More information about the Commits mailing list