Example #1
0
void linphone_gtk_create_log_window(void){
	GtkTextBuffer *b;
	log_window=linphone_gtk_create_window("log");
	b=gtk_text_view_get_buffer(GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview")));
	gtk_text_buffer_create_tag(b,"red","foreground","red",NULL);
	gtk_text_buffer_create_tag(b,"orange","foreground","orange",NULL);
}
Example #2
0
GtkWidget * linphone_gtk_show_buddy_lookup_window(SipSetupContext *ctx){
	GtkTreeStore *store;
	GtkCellRenderer *renderer,*pbuf_renderer;
	GtkTreeViewColumn *column;
	GtkTreeSelection *select;
	GtkWidget *w=linphone_gtk_create_window("buddylookup");
	GtkWidget *results=linphone_gtk_get_widget(w,"search_results");
	GtkProgressBar *pb=GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar"));
	
	store = gtk_tree_store_new(LOOKUP_RESULT_NCOL, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF);
	
	/*gtk_tree_view_set_hover_expand(GTK_TREE_VIEW(results),TRUE);*/
	gtk_tree_view_set_model(GTK_TREE_VIEW(results),GTK_TREE_MODEL(store));
	g_object_unref(G_OBJECT(store));

	renderer = gtk_cell_renderer_text_new ();
	column = gtk_tree_view_column_new_with_attributes (_("Firstname, Lastname"),
                                                   renderer,
                                                   "markup", LOOKUP_RESULT_NAME,
                                                   NULL);
	g_object_set (G_OBJECT(column), "resizable", TRUE, NULL);
	

	pbuf_renderer=gtk_cell_renderer_pixbuf_new();
	g_object_set(G_OBJECT(renderer),"is-expander",TRUE,NULL);
	gtk_tree_view_column_pack_start(column,pbuf_renderer,FALSE);
	gtk_tree_view_column_add_attribute  (column,pbuf_renderer,
                                                         "pixbuf",
                                                         LOOKUP_RESULT_ICON);
	gtk_tree_view_append_column (GTK_TREE_VIEW (results), column);
	
/*
	column = gtk_tree_view_column_new_with_attributes (_("SIP address"),
                                                   renderer,
                                                   "text", LOOKUP_RESULT_SIP_URI,
                                                   NULL);
	g_object_set (G_OBJECT(column), "resizable", TRUE, NULL);
	gtk_tree_view_append_column (GTK_TREE_VIEW (results), column);
*/

	select = gtk_tree_view_get_selection (GTK_TREE_VIEW (results));
	gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
	g_signal_connect_swapped(G_OBJECT(select),"changed",(GCallback)buddy_selection_changed,w);
/*
#if GTK_CHECK_VERSION(2,12,0)
	gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(results),LOOKUP_RESULT_ADDRESS);
#endif
*/
	g_object_set_data(G_OBJECT(w),"SipSetupContext",ctx);
	g_object_weak_ref(G_OBJECT(w),(GWeakNotify)linphone_gtk_buddy_lookup_window_destroyed,w);
	//g_signal_connect_swapped(G_OBJECT(w),"destroy",(GCallback)linphone_gtk_buddy_lookup_window_destroyed,w);
	gtk_progress_bar_set_fraction(pb,0);
	gtk_progress_bar_set_text(pb,NULL);
	gtk_dialog_add_button(GTK_DIALOG(w),GTK_STOCK_CLOSE,GTK_RESPONSE_CLOSE);
	g_object_set_data(G_OBJECT(w),"last_state",GINT_TO_POINTER(-1));

	gtk_widget_show(w);
	return w;
}
Example #3
0
void linphone_gtk_create_log_window(void){
	GtkTextBuffer *b;
	log_window=linphone_gtk_create_window("log", NULL);
	b=gtk_text_view_get_buffer(GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview")));
	gtk_text_buffer_create_tag(b,"red","foreground","red",NULL);
	gtk_text_buffer_create_tag(b,"orange","foreground","orange",NULL);
	/*prevent the log window from being destroyed*/
	g_signal_connect (G_OBJECT (log_window), "delete-event",
		G_CALLBACK (gtk_widget_hide_on_delete), log_window);
}
Example #4
0
void *linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, const char *purpose, float progress){
	GtkWidget *w;
	switch(ws){
		case LinphoneWaitingStart:
			gdk_threads_enter();
			w=linphone_gtk_create_window("waiting");
			gtk_window_set_transient_for(GTK_WINDOW(w),GTK_WINDOW(linphone_gtk_get_main_window()));
			gtk_window_set_position(GTK_WINDOW(w),GTK_WIN_POS_CENTER_ON_PARENT);
			if (purpose) {
				gtk_progress_bar_set_text(
					GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
					purpose);
			}
			gtk_widget_show(w);
			/*g_message("Creating waiting window");*/
			run_gtk();
			gdk_threads_leave();
			return w;
		break;
		case LinphoneWaitingProgress:
			w=(GtkWidget*)ctx;
			gdk_threads_enter();
			if (progress>=0){
				gtk_progress_bar_set_fraction(
					GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
					progress);
				
				
			}else {
				gtk_progress_bar_pulse(
					GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar"))
				);
			}
			/*g_message("Updating progress");*/
			run_gtk();
			gdk_threads_leave();
			g_usleep(50000);
			return w;
		break;
		case LinphoneWaitingFinished:
			w=(GtkWidget*)ctx;
			gdk_threads_enter();
			gtk_widget_destroy(w);
			run_gtk();
			gdk_threads_leave();
			return NULL;
		break;
	}
	return NULL;
}
Example #5
0
GtkWidget * linphone_gtk_show_call_logs(void){
	GtkWidget *mw=linphone_gtk_get_main_window();
	GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"call_logs");
	if (w==NULL){
		w=linphone_gtk_create_window("call_logs");
		gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(w,"call_back_button")),
		                     create_pixmap (linphone_gtk_get_ui_config("callback_button","status-green.png")));
		fill_renderers(GTK_TREE_VIEW(linphone_gtk_get_widget(w,"logs_view")));
		g_object_set_data(G_OBJECT(mw),"call_logs",w);
		g_signal_connect(G_OBJECT(w),"response",(GCallback)linphone_gtk_call_log_response,NULL);
		gtk_widget_show(w);
		linphone_gtk_call_log_update(w);
	}else gtk_window_present(GTK_WINDOW(w));
	return w;
}
Example #6
0
GtkWidget * linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const char *with){
	GtkWidget *w;
	GtkTextBuffer *b;
	gchar *tmp;
	w=linphone_gtk_create_window("chatroom");
	tmp=g_strdup_printf(_("Chat with %s"),with);
	gtk_window_set_title(GTK_WINDOW(w),tmp);
	g_free(tmp);
	g_object_set_data(G_OBJECT(w),"cr",cr);
	gtk_widget_show(w);
	linphone_chat_room_set_user_data(cr,w);
	b=gtk_text_view_get_buffer(GTK_TEXT_VIEW(linphone_gtk_get_widget(w,"textlog")));
	gtk_text_buffer_create_tag(b,"blue","foreground","blue",NULL);
	gtk_text_buffer_create_tag(b,"green","foreground","green",NULL);
	return w;
}
Example #7
0
GtkWidget * linphone_gtk_show_call_logs(void){
	GtkWidget *mw=linphone_gtk_get_main_window();
	GtkTextBuffer *b;
	GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"call_logs");
	if (w==NULL){
		w=linphone_gtk_create_window("call_logs");
		g_object_set_data(G_OBJECT(mw),"call_logs",w);
		g_signal_connect(G_OBJECT(w),"response",(GCallback)linphone_gtk_call_log_response,NULL);
		gtk_widget_show(w);
		b=gtk_text_view_get_buffer(GTK_TEXT_VIEW(linphone_gtk_get_widget(w,"logtextview")));
		gtk_text_buffer_create_tag(b,"blue","foreground","blue",NULL);
		gtk_text_buffer_create_tag(b,"green","foreground","green",NULL);
		linphone_gtk_call_log_update(w);
	}else gtk_window_present(GTK_WINDOW(w));
	return w;
}
Example #8
0
static void linphone_gtk_show_call_stats(LinphoneCall *call) {
    GtkWidget *w=(GtkWidget*)linphone_call_get_user_pointer(call);
    GtkWidget *call_stats=(GtkWidget*)g_object_get_data(G_OBJECT(w),"call_stats");
    if (call_stats==NULL) {
        guint tid;
        call_stats=linphone_gtk_create_window("call_statistics", NULL);
        g_object_set_data(G_OBJECT(w),"call_stats",call_stats);
        g_object_set_data(G_OBJECT(call_stats),"call",linphone_call_ref(call));
        tid=g_timeout_add(1000,(GSourceFunc)refresh_call_stats,call_stats);
        g_object_set_data(G_OBJECT(call_stats),"tid",GINT_TO_POINTER(tid));
        g_signal_connect_swapped(G_OBJECT(call_stats),"destroy",(GCallback)on_call_stats_destroyed,(gpointer)w);
        show_used_codecs(call_stats,call);
        refresh_call_stats(call_stats);
        gtk_widget_show(call_stats);
    }

}
void linphone_gtk_show_audio_assistant(void){
	GtkWidget *w;
	if(audio_assistant!=NULL)
		return;
	w=audio_assistant=linphone_gtk_create_window("audio_assistant");

	gtk_window_set_resizable (GTK_WINDOW(w), FALSE);
	gtk_window_set_title(GTK_WINDOW(w),_("Audio Assistant"));
	
	GtkWidget *welcome=create_intro();
	GtkWidget *mic_page=create_mic_page();
	GtkWidget *speaker_page=create_speaker_page();
	GtkWidget *play_record_page=create_play_record_page();
	GtkWidget *end_page=create_end_page();

	gtk_assistant_append_page(GTK_ASSISTANT(w),welcome);
	gtk_assistant_set_page_type(GTK_ASSISTANT(w),welcome,GTK_ASSISTANT_PAGE_INTRO);
	gtk_assistant_set_page_title(GTK_ASSISTANT(w),welcome,_("Audio assistant"));
	gtk_assistant_set_page_complete(GTK_ASSISTANT(w),welcome,TRUE);

	gtk_assistant_append_page(GTK_ASSISTANT(w),mic_page);
	gtk_assistant_set_page_type(GTK_ASSISTANT(w),mic_page,GTK_ASSISTANT_PAGE_CONTENT);
	gtk_assistant_set_page_title(GTK_ASSISTANT(w),mic_page,_("Mic Gain calibration"));
	gtk_assistant_set_page_complete(GTK_ASSISTANT(w),mic_page,TRUE);

	gtk_assistant_append_page(GTK_ASSISTANT(w),speaker_page);
	gtk_assistant_set_page_type(GTK_ASSISTANT(w),speaker_page,GTK_ASSISTANT_PAGE_CONTENT);
	gtk_assistant_set_page_complete(GTK_ASSISTANT(w),speaker_page,FALSE);
	gtk_assistant_set_page_title(GTK_ASSISTANT(w),speaker_page,_("Speaker volume calibration"));

	gtk_assistant_append_page(GTK_ASSISTANT(w),play_record_page);
	gtk_assistant_set_page_type(GTK_ASSISTANT(w),play_record_page,GTK_ASSISTANT_PAGE_CONTENT);
	gtk_assistant_set_page_complete(GTK_ASSISTANT(w),play_record_page,TRUE);
	gtk_assistant_set_page_title(GTK_ASSISTANT(w),play_record_page,_("Record and Play"));

	gtk_assistant_append_page(GTK_ASSISTANT(w),end_page);
	gtk_assistant_set_page_type(GTK_ASSISTANT(w),end_page,GTK_ASSISTANT_PAGE_SUMMARY);
	gtk_assistant_set_page_complete(GTK_ASSISTANT(w),end_page,TRUE);
	gtk_assistant_set_page_title(GTK_ASSISTANT(w),end_page,_("Terminating"));

 	g_signal_connect(G_OBJECT(w),"close",(GCallback)linphone_gtk_close_audio_assistant,w);
 	g_signal_connect(G_OBJECT(w),"cancel",(GCallback)linphone_gtk_close_audio_assistant,w);
 	g_signal_connect(G_OBJECT(w),"prepare",(GCallback)prepare,NULL);

	gtk_widget_show(w);
}