changeset 6009:5cd7a10c6ade

[gaim-migrate @ 6457] Renamed setup_stock() to gaim_gtk_stock_init(), to be more compliant with the rest of the naming schemes. We now initialize it before registering the debug stuff, so the debug window can use our stock icons. Also, added a Pause stock icon, and used it in the debug window. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 04 Jul 2003 00:04:07 +0000
parents 35679a3f2bcc
children 6dad1643e3bf
files pixmaps/Makefile.am pixmaps/pause.png src/gtkdebug.c src/main.c src/stock.c src/stock.h
diffstat 6 files changed, 23 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/pixmaps/Makefile.am	Thu Jul 03 23:40:10 2003 +0000
+++ b/pixmaps/Makefile.am	Fri Jul 04 00:04:07 2003 +0000
@@ -23,6 +23,7 @@
 		msgunread.png			\
 		offline.png			\
 		online.png			\
+		pause.png                   \
 		send-im.png			\
 		tb_drag_arrow_down.xpm		\
 		tb_drag_arrow_left.xpm		\
@@ -35,7 +36,7 @@
 		typing.png
 
 gaimbuttonpixdir = $(datadir)/pixmaps/gaim/buttons
-gaimbuttonpix_DATA = about_menu.png accounts.png change-bgcolor-small.png change-fgcolor-small.png edit.png insert-image-small.png insert-link-small.png insert-smiley-small.png text_bigger.png text_normal.png text_smaller.png send-im.png
+gaimbuttonpix_DATA = about_menu.png accounts.png change-bgcolor-small.png change-fgcolor-small.png edit.png insert-image-small.png insert-link-small.png insert-smiley-small.png pause.png text_bigger.png text_normal.png text_smaller.png send-im.png
 
 gaimdialogpixdir = $(datadir)/pixmaps/gaim/dialogs
 gaimdialogpix_DATA = gaim_error.png gaim_info.png gaim_question.png gaim_warning.png gaim_cool.png gaim_auth.png
Binary file pixmaps/pause.png has changed
--- a/src/gtkdebug.c	Thu Jul 03 23:40:10 2003 +0000
+++ b/src/gtkdebug.c	Fri Jul 04 00:04:07 2003 +0000
@@ -27,6 +27,7 @@
 
 #include "gtkdebug.h"
 #include "gtkimhtml.h"
+#include "stock.h"
 
 #include "ui.h"
 
@@ -174,10 +175,8 @@
 		gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1);
 
 		/* Pause */
-		gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
-								   GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
-								   _("Pause"), NULL, NULL,
-								   NULL, G_CALLBACK(pause_cb), win);
+		gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GAIM_STOCK_PAUSE,
+								 NULL, NULL, G_CALLBACK(pause_cb), win, -1);
 
 		/* Timestamps */
 		button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
--- a/src/main.c	Thu Jul 03 23:40:10 2003 +0000
+++ b/src/main.c	Fri Jul 04 00:04:07 2003 +0000
@@ -524,7 +524,6 @@
 	}
 
 	gaim_gtk_blist_setup_sort_methods();
-	setup_stock();
 
 #ifndef _WIN32
 	/* use the nice PNG icon for all the windows */
@@ -837,6 +836,9 @@
 		return 0;
 	}
 
+	/* This has to be done before the debug stuff. */
+	gaim_gtk_stock_init();
+
 	gaim_prefs_init();
 	gaim_gtk_prefs_init();
 
--- a/src/stock.c	Thu Jul 03 23:40:10 2003 +0000
+++ b/src/stock.c	Fri Jul 04 00:04:07 2003 +0000
@@ -63,12 +63,13 @@
 	{ GAIM_STOCK_LINK,            "buttons", "insert-link-small.png"    },
 	{ GAIM_STOCK_LOGO,            "gaim",    "logo.png"                 },
 	{ GAIM_STOCK_MODIFY,          NULL,      GTK_STOCK_PREFERENCES      },
+	{ GAIM_STOCK_PAUSE,           "buttons", "pause.png"                },
 	{ GAIM_STOCK_PRIVACY,         NULL,      GTK_STOCK_PROPERTIES       },
+	{ GAIM_STOCK_OPEN_MAIL,       NULL,      GTK_STOCK_JUMP_TO          },
 	{ GAIM_STOCK_SEND,            "buttons", "send-im.png"              },
 	{ GAIM_STOCK_SIGN_ON,         NULL,      GTK_STOCK_EXECUTE          },
 	{ GAIM_STOCK_SIGN_OFF,        NULL,      GTK_STOCK_CLOSE            },
 	{ GAIM_STOCK_SMILEY,          "buttons", "insert-smiley-small.png"  },
-	{ GAIM_STOCK_OPEN_MAIL,       NULL,      GTK_STOCK_JUMP_TO          },
 	{ GAIM_STOCK_TEXT_BIGGER,     "buttons", "text_bigger.png"          },
 	{ GAIM_STOCK_TEXT_NORMAL,     "buttons", "text_normal.png"          },
 	{ GAIM_STOCK_TEXT_SMALLER,    "buttons", "text_smaller.png"         },
@@ -81,12 +82,15 @@
 const GtkStockItem stock_items[] =
 {
 	{ GAIM_STOCK_MODIFY,    N_("_Modify"),    0, 0, NULL },
-	{ GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }
+	{ GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL },
+	{ GAIM_STOCK_PAUSE,     N_("_Pause"),     0, 0, NULL }
 };
 
 static gint stock_icon_count = sizeof(stock_icons) / sizeof(*stock_icons);
 static gint stock_item_count = sizeof(stock_items) / sizeof(*stock_items);
 
+static gboolean stock_inited = FALSE;
+
 static gchar *
 find_file(const char *dir, const char *base)
 {
@@ -112,12 +116,15 @@
 }
 
 void
-setup_stock()
+gaim_gtk_stock_init(void)
 {
 	GtkIconFactory *icon_factory;
 	int i;
 	GtkWidget *win;
 
+	if (stock_inited)
+		return;
+
 	/* Setup the icon factory. */
 	icon_factory = gtk_icon_factory_new();
 
@@ -165,4 +172,6 @@
 
 	/* Register the stock items. */
 	gtk_stock_add_static(stock_items, stock_item_count);
+
+	stock_inited = TRUE;
 }
--- a/src/stock.h	Thu Jul 03 23:40:10 2003 +0000
+++ b/src/stock.h	Fri Jul 04 00:04:07 2003 +0000
@@ -59,12 +59,13 @@
 #define GAIM_STOCK_LINK            "gaim-link"
 #define GAIM_STOCK_LOGO            "gaim-logo"
 #define GAIM_STOCK_MODIFY          "gaim-modify"
+#define GAIM_STOCK_OPEN_MAIL       "gaim-stock-open-mail"
+#define GAIM_STOCK_PAUSE           "gaim-pause"
 #define GAIM_STOCK_PRIVACY         "gaim-privacy"
 #define GAIM_STOCK_SEND            "gaim-send"
 #define GAIM_STOCK_SIGN_OFF        "gaim-sign-off"
 #define GAIM_STOCK_SIGN_ON         "gaim-sign-on"
 #define GAIM_STOCK_SMILEY          "gaim-smiley"
-#define GAIM_STOCK_OPEN_MAIL       "gaim-stock-open-mail"
 #define GAIM_STOCK_TEXT_BIGGER     "gaim-text-bigger"
 #define GAIM_STOCK_TEXT_NORMAL     "gaim-text-normal"
 #define GAIM_STOCK_TEXT_SMALLER    "gaim-text-smaller"
@@ -82,6 +83,6 @@
 /**
  * Sets up the gaim stock repository.
  */
-void setup_stock(void);
+void gaim_gtk_stock_init(void);
 
 #endif /* _STOCK_H_ */