forked from mirrors/linphone-iphone
refactor sipsetup.
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@493 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
b645009425
commit
ea233cb9af
4 changed files with 23 additions and 4 deletions
|
|
@ -653,6 +653,7 @@ LinphoneAccountCreator *linphone_account_creator_new(struct _LinphoneCore *core,
|
|||
ssctx=sip_setup_context_new(ss,cfg);
|
||||
obj->lc=core;
|
||||
obj->ssctx=ssctx;
|
||||
set_string(&obj->domain,sip_setup_context_get_domains(ssctx)[0]);
|
||||
cfg->lc=core;
|
||||
return obj;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,6 +166,19 @@ int sip_setup_context_get_buddy_lookup_results(SipSetupContext *ctx, MSList **re
|
|||
return -1;
|
||||
}
|
||||
|
||||
const char * sip_setup_context_get_notice(SipSetupContext *ctx){
|
||||
if (ctx->funcs->get_notice)
|
||||
return ctx->funcs->get_notice(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char ** sip_setup_context_get_domains(SipSetupContext *ctx){
|
||||
if (ctx->funcs->get_domains)
|
||||
return ctx->funcs->get_domains(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void sip_setup_context_free_results(MSList *results){
|
||||
ms_list_for_each(results,(void (*)(void*))&ms_free);
|
||||
ms_list_free(results);
|
||||
|
|
|
|||
|
|
@ -73,8 +73,11 @@ typedef struct _BuddyInfo{
|
|||
struct _SipSetup{
|
||||
char *name;
|
||||
unsigned int capabilities;
|
||||
int initialized;
|
||||
bool_t (*init)(void);
|
||||
void (*exit)(void);
|
||||
void (*init_instance)(SipSetupContext *ctx);
|
||||
void (*uninit_instance)(SipSetupContext *ctx);
|
||||
int (*account_exists)(SipSetupContext *ctx, const char *uri);
|
||||
int (*create_account)(SipSetupContext *ctx, const char *uri, const char *passwd);
|
||||
int (*login_account)(SipSetupContext *ctx, const char *uri, const char *passwd);
|
||||
|
|
@ -84,10 +87,8 @@ struct _SipSetup{
|
|||
int (*lookup_buddy)(SipSetupContext *ctx, const char *key);
|
||||
BuddyLookupStatus (*get_buddy_lookup_status)(SipSetupContext *ctx);
|
||||
int (*get_buddy_lookup_results)(SipSetupContext *ctx, MSList **results);
|
||||
void (*uninit_instance)(SipSetupContext *ctx);
|
||||
void (*exit)(void);
|
||||
char *notice;
|
||||
bool_t initialized;
|
||||
const char * (*get_notice)(SipSetupContext *ctx);
|
||||
const char ** (*get_domains)(SipSetupContext *ctx);
|
||||
};
|
||||
|
||||
typedef struct _SipSetup SipSetup;
|
||||
|
|
@ -114,6 +115,9 @@ int sip_setup_context_get_relay(SipSetupContext *ctx, char *relay, size_t size);
|
|||
int sip_setup_context_lookup_buddy(SipSetupContext *ctx, const char *key);
|
||||
BuddyLookupStatus sip_setup_context_get_buddy_lookup_status(SipSetupContext *ctx);
|
||||
int sip_setup_context_get_buddy_lookup_results(SipSetupContext *ctx, MSList **results /*of BuddyInfo */);
|
||||
const char * sip_setup_context_get_notice(SipSetupContext *ctx);
|
||||
const char ** sip_setup_context_get_domains(SipSetupContext *ctx);
|
||||
|
||||
void sip_setup_context_free_results(MSList *results);
|
||||
void sip_setup_context_free(SipSetupContext *ctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ static GtkWidget *create_intro(){
|
|||
GtkWidget *vbox=gtk_vbox_new(FALSE,2);
|
||||
GtkWidget *label=gtk_label_new(_("Welcome !\nThis assistant will help you to use a SIP account for your calls."));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 2);
|
||||
g_object_set_data(G_OBJECT(vbox),"label",label);
|
||||
gtk_widget_show_all(vbox);
|
||||
return vbox;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue