comparison src/util.c @ 5160:91ea5ef2278b

[gaim-migrate @ 5524] 1) Added neat little protocol icons next to the set away message menu when you have more than one account signed on. I basically just copied Nathan's code, so it should be ok. 2) Changed the horizontal rules in the away message menu so they show up for me. This is how horizontal rules are done in other menus, I'm not sure why the away message menu was different. 3) Moved 2 gtkish functions from util.c to gtkutils.c. Earlier I used one of these functions, and then earlier, but not as early, I realized that gtkutils.c existed, so I put 2 and 2 together and realized you were probably flying somewhere. Well then, let's put another shrimp on the barbi'! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 18 Apr 2003 02:28:06 +0000
parents 381da05cb5ed
children 6911a84cbab1
comparison
equal deleted inserted replaced
5159:6b845e0cea87 5160:91ea5ef2278b
43 #include <iconv.h> 43 #include <iconv.h>
44 #endif 44 #endif
45 #include <math.h> 45 #include <math.h>
46 #include "gaim.h" 46 #include "gaim.h"
47 #include "prpl.h" 47 #include "prpl.h"
48 #include "gtklist.h"
49 48
50 #ifndef _WIN32 49 #ifndef _WIN32
51 #include <sys/socket.h> 50 #include <sys/socket.h>
52 #include <arpa/inet.h> 51 #include <arpa/inet.h>
53 #else 52 #else
1109 1108
1110 1109
1111 return NULL; 1110 return NULL;
1112 } 1111 }
1113 1112
1114 GtkWidget *gaim_new_item_from_stock(GtkWidget *menu, const char *str, const char *icon, GtkSignalFunc sf, gpointer data, guint accel_key, guint accel_mods, char *mod)
1115 {
1116 GtkWidget *menuitem;
1117 /*
1118 GtkWidget *hbox;
1119 GtkWidget *label;
1120 */
1121 GtkWidget *image;
1122
1123 if (icon == NULL)
1124 menuitem = gtk_menu_item_new_with_mnemonic(str);
1125 else
1126 menuitem = gtk_image_menu_item_new_with_mnemonic(str);
1127
1128 if (menu)
1129 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
1130
1131 if (sf)
1132 g_signal_connect(GTK_OBJECT(menuitem), "activate", sf, data);
1133
1134 if (icon != NULL) {
1135 image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_MENU);
1136 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
1137 }
1138 /* FIXME: this isn't right
1139 if (mod) {
1140 label = gtk_label_new(mod);
1141 gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 2);
1142 gtk_widget_show(label);
1143 }
1144 */
1145 /*
1146 if (accel_key) {
1147 gtk_widget_add_accelerator(menuitem, "activate", accel, accel_key,
1148 accel_mods, GTK_ACCEL_LOCKED);
1149 }
1150 */
1151
1152 gtk_widget_show_all(menuitem);
1153
1154 return menuitem;
1155 }
1156
1157 GtkWidget *gaim_new_item(GtkWidget *menu, const char *str)
1158 {
1159 GtkWidget *menuitem;
1160 GtkWidget *label;
1161
1162 menuitem = gtk_menu_item_new();
1163 if (menu)
1164 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
1165 gtk_widget_show(menuitem);
1166
1167 label = gtk_label_new(str);
1168 gtk_label_set_pattern(GTK_LABEL(label), "_");
1169 gtk_container_add(GTK_CONTAINER(menuitem), label);
1170 gtk_widget_show(label);
1171 /* FIXME: Go back and fix this
1172 gtk_widget_add_accelerator(menuitem, "activate", accel, str[0],
1173 GDK_MOD1_MASK, GTK_ACCEL_LOCKED);
1174 */
1175 return menuitem;
1176 }
1177
1178 char *gaim_try_conv_to_utf8(const char *str) 1113 char *gaim_try_conv_to_utf8(const char *str)
1179 { 1114 {
1180 int converted; 1115 int converted;
1181 char *utf8; 1116 char *utf8;
1182 1117