comparison finch/gntrequest.c @ 22005:829d054f4f1a

Add a function to get a widget for a request field.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 06 Jan 2008 18:53:47 +0000
parents ae08b1e3ef63
children 6ab421173406
comparison
equal deleted inserted replaced
22004:f9dcdc0e89a5 22005:829d054f4f1a
34 #include <gntline.h> 34 #include <gntline.h>
35 #include <gnttree.h> 35 #include <gnttree.h>
36 36
37 #include "finch.h" 37 #include "finch.h"
38 #include "gntrequest.h" 38 #include "gntrequest.h"
39 #include "debug.h"
39 #include "util.h" 40 #include "util.h"
40 41
41 typedef struct 42 typedef struct
42 { 43 {
43 void *user_data; 44 void *user_data;
822 } 823 }
823 } 824 }
824 } 825 }
825 } 826 }
826 827
828 GntWidget *finch_request_field_get_widget(PurpleRequestField *field)
829 {
830 GntWidget *ret = NULL;
831 switch (purple_request_field_get_type(field)) {
832 case PURPLE_REQUEST_FIELD_BOOLEAN:
833 ret = create_boolean_field(field);
834 break;
835 case PURPLE_REQUEST_FIELD_STRING:
836 ret = create_string_field(field, NULL);
837 break;
838 case PURPLE_REQUEST_FIELD_INTEGER:
839 ret = create_integer_field(field);
840 break;
841 case PURPLE_REQUEST_FIELD_CHOICE:
842 ret = create_choice_field(field);
843 break;
844 case PURPLE_REQUEST_FIELD_LIST:
845 ret = create_list_field(field);
846 break;
847 case PURPLE_REQUEST_FIELD_ACCOUNT:
848 ret = create_account_field(field);
849 break;
850 default:
851 purple_debug_error("GntRequest", "Unimplemented request-field %d\n", purple_request_field_get_type(field));
852 break;
853 }
854 return ret;
855 }
856