pidgin/gtkrequest.c

changeset 39149
c18e9cfa0310
parent 39137
6c89a6333c6f
parent 39146
af0a3b8c0354
child 39243
24db7140b77d
equal deleted inserted replaced
39142:eab8c08a9962 39149:c18e9cfa0310
350 { 350 {
351 GtkWidget *img = NULL; 351 GtkWidget *img = NULL;
352 PurpleRequestIconType icon_type; 352 PurpleRequestIconType icon_type;
353 gconstpointer icon_data; 353 gconstpointer icon_data;
354 gsize icon_size; 354 gsize icon_size;
355 const gchar *icon_stock = PIDGIN_STOCK_DIALOG_QUESTION; 355 const gchar *icon_name = "dialog-question";
356 356
357 /* Dialog icon. */ 357 /* Dialog icon. */
358 icon_data = purple_request_cpar_get_custom_icon(cpar, &icon_size); 358 icon_data = purple_request_cpar_get_custom_icon(cpar, &icon_size);
359 if (icon_data) { 359 if (icon_data) {
360 GdkPixbuf *pixbuf; 360 GdkPixbuf *pixbuf;
395 395
396 icon_type = purple_request_cpar_get_icon(cpar); 396 icon_type = purple_request_cpar_get_icon(cpar);
397 switch (icon_type) 397 switch (icon_type)
398 { 398 {
399 case PURPLE_REQUEST_ICON_DEFAULT: 399 case PURPLE_REQUEST_ICON_DEFAULT:
400 icon_stock = NULL; 400 icon_name = NULL;
401 break; 401 break;
402 case PURPLE_REQUEST_ICON_REQUEST: 402 case PURPLE_REQUEST_ICON_REQUEST:
403 icon_stock = PIDGIN_STOCK_DIALOG_QUESTION; 403 icon_name = "dialog-question";
404 break; 404 break;
405 case PURPLE_REQUEST_ICON_DIALOG: 405 case PURPLE_REQUEST_ICON_DIALOG:
406 case PURPLE_REQUEST_ICON_INFO: 406 case PURPLE_REQUEST_ICON_INFO:
407 case PURPLE_REQUEST_ICON_WAIT: /* TODO: we need another icon */ 407 case PURPLE_REQUEST_ICON_WAIT: /* TODO: we need another icon */
408 icon_stock = PIDGIN_STOCK_DIALOG_INFO; 408 icon_name = "dialog-information";
409 break; 409 break;
410 case PURPLE_REQUEST_ICON_WARNING: 410 case PURPLE_REQUEST_ICON_WARNING:
411 icon_stock = PIDGIN_STOCK_DIALOG_WARNING; 411 icon_name = "dialog-warning";
412 break; 412 break;
413 case PURPLE_REQUEST_ICON_ERROR: 413 case PURPLE_REQUEST_ICON_ERROR:
414 icon_stock = PIDGIN_STOCK_DIALOG_ERROR; 414 icon_name = "dialog-error";
415 break; 415 break;
416 /* intentionally no default value */ 416 /* intentionally no default value */
417 } 417 }
418 418
419 if (icon_stock == NULL) { 419 if (icon_name == NULL) {
420 switch (dialog_type) { 420 switch (dialog_type) {
421 case PURPLE_REQUEST_INPUT: 421 case PURPLE_REQUEST_INPUT:
422 case PURPLE_REQUEST_CHOICE: 422 case PURPLE_REQUEST_CHOICE:
423 case PURPLE_REQUEST_ACTION: 423 case PURPLE_REQUEST_ACTION:
424 case PURPLE_REQUEST_FIELDS: 424 case PURPLE_REQUEST_FIELDS:
425 case PURPLE_REQUEST_FILE: 425 case PURPLE_REQUEST_FILE:
426 case PURPLE_REQUEST_FOLDER: 426 case PURPLE_REQUEST_FOLDER:
427 icon_stock = PIDGIN_STOCK_DIALOG_QUESTION; 427 icon_name = "dialog-question";
428 break; 428 break;
429 case PURPLE_REQUEST_WAIT: 429 case PURPLE_REQUEST_WAIT:
430 icon_stock = PIDGIN_STOCK_DIALOG_INFO; 430 icon_name = "dialog-information";
431 break; 431 break;
432 /* intentionally no default value */ 432 /* intentionally no default value */
433 } 433 }
434 } 434 }
435 435
436 img = gtk_image_new_from_stock(icon_stock, 436 img = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_DIALOG);
437 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
438 437
439 if (img || icon_type == PURPLE_REQUEST_ICON_REQUEST) 438 if (img || icon_type == PURPLE_REQUEST_ICON_REQUEST)
440 return img; 439 return img;
441 440
442 return gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, 441 return gtk_image_new_from_icon_name("dialog-question",
443 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); 442 GTK_ICON_SIZE_DIALOG);
444 } 443 }
445 444
446 static void 445 static void
447 pidgin_request_help_clicked(GtkButton *button, gpointer _unused) 446 pidgin_request_help_clicked(GtkButton *button, gpointer _unused)
448 { 447 {

mercurial