Commit 20b7a67f authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files
parents e8321b8b c30f350b
...@@ -11,10 +11,10 @@ Goals for next release (0.8) ...@@ -11,10 +11,10 @@ Goals for next release (0.8)
* Functional IAX transport * Functional IAX transport
* Near perfect audio * Near perfect audio
* Multiple-client (GUI or other) connectivity to server * Multiple-client (GUI or other) connectivity to server
- New Gtk+ GUI with following functionnality (altough the server can do more): - New Gtk+ GUI with following functionality (although the server can do more):
* User can place a call * User can place a call
* User can answer a call * User can answer a call
* User can transfert a call * User can transfer a call
* User can have an unlimited number of calls * User can have an unlimited number of calls
* User can put a call on hold and off hold * User can put a call on hold and off hold
* User is informed of waiting voice mail * User is informed of waiting voice mail
...@@ -29,7 +29,7 @@ Goals for release 0.8.5 ...@@ -29,7 +29,7 @@ Goals for release 0.8.5
- Server side: - Server side:
* Perfect audio * Perfect audio
* Better error handling of failed account registrations * Better error handling of failed account registrations
* Fully working multiple account functionnality * Fully working multiple account functionality
- Gtk+ GUI updates - Gtk+ GUI updates
* User can set up audio parameters * User can set up audio parameters
* User can set up STUN and proxy settings for SIP accounts * User can set up STUN and proxy settings for SIP accounts
...@@ -41,7 +41,7 @@ Goals for release 0.8.5 ...@@ -41,7 +41,7 @@ Goals for release 0.8.5
* User can place a call * User can place a call
* User can answer calls * User can answer calls
* User can send DTMF * User can send DTMF
* User can transfert a call * User can transfer a call
...@@ -55,7 +55,7 @@ Goals for release 0.9 ...@@ -55,7 +55,7 @@ Goals for release 0.9
- Gtk+ GUI updates - Gtk+ GUI updates
* User can receive and send SMS messages * User can receive and send SMS messages
* User is informed of call duration * User is informed of call duration
* User can set up speel call buttons * User can set up speed call buttons
* User can consult/clear call history * User can consult/clear call history
* User can set a status * User can set a status
- Python CLI client - Python CLI client
......
...@@ -67,13 +67,11 @@ codec_list_add(codec_t * c) ...@@ -67,13 +67,11 @@ codec_list_add(codec_t * c)
void void
codec_set_active(gchar* name) codec_set_active(gchar* name)
{ {
printf("entry point set active");
codec_t * c = codec_list_get(name); codec_t * c = codec_list_get(name);
if(c){ if(c){
printf("blablabla"); printf("%s set active/n", c->name);
c->is_active = TRUE; c->is_active = TRUE;
} }
printf("exit point set active");
} }
void void
...@@ -89,17 +87,7 @@ codec_list_get_size() ...@@ -89,17 +87,7 @@ codec_list_get_size()
{ {
return g_queue_get_length(codecQueue); return g_queue_get_length(codecQueue);
} }
/*
codec_t*
codec_list_get( const gchar * name)
{
GList * c = g_queue_find_custom(codecQueue, name, is_name_codecstruct);
if(c)
return (codec_t *)c->data;
else
return NULL;
}
*/
codec_t* codec_t*
codec_list_get( const gchar* name) codec_list_get( const gchar* name)
{ {
...@@ -124,3 +112,34 @@ codec_set_prefered_order(guint index) ...@@ -124,3 +112,34 @@ codec_set_prefered_order(guint index)
g_queue_push_head(codecQueue, prefered); g_queue_push_head(codecQueue, prefered);
} }
void
codec_list_move_codec_up(guint index)
{
if(index != 0)
{
gpointer codec = g_queue_pop_nth(codecQueue, index);
g_queue_push_nth(codecQueue, codec, index-1);
}
// TEMP
int i;
printf("\nCodec list\n");
for(i=0; i < codecQueue->length; i++)
printf("%s\n", codec_list_get_nth(i)->name);
}
void
codec_list_move_codec_down(guint index)
{
if(index != codecQueue->length)
{
gpointer codec = g_queue_pop_nth(codecQueue, index);
g_queue_push_nth(codecQueue, codec, index+1);
}
// TEMP
int i;
printf("\nCodec list\n");
for(i=0; i < codecQueue->length; i++)
printf("%s\n", codec_list_get_nth(i)->name);
}
...@@ -37,8 +37,8 @@ typedef struct { ...@@ -37,8 +37,8 @@ typedef struct {
void codec_list_init(); void codec_list_init();
void codec_list_clear(); void codec_list_clear();
void codec_list_add(codec_t * c); void codec_list_add(codec_t * c);
//void codec_set_active(gchar* name); void codec_set_active(gchar* name);
//void codec_set_inactive(gchar* name); void codec_set_inactive(gchar* name);
guint codec_list_get_size(); guint codec_list_get_size();
codec_t * codec_list_get(const gchar * name); codec_t * codec_list_get(const gchar * name);
//codec_t * codec_list_get(const int payload); //codec_t * codec_list_get(const int payload);
...@@ -52,4 +52,7 @@ void codec_set_prefered_order(guint index); ...@@ -52,4 +52,7 @@ void codec_set_prefered_order(guint index);
//gchar * codec_get_name(codec_t * c); //gchar * codec_get_name(codec_t * c);
//guint codec_get_rate(gchar * codec_name); //guint codec_get_rate(gchar * codec_name);
void codec_list_move_codec_up(guint index);
void codec_list_move_codec_down(guint index);
#endif #endif
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <accountlist.h> #include <accountlist.h>
...@@ -261,30 +261,42 @@ select_codec(GtkTreeSelection *selection, GtkTreeModel *model) ...@@ -261,30 +261,42 @@ select_codec(GtkTreeSelection *selection, GtkTreeModel *model)
* and in configuration files * and in configuration files
*/ */
static void static void
codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer *data) codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer data)
{ {
GtkTreeIter iter; GtkTreeIter iter;
GtkTreePath *treePath; GtkTreePath *treePath;
GtkTreeModel *model; GtkTreeModel *model;
gboolean active; gboolean active;
char* name;
// Get path of clicked codec active toggle box // Get path of clicked codec active toggle box
treePath = gtk_tree_path_new_from_string(path); treePath = gtk_tree_path_new_from_string(path);
printf(path);
model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); model = gtk_tree_view_get_model(GTK_TREE_VIEW(data));
gtk_tree_model_get_iter(model, &iter, treePath); gtk_tree_model_get_iter(model, &iter, treePath);
// Get value at iteration // Get active value and name at iteration
gtk_tree_model_get(model, &iter, gtk_tree_model_get(model, &iter,
COLUMN_CODEC_ACTIVE, &active, COLUMN_CODEC_ACTIVE, &active,
COLUMN_CODEC_NAME, &name,
-1); -1);
printf("%s\n", name);
// Toggle active value // Toggle active value
active = !active;
// Store value
gtk_list_store_set(GTK_LIST_STORE(model), &iter, gtk_list_store_set(GTK_LIST_STORE(model), &iter,
COLUMN_CODEC_ACTIVE, !active, COLUMN_CODEC_ACTIVE, active,
-1); -1);
gtk_tree_path_free(treePath); gtk_tree_path_free(treePath);
// Modify codec queue to represent change
if(active)
codec_set_active(name);
else
codec_set_inactive(name);
// TODO Perpetuate changes to the deamon // TODO Perpetuate changes to the deamon
} }
...@@ -294,7 +306,7 @@ codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer *dat ...@@ -294,7 +306,7 @@ codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer *dat
* update changes in the deamon list and the configuration files * update changes in the deamon list and the configuration files
*/ */
static void static void
moveCodec(gboolean moveUp, gpointer data) codec_move(gboolean moveUp, gpointer data)
{ {
GtkTreeIter iter; GtkTreeIter iter;
GtkTreeIter *iter2; GtkTreeIter *iter2;
...@@ -316,7 +328,9 @@ moveCodec(gboolean moveUp, gpointer data) ...@@ -316,7 +328,9 @@ moveCodec(gboolean moveUp, gpointer data)
// Find path of iteration // Find path of iteration
path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter); path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter);
treePath = gtk_tree_path_new_from_string(path); treePath = gtk_tree_path_new_from_string(path);
gint *indices = gtk_tree_path_get_indices(treePath);
gint indice = indices[0];
// Depending on button direction get new path // Depending on button direction get new path
if(moveUp) if(moveUp)
gtk_tree_path_prev(treePath); gtk_tree_path_prev(treePath);
...@@ -336,33 +350,33 @@ moveCodec(gboolean moveUp, gpointer data) ...@@ -336,33 +350,33 @@ moveCodec(gboolean moveUp, gpointer data)
gtk_tree_iter_free(iter2); gtk_tree_iter_free(iter2);
g_free(path); g_free(path);
// Perpetuate changes in codec queue
if(moveUp)
codec_list_move_codec_up(indice);
else
codec_list_move_codec_down(indice);
// TODO Perpetuate changes to the deamon // TODO Perpetuate changes to the deamon
/* Update the gconf key
codecs_data = gm_codecs_list_to_gm_conf_list (GTK_WIDGET (data));
gm_conf_set_string_list (AUDIO_CODECS_KEY "list", codecs_data);
g_slist_foreach (codecs_data, (GFunc) g_free, NULL);
g_slist_free (codecs_data);
*/
} }
/** /**
* Called from move up codec button signal * Called from move up codec button signal
*/ */
void static void
moveCodecUp(GtkButton *button, gpointer data) codec_move_up(GtkButton *button, gpointer data)
{ {
moveCodec(TRUE, data); // Change tree view ordering and get indice changed
codec_move(TRUE, data);
} }
/** /**
* Called from move down codec button signal * Called from move down codec button signal
*/ */
static void static void
moveCodecDown(GtkButton *button, gpointer data) codec_move_down(GtkButton *button, gpointer data)
{ {
moveCodec(FALSE, data); // Change tree view ordering and get indice changed
codec_move(FALSE, data);
} }
/** /**
...@@ -375,10 +389,9 @@ bold_if_default_account(GtkTreeViewColumn *col, ...@@ -375,10 +389,9 @@ bold_if_default_account(GtkTreeViewColumn *col,
GtkTreeIter *iter, GtkTreeIter *iter,
gpointer data) gpointer data)
{ {
GValue val; GValue val = { 0, };
val.g_type = G_TYPE_POINTER;
gtk_tree_model_get_value(tree_model, iter, 3, &val); gtk_tree_model_get_value(tree_model, iter, 3, &val);
account_t *current = (account_t*) g_value_get_pointer(&val); account_t *current = (account_t*)g_value_get_pointer(&val);
g_value_unset(&val); g_value_unset(&val);
if(g_strcasecmp(current->accountID, account_list_get_default()) == 0) if(g_strcasecmp(current->accountID, account_list_get_default()) == 0)
g_object_set(G_OBJECT(rend), "weight", 800, NULL); g_object_set(G_OBJECT(rend), "weight", 800, NULL);
...@@ -507,12 +520,12 @@ create_codec_table() ...@@ -507,12 +520,12 @@ create_codec_table()
moveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP); moveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP);
gtk_widget_set_sensitive(GTK_WIDGET(moveUpButton), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(moveUpButton), FALSE);
gtk_box_pack_start(GTK_BOX(buttonBox), moveUpButton, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(buttonBox), moveUpButton, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(moveUpButton), "clicked", G_CALLBACK(moveCodecUp), codecTreeView); g_signal_connect(G_OBJECT(moveUpButton), "clicked", G_CALLBACK(codec_move_up), codecTreeView);
moveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN); moveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN);
gtk_widget_set_sensitive(GTK_WIDGET(moveDownButton), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(moveDownButton), FALSE);
gtk_box_pack_start(GTK_BOX(buttonBox), moveDownButton, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(buttonBox), moveDownButton, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(moveDownButton), "clicked", G_CALLBACK(moveCodecDown), codecTreeView); g_signal_connect(G_OBJECT(moveDownButton), "clicked", G_CALLBACK(codec_move_down), codecTreeView);
config_window_fill_codec_list(); config_window_fill_codec_list();
......
...@@ -16,16 +16,28 @@ ...@@ -16,16 +16,28 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef __CONFIGWINDOW_H__ #ifndef __CONFIGWINDOW_H__
#define __CONFIGWINDOW_H__ #define __CONFIGWINDOW_H__
#include <calllist.h> #include <calllist.h>
/** @file configwindow.h /**
* @brief The Preferences window. * @file configwindow.h
*/ * @brief The Preferences window.
void show_config_window ( ); */
void config_window_fill_account_list ( ); void config_window_fill_account_list();
void config_window_fill_codec_list();
void show_config_window();
void config_window_fill_audio_manager_list();
void config_window_fill_output_audio_device_list();
void config_window_fill_input_audio_device_list();
void default_account(GtkWidget *widget, gpointer data);
void bold_if_default_account(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data);
void default_codecs(GtkWidget* widget, gpointer data);
GtkWidget * create_codec_table();
GtkWidget * create_accounts_tab();
GtkWidget * create_audio_tab();
void show_config_window();
#endif #endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment