Commit ba5c45ef authored by Emmanuel Milou's avatar Emmanuel Milou

Change version of license GPL 2 -> GPL 3

parent 18305aa6
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -196,7 +196,7 @@ sflphone_hang_up() ...@@ -196,7 +196,7 @@ sflphone_hang_up()
sflphone_pick_up() sflphone_pick_up()
{ {
call_t * selectedCall = call_get_selected(); call_t * selectedCall = call_get_selected();
//screen_set_call(selectedCall); //printf("full name: %s\n",g_hash_table_lookup(selectedCall->properties, ACCOUNT_IAX_FULL_NAME));
main_window_callinfo(TRUE, selectedCall); main_window_callinfo(TRUE, selectedCall);
if(selectedCall) if(selectedCall)
{ {
...@@ -204,6 +204,7 @@ sflphone_pick_up() ...@@ -204,6 +204,7 @@ sflphone_pick_up()
{ {
case CALL_STATE_DIALING: case CALL_STATE_DIALING:
sflphone_place_call (selectedCall); sflphone_place_call (selectedCall);
printf("accountID=%s\n",selectedCall->accountID);
break; break;
case CALL_STATE_INCOMING: case CALL_STATE_INCOMING:
dbus_accept (selectedCall); dbus_accept (selectedCall);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -29,12 +29,15 @@ ...@@ -29,12 +29,15 @@
/** Local variables */ /** Local variables */
gboolean dialogOpen = FALSE; gboolean dialogOpen = FALSE;
GtkListStore *account_store; GtkListStore * account_store;
GtkListStore *codec_store; GtkListStore * codec_store;
GtkListStore * rate_store;
GtkWidget * addButton; GtkWidget * addButton;
GtkWidget * editButton; GtkWidget * editButton;
GtkWidget * deleteButton; GtkWidget * deleteButton;
GtkWidget * defaultButton; GtkWidget * defaultButton;
GtkWidget * restoreButton;
GtkWidget * combo_box;
account_t * selectedAccount; account_t * selectedAccount;
...@@ -71,7 +74,7 @@ config_window_fill_account_list () ...@@ -71,7 +74,7 @@ config_window_fill_account_list ()
} }
} }
void
config_window_fill_codec_list() config_window_fill_codec_list()
{ {
if(dialogOpen) if(dialogOpen)
...@@ -92,6 +95,25 @@ config_window_fill_codec_list() ...@@ -92,6 +95,25 @@ config_window_fill_codec_list()
gtk_list_store_set(codec_store, &iter,0,c->name,-1); gtk_list_store_set(codec_store, &iter,0,c->name,-1);
} }
} }
}
gtk_combo_box_set_active(combo_box, 0);
}
void
config_window_fill_rate_list()
{
if(dialogOpen)
{
GtkTreeIter iter;
int i=0;
gchar** ratelist = (gchar**)dbus_get_sample_rate_list();
while(ratelist[i]!=NULL)
{
printf("%s\n", ratelist[i]);
gtk_list_store_append (rate_store, &iter);
gtk_list_store_set(rate_store, &iter,0,ratelist[i],-1);
i++;
}
} }
} }
...@@ -119,7 +141,6 @@ edit_account( GtkWidget *widget, gpointer data ) ...@@ -119,7 +141,6 @@ edit_account( GtkWidget *widget, gpointer data )
} }
} }
/** /**
* Add an account * Add an account
*/ */
...@@ -201,6 +222,34 @@ bold_if_default_account(GtkTreeViewColumn *col, ...@@ -201,6 +222,34 @@ bold_if_default_account(GtkTreeViewColumn *col,
} }
void
default_codecs(GtkWidget* widget, gpointer data)
{
int i=0;
int j=0;
gint * new_order;
gchar ** default_list = (gchar**)dbus_default_codec_list();
while(default_list[i] != NULL)
{printf("%s\n", default_list[i]);
i++;}
i=0;
while(default_list[i] != NULL)
{
if(g_strcasecmp(codec_list_get_nth(0)->name ,default_list[i])==0){
printf("%s %s\n",codec_list_get_nth(0)->name, default_list[i]);
new_order[i]=0;
}
else if(g_strcasecmp(codec_list_get_nth(1)->name ,default_list[i])==0){
printf("%s %s\n",codec_list_get_nth(0)->name, default_list[0]);
new_order[i] = 1;}
else{
printf("%s %s\n",codec_list_get_nth(0)->name, default_list[0]);
new_order[i] = 2;}
printf("new_order[%i]=%i\n", i,j);
i++;
}
gtk_list_store_reorder(codec_store, new_order);
}
GtkWidget * GtkWidget *
create_accounts_tab() create_accounts_tab()
...@@ -321,10 +370,12 @@ create_accounts_tab() ...@@ -321,10 +370,12 @@ create_accounts_tab()
GtkWidget* GtkWidget*
create_audio_tab () create_audio_tab ()
{ {
GtkWidget* ret; GtkWidget * ret;
GtkWidget* label; GtkWidget * label;
GtkWidget* combo_box; GtkWidget * codecBox;
GtkWidget* hbox1; GtkWidget * rate_box;
GtkWidget * image;
GtkWidget * hbox1;
GtkTreeIter iter; GtkTreeIter iter;
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
...@@ -336,12 +387,18 @@ create_audio_tab () ...@@ -336,12 +387,18 @@ create_audio_tab ()
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
gtk_widget_show(label); gtk_widget_show(label);
hbox1 = gtk_label_new("Available Codecs"); codecBox = gtk_hbutton_box_new();
gtk_box_set_spacing(GTK_BOX(codecBox), 10); //GAIM_HIG_BOX_SPACE
gtk_button_box_set_layout(GTK_BUTTON_BOX(codecBox), GTK_BUTTONBOX_SPREAD);
gtk_box_pack_start(GTK_BOX(ret), codecBox, FALSE, FALSE, 0);
gtk_widget_show (codecBox);
hbox1 = gtk_label_new("Codec:");
gtk_misc_set_alignment(GTK_MISC(hbox1), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(hbox1), 0, 0.5);
gtk_box_pack_start(GTK_BOX(ret), hbox1, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(codecBox), hbox1, FALSE, FALSE, 0);
gtk_widget_show(hbox1); gtk_widget_show(hbox1);
codec_store = gtk_list_store_new(1, G_TYPE_STRING); codec_store = gtk_list_store_new(1, G_TYPE_STRING);
...@@ -350,18 +407,53 @@ create_audio_tab () ...@@ -350,18 +407,53 @@ create_audio_tab ()
renderer = gtk_cell_renderer_text_new(); renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), renderer, TRUE); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), renderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), renderer, "text",0,NULL); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), renderer, "text",0,NULL);
gtk_box_pack_start(GTK_BOX(ret), combo_box, FALSE, TRUE,0); gtk_box_pack_start(GTK_BOX(codecBox), combo_box, FALSE, FALSE,0);
g_signal_connect (G_OBJECT (combo_box), "changed", g_signal_connect (G_OBJECT (combo_box), "changed",
G_CALLBACK (select_codec), G_CALLBACK (select_codec),
NULL); NULL);
gtk_widget_show(combo_box); gtk_widget_show(combo_box);
restoreButton = gtk_button_new_from_stock(GTK_STOCK_REFRESH);
gtk_box_pack_start(GTK_BOX(codecBox), restoreButton, FALSE, FALSE,10);
//g_signal_connect(G_OBJECT(restoreButton), "clicked", G_CALLBACK(default_codecs), NULL);
gtk_widget_show(restoreButton);
codecBox = gtk_hbutton_box_new();
gtk_box_set_spacing(GTK_BOX(codecBox), 10); //GAIM_HIG_BOX_SPACE
gtk_button_box_set_layout(GTK_BUTTON_BOX(codecBox), GTK_BUTTONBOX_SPREAD);
gtk_box_pack_start(GTK_BOX(ret), codecBox, FALSE, FALSE, 0);
gtk_widget_show (codecBox);
hbox1 = gtk_label_new("Sample Rate:");
gtk_misc_set_alignment(GTK_MISC(hbox1), 0, 0.5);
gtk_box_pack_start(GTK_BOX(codecBox), hbox1, FALSE, FALSE, 0);
gtk_widget_show(hbox1);
rate_store = gtk_list_store_new(1, G_TYPE_STRING);
rate_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(rate_store));
gtk_label_set_mnemonic_widget(GTK_LABEL(hbox1), rate_box);
renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(rate_box), renderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(rate_box), renderer, "text",0,NULL);
gtk_box_pack_start(GTK_BOX(codecBox), rate_box, FALSE, FALSE,0);
//g_signal_connect (G_OBJECT (combo_box), "changed",
// G_CALLBACK (select_codec),
// NULL);
gtk_widget_show(rate_box);
restoreButton = gtk_button_new_from_stock(GTK_STOCK_REFRESH);
gtk_box_pack_start(GTK_BOX(codecBox), restoreButton, FALSE, FALSE,0);
//g_signal_connect(G_OBJECT(restoreButton), "clicked", G_CALLBACK(default_codecs), NULL);
gtk_widget_show(restoreButton);
gtk_widget_show_all(ret); gtk_widget_show_all(ret);
config_window_fill_codec_list(); config_window_fill_codec_list();
gtk_combo_box_set_active(combo_box, 0); config_window_fill_rate_list();
gtk_combo_box_set_active(rate_box, 0);
return ret; return ret;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
...@@ -37,7 +38,7 @@ create_screen() ...@@ -37,7 +38,7 @@ create_screen()
subvbox = gtk_vbox_new ( FALSE /*homogeneous*/, 10 /*spacing*/); subvbox = gtk_vbox_new ( FALSE /*homogeneous*/, 10 /*spacing*/);
sw = gtk_scrolled_window_new( NULL, NULL); sw = gtk_scrolled_window_new( NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_NEVER); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE);
event = gtk_event_box_new (); event = gtk_event_box_new ();
...@@ -53,7 +54,7 @@ create_screen() ...@@ -53,7 +54,7 @@ create_screen()
gtk_box_pack_start (GTK_BOX (subvbox), sw, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (subvbox), sw, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
screen_clear(); //screen_clear();
return subvbox; return subvbox;
} }
...@@ -67,8 +68,7 @@ screen_clear() ...@@ -67,8 +68,7 @@ screen_clear()
void void
screen_set_call(const call_t * c) screen_set_call(const call_t * c)
{ {
//printf("accountID = %s\ncall to = %s\n", c->accountID, c->to); printf("accountID = %s\ncall to = %s\n", c->from, c->to);
//gchar * markup = g_strconcat("<big><b>", call_get_name(c), "</b></big>\n", call_get_number(c), NULL);
gchar * markup = g_strconcat("<b><i>Calling to:</i></b>", "\t", call_get_number(c), gchar * markup = g_strconcat("<b><i>Calling to:</i></b>", "\t", call_get_number(c),
"\n<b><i>Codec:</i></b>", "\t", codec_list_get_nth(0)->name, NULL); "\n<b><i>Codec:</i></b>", "\t", codec_list_get_nth(0)->name, NULL);
gtk_label_set_markup(GTK_LABEL(label), markup); gtk_label_set_markup(GTK_LABEL(label), markup);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
......