changeset 15024:36cfa2e714b7

[gaim-migrate @ 17806] Helpful message in the blank buddy list as suggested by Mark. This is definitely filler text right now. I also wrote a 'kiosk mode' page which maybe I'll play with later, but now it's #if 0'ed out committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 22 Nov 2006 08:00:42 +0000
parents dd4160b36f80
children c039c920e11c
files gtk/gtkaccount.c gtk/gtkblist.c gtk/gtkblist.h
diffstat 3 files changed, 101 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkaccount.c	Wed Nov 22 00:43:42 2006 +0000
+++ b/gtk/gtkaccount.c	Wed Nov 22 08:00:42 2006 +0000
@@ -2060,6 +2060,7 @@
 	GtkWidget *treeview;
 	GtkTreeSelection *sel;
 	GtkTargetEntry gte[] = {{"GAIM_ACCOUNT", GTK_TARGET_SAME_APP, 0}};
+	char *pretty;
 
 	frame = gtk_frame_new(NULL);
 	gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
@@ -2073,7 +2074,7 @@
 	/* Create a helpful first-time-use label */
        	label = gtk_label_new(NULL);
 	/* Translators: Please maintain the use of -> or <- to represent the menu heirarchy */
-	gtk_label_set_markup(GTK_LABEL(label), gaim_gtk_make_pretty_arrows(_(
+	pretty = gaim_gtk_make_pretty_arrows(_(
 						 "<span size='larger' weight='bold'>Welcome to Gaim!</span>\n\n"
 						 
 						 "You have no IM accounts configured. To start connecting with Gaim "
@@ -2083,7 +2084,10 @@
 						 
 						 "You can come back to this window to add, edit, or remove "
 						 "accounts from <b>Accounts->Add/Edit</b> in the Buddy "
-						 "List window")));
+						 "List window"));
+	gtk_label_set_markup(GTK_LABEL(label), pretty);
+	g_free(pretty);
+
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
 	gtk_widget_show(label);
 
--- a/gtk/gtkblist.c	Wed Nov 22 00:43:42 2006 +0000
+++ b/gtk/gtkblist.c	Wed Nov 22 08:00:42 2006 +0000
@@ -3730,6 +3730,11 @@
 	if (!gtkblist)
 		return;
 
+	if (gaim_accounts_get_all_active())
+		gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkblist->notebook), 1);
+	else
+		gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkblist->notebook), 0);
+
 	update_menu_bar(gtkblist);
 }
 
@@ -3877,10 +3882,58 @@
 			create_connection_error_buttons, NULL);
 }
 
+
 /******************************************/
 /* End of connection error handling stuff */
 /******************************************/
 
+#if 0
+static GtkWidget *
+kiosk_page()
+{
+	GtkWidget *ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE);
+	GtkWidget *label;
+	GtkWidget *entry;
+	GtkWidget *bbox;
+	GtkWidget *button;
+
+	label = gtk_label_new(NULL);
+	gtk_box_pack_start(GTK_BOX(ret), label, TRUE, TRUE, 0);
+
+	label = gtk_label_new(NULL);
+	gtk_label_set_markup(GTK_LABEL(label), _("<b>Username:</b>"));
+	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
+	entry = gtk_entry_new();
+	gtk_box_pack_start(GTK_BOX(ret), entry, FALSE, FALSE, 0);
+
+	label = gtk_label_new(NULL);
+	gtk_label_set_markup(GTK_LABEL(label), _("<b>Password:</b>"));
+	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
+	entry = gtk_entry_new();
+	gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
+	gtk_box_pack_start(GTK_BOX(ret), entry, FALSE, FALSE, 0);
+
+	label = gtk_label_new(" ");
+	gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
+
+	bbox = gtk_hbutton_box_new();
+	button = gtk_button_new_with_mnemonic(_("_Login"));
+	gtk_box_pack_start(GTK_BOX(ret), bbox, FALSE, FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(bbox), button);
+
+	
+	label = gtk_label_new(NULL);
+	gtk_box_pack_start(GTK_BOX(ret), label, TRUE, TRUE, 0);
+
+	gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER);
+
+	gtk_widget_show_all(ret);
+	return ret;
+}
+#endif
+
 static void gaim_gtk_blist_show(GaimBuddyList *list)
 {
 	void *handle;
@@ -3889,6 +3942,8 @@
 	GtkWidget *menu;
 	GtkWidget *sw;
 	GtkWidget *sep;
+	GtkWidget *label;
+	char *pretty;
 	GtkAccelGroup *accel_group;
 	GtkTreeSelection *selection;
 	GtkTargetEntry dte[] = {{"GAIM_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW},
@@ -3911,9 +3966,9 @@
 	gtk_window_set_title(GTK_WINDOW(gtkblist->window), _("Buddy List"));
 	GTK_WINDOW(gtkblist->window)->allow_shrink = TRUE;
 
-	gtkblist->vbox = gtk_vbox_new(FALSE, 0);
-	gtk_widget_show(gtkblist->vbox);
-	gtk_container_add(GTK_CONTAINER(gtkblist->window), gtkblist->vbox);
+	gtkblist->main_vbox = gtk_vbox_new(FALSE, 0);
+	gtk_widget_show(gtkblist->main_vbox);
+	gtk_container_add(GTK_CONTAINER(gtkblist->window), gtkblist->main_vbox);
 
 	g_signal_connect(G_OBJECT(gtkblist->window), "delete_event", G_CALLBACK(gtk_blist_delete_cb), NULL);
 	g_signal_connect(G_OBJECT(gtkblist->window), "configure_event", G_CALLBACK(gtk_blist_configure_cb), NULL);
@@ -3940,11 +3995,40 @@
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtkblist->menutray);
 	gtk_widget_show(gtkblist->menutray);
 	gtk_widget_show(menu);
-	gtk_box_pack_start(GTK_BOX(gtkblist->vbox), menu, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), menu, FALSE, FALSE, 0);
 
 	accountmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts"));
 
 
+	/****************************** Notebook *************************************/
+	gtkblist->notebook = gtk_notebook_new();
+	gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkblist->notebook), FALSE);
+	gtk_notebook_set_show_border(GTK_NOTEBOOK(gtkblist->notebook), FALSE);
+	gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), gtkblist->notebook, TRUE, TRUE, 0);
+
+#if 0
+	gtk_notebook_append_page(GTK_NOTEBOOK(gtkblist->notebook), kiosk_page(), NULL);
+#endif
+
+	/* Translators: Please maintain the use of -> and <- to refer to menu heirarchy */
+	pretty = gaim_gtk_make_pretty_arrows(_("<span weight='bold' size='larger'>Welcome to Gaim!</span>\n\n"
+					       
+					       "You have no accounts enabled. Enable your IM accounts from the "
+					       "<b>Accounts</b> window at <b>Accounts->Add/Edit</b>. Once you "
+					       "enable accounts, you'll be able to sign on, set your status, "
+					       "and talk to your friends."));
+	label = gtk_label_new(NULL);
+	gtk_widget_set_size_request(label, gaim_prefs_get_int("/gaim/gtk/blist/width") - 12, -1);
+	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+	gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.2);
+	gtk_label_set_markup(GTK_LABEL(label), pretty);
+	g_free(pretty);
+	gtk_notebook_append_page(GTK_NOTEBOOK(gtkblist->notebook),label, NULL);
+	gtkblist->vbox = gtk_vbox_new(FALSE, 0);
+	gtk_notebook_append_page(GTK_NOTEBOOK(gtkblist->notebook), gtkblist->vbox, NULL);
+	gtk_widget_show_all(gtkblist->notebook);
+
+
 	/****************************** GtkTreeView **********************************/
 	sw = gtk_scrolled_window_new(NULL,NULL);
 	gtk_widget_show(sw);
@@ -5518,8 +5602,8 @@
 	gaim_prefs_add_string("/gaim/gtk/blist/sort_type", "alphabetical");
 	gaim_prefs_add_int("/gaim/gtk/blist/x", 0);
 	gaim_prefs_add_int("/gaim/gtk/blist/y", 0);
-	gaim_prefs_add_int("/gaim/gtk/blist/width", 309); /* Golden ratio, baby */
-	gaim_prefs_add_int("/gaim/gtk/blist/height", 500); /* Golden ratio, baby */
+	gaim_prefs_add_int("/gaim/gtk/blist/width", 250); /* Golden ratio, baby */
+	gaim_prefs_add_int("/gaim/gtk/blist/height", 405); /* Golden ratio, baby */
 	gaim_prefs_add_int("/gaim/gtk/blist/tooltip_delay", 500);
 
 	/* Register our signals */
--- a/gtk/gtkblist.h	Wed Nov 22 00:43:42 2006 +0000
+++ b/gtk/gtkblist.h	Wed Nov 22 08:00:42 2006 +0000
@@ -61,8 +61,11 @@
  */
 struct _GaimGtkBuddyList {
 	GtkWidget *window;
-	GtkWidget *vbox;                /**< This is the vbox that everything gets packed into.  Your plugin might
-					   want to pack something in it itself.  Go, plugins! */
+	GtkWidget *notebook;            /**< The notebook that switches between the real buddy list and the helpful 
+					   instructions page */
+	GtkWidget *main_vbox;           /**< This vbox contains the menu and notebook */
+	GtkWidget *vbox;                /**< This is the vbox that everything important gets packed into.  
+					   Your plugin might want to pack something in it itself.  Go, plugins! */
 
 	GtkWidget *treeview;            /**< It's a treeview... d'uh. */
 	GtkTreeStore *treemodel;        /**< This is the treemodel.  */