pidgin: d2a3c103: De-dialogify the file-transfer and debug...

sadrul at pidgin.im sadrul at pidgin.im
Mon Feb 8 13:40:41 EST 2010


-----------------------------------------------------------------
Revision: d2a3c1030225e8e39307ad3cab192be42cb04cde
Ancestor: 226a30da7a9fe3b828a1fe564797b3388e6159bc
Author: sadrul at pidgin.im
Date: 2010-02-08T16:44:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d2a3c1030225e8e39307ad3cab192be42cb04cde

Modified files:
        pidgin/gtkdebug.c pidgin/gtkft.c

ChangeLog: 

De-dialogify the file-transfer and debug windows.

Closes #6054.

-------------- next part --------------
============================================================
--- pidgin/gtkdebug.c	a8218764b4e35deb42cda7ac2b18469d15d3c88c
+++ pidgin/gtkdebug.c	bd71ece104a026ad4a08e580daa1bbd524c8f633
@@ -686,7 +686,7 @@ debug_window_new(void)
 	width  = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/width");
 	height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/height");
 
-	win->window = pidgin_create_dialog(_("Debug Window"), 0, "debug", TRUE);
+	win->window = pidgin_create_window(_("Debug Window"), 0, "debug", TRUE);
 	purple_debug_info("gtkdebug", "Setting dimensions to %d, %d\n",
 					width, height);
 
@@ -714,7 +714,8 @@ debug_window_new(void)
 #endif /* HAVE_REGEX_H */
 
 	/* Setup the vbox */
-	vbox = pidgin_dialog_get_vbox(GTK_DIALOG(win->window));
+	vbox = gtk_vbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(win->window), vbox);
 
 	if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/toolbar")) {
 		/* Setup our top button bar thingie. */
============================================================
--- pidgin/gtkft.c	c0bf4c0ab2b8dae100d21dac57e640ca271908fa
+++ pidgin/gtkft.c	4404137bbba231e39059687d5d60829eb966df73
@@ -728,11 +728,11 @@ pidgin_xfer_dialog_new(void)
 	GtkWidget *window;
 	GtkWidget *vbox1, *vbox2;
 	GtkWidget *sw;
-	GtkWidget *button;
 	GtkWidget *expander;
 	GtkWidget *alignment;
 	GtkWidget *table;
 	GtkWidget *checkbox;
+	GtkWidget *bbox;
 
 	dialog = g_new0(PidginXferDialog, 1);
 	dialog->keep_open =
@@ -741,14 +741,16 @@ pidgin_xfer_dialog_new(void)
 		purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/filetransfer/clear_finished");
 
 	/* Create the window. */
-	dialog->window = window = pidgin_create_dialog(_("File Transfers"), PIDGIN_HIG_BORDER, "file transfer", TRUE);
+	dialog->window = window = pidgin_create_window(_("File Transfers"), PIDGIN_HIG_BORDER, "file transfer", TRUE);
 	gtk_window_set_default_size(GTK_WINDOW(window), 450, 250);
 
 	g_signal_connect(G_OBJECT(window), "delete_event",
 					 G_CALLBACK(delete_win_cb), dialog);
 
 	/* Create the parent vbox for everything. */
-	vbox1 = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(window), FALSE, PIDGIN_HIG_BORDER);
+	vbox1 = gtk_vbox_new(FALSE, 0);
+	gtk_widget_show(vbox1);
+	gtk_container_add(GTK_CONTAINER(window), vbox1);
 
 	/* Create the main vbox for top half of the window. */
 	vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
@@ -799,25 +801,37 @@ pidgin_xfer_dialog_new(void)
 	gtk_container_add(GTK_CONTAINER(alignment), table);
 	gtk_widget_show(table);
 
+	bbox = gtk_hbutton_box_new();
+	gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
+	gtk_box_set_spacing(GTK_BOX(bbox), PIDGIN_HIG_BOX_SPACE);
+	gtk_box_pack_end(GTK_BOX(vbox1), bbox, FALSE, TRUE, 0);
+	gtk_widget_show(bbox);
+
+#define ADD_BUTTON(b, label, callback, callbackdata) do { \
+		GtkWidget *button = gtk_button_new_from_stock(label); \
+		gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); \
+		g_signal_connect(G_OBJECT(button), "clicked", callback, callbackdata); \
+		gtk_widget_show(button); \
+		b = button; \
+	} while (0)
+
 	/* Open button */
-	button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_OPEN, G_CALLBACK(open_button_cb), dialog);
-	gtk_widget_set_sensitive(button, FALSE);
-	dialog->open_button = button;
+	ADD_BUTTON(dialog->open_button, GTK_STOCK_OPEN, G_CALLBACK(open_button_cb), dialog);
+	gtk_widget_set_sensitive(dialog->open_button, FALSE);
 
 	/* Remove button */
-	button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_REMOVE, G_CALLBACK(remove_button_cb), dialog);
-	gtk_widget_hide(button);
-	dialog->remove_button = button;
+	ADD_BUTTON(dialog->remove_button, GTK_STOCK_REMOVE, G_CALLBACK(remove_button_cb), dialog);
+	gtk_widget_hide(dialog->remove_button);
 
 	/* Stop button */
-	button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_STOP, G_CALLBACK(stop_button_cb), dialog);
-	gtk_widget_set_sensitive(button, FALSE);
-	dialog->stop_button = button;
+	ADD_BUTTON(dialog->stop_button, GTK_STOCK_STOP, G_CALLBACK(stop_button_cb), dialog);
+	gtk_widget_set_sensitive(dialog->stop_button, FALSE);
 
 	/* Close button */
-	button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CLOSE, G_CALLBACK(close_button_cb), dialog);
-	dialog->close_button = button;
+	ADD_BUTTON(dialog->close_button, GTK_STOCK_CLOSE, G_CALLBACK(close_button_cb), dialog);
 
+#undef ADD_BUTTON
+
 #ifdef _WIN32
 	g_signal_connect(G_OBJECT(dialog->window), "show",
 		G_CALLBACK(winpidgin_ensure_onscreen), dialog->window);


More information about the Commits mailing list