diff src/gtkconv.c @ 5046:44945824ba60

[gaim-migrate @ 5394] javabsp fixed im image scaling I fixed im image saving, and the button annoyingly staying toggled committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 06 Apr 2003 02:09:56 +0000
parents 8e55a4d362a3
children 24d0da9c56f2
line wrap: on
line diff
--- a/src/gtkconv.c	Sun Apr 06 01:27:56 2003 +0000
+++ b/src/gtkconv.c	Sun Apr 06 02:09:56 2003 +0000
@@ -171,6 +171,8 @@
 	gtk_text_buffer_insert_at_cursor(GTK_TEXT_BUFFER(gtkconv->entry_buffer),
 									 buf, -1);
 	g_free(buf);
+
+	set_toggle(gtkconv->toolbar.image, FALSE);
 }
 
 static gint
@@ -202,26 +204,26 @@
 
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
 
-	window = gtk_file_selection_new(_("Gaim - Insert Image"));
-	g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S, gaim_home_dir());
-	gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf);
-
-	g_object_set_data(G_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
-					  "user_data", conv);
-	g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
-					 "clicked", G_CALLBACK(do_insert_image_cb), window);
-	g_signal_connect_swapped(
-			G_OBJECT(GTK_FILE_SELECTION(window)->cancel_button),
-			"clicked", G_CALLBACK(gtk_widget_destroy), window);
-
-	gtk_widget_show(window);
-/*
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkconv->toolbar.image),
-								FALSE);
-								*/
+	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gtkconv->toolbar.image))) {
+		window = gtk_file_selection_new(_("Gaim - Insert Image"));
+		g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S, gaim_home_dir());
+		gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf);
+
+		g_object_set_data(G_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
+				"user_data", conv);
+		g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
+				"clicked", G_CALLBACK(do_insert_image_cb), window);
+		g_signal_connect_swapped(
+				G_OBJECT(GTK_FILE_SELECTION(window)->cancel_button),
+				"clicked", G_CALLBACK(gtk_widget_destroy), window);
+
+		gtk_widget_show(window);
+	} else {
+		gtk_widget_grab_focus(gtkconv->entry);
+	}
 }
 
-static void
+	static void
 insert_link_cb(GtkWidget *w, struct gaim_conversation *conv)
 {
 	struct gaim_gtk_conversation *gtkconv;