changeset 1757:3dfe4aefd366

[gaim-migrate @ 1767] la la la committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 27 Apr 2001 00:33:38 +0000
parents baf57b74e818
children eb7b48eef4a3
files ChangeLog src/buddy_chat.c src/conversation.c src/gaim.h src/prefs.c
diffstat 5 files changed, 216 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 27 00:28:44 2001 +0000
+++ b/ChangeLog	Fri Apr 27 00:33:38 2001 +0000
@@ -17,6 +17,8 @@
 	  op, deop, voice, devoice, mode, raw, quote, and kick (thanks
 	  to Sean Egan)
 	* MSN Properly handles URL decoding of 'friendly' names
+	* Redesigned Preferences pages (design by DennisR)
+	* Can select where tabs are for tabbed IM/Chat windows
 
 version 0.11.0-pre10 (04/13/2001):
 	* Many, many bug fixes
--- a/src/buddy_chat.c	Fri Apr 27 00:28:44 2001 +0000
+++ b/src/buddy_chat.c	Fri Apr 27 00:33:38 2001 +0000
@@ -779,6 +779,23 @@
 					   GTK_SIGNAL_FUNC(delete_all_chats), NULL);
 
 			chat_notebook = gtk_notebook_new();
+			if (display_options & OPT_DISP_CHAT_SIDE_TAB) {
+				if (display_options & OPT_DISP_CHAT_BR_TAB) {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
+							GTK_POS_RIGHT);
+				} else {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
+							GTK_POS_LEFT);
+				}
+			} else {
+				if (display_options & OPT_DISP_CHAT_BR_TAB) {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
+							GTK_POS_BOTTOM);
+				} else {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
+							GTK_POS_TOP);
+				}
+			}
 			gtk_notebook_set_scrollable(GTK_NOTEBOOK(chat_notebook), TRUE);
 			gtk_notebook_popup_enable(GTK_NOTEBOOK(chat_notebook));
 			gtk_container_add(GTK_CONTAINER(win), chat_notebook);
@@ -1143,6 +1160,7 @@
 		if (all_chats)
 			gtk_widget_destroy(all_chats);
 		all_chats = NULL;
+		chat_notebook = NULL;
 		chats = m;
 	}
 }
--- a/src/conversation.c	Fri Apr 27 00:28:44 2001 +0000
+++ b/src/conversation.c	Fri Apr 27 00:33:38 2001 +0000
@@ -398,6 +398,7 @@
 					gtk_widget_destroy(c->window);
 				c->window = NULL;
 				all_convos = NULL;
+				convo_notebook = NULL;
 			}
 		} else {
 			if (c->window)
@@ -414,6 +415,7 @@
 					gtk_widget_destroy(c->window);
 				c->window = NULL;
 				all_chats = NULL;
+				chat_notebook = NULL;
 			}
 		} else {
 			if (c->window)
@@ -1967,6 +1969,23 @@
 					   GTK_SIGNAL_FUNC(delete_all_convo), NULL);
 
 			convo_notebook = gtk_notebook_new();
+			if (display_options & OPT_DISP_CONV_SIDE_TAB) {
+				if (display_options & OPT_DISP_CONV_BR_TAB) {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+							GTK_POS_RIGHT);
+				} else {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+							GTK_POS_LEFT);
+				}
+			} else  {
+				if (display_options & OPT_DISP_CONV_BR_TAB) {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+							GTK_POS_BOTTOM);
+				} else {
+					gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+							GTK_POS_TOP);
+				}
+			}
 			gtk_notebook_set_scrollable(GTK_NOTEBOOK(convo_notebook), TRUE);
 			gtk_notebook_popup_enable(GTK_NOTEBOOK(convo_notebook));
 			gtk_container_add(GTK_CONTAINER(win), convo_notebook);
@@ -2271,6 +2290,7 @@
 		if (all_convos)
 			gtk_widget_destroy(all_convos);
 		all_convos = NULL;
+		convo_notebook = NULL;
 		conversations = m;
 	}
 }
@@ -2287,3 +2307,47 @@
 	gtk_notebook_set_page(GTK_NOTEBOOK(convo_notebook), g_list_index(conversations, c));
 	gdk_window_show(c->window->window);
 }
+
+void update_im_tabs() {
+	if (!convo_notebook || !all_convos)
+		return;
+	if (display_options & OPT_DISP_CONV_SIDE_TAB) {
+		if (display_options & OPT_DISP_CONV_BR_TAB) {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+					GTK_POS_RIGHT);
+		} else {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+					GTK_POS_LEFT);
+		}
+	} else  {
+		if (display_options & OPT_DISP_CONV_BR_TAB) {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+					GTK_POS_BOTTOM);
+		} else {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
+					GTK_POS_TOP);
+		}
+	}
+}
+
+void update_chat_tabs() {
+	if (!chat_notebook || !all_chats)
+		return;
+	if (display_options & OPT_DISP_CHAT_SIDE_TAB) {
+		if (display_options & OPT_DISP_CHAT_BR_TAB) {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 
+					GTK_POS_RIGHT);
+		} else {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 
+					GTK_POS_LEFT);
+		}
+	} else {
+		if (display_options & OPT_DISP_CHAT_BR_TAB) {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 
+					GTK_POS_BOTTOM);
+		} else {
+			gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 
+					GTK_POS_TOP);
+		}
+	}
+}
--- a/src/gaim.h	Fri Apr 27 00:28:44 2001 +0000
+++ b/src/gaim.h	Fri Apr 27 00:33:38 2001 +0000
@@ -487,6 +487,10 @@
 #define OPT_DISP_IGNORE_SIZES     0x00800000
 #define OPT_DISP_ONE_WINDOW       0x01000000
 #define OPT_DISP_ONE_CHAT_WINDOW  0x02000000
+#define OPT_DISP_CONV_SIDE_TAB    0x04000000
+#define OPT_DISP_CONV_BR_TAB      0x08000000
+#define OPT_DISP_CHAT_SIDE_TAB    0x10000000
+#define OPT_DISP_CHAT_BR_TAB      0x20000000
 
 extern int sound_options;
 #define OPT_SOUND_LOGIN          0x00000001
@@ -552,6 +556,8 @@
 extern void do_quit();
 extern void update_chat_button_pix();
 extern void update_im_button_pix();
+extern void update_chat_tabs();
+extern void update_im_tabs();
 extern void update_idle_times();
 
 /* Functions in html.c */
--- a/src/prefs.c	Fri Apr 27 00:28:44 2001 +0000
+++ b/src/prefs.c	Fri Apr 27 00:33:38 2001 +0000
@@ -459,6 +459,8 @@
 		update_chat_button_pix();
 	else
 		update_im_button_pix();
+
+	save_prefs();
 }
 
 /* i like everclear */
@@ -512,6 +514,52 @@
 	return opt;
 }
 
+static void set_tab_opt(GtkWidget *w, int data)
+{
+	int mask;
+	if (data & 0x1)		/* set the first bit if we're affecting chat buttons */
+		mask = (OPT_DISP_CHAT_SIDE_TAB | OPT_DISP_CHAT_BR_TAB);
+	else
+		mask = (OPT_DISP_CONV_SIDE_TAB | OPT_DISP_CONV_BR_TAB);
+	display_options &= ~(mask);
+	display_options |= (data & mask);
+
+	if (data & 0x1)
+		update_chat_tabs();
+	else
+		update_im_tabs();
+
+	save_prefs();
+}
+
+static GtkWidget *tab_radio(char *label, int which, GtkWidget *box, GtkWidget *set)
+{
+	GtkWidget *opt;
+
+	if (!set)
+		opt = gtk_radio_button_new_with_label(NULL, label);
+	else
+		opt =
+		    gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)),
+						    label);
+	gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0);
+	gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_tab_opt), (void *)which);
+	gtk_widget_show(opt);
+	if (which & 1) {
+		if ((display_options & (OPT_DISP_CHAT_SIDE_TAB | OPT_DISP_CHAT_BR_TAB)) == (which ^ 1))
+			gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
+		if (!(display_options & OPT_DISP_ONE_CHAT_WINDOW))
+			gtk_widget_set_sensitive(opt, FALSE);
+	} else {
+		if ((display_options & (OPT_DISP_CONV_SIDE_TAB | OPT_DISP_CONV_BR_TAB)) == which)
+			gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
+		if (!(display_options & OPT_DISP_ONE_WINDOW))
+			gtk_widget_set_sensitive(opt, FALSE);
+	}
+
+	return opt;
+}
+
 static void im_page()
 {
 	GtkWidget *parent;
@@ -522,6 +570,10 @@
 	GtkWidget *vbox;
 	GtkWidget *opt;
 	GtkWidget *sep;
+	GtkWidget *button;
+	GtkWidget *button2;
+	GtkWidget *hbox2;
+	GtkWidget *vbox2;
 
 	parent = prefdialog->parent;
 	gtk_widget_destroy(prefdialog);
@@ -566,7 +618,7 @@
 	gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5);
 	gtk_widget_show(vbox);
 
-	gaim_button(_("Show all conversations in one tabbed window"), &display_options, OPT_DISP_ONE_WINDOW, vbox);
+	button = gaim_button(_("Show all conversations in one tabbed window"), &display_options, OPT_DISP_ONE_WINDOW, vbox);
 	gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_WINDOWS, vbox);
 	gaim_button(_("Show logins in window"), &display_options, OPT_DISP_SHOW_LOGON, vbox);
 	gaim_button(_("Show larger entry box on new windows"), &display_options, OPT_DISP_CONV_BIG_ENTRY, vbox);
@@ -599,11 +651,83 @@
 	gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5);
 	gtk_widget_show(vbox);
 
-	gaim_button(_("Show all chats in one tabbed window"), &display_options, OPT_DISP_ONE_CHAT_WINDOW, vbox);
+	button2 = gaim_button(_("Show all chats in one tabbed window"), &display_options, OPT_DISP_ONE_CHAT_WINDOW, vbox);
 	gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_CHAT, vbox);
 	gaim_button(_("Show people joining/leaving in window"), &display_options, OPT_DISP_CHAT_LOGON, vbox);
 	gaim_button(_("Show larger entry box on new windows"), &display_options, OPT_DISP_CHAT_BIG_ENTRY, vbox);
 
+	frame = gtk_frame_new(_("Tabbed Window Options"));
+	gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5);
+	gtk_widget_show(frame);
+
+	hbox = gtk_hbox_new(FALSE, 5);
+	gtk_container_add(GTK_CONTAINER(frame), hbox);
+	gtk_widget_show(hbox);
+
+	vbox = gtk_vbox_new(FALSE, 5);
+	gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5);
+	gtk_widget_show(vbox);
+
+	label = gtk_label_new(_("IM Tab Placement:"));
+	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
+	gtk_widget_show(label);
+
+	hbox2 = gtk_hbox_new(TRUE, 5);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox2, TRUE, TRUE, 5);
+	gtk_widget_show(hbox2);
+
+	vbox2 = gtk_vbox_new(TRUE, 5);
+	gtk_box_pack_start(GTK_BOX(hbox2), vbox2, TRUE, TRUE, 5);
+	gtk_widget_show(vbox2);
+
+	opt = tab_radio(_("Top"), 0, vbox2, NULL);
+	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+	opt = tab_radio(_("Bottom"), OPT_DISP_CONV_BR_TAB, vbox2, opt);
+	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+
+	vbox2 = gtk_vbox_new(TRUE, 5);
+	gtk_box_pack_start(GTK_BOX(hbox2), vbox2, TRUE, TRUE, 5);
+	gtk_widget_show(vbox2);
+
+	opt = tab_radio(_("Left"), OPT_DISP_CONV_SIDE_TAB, vbox2, opt);
+	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+	opt = tab_radio(_("Right"), OPT_DISP_CONV_SIDE_TAB | OPT_DISP_CONV_BR_TAB, vbox2, opt);
+	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+
+	sep = gtk_vseparator_new();
+	gtk_box_pack_start(GTK_BOX(hbox), sep, FALSE, FALSE, 5);
+	gtk_widget_show(sep);
+
+	vbox = gtk_vbox_new(FALSE, 5);
+	gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5);
+	gtk_widget_show(vbox);
+
+	label = gtk_label_new(_("Chat Tab Placement:"));
+	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
+	gtk_widget_show(label);
+
+	hbox2 = gtk_hbox_new(TRUE, 5);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox2, TRUE, TRUE, 5);
+	gtk_widget_show(hbox2);
+
+	vbox2 = gtk_vbox_new(TRUE, 5);
+	gtk_box_pack_start(GTK_BOX(hbox2), vbox2, TRUE, TRUE, 5);
+	gtk_widget_show(vbox2);
+
+	opt = tab_radio(_("Top"), 1, vbox2, NULL);
+	gtk_signal_connect(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+	opt = tab_radio(_("Bottom"), OPT_DISP_CHAT_BR_TAB | 1, vbox2, opt);
+	gtk_signal_connect(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+
+	vbox2 = gtk_vbox_new(TRUE, 5);
+	gtk_box_pack_start(GTK_BOX(hbox2), vbox2, TRUE, TRUE, 5);
+	gtk_widget_show(vbox2);
+
+	opt = tab_radio(_("Left"), OPT_DISP_CHAT_SIDE_TAB | 1, vbox2, opt);
+	gtk_signal_connect(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+	opt = tab_radio(_("Right"), OPT_DISP_CHAT_SIDE_TAB | OPT_DISP_CHAT_BR_TAB | 1, vbox2, opt);
+	gtk_signal_connect(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt);
+
 	gtk_widget_show(prefdialog);
 }