comparison src/dialogs.c @ 4793:677d3cb193a1

[gaim-migrate @ 5113] this removes all the remaining deprecated glib, gdk, gdk-pixbuf, and gtk function calls. Hopefully I didn't break anything. Most of this is due to the deprecation of g_strcasecmp and g_strncasecmp. Two functions I never thought would be deprecated, but apparently they're no good at comparing utf8 text. g_ascii_str{,n}casecmp is OK when you're sure that it's ASCII. Otherwise, we're supposed to use g_utf8_collate(), except that it is case sensitive. Since glib doesn't currently have a case-insensitive one, I wrote one. If you need to compare utf8 text, you can use gaim_utf8_strcasecmp(). I have to go do dishes now. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 16 Mar 2003 00:01:49 +0000
parents 5939d3d13ab3
children f98467b35b95
comparison
equal deleted inserted replaced
4792:9212d1c5b7dc 4793:677d3cb193a1
161 continue; 161 continue;
162 if (d->who == NULL) 162 if (d->who == NULL)
163 continue; 163 continue;
164 if (!who) 164 if (!who)
165 continue; 165 continue;
166 if (!g_strcasecmp(normalize(who), d->who)) 166 if (!gaim_utf8_strcasecmp(normalize(who), d->who))
167 return d; 167 return d;
168 } 168 }
169 return NULL; 169 return NULL;
170 } 170 }
171 171
269 } 269 }
270 } else if (GTK_IS_FONT_SELECTION_DIALOG(w)) { 270 } else if (GTK_IS_FONT_SELECTION_DIALOG(w)) {
271 gtk_toggle_button_set_active( 271 gtk_toggle_button_set_active(
272 GTK_TOGGLE_BUTTON(gtkconv->toolbar.font), FALSE); 272 GTK_TOGGLE_BUTTON(gtkconv->toolbar.font), FALSE);
273 gtkconv->dialogs.font = NULL; 273 gtkconv->dialogs.font = NULL;
274 } else if (!g_strcasecmp(object_data, "smiley dialog")) { 274 } else if (!g_ascii_strcasecmp(object_data, "smiley dialog")) {
275 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkconv->toolbar.smiley), 275 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkconv->toolbar.smiley),
276 FALSE); 276 FALSE);
277 gtkconv->dialogs.smiley = NULL; 277 gtkconv->dialogs.smiley = NULL;
278 } else if (!g_strcasecmp(object_data, "log dialog")) { 278 } else if (!g_ascii_strcasecmp(object_data, "log dialog")) {
279 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtkconv->toolbar.log), 279 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtkconv->toolbar.log),
280 FALSE); 280 FALSE);
281 gtkconv->dialogs.log = NULL; 281 gtkconv->dialogs.log = NULL;
282 } 282 }
283 283
564 char *who; 564 char *who;
565 565
566 if (resp == GTK_RESPONSE_OK) { 566 if (resp == GTK_RESPONSE_OK) {
567 who = g_strdup(normalize(gtk_entry_get_text(GTK_ENTRY(info->entry)))); 567 who = g_strdup(normalize(gtk_entry_get_text(GTK_ENTRY(info->entry))));
568 568
569 if (!g_strcasecmp(who, "")) { 569 if (!g_ascii_strcasecmp(who, "")) {
570 g_free(who); 570 g_free(who);
571 return; 571 return;
572 } 572 }
573 573
574 /* what do we want to do about this case? */ 574 /* what do we want to do about this case? */
1842 1842
1843 orig = gtk_entry_get_text(GTK_ENTRY(b->original)); 1843 orig = gtk_entry_get_text(GTK_ENTRY(b->original));
1844 new1 = gtk_entry_get_text(GTK_ENTRY(b->new1)); 1844 new1 = gtk_entry_get_text(GTK_ENTRY(b->new1));
1845 new2 = gtk_entry_get_text(GTK_ENTRY(b->new2)); 1845 new2 = gtk_entry_get_text(GTK_ENTRY(b->new2));
1846 1846
1847 if (g_strcasecmp(new1, new2)) { 1847 if (g_utf8_collate(new1, new2)) {
1848 do_error_dialog(_("New Passwords Do Not Match"), NULL, GAIM_ERROR); 1848 do_error_dialog(_("New Passwords Do Not Match"), NULL, GAIM_ERROR);
1849 return; 1849 return;
1850 } 1850 }
1851 1851
1852 if ((strlen(orig) < 1) || (strlen(new1) < 1) || (strlen(new2) < 1)) { 1852 if ((strlen(orig) < 1) || (strlen(new1) < 1) || (strlen(new2) < 1)) {
3900 g = g_object_get_data(G_OBJECT(entry), "group"); 3900 g = g_object_get_data(G_OBJECT(entry), "group");
3901 3901
3902 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, g->name)) { 3902 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, g->name)) {
3903 char *prevname; 3903 char *prevname;
3904 3904
3905 if ((orig = gaim_find_group(new_name)) != NULL && g_strcasecmp(new_name, g->name)) { 3905 if ((orig = gaim_find_group(new_name)) != NULL && gaim_utf8_strcasecmp(new_name, g->name)) {
3906 gaim_blist_rename_group(orig, g->name); 3906 gaim_blist_rename_group(orig, g->name);
3907 accts = gaim_group_get_accounts(g); 3907 accts = gaim_group_get_accounts(g);
3908 while(accts) { 3908 while(accts) {
3909 struct gaim_account *account = accts->data; 3909 struct gaim_account *account = accts->data;
3910 serv_rename_group(account->gc, g, new_name); 3910 serv_rename_group(account->gc, g, new_name);
4223 gtk_widget_show(button_box); 4223 gtk_widget_show(button_box);
4224 4224
4225 /* this causes clipping on lots of buttons with long text */ 4225 /* this causes clipping on lots of buttons with long text */
4226 /* gtk_widget_set_size_request(button, 75, 30);*/ 4226 /* gtk_widget_set_size_request(button, 75, 30);*/
4227 gtk_widget_show(button); 4227 gtk_widget_show(button);
4228 gdk_pixmap_unref(pm); 4228 g_object_unref(G_OBJECT(pm));
4229 gdk_bitmap_unref(mask); 4229 g_object_unref(G_OBJECT(mask));
4230 4230
4231 return button; 4231 return button;
4232 } 4232 }
4233 4233
4234 static GtkTooltips *button_tips = NULL; 4234 static GtkTooltips *button_tips = NULL;
4259 pixmap = gtk_image_new_from_pixmap(pm, mask); 4259 pixmap = gtk_image_new_from_pixmap(pm, mask);
4260 gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0); 4260 gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0);
4261 4261
4262 gtk_widget_show(pixmap); 4262 gtk_widget_show(pixmap);
4263 4263
4264 gdk_pixmap_unref(pm); 4264 g_object_unref(G_OBJECT(pm));
4265 gdk_bitmap_unref(mask); 4265 g_object_unref(G_OBJECT(mask));
4266 } 4266 }
4267 4267
4268 if (dispstyle == 2 || dispstyle == 1) { 4268 if (dispstyle == 2 || dispstyle == 1) {
4269 label = gtk_label_new(text); 4269 label = gtk_label_new(text);
4270 gtk_widget_show(label); 4270 gtk_widget_show(label);