diff --git a/astylerc b/astylerc index 14177d0fa0ef4086ca0e03957f3f17361d80b493..0170fbdc9431c1f5875bf75231dd88f8c692b06c 100644 --- a/astylerc +++ b/astylerc @@ -5,7 +5,7 @@ # Savoir-faire Linux Inc # http://www.sflphone.org -style=kr # Kernighan & Ritchie style formatting/indenting uses linux bracket +style=k&r # Kernighan & Ritchie style formatting/indenting uses linux bracket indent=spaces=4 # Use spaces instead of tabs for indentation indent-classes # Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented indent-switches # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block diff --git a/sflphone-client-gnome/src/accountlist.c b/sflphone-client-gnome/src/accountlist.c index 7e6d0c86dd75155b6ac960fe254eef704d2a5d02..52109a17b133cf5aca14fba2e14ccf2bd2f7e562 100644 --- a/sflphone-client-gnome/src/accountlist.c +++ b/sflphone-client-gnome/src/accountlist.c @@ -36,357 +36,366 @@ GQueue * accountQueue; /* GCompareFunc to compare a accountID (gchar* and a account_t) */ -gint is_accountID_struct ( gconstpointer a, gconstpointer b) { - - account_t * c = (account_t*)a; - if(strcmp(c->accountID, (gchar*) b) == 0) - { - return 0; - } - else - { - return 1; - } +gint is_accountID_struct (gconstpointer a, gconstpointer b) +{ + + account_t * c = (account_t*) a; + + if (strcmp (c->accountID, (gchar*) b) == 0) { + return 0; + } else { + return 1; + } } /* GCompareFunc to get current call (gchar* and a account_t) */ -gint get_state_struct ( gconstpointer a, gconstpointer b) { - - account_t * c = (account_t*)a; - if( c->state == *((account_state_t*)b)) - { - return 0; - } - else - { - return 1; - } +gint get_state_struct (gconstpointer a, gconstpointer b) +{ + + account_t * c = (account_t*) a; + + if (c->state == * ( (account_state_t*) b)) { + return 0; + } else { + return 1; + } } -void account_list_init () { +void account_list_init () +{ - accountQueue = g_queue_new (); + accountQueue = g_queue_new (); } - void +void account_list_clean () { - g_queue_free (accountQueue); + g_queue_free (accountQueue); } - void +void account_list_add (account_t * c) { - g_queue_push_tail (accountQueue, (gpointer *) c); + g_queue_push_tail (accountQueue, (gpointer *) c); } - void +void account_list_add_at_nth (account_t * c, guint pos) { - g_queue_push_nth (accountQueue, (gpointer *) c, pos); + g_queue_push_nth (accountQueue, (gpointer *) c, pos); } - void +void account_list_remove (const gchar * accountID) { - GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); - if (c) - { - g_queue_remove(accountQueue, c->data); - } + GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); + + if (c) { + g_queue_remove (accountQueue, c->data); + } } - account_t * -account_list_get_by_state (account_state_t state ) +account_t * +account_list_get_by_state (account_state_t state) { - GList * c = g_queue_find_custom (accountQueue, &state, get_state_struct); - if (c) - { - return (account_t *)c->data; - } - else - { - return NULL; - } + GList * c = g_queue_find_custom (accountQueue, &state, get_state_struct); + + if (c) { + return (account_t *) c->data; + } else { + return NULL; + } } - account_t * -account_list_get_by_id(gchar * accountID) +account_t * +account_list_get_by_id (gchar * accountID) { - GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); - if(c) - { - return (account_t *)c->data; - } - else - { - return NULL; - } + GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); + + if (c) { + return (account_t *) c->data; + } else { + return NULL; + } } -guint account_list_get_size (void) { - - return g_queue_get_length (accountQueue); +guint account_list_get_size (void) +{ + + return g_queue_get_length (accountQueue); } -account_t * account_list_get_nth (guint n) { +account_t * account_list_get_nth (guint n) +{ - return g_queue_peek_nth (accountQueue, n); + return g_queue_peek_nth (accountQueue, n); } - account_t* -account_list_get_current( ) +account_t* +account_list_get_current() { - account_t *current; + account_t *current; - // No account registered - if (account_list_get_registered_accounts () == 0) - return NULL; + // No account registered + if (account_list_get_registered_accounts () == 0) + return NULL; - // if we are here, it means that we have at least one registered account in the list - // So we get the first one - current = account_list_get_by_state (ACCOUNT_STATE_REGISTERED); - if (!current) - return NULL; + // if we are here, it means that we have at least one registered account in the list + // So we get the first one + current = account_list_get_by_state (ACCOUNT_STATE_REGISTERED); - return current; + if (!current) + return NULL; + + return current; } void account_list_set_current (account_t *current) { - gpointer acc; - guint pos; - - // 2 steps: - // 1 - retrieve the index of the current account in the Queue - // 2 - then set it as first - pos = account_list_get_position (current); - if (pos > 0) - { - acc = g_queue_pop_nth(accountQueue, pos); - g_queue_push_nth(accountQueue, acc, 0); - } + gpointer acc; + guint pos; + + // 2 steps: + // 1 - retrieve the index of the current account in the Queue + // 2 - then set it as first + pos = account_list_get_position (current); + + if (pos > 0) { + acc = g_queue_pop_nth (accountQueue, pos); + g_queue_push_nth (accountQueue, acc, 0); + } } const gchar * account_state_name (account_state_t s) { - gchar * state; - switch(s) - { - case ACCOUNT_STATE_REGISTERED: - state = _("Registered"); - break; - case ACCOUNT_STATE_UNREGISTERED: - state = _("Not Registered"); - break; - case ACCOUNT_STATE_TRYING: - state = _("Trying..."); - break; - case ACCOUNT_STATE_ERROR: - state = _("Error"); - break; - case ACCOUNT_STATE_ERROR_AUTH: - state = _("Authentication Failed"); - break; - case ACCOUNT_STATE_ERROR_NETWORK: - state = _("Network unreachable"); - break; - case ACCOUNT_STATE_ERROR_HOST: - state = _("Host unreachable"); - break; - case ACCOUNT_STATE_ERROR_CONF_STUN: - state = _("Stun configuration error"); - break; - case ACCOUNT_STATE_ERROR_EXIST_STUN: - state = _("Stun server invalid"); - break; - case IP2IP_PROFILE_STATUS: - state = _("Ready"); - break; - default: - state = _("Invalid"); - break; - } - return state; + gchar * state; + + switch (s) { + case ACCOUNT_STATE_REGISTERED: + state = _ ("Registered"); + break; + case ACCOUNT_STATE_UNREGISTERED: + state = _ ("Not Registered"); + break; + case ACCOUNT_STATE_TRYING: + state = _ ("Trying..."); + break; + case ACCOUNT_STATE_ERROR: + state = _ ("Error"); + break; + case ACCOUNT_STATE_ERROR_AUTH: + state = _ ("Authentication Failed"); + break; + case ACCOUNT_STATE_ERROR_NETWORK: + state = _ ("Network unreachable"); + break; + case ACCOUNT_STATE_ERROR_HOST: + state = _ ("Host unreachable"); + break; + case ACCOUNT_STATE_ERROR_CONF_STUN: + state = _ ("Stun configuration error"); + break; + case ACCOUNT_STATE_ERROR_EXIST_STUN: + state = _ ("Stun server invalid"); + break; + case IP2IP_PROFILE_STATUS: + state = _ ("Ready"); + break; + default: + state = _ ("Invalid"); + break; + } + + return state; } - void -account_list_clear ( ) +void +account_list_clear () { - g_queue_free (accountQueue); - accountQueue = g_queue_new (); + g_queue_free (accountQueue); + accountQueue = g_queue_new (); } - void -account_list_move_up(guint index) +void +account_list_move_up (guint index) { - DEBUG ("index = %i\n", index); + DEBUG ("index = %i\n", index); - if(index != 0) - { - gpointer acc = g_queue_pop_nth(accountQueue, index); - g_queue_push_nth(accountQueue, acc, index-1); - } + if (index != 0) { + gpointer acc = g_queue_pop_nth (accountQueue, index); + g_queue_push_nth (accountQueue, acc, index-1); + } } - void -account_list_move_down(guint index) +void +account_list_move_down (guint index) { - if(index != accountQueue->length) - { - gpointer acc = g_queue_pop_nth(accountQueue, index); - g_queue_push_nth(accountQueue, acc, index+1); - } + if (index != accountQueue->length) { + gpointer acc = g_queue_pop_nth (accountQueue, index); + g_queue_push_nth (accountQueue, acc, index+1); + } } - guint -account_list_get_registered_accounts( void ) +guint +account_list_get_registered_accounts (void) { - guint res = 0; - unsigned int i; - for(i=0;i<account_list_get_size();i++) - { - if( account_list_get_nth( i ) -> state == ( ACCOUNT_STATE_REGISTERED )) - res ++; - } - DEBUG(" %d registered accounts" , res ); - return res; + guint res = 0; + unsigned int i; + + for (i=0; i<account_list_get_size(); i++) { + if (account_list_get_nth (i) -> state == (ACCOUNT_STATE_REGISTERED)) + res ++; + } + + DEBUG (" %d registered accounts" , res); + return res; } -gchar* account_list_get_current_id( void ){ +gchar* account_list_get_current_id (void) +{ + + account_t *current; - account_t *current; + current = account_list_get_current (); - current = account_list_get_current (); - if (current) - return current->accountID; - else - return ""; + if (current) + return current->accountID; + else + return ""; } -int account_list_get_sip_account_number( void ){ +int account_list_get_sip_account_number (void) +{ + + int n; + guint size, i; + account_t *current; + + size = account_list_get_size(); + n = 0; - int n; - guint size, i; - account_t *current; + for (i=0; i<size ; i++) { + current = account_list_get_nth (i); - size = account_list_get_size(); - n = 0; - for( i=0; i<size ;i++ ){ - current = account_list_get_nth( i ); - if( strcmp(g_hash_table_lookup(current->properties, ACCOUNT_TYPE), "SIP" ) == 0 ) - n++; - } + if (strcmp (g_hash_table_lookup (current->properties, ACCOUNT_TYPE), "SIP") == 0) + n++; + } - return n; + return n; } -int account_list_get_iax_account_number( void ){ +int account_list_get_iax_account_number (void) +{ + + int n; + guint size, i; + account_t *current; + + size = account_list_get_size(); + n = 0; - int n; - guint size, i; - account_t *current; + for (i=0; i<size ; i++) { + current = account_list_get_nth (i); - size = account_list_get_size(); - n = 0; - for( i=0; i<size ;i++ ){ - current = account_list_get_nth( i ); - if( strcmp(g_hash_table_lookup(current->properties, ACCOUNT_TYPE), "IAX" ) == 0 ) - n++; - } + if (strcmp (g_hash_table_lookup (current->properties, ACCOUNT_TYPE), "IAX") == 0) + n++; + } - return n; + return n; } -gchar * account_list_get_ordered_list (void) { +gchar * account_list_get_ordered_list (void) +{ + + gchar *order=""; + guint i; + + for (i=0; i < account_list_get_size(); i++) { + account_t * account = NULL; + account = account_list_get_nth (i); - gchar *order=""; - guint i; + if (account != NULL) { + order = g_strconcat (order, account->accountID, "/", NULL); + } + } - for( i=0; i < account_list_get_size(); i++ ) - { - account_t * account = NULL; - account = account_list_get_nth(i); - if (account != NULL) { - order = g_strconcat (order, account->accountID, "/", NULL); - } - } - return order; + return order; } -guint account_list_get_position (account_t *account) +guint account_list_get_position (account_t *account) { - guint size, i; - account_t *tmp; - - size = account_list_get_size (); - for (i=0; i<size; i++) - { - tmp = account_list_get_nth (i); - if (g_strcasecmp (tmp->accountID, account->accountID) == 0) - { - return i; - } - } - // Not found - return -1; + guint size, i; + account_t *tmp; + + size = account_list_get_size (); + + for (i=0; i<size; i++) { + tmp = account_list_get_nth (i); + + if (g_strcasecmp (tmp->accountID, account->accountID) == 0) { + return i; + } + } + + // Not found + return -1; } gboolean current_account_has_mailbox (void) { - account_t *current; + account_t *current; + + // Check if the current account has a voicemail number configured - // Check if the current account has a voicemail number configured + current = account_list_get_current (); - current = account_list_get_current (); - if (current) - { - if (g_strcasecmp (g_hash_table_lookup (current->properties, ACCOUNT_MAILBOX), "") != 0) - return TRUE; - } + if (current) { + if (g_strcasecmp (g_hash_table_lookup (current->properties, ACCOUNT_MAILBOX), "") != 0) + return TRUE; + } - return FALSE; + return FALSE; } void current_account_set_message_number (guint nb) { - account_t *current; + account_t *current; - current = account_list_get_current (); - if (current) - { - current->_messages_number = nb; - } + current = account_list_get_current (); + + if (current) { + current->_messages_number = nb; + } } guint current_account_get_message_number (void) { - account_t *current; - - current = account_list_get_current (); - if (current) - { - return current->_messages_number; - } - else - return 0; + account_t *current; + + current = account_list_get_current (); + + if (current) { + return current->_messages_number; + } else + return 0; } gboolean current_account_has_new_message (void) { - account_t *current; - - current = account_list_get_current (); - if (current) - { - return (current->_messages_number > 0); - } - return FALSE; + account_t *current; + + current = account_list_get_current (); + + if (current) { + return (current->_messages_number > 0); + } + + return FALSE; } diff --git a/sflphone-client-gnome/src/accountlist.h b/sflphone-client-gnome/src/accountlist.h index 1ba201ffa8a4aca27da2210801465211bf24c71a..d1f40bc4186ee9896ab6a5ae4c35fb3227896a40 100644 --- a/sflphone-client-gnome/src/accountlist.h +++ b/sflphone-client-gnome/src/accountlist.h @@ -2,17 +2,17 @@ * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -28,7 +28,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __ACCOUNTLIST_H__ #define __ACCOUNTLIST_H__ @@ -37,170 +37,169 @@ * @brief A list to hold accounts. */ -/** @enum account_state_t +/** @enum account_state_t * This enum have all the states an account can take. */ -typedef enum -{ - /** Invalid state */ - ACCOUNT_STATE_INVALID = 0, - /** The account is registered */ - ACCOUNT_STATE_REGISTERED, - /** The account is not registered */ - ACCOUNT_STATE_UNREGISTERED, - /** The account is trying to register */ - ACCOUNT_STATE_TRYING, - /** Error state. The account is not registered */ - ACCOUNT_STATE_ERROR, - /** An authentification error occured. Wrong password or wrong username. The account is not registered */ - ACCOUNT_STATE_ERROR_AUTH, - /** The network is unreachable. The account is not registered */ - ACCOUNT_STATE_ERROR_NETWORK, - /** Host is unreachable. The account is not registered */ - ACCOUNT_STATE_ERROR_HOST, - /** Stun server configuration error. The account is not registered */ - ACCOUNT_STATE_ERROR_CONF_STUN, - /** Stun server is not existing. The account is not registered */ - ACCOUNT_STATE_ERROR_EXIST_STUN, - /** IP profile status **/ - IP2IP_PROFILE_STATUS +typedef enum { + /** Invalid state */ + ACCOUNT_STATE_INVALID = 0, + /** The account is registered */ + ACCOUNT_STATE_REGISTERED, + /** The account is not registered */ + ACCOUNT_STATE_UNREGISTERED, + /** The account is trying to register */ + ACCOUNT_STATE_TRYING, + /** Error state. The account is not registered */ + ACCOUNT_STATE_ERROR, + /** An authentification error occured. Wrong password or wrong username. The account is not registered */ + ACCOUNT_STATE_ERROR_AUTH, + /** The network is unreachable. The account is not registered */ + ACCOUNT_STATE_ERROR_NETWORK, + /** Host is unreachable. The account is not registered */ + ACCOUNT_STATE_ERROR_HOST, + /** Stun server configuration error. The account is not registered */ + ACCOUNT_STATE_ERROR_CONF_STUN, + /** Stun server is not existing. The account is not registered */ + ACCOUNT_STATE_ERROR_EXIST_STUN, + /** IP profile status **/ + IP2IP_PROFILE_STATUS } account_state_t; /** @struct account_t * @brief Account information. - * This struct holds information about an account. All values are stored in the - * properties GHashTable except the accountID and state. This match how the + * This struct holds information about an account. All values are stored in the + * properties GHashTable except the accountID and state. This match how the * server internally works and the dbus API to save and retrieve the accounts details. - * - * To retrieve the Alias for example, use g_hash_table_lookup(a->properties, ACCOUNT_ALIAS). + * + * To retrieve the Alias for example, use g_hash_table_lookup(a->properties, ACCOUNT_ALIAS). */ typedef struct { - gchar * accountID; - account_state_t state; - gchar * protocol_state_description; - guint protocol_state_code; - GHashTable * properties; - GPtrArray * credential_information; - - /* The codec list */ - GQueue *codecs; - guint _messages_number; + gchar * accountID; + account_state_t state; + gchar * protocol_state_description; + guint protocol_state_code; + GHashTable * properties; + GPtrArray * credential_information; + + /* The codec list */ + GQueue *codecs; + guint _messages_number; } account_t; -/** - * This function initialize the account list. +/** + * This function initialize the account list. */ void account_list_init (); -/** - * This function empty and free the account list. +/** + * This function empty and free the account list. */ void account_list_clean (); -/** - * This function append an account to list. - * @param a The account you want to add +/** + * This function append an account to list. + * @param a The account you want to add */ void account_list_add (account_t * a); -/** - * This function append an account to list at a given position. +/** + * This function append an account to list at a given position. * @param a The account you want to add * @param pos THe position in the list to insert the account */ void account_list_add_at_nth (account_t * a, guint pos); -/** - * This function remove an account from list. +/** + * This function remove an account from list. * @param accountID The accountID of the account you want to remove */ void account_list_remove (const gchar * accountID); -/** - * Return the first account that corresponds to the state +/** + * Return the first account that corresponds to the state * @param state The state - * @return account_t* An account or NULL + * @return account_t* An account or NULL */ -account_t * account_list_get_by_state ( account_state_t state); +account_t * account_list_get_by_state (account_state_t state); /** * @return guint The number of registered accounts in the list */ -guint account_list_get_registered_accounts( ); +guint account_list_get_registered_accounts(); -/** +/** * Return the number of accounts in the list - * @return guint The number of accounts in the list + * @return guint The number of accounts in the list */ -guint account_list_get_size ( ); +guint account_list_get_size (); -/** +/** * Return the account at the nth position in the list * @param n The position of the account you want - * @return An account or NULL + * @return An account or NULL */ -account_t * account_list_get_nth ( guint n ); +account_t * account_list_get_nth (guint n); -/** +/** * Return the current account struct * @return The current account struct */ -account_t * account_list_get_current( ); +account_t * account_list_get_current(); -/** +/** * This function sets an account as the current one * @param current the account you want to set as current */ void account_list_set_current (account_t *current); -/** +/** * This function maps account_state_t enums to a description. * @param s The state - * @return The full text description of the state + * @return The full text description of the state */ -const gchar * account_state_name(account_state_t s); +const gchar * account_state_name (account_state_t s); -/** +/** * This function clear the list */ -void account_list_clear ( ); +void account_list_clear (); -/** +/** * Return the account associated with an ID * @param accountID The ID of the account - * @return An account or NULL + * @return An account or NULL */ -account_t * account_list_get_by_id(gchar * accountID); +account_t * account_list_get_by_id (gchar * accountID); -/** +/** * Move the account from an unit up in the account_list * @param index The current index in the list */ -void account_list_move_up( guint index ); +void account_list_move_up (guint index); -/** +/** * Move the account from an unit down in the account_list * @param index The current index in the list */ -void account_list_move_down( guint index ); +void account_list_move_down (guint index); /** * Return the ID of the current default account * @return gchar* The id */ -gchar* account_list_get_current_id( void ); +gchar* account_list_get_current_id (void); /** * Returns the number of SIP accounts that have been configured */ -int account_list_get_sip_account_number( void ); +int account_list_get_sip_account_number (void); /** * Returns the number of IAX accounts that have been configured */ -int account_list_get_iax_account_number( void ); +int account_list_get_iax_account_number (void); gchar * account_list_get_ordered_list (void); @@ -214,4 +213,4 @@ void current_account_set_message_number (guint nb); gboolean current_account_has_new_message (void); -#endif +#endif diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index e736011ef8216b214dbd05094bf9a6e12e125415..45275b2ce611b98efd679d0c7df374d03c367a01 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -55,12 +55,12 @@ GHashTable * ip2ip_profile=NULL; - void +void sflphone_notify_voice_mail (const gchar* accountID , guint count) { gchar *id; gchar *current_id; - account_t *current; + account_t *current; // We want to notify only the current account; ie the first in the list id = g_strdup (accountID); @@ -69,15 +69,15 @@ sflphone_notify_voice_mail (const gchar* accountID , guint count) if (g_strcasecmp (id, current_id) != 0 || account_list_get_size() == 0) return; - // Set the number of voice messages for the current account - current_account_set_message_number (count); - current = account_list_get_current (); + // Set the number of voice messages for the current account + current_account_set_message_number (count); + current = account_list_get_current (); - // Update the voicemail tool button - update_voicemail_status (); + // Update the voicemail tool button + update_voicemail_status (); - if (current) - notify_voice_mails (count, current); + if (current) + notify_voice_mails (count, current); } /* @@ -86,23 +86,25 @@ sflphone_notify_voice_mail (const gchar* accountID , guint count) * registered account of the account list * Else, check if it an IP call. if not, popup an error message */ - -static gboolean _is_direct_call(callable_obj_t * c) { - if(g_strcasecmp(c->_accountID, EMPTY_ENTRY) == 0) { - if(!g_str_has_prefix (c->_peer_number, "sip:")) { - gchar * new_number = g_strconcat("sip:", c->_peer_number, NULL); - g_free(c->_peer_number); +static gboolean _is_direct_call (callable_obj_t * c) +{ + + if (g_strcasecmp (c->_accountID, EMPTY_ENTRY) == 0) { + if (!g_str_has_prefix (c->_peer_number, "sip:")) { + gchar * new_number = g_strconcat ("sip:", c->_peer_number, NULL); + g_free (c->_peer_number); c->_peer_number = new_number; } + return 1; } - if(g_str_has_prefix (c->_peer_number, "sip:")) { + if (g_str_has_prefix (c->_peer_number, "sip:")) { return 1; } - if(g_str_has_prefix (c->_peer_number, "sips:")) { + if (g_str_has_prefix (c->_peer_number, "sips:")) { return 1; } @@ -110,273 +112,257 @@ static gboolean _is_direct_call(callable_obj_t * c) { } - void +void status_bar_display_account () { gchar* msg; account_t* acc; - statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); + statusbar_pop_message (__MSG_ACCOUNT_DEFAULT); acc = account_list_get_current (); - if(acc){ - status_tray_icon_online(TRUE); - msg = g_markup_printf_escaped("%s %s (%s)" , - _("Using account"), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE)); - } - else - { - status_tray_icon_online(FALSE); - msg = g_markup_printf_escaped(_("No registered accounts")); + + if (acc) { + status_tray_icon_online (TRUE); + msg = g_markup_printf_escaped ("%s %s (%s)" , + _ ("Using account"), + (gchar*) g_hash_table_lookup (acc->properties , ACCOUNT_ALIAS), + (gchar*) g_hash_table_lookup (acc->properties , ACCOUNT_TYPE)); + } else { + status_tray_icon_online (FALSE); + msg = g_markup_printf_escaped (_ ("No registered accounts")); } - statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); - g_free(msg); + + statusbar_push_message (msg , __MSG_ACCOUNT_DEFAULT); + g_free (msg); } - gboolean +gboolean sflphone_quit () { gboolean quit = FALSE; - guint count = calllist_get_size(current_calls); - if(count > 0){ + guint count = calllist_get_size (current_calls); + + if (count > 0) { quit = main_window_ask_quit(); - } - else{ + } else { quit = TRUE; } - if (quit) - { - // Save the history + if (quit) { + // Save the history sflphone_save_history (); - dbus_unregister(getpid()); + dbus_unregister (getpid()); dbus_clean (); //call_list_clean(); TODO //account_list_clean() gtk_main_quit (); } + return quit; } - void -sflphone_hold (callable_obj_t * c ) +void +sflphone_hold (callable_obj_t * c) { c->_state = CALL_STATE_HOLD; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_ringing(callable_obj_t * c ) +void +sflphone_ringing (callable_obj_t * c) { c->_state = CALL_STATE_RINGING; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_hung_up( callable_obj_t * c) +void +sflphone_hung_up (callable_obj_t * c) { - calllist_remove( current_calls, c->_callID); - calltree_remove_call(current_calls, c, NULL); + calllist_remove (current_calls, c->_callID); + calltree_remove_call (current_calls, c, NULL); c->_state = CALL_STATE_DIALING; - call_remove_all_errors(c); + call_remove_all_errors (c); update_actions(); - /* Update the IM interface */ - im_widget_update_state (c->_im_widget, FALSE); + /* Update the IM interface */ + im_widget_update_state (c->_im_widget, FALSE); #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink( FALSE ); + status_tray_icon_blink (FALSE); #endif } -static hashtable_free(gpointer key, gpointer value, gpointer user_data) +static hashtable_free (gpointer key, gpointer value, gpointer user_data) { - g_free(key); - g_free(value); + g_free (key); + g_free (value); } /** Internal to actions: Fill account list */ -void sflphone_fill_account_list (void) { +void sflphone_fill_account_list (void) +{ gchar** array; gchar** accountID; unsigned int i; - int count; - GQueue *codeclist; + int count; + GQueue *codeclist; - DEBUG("SFLphone: Fill account list"); + DEBUG ("SFLphone: Fill account list"); - count = current_account_get_message_number (); + count = current_account_get_message_number (); account_list_clear (); - array = (gchar **)dbus_account_list(); - if(array) - { - for (accountID = array; *accountID; accountID++) - { - account_t * a = g_new0(account_t,1); - a->accountID = g_strdup(*accountID); + array = (gchar **) dbus_account_list(); + + if (array) { + for (accountID = array; *accountID; accountID++) { + account_t * a = g_new0 (account_t,1); + a->accountID = g_strdup (*accountID); a->credential_information = NULL; - // TODO Clean codec list QUEUE - account_list_add(a); + // TODO Clean codec list QUEUE + account_list_add (a); } + g_strfreev (array); } - for( i = 0; i < account_list_get_size(); i++) - { + for (i = 0; i < account_list_get_size(); i++) { account_t * a = account_list_get_nth (i); - GHashTable * details = (GHashTable *) dbus_account_details(a->accountID); - if( details == NULL ) + GHashTable * details = (GHashTable *) dbus_account_details (a->accountID); + + if (details == NULL) break; + a->properties = details; - - /* As this function might be called numberous time, we should free the + + /* As this function might be called numberous time, we should free the * previously allocated space to avoid memory leaks. */ /* Fill the actual array of credentials */ - int number_of_credential = dbus_get_number_of_credential(a->accountID); - if(number_of_credential) { + int number_of_credential = dbus_get_number_of_credential (a->accountID); + + if (number_of_credential) { a->credential_information = g_ptr_array_new(); } else { a->credential_information = NULL; } - + int credential_index; - for(credential_index = 0; credential_index < number_of_credential; credential_index++) { + + for (credential_index = 0; credential_index < number_of_credential; credential_index++) { GHashTable * credential_information = dbus_get_credential (a->accountID, credential_index); - g_ptr_array_add(a->credential_information, credential_information); + g_ptr_array_add (a->credential_information, credential_information); } - gchar * status = g_hash_table_lookup(details, REGISTRATION_STATUS); - if(strcmp(status, "REGISTERED") == 0) - { + gchar * status = g_hash_table_lookup (details, REGISTRATION_STATUS); + + if (strcmp (status, "REGISTERED") == 0) { a->state = ACCOUNT_STATE_REGISTERED; - } - else if(strcmp(status, "UNREGISTERED") == 0) - { + } else if (strcmp (status, "UNREGISTERED") == 0) { a->state = ACCOUNT_STATE_UNREGISTERED; - } - else if(strcmp(status, "TRYING") == 0) - { + } else if (strcmp (status, "TRYING") == 0) { a->state = ACCOUNT_STATE_TRYING; - } - else if(strcmp(status, "ERROR") == 0) - { + } else if (strcmp (status, "ERROR") == 0) { a->state = ACCOUNT_STATE_ERROR; - } - else if(strcmp( status , "ERROR_AUTH") == 0 ) - { + } else if (strcmp (status , "ERROR_AUTH") == 0) { a->state = ACCOUNT_STATE_ERROR_AUTH; - } - else if(strcmp( status , "ERROR_NETWORK") == 0 ) - { + } else if (strcmp (status , "ERROR_NETWORK") == 0) { a->state = ACCOUNT_STATE_ERROR_NETWORK; - } - else if(strcmp( status , "ERROR_HOST") == 0 ) - { + } else if (strcmp (status , "ERROR_HOST") == 0) { a->state = ACCOUNT_STATE_ERROR_HOST; - } - else if(strcmp( status , "ERROR_CONF_STUN") == 0 ) - { + } else if (strcmp (status , "ERROR_CONF_STUN") == 0) { a->state = ACCOUNT_STATE_ERROR_CONF_STUN; - } - else if(strcmp( status , "ERROR_EXIST_STUN") == 0 ) - { + } else if (strcmp (status , "ERROR_EXIST_STUN") == 0) { a->state = ACCOUNT_STATE_ERROR_EXIST_STUN; - } - else if (strcmp (status, "READY") == 0) { - a->state = IP2IP_PROFILE_STATUS; - } - else - { + } else if (strcmp (status, "READY") == 0) { + a->state = IP2IP_PROFILE_STATUS; + } else { a->state = ACCOUNT_STATE_INVALID; } gchar * code = NULL; - code = g_hash_table_lookup(details, REGISTRATION_STATE_CODE); + code = g_hash_table_lookup (details, REGISTRATION_STATE_CODE); + if (code != NULL) { - a->protocol_state_code = atoi(code); + a->protocol_state_code = atoi (code); } - g_free(a->protocol_state_description); - a->protocol_state_description = g_hash_table_lookup(details, REGISTRATION_STATE_DESCRIPTION); + + g_free (a->protocol_state_description); + a->protocol_state_description = g_hash_table_lookup (details, REGISTRATION_STATE_DESCRIPTION); } - // Set the current account message number - current_account_set_message_number (count); + // Set the current account message number + current_account_set_message_number (count); - sflphone_fill_codec_list (); + sflphone_fill_codec_list (); } -gboolean sflphone_init() { +gboolean sflphone_init() +{ - if(!dbus_connect ()){ + if (!dbus_connect ()) { - main_window_error_message(_("Unable to connect to the SFLphone server.\nMake sure the daemon is running.")); + main_window_error_message (_ ("Unable to connect to the SFLphone server.\nMake sure the daemon is running.")); return FALSE; - } - else - { - dbus_register(getpid(), "Gtk+ Client"); + } else { + dbus_register (getpid(), "Gtk+ Client"); - // Init icons factory - init_icon_factory (); + // Init icons factory + init_icon_factory (); - current_calls = calltab_init(FALSE, CURRENT_CALLS); - contacts = calltab_init(TRUE, CONTACTS); - history = calltab_init(TRUE, HISTORY); + current_calls = calltab_init (FALSE, CURRENT_CALLS); + contacts = calltab_init (TRUE, CONTACTS); + history = calltab_init (TRUE, HISTORY); account_list_init (); codec_capabilities_load (); - conferencelist_init (); + conferencelist_init (); // Fetch the configured accounts sflphone_fill_account_list (); - // Fetch the ip2ip profile + // Fetch the ip2ip profile sflphone_fill_ip2ip_profile(); - - // Fetch the conference list - // sflphone_fill_conference_list(); + + // Fetch the conference list + // sflphone_fill_conference_list(); return TRUE; } } -void sflphone_fill_ip2ip_profile(void) +void sflphone_fill_ip2ip_profile (void) { ip2ip_profile = (GHashTable *) dbus_get_ip2_ip_details(); } void sflphone_get_ip2ip_properties (GHashTable **properties) { - *properties = ip2ip_profile; + *properties = ip2ip_profile; } - void +void sflphone_hang_up() { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree); + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); - if(selectedCall) - { - switch(selectedCall->_state) - { + if (selectedCall) { + switch (selectedCall->_state) { case CALL_STATE_DIALING: dbus_hang_up (selectedCall); break; case CALL_STATE_RINGING: dbus_hang_up (selectedCall); - call_remove_all_errors(selectedCall); + call_remove_all_errors (selectedCall); selectedCall->_state = CALL_STATE_DIALING; //selectedCall->_stop = 0; break; @@ -385,37 +371,37 @@ sflphone_hang_up() case CALL_STATE_BUSY: case CALL_STATE_RECORD: dbus_hang_up (selectedCall); - call_remove_all_errors(selectedCall); + call_remove_all_errors (selectedCall); selectedCall->_state = CALL_STATE_DIALING; set_timestamp (&selectedCall->_time_stop); - im_widget_update_state (selectedCall->_im_widget, FALSE); + im_widget_update_state (selectedCall->_im_widget, FALSE); break; case CALL_STATE_FAILURE: dbus_hang_up (selectedCall); - call_remove_all_errors(selectedCall); + call_remove_all_errors (selectedCall); selectedCall->_state = CALL_STATE_DIALING; break; case CALL_STATE_INCOMING: dbus_refuse (selectedCall); - call_remove_all_errors(selectedCall); + call_remove_all_errors (selectedCall); selectedCall->_state = CALL_STATE_DIALING; - DEBUG("from sflphone_hang_up : "); stop_notification(); + DEBUG ("from sflphone_hang_up : "); + stop_notification(); break; case CALL_STATE_TRANSFERT: dbus_hang_up (selectedCall); - call_remove_all_errors(selectedCall); + call_remove_all_errors (selectedCall); set_timestamp (&selectedCall->_time_stop); break; default: - WARN("Should not happen in sflphone_hang_up()!"); + WARN ("Should not happen in sflphone_hang_up()!"); break; } - } - else if(selectedConf) { - dbus_hang_up_conference(selectedConf); + } else if (selectedConf) { + dbus_hang_up_conference (selectedConf); } - calltree_update_call(history, selectedCall, NULL); + calltree_update_call (history, selectedCall, NULL); } @@ -424,30 +410,29 @@ sflphone_conference_hang_up() { conference_obj_t * selectedConf = calltab_get_selected_conf(); - if(selectedConf) - dbus_hang_up_conference(selectedConf); + if (selectedConf) + dbus_hang_up_conference (selectedConf); } - void +void sflphone_pick_up() { - DEBUG("sflphone_pick_up\n"); + DEBUG ("sflphone_pick_up\n"); callable_obj_t * selectedCall = NULL; - selectedCall = calltab_get_selected_call(active_calltree); - - if(selectedCall) - { - switch(selectedCall->_state) - { + selectedCall = calltab_get_selected_call (active_calltree); + + if (selectedCall) { + switch (selectedCall->_state) { case CALL_STATE_DIALING: sflphone_place_call (selectedCall); break; case CALL_STATE_INCOMING: selectedCall->_history_state = INCOMING; - calltree_update_call( history, selectedCall, NULL); + calltree_update_call (history, selectedCall, NULL); dbus_accept (selectedCall); - DEBUG("from sflphone_pick_up : "); stop_notification(); + DEBUG ("from sflphone_pick_up : "); + stop_notification(); break; case CALL_STATE_HOLD: sflphone_new_call(); @@ -464,27 +449,25 @@ sflphone_pick_up() sflphone_new_call(); break; default: - WARN("Should not happen in sflphone_pick_up()!"); + WARN ("Should not happen in sflphone_pick_up()!"); break; } - } - else { + } else { sflphone_new_call(); } } - void +void sflphone_on_hold () { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree); + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); - DEBUG("sflphone_on_hold"); - if(selectedCall) - { - switch(selectedCall->_state) - { + DEBUG ("sflphone_on_hold"); + + if (selectedCall) { + switch (selectedCall->_state) { case CALL_STATE_CURRENT: dbus_hold (selectedCall); break; @@ -493,39 +476,36 @@ sflphone_on_hold () break; default: - WARN("Should not happen in sflphone_on_hold!"); + WARN ("Should not happen in sflphone_on_hold!"); break; } - } - else if (selectedConf) { - dbus_hold_conference(selectedConf); + } else if (selectedConf) { + dbus_hold_conference (selectedConf); } } - void +void sflphone_off_hold () { - DEBUG("sflphone_off_hold"); - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree); + DEBUG ("sflphone_off_hold"); + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); - if(selectedCall) - { - switch(selectedCall->_state) - { + if (selectedCall) { + switch (selectedCall->_state) { case CALL_STATE_HOLD: dbus_unhold (selectedCall); break; default: - WARN("Should not happen in sflphone_off_hold ()!"); + WARN ("Should not happen in sflphone_off_hold ()!"); break; } - } - else if (selectedConf) { + } else if (selectedConf) { + - - dbus_unhold_conference(selectedConf); + dbus_unhold_conference (selectedConf); } + /* if(dbus_get_is_recording(selectedCall)) { @@ -539,143 +519,143 @@ sflphone_off_hold () } - void -sflphone_fail( callable_obj_t * c ) +void +sflphone_fail (callable_obj_t * c) { c->_state = CALL_STATE_FAILURE; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_busy( callable_obj_t * c ) +void +sflphone_busy (callable_obj_t * c) { c->_state = CALL_STATE_BUSY; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_current( callable_obj_t * c ) +void +sflphone_current (callable_obj_t * c) { - if( c->_state != CALL_STATE_HOLD ) + if (c->_state != CALL_STATE_HOLD) set_timestamp (&c->_time_start); + c->_state = CALL_STATE_CURRENT; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_record( callable_obj_t * c ) +void +sflphone_record (callable_obj_t * c) { - if( c->_state != CALL_STATE_HOLD ) + if (c->_state != CALL_STATE_HOLD) set_timestamp (&c->_time_start); + c->_state = CALL_STATE_RECORD; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void +void sflphone_set_transfert() { - callable_obj_t * c = calltab_get_selected_call(current_calls); - if(c) - { + callable_obj_t * c = calltab_get_selected_call (current_calls); + + if (c) { c->_state = CALL_STATE_TRANSFERT; - c->_trsft_to = g_strdup(""); - calltree_update_call(current_calls, c, NULL); + c->_trsft_to = g_strdup (""); + calltree_update_call (current_calls, c, NULL); } + update_actions(); } - void +void sflphone_unset_transfert() { - callable_obj_t * c = calltab_get_selected_call(current_calls); - if(c) - { + callable_obj_t * c = calltab_get_selected_call (current_calls); + + if (c) { c->_state = CALL_STATE_CURRENT; - c->_trsft_to = g_strdup(""); - calltree_update_call(current_calls, c, NULL); + c->_trsft_to = g_strdup (""); + calltree_update_call (current_calls, c, NULL); } + update_actions(); } - void -sflphone_display_transfer_status(const gchar* message) +void +sflphone_display_transfer_status (const gchar* message) { - statusbar_push_message( message , __MSG_ACCOUNT_DEFAULT); + statusbar_push_message (message , __MSG_ACCOUNT_DEFAULT); } - void +void sflphone_incoming_call (callable_obj_t * c) { - gchar *msg = ""; + gchar *msg = ""; c->_history_state = MISSED; - calllist_add ( current_calls, c ); - calllist_add( history, c ); - calltree_add_call( current_calls, c, NULL); + calllist_add (current_calls, c); + calllist_add (history, c); + calltree_add_call (current_calls, c, NULL); update_actions(); calltree_display (current_calls); - - // Change the status bar if we are dealing with a direct SIP call - if(_is_direct_call(c)) { - msg = g_markup_printf_escaped (_("Direct SIP call")); - statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); - statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); - g_free(msg); - } + + // Change the status bar if we are dealing with a direct SIP call + if (_is_direct_call (c)) { + msg = g_markup_printf_escaped (_ ("Direct SIP call")); + statusbar_pop_message (__MSG_ACCOUNT_DEFAULT); + statusbar_push_message (msg , __MSG_ACCOUNT_DEFAULT); + g_free (msg); + } } - void -process_dialing(callable_obj_t * c, guint keyval, gchar * key) +void +process_dialing (callable_obj_t * c, guint keyval, gchar * key) { // We stop the tone - if(strlen(c->_peer_number) == 0 && c->_state != CALL_STATE_TRANSFERT){ - dbus_start_tone( FALSE , 0 ); + if (strlen (c->_peer_number) == 0 && c->_state != CALL_STATE_TRANSFERT) { + dbus_start_tone (FALSE , 0); //dbus_play_dtmf( key ); } - DEBUG("process_dialing : keyval : %i",keyval); - DEBUG("process_dialing : key : %s",key); + DEBUG ("process_dialing : keyval : %i",keyval); + DEBUG ("process_dialing : key : %s",key); - switch (keyval) - { + switch (keyval) { case 65293: /* ENTER */ case 65421: /* ENTER numpad */ - sflphone_place_call(c); + sflphone_place_call (c); break; case 65307: /* ESCAPE */ - sflphone_hang_up(c); + sflphone_hang_up (c); break; case 65288: /* BACKSPACE */ - { /* Brackets mandatory because of local vars */ - gchar * before = c->_peer_number; - if(strlen(c->_peer_number) >= 1){ - - if (c->_state == CALL_STATE_TRANSFERT) - { - // Process backspace if and only if string not NULL - if(strlen(c->_trsft_to) > 0) - c->_trsft_to = g_strndup (c->_trsft_to, strlen(c->_trsft_to) - 1); - } - else - { - c->_peer_number = g_strndup(c->_peer_number, strlen(c->_peer_number) -1); - g_free(before); - DEBUG("TO: backspace %s", c->_peer_number); - } - calltree_update_call(current_calls, c, NULL); - } - else if(strlen(c->_peer_number) == 0) - { - if(c->_state != CALL_STATE_TRANSFERT) - dbus_hang_up(c); + { /* Brackets mandatory because of local vars */ + gchar * before = c->_peer_number; + + if (strlen (c->_peer_number) >= 1) { + + if (c->_state == CALL_STATE_TRANSFERT) { + // Process backspace if and only if string not NULL + if (strlen (c->_trsft_to) > 0) + c->_trsft_to = g_strndup (c->_trsft_to, strlen (c->_trsft_to) - 1); + } else { + c->_peer_number = g_strndup (c->_peer_number, strlen (c->_peer_number) -1); + g_free (before); + DEBUG ("TO: backspace %s", c->_peer_number); } + + calltree_update_call (current_calls, c, NULL); + } else if (strlen (c->_peer_number) == 0) { + if (c->_state != CALL_STATE_TRANSFERT) + dbus_hang_up (c); } - break; + } + break; case 65289: /* TAB */ case 65513: /* ALT */ case 65507: /* CTRL */ @@ -683,33 +663,31 @@ process_dialing(callable_obj_t * c, guint keyval, gchar * key) case 65509: /* CAPS */ break; default: + // if (keyval < 255 || (keyval >65453 && keyval < 65466)) - if (keyval < 127 || (keyval > 65400 && keyval < 65466)) - { + if (keyval < 127 || (keyval > 65400 && keyval < 65466)) { - if (c->_state == CALL_STATE_TRANSFERT) - { - c->_trsft_to = g_strconcat(c->_trsft_to, key, NULL); - } - else - { - dbus_play_dtmf( key ); - c->_peer_number = g_strconcat(c->_peer_number, key, NULL); + if (c->_state == CALL_STATE_TRANSFERT) { + c->_trsft_to = g_strconcat (c->_trsft_to, key, NULL); + } else { + dbus_play_dtmf (key); + c->_peer_number = g_strconcat (c->_peer_number, key, NULL); } - if(c->_state == CALL_STATE_DIALING) - { + if (c->_state == CALL_STATE_DIALING) { //g_free(c->_peer_name); //c->_peer_name = g_strconcat("\"\" <", c->_peer_number, ">", NULL); } - calltree_update_call(current_calls, c, NULL); + + calltree_update_call (current_calls, c, NULL); } + break; } } - callable_obj_t * +callable_obj_t * sflphone_new_call() { @@ -717,18 +695,18 @@ sflphone_new_call() callable_obj_t * current_selected_call; gchar *peer_name, *peer_number; - DEBUG("sflphone_new_call"); + DEBUG ("sflphone_new_call"); - current_selected_call = calltab_get_selected_call(current_calls); + current_selected_call = calltab_get_selected_call (current_calls); - if ((current_selected_call != NULL) && (current_selected_call->_confID == NULL)) - sflphone_on_hold(); + if ( (current_selected_call != NULL) && (current_selected_call->_confID == NULL)) + sflphone_on_hold(); // Play a tone when creating a new call - if( calllist_get_size(current_calls) == 0 ) - dbus_start_tone( TRUE , (current_account_has_new_message () > 0)? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ; + if (calllist_get_size (current_calls) == 0) + dbus_start_tone (TRUE , (current_account_has_new_message () > 0) ? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ; - peer_number = g_strdup(""); + peer_number = g_strdup (""); peer_name = g_strdup (""); create_new_call (CALL, CALL_STATE_DIALING, "", "", peer_name, peer_number, &c); @@ -742,50 +720,47 @@ sflphone_new_call() } - void -sflphone_keypad( guint keyval, gchar * key) +void +sflphone_keypad (guint keyval, gchar * key) { - callable_obj_t * c = calltab_get_selected_call(current_calls); + callable_obj_t * c = calltab_get_selected_call (current_calls); + + if ( (active_calltree != current_calls) || (active_calltree == current_calls && !c)) { + DEBUG ("Not in a call, not dialing, create a new call"); - if((active_calltree != current_calls) || (active_calltree == current_calls && !c)) - { - DEBUG("Not in a call, not dialing, create a new call"); //dbus_play_dtmf(key); - switch (keyval) - { + switch (keyval) { case 65293: /* ENTER */ case 65421: /* ENTER numpad */ case 65307: /* ESCAPE */ break; default: calltree_display (current_calls); - process_dialing(sflphone_new_call(), keyval, key); + process_dialing (sflphone_new_call(), keyval, key); break; } - } - else if(c) - { - DEBUG("Call is non-zero"); - switch(c->_state) - { + } else if (c) { + DEBUG ("Call is non-zero"); + + switch (c->_state) { case CALL_STATE_DIALING: // Currently dialing => edit number - DEBUG("Writing a number"); - process_dialing(c, keyval, key); + DEBUG ("Writing a number"); + process_dialing (c, keyval, key); break; case CALL_STATE_RECORD: case CALL_STATE_CURRENT: - switch (keyval) - { + + switch (keyval) { case 65307: /* ESCAPE */ - dbus_hang_up(c); + dbus_hang_up (c); set_timestamp (&c->_time_stop); - calltree_update_call(history, c, NULL); + calltree_update_call (history, c, NULL); break; default: // To play the dtmf when calling mail box for instance - dbus_play_dtmf(key); - if (keyval < 255 || (keyval >65453 && keyval < 65466)) - { + dbus_play_dtmf (key); + + if (keyval < 255 || (keyval >65453 && keyval < 65466)) { //gchar * temp = g_strconcat(call_get_number(c), key, NULL); //gchar * before = c->from; //c->from = g_strconcat("\"",call_get_name(c) ,"\" <", temp, ">", NULL); @@ -793,341 +768,351 @@ sflphone_keypad( guint keyval, gchar * key) //g_free(temp); //update_callable_obj_tree(current_calls,c); } + break; } + break; case CALL_STATE_INCOMING: - switch (keyval) - { + + switch (keyval) { case 65293: /* ENTER */ case 65421: /* ENTER numpad */ c->_history_state = INCOMING; - calltree_update_call(history, c, NULL); - dbus_accept(c); - DEBUG("from sflphone_keypad ( enter ) : "); stop_notification(); + calltree_update_call (history, c, NULL); + dbus_accept (c); + DEBUG ("from sflphone_keypad ( enter ) : "); + stop_notification(); break; case 65307: /* ESCAPE */ - dbus_refuse(c); - DEBUG("from sflphone_keypad ( escape ) : "); stop_notification(); + dbus_refuse (c); + DEBUG ("from sflphone_keypad ( escape ) : "); + stop_notification(); break; } + break; case CALL_STATE_TRANSFERT: - switch (keyval) - { + + switch (keyval) { case 65293: /* ENTER */ case 65421: /* ENTER numpad */ - dbus_transfert(c); + dbus_transfert (c); set_timestamp (&c->_time_stop); break; case 65307: /* ESCAPE */ - sflphone_unset_transfert(c); + sflphone_unset_transfert (c); break; default: // When a call is on transfert, typing new numbers will add it to c->_peer_number - process_dialing(c, keyval, key); + process_dialing (c, keyval, key); break; } + break; case CALL_STATE_HOLD: - switch (keyval) - { + + switch (keyval) { case 65293: /* ENTER */ case 65421: /* ENTER numpad */ - dbus_unhold(c); + dbus_unhold (c); break; case 65307: /* ESCAPE */ - dbus_hang_up(c); + dbus_hang_up (c); break; default: // When a call is on hold, typing new numbers will create a new call - process_dialing(sflphone_new_call(), keyval, key); + process_dialing (sflphone_new_call(), keyval, key); break; } + break; case CALL_STATE_RINGING: case CALL_STATE_BUSY: case CALL_STATE_FAILURE: + //c->_stop = 0; - switch (keyval) - { + switch (keyval) { case 65307: /* ESCAPE */ - dbus_hang_up(c); + dbus_hang_up (c); //c->_stop = 0; - calltree_update_call(history, c, NULL); + calltree_update_call (history, c, NULL); break; } + break; default: break; } - } - else { + } else { sflphone_new_call(); } } -static int _place_direct_call(const callable_obj_t * c) { +static int _place_direct_call (const callable_obj_t * c) +{ if (c->_state == CALL_STATE_DIALING) { dbus_place_call (c); } else { return -1; } + return 0; } -static int _place_registered_call(callable_obj_t * c) { +static int _place_registered_call (callable_obj_t * c) +{ account_t * current = NULL; - - if(c == NULL) { - DEBUG("callable_obj_t is NULL in _place_registered_call"); + + if (c == NULL) { + DEBUG ("callable_obj_t is NULL in _place_registered_call"); return -1; } - + if (c->_state != CALL_STATE_DIALING) { return -1; } - - if(g_strcasecmp(c->_peer_number, "") == 0) { + + if (g_strcasecmp (c->_peer_number, "") == 0) { return -1; } - - if( account_list_get_size() == 0 ) { + + if (account_list_get_size() == 0) { notify_no_accounts(); - sflphone_fail(c); + sflphone_fail (c); return -1; - } - - if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL ) { + } + + if (account_list_get_by_state (ACCOUNT_STATE_REGISTERED) == NULL) { notify_no_registered_accounts(); - sflphone_fail(c); + sflphone_fail (c); return -1; } - - if(g_strcasecmp(c->_accountID, "") != 0) { - current = account_list_get_by_id(c->_accountID); + + if (g_strcasecmp (c->_accountID, "") != 0) { + current = account_list_get_by_id (c->_accountID); } else { current = account_list_get_current(); } - if(current == NULL) { - DEBUG("Unexpected condition: account_t is NULL in %s at %d for accountID %s", __FILE__, __LINE__, c->_accountID); + if (current == NULL) { + DEBUG ("Unexpected condition: account_t is NULL in %s at %d for accountID %s", __FILE__, __LINE__, c->_accountID); return -1; - } - - if(g_strcasecmp(g_hash_table_lookup( current->properties, "Status"),"REGISTERED")==0) { + } + + if (g_strcasecmp (g_hash_table_lookup (current->properties, "Status"),"REGISTERED") ==0) { /* The call is made with the current account */ c->_accountID = current->accountID; - dbus_place_call(c); + dbus_place_call (c); } else { - /* Place the call with the first registered account - * and switch the current account. - * If we are here, we can be sure that there is at least one. - */ - current = account_list_get_by_state( ACCOUNT_STATE_REGISTERED ); + /* Place the call with the first registered account + * and switch the current account. + * If we are here, we can be sure that there is at least one. + */ + current = account_list_get_by_state (ACCOUNT_STATE_REGISTERED); c->_accountID = current->accountID; - dbus_place_call(c); - notify_current_account( current ); - } + dbus_place_call (c); + notify_current_account (current); + } c->_history_state = OUTGOING; - calllist_add(history, c); + calllist_add (history, c); return 0; } - void -sflphone_place_call ( callable_obj_t * c ) +void +sflphone_place_call (callable_obj_t * c) { - gchar *msg = ""; + gchar *msg = ""; + + DEBUG ("Placing call with %s @ %s and accountid %s", c->_peer_name, c->_peer_number, c->_accountID); - DEBUG("Placing call with %s @ %s and accountid %s", c->_peer_name, c->_peer_number, c->_accountID); - - if(c == NULL) { - DEBUG("Unexpected condition: callable_obj_t is null in %s at %d", __FILE__, __LINE__); + if (c == NULL) { + DEBUG ("Unexpected condition: callable_obj_t is null in %s at %d", __FILE__, __LINE__); return; } - if(_is_direct_call(c)) { - msg = g_markup_printf_escaped (_("Direct SIP call")); - statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); - statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); - g_free(msg); - if(_place_direct_call(c) < 0) { - DEBUG("An error occured while placing direct call in %s at %d", __FILE__, __LINE__); + if (_is_direct_call (c)) { + msg = g_markup_printf_escaped (_ ("Direct SIP call")); + statusbar_pop_message (__MSG_ACCOUNT_DEFAULT); + statusbar_push_message (msg , __MSG_ACCOUNT_DEFAULT); + g_free (msg); + + if (_place_direct_call (c) < 0) { + DEBUG ("An error occured while placing direct call in %s at %d", __FILE__, __LINE__); return; } } else { - if(_place_registered_call(c) < 0) { - DEBUG("An error occured while placing registered call in %s at %d", __FILE__, __LINE__); + if (_place_registered_call (c) < 0) { + DEBUG ("An error occured while placing registered call in %s at %d", __FILE__, __LINE__); return; } } } - void -sflphone_detach_participant(const gchar* callID) +void +sflphone_detach_participant (const gchar* callID) { - DEBUG("Action: Detach participant from conference"); + DEBUG ("Action: Detach participant from conference"); - if(callID == NULL) { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - DEBUG("Action: Detach participant %s", selectedCall->_callID); + if (callID == NULL) { + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + DEBUG ("Action: Detach participant %s", selectedCall->_callID); - if(selectedCall->_confID) { - g_free(selectedCall->_confID); - selectedCall->_confID = NULL; - } + if (selectedCall->_confID) { + g_free (selectedCall->_confID); + selectedCall->_confID = NULL; + } - calltree_remove_call(current_calls, selectedCall, NULL); - calltree_add_call(current_calls, selectedCall, NULL); - dbus_detach_participant(selectedCall->_callID); - } - else { - callable_obj_t * selectedCall = calllist_get(current_calls, callID); - DEBUG("Action: Darticipant %s", callID); - - if(selectedCall->_confID) { - g_free(selectedCall->_confID); - selectedCall->_confID = NULL; - } - - calltree_remove_call(current_calls, selectedCall, NULL); - calltree_add_call(current_calls, selectedCall, NULL); - dbus_detach_participant(callID); + calltree_remove_call (current_calls, selectedCall, NULL); + calltree_add_call (current_calls, selectedCall, NULL); + dbus_detach_participant (selectedCall->_callID); + } else { + callable_obj_t * selectedCall = calllist_get (current_calls, callID); + DEBUG ("Action: Darticipant %s", callID); + + if (selectedCall->_confID) { + g_free (selectedCall->_confID); + selectedCall->_confID = NULL; + } + + calltree_remove_call (current_calls, selectedCall, NULL); + calltree_add_call (current_calls, selectedCall, NULL); + dbus_detach_participant (callID); } - + } - void -sflphone_join_participant(const gchar* sel_callID, const gchar* drag_callID) +void +sflphone_join_participant (const gchar* sel_callID, const gchar* drag_callID) { - DEBUG("sflphone join participants %s and %s", sel_callID, drag_callID); + DEBUG ("sflphone join participants %s and %s", sel_callID, drag_callID); - - dbus_join_participant(sel_callID, drag_callID); + + dbus_join_participant (sel_callID, drag_callID); } - void -sflphone_add_participant(const gchar* callID, const gchar* confID) +void +sflphone_add_participant (const gchar* callID, const gchar* confID) { - DEBUG("sflphone add participant %s to conference %s", callID, confID); + DEBUG ("sflphone add participant %s to conference %s", callID, confID); - dbus_add_participant(callID, confID); + dbus_add_participant (callID, confID); } - void +void sflphone_add_conference() { - DEBUG("sflphone add a conference to tree view"); + DEBUG ("sflphone add a conference to tree view"); // dbus_join_participant(selected_call, dragged_call); } - void -sflphone_join_conference(const gchar* sel_confID, const gchar* drag_confID) +void +sflphone_join_conference (const gchar* sel_confID, const gchar* drag_confID) { - DEBUG("sflphone join two conference"); - dbus_join_conference(sel_confID, drag_confID); + DEBUG ("sflphone join two conference"); + dbus_join_conference (sel_confID, drag_confID); } void -sflphone_add_main_participant(const conference_obj_t * c) +sflphone_add_main_participant (const conference_obj_t * c) { - DEBUG("sflphone add main participant"); - dbus_add_main_participant(c->_confID); + DEBUG ("sflphone add main participant"); + dbus_add_main_participant (c->_confID); } void -sflphone_conference_on_hold(const conference_obj_t * c) +sflphone_conference_on_hold (const conference_obj_t * c) { - DEBUG("sflphone_conference_on_hold"); - dbus_hold_conference(c); + DEBUG ("sflphone_conference_on_hold"); + dbus_hold_conference (c); } void -sflphone_conference_off_hold(const conference_obj_t * c) +sflphone_conference_off_hold (const conference_obj_t * c) { - DEBUG("sflphone_conference_off_hold"); - dbus_unhold_conference(c); + DEBUG ("sflphone_conference_off_hold"); + dbus_unhold_conference (c); } - void +void sflphone_rec_call() { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - conference_obj_t * selectedConf = calltab_get_selected_conf(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf (current_calls); - if(selectedCall) - { - dbus_set_record(selectedCall->_callID); - switch(selectedCall->_state) - { + if (selectedCall) { + dbus_set_record (selectedCall->_callID); + + switch (selectedCall->_state) { case CALL_STATE_CURRENT: - selectedCall->_state = CALL_STATE_RECORD; - break; + selectedCall->_state = CALL_STATE_RECORD; + break; case CALL_STATE_RECORD: - selectedCall->_state = CALL_STATE_CURRENT; - break; + selectedCall->_state = CALL_STATE_CURRENT; + break; default: - WARN("Should not happen in sflphone_off_hold ()!"); - break; - } - } - else if(selectedConf) - { - dbus_set_record(selectedConf->_confID); - switch(selectedConf->_state) - { + WARN ("Should not happen in sflphone_off_hold ()!"); + break; + } + } else if (selectedConf) { + dbus_set_record (selectedConf->_confID); + + switch (selectedConf->_state) { case CONFERENCE_STATE_ACTIVE_ATACHED: - selectedCall->_state = CONFERENCE_STATE_RECORD; - break; + selectedCall->_state = CONFERENCE_STATE_RECORD; + break; case CONFERENCE_STATE_RECORD: - selectedCall->_state = CONFERENCE_STATE_ACTIVE_ATACHED; - break; + selectedCall->_state = CONFERENCE_STATE_ACTIVE_ATACHED; + break; default: - WARN("Should not happen in sflphone_off_hold ()!"); - break; - } + WARN ("Should not happen in sflphone_off_hold ()!"); + break; + } } - calltree_update_call(current_calls, selectedCall, NULL); + + calltree_update_call (current_calls, selectedCall, NULL); update_actions(); // gchar* codname = sflphone_get_current_codec_name(); // DEBUG("sflphone_get_current_codec_name: %s",codname); } -void sflphone_fill_codec_list () { +void sflphone_fill_codec_list () +{ + + guint account_list_size; + guint i; + account_t *current = NULL; + gchar** codecs = NULL; - guint account_list_size; - guint i; - account_t *current = NULL; - gchar** codecs = NULL; + DEBUG ("SFLphone: Fill codec list"); - DEBUG("SFLphone: Fill codec list"); + account_list_size = account_list_get_size (); - account_list_size = account_list_get_size (); + for (i=0; i<account_list_size; i++) { + current = account_list_get_nth (i); - for (i=0; i<account_list_size; i++) - { - current = account_list_get_nth (i); - if (current) { - sflphone_fill_codec_list_per_account (¤t); - } - } + if (current) { + sflphone_fill_codec_list_per_account (¤t); + } + } - /* - if (codec_list_get_size() == 0) { + /* + if (codec_list_get_size() == 0) { - // Error message - ERROR ("No audio codecs found"); + // Error message + ERROR ("No audio codecs found"); dbus_unregister(getpid()); exit(0); }*/ } -void sflphone_fill_codec_list_per_account (account_t **account) { +void sflphone_fill_codec_list_per_account (account_t **account) +{ gchar **order; gchar** details; @@ -1136,77 +1121,74 @@ void sflphone_fill_codec_list_per_account (account_t **account) { GQueue *codeclist; gboolean active = FALSE; - order = (gchar**) dbus_get_active_codec_list ((*account)->accountID); + order = (gchar**) dbus_get_active_codec_list ( (*account)->accountID); codeclist = (*account)->codecs; // First clean the list codec_list_clear (&codeclist); - if(!(*order)) - ERROR("SFLphone: No codec list provided"); + if (! (*order)) + ERROR ("SFLphone: No codec list provided"); + + for (pl=order; *pl; pl++) { + codec_t * cpy = NULL; + + // Each account will have a copy of the system-wide capabilities + codec_create_new_from_caps (codec_list_get_by_payload ( (gconstpointer) (size_t) atoi (*pl), NULL), &cpy); + + if (cpy) { + cpy->is_active = TRUE; + codec_list_add (cpy, &codeclist); + } else + ERROR ("SFLphone: Couldn't find codec"); + } + + // Test here if we just added some active codec. + active = (codeclist->length == 0) ? TRUE : FALSE; + + guint caps_size = codec_list_get_size (), i=0; + + for (i=0; i<caps_size; i++) { + + codec_t * current_cap = capabilities_get_nth (i); + + // Check if this codec has already been enabled for this account + if (codec_list_get_by_payload ( (gconstpointer) (size_t) (current_cap->_payload), codeclist) == NULL) { + // codec_t *cpy; + // codec_create_new_from_caps (current_cap, &cpy); + current_cap->is_active = active; + codec_list_add (current_cap, &codeclist); + } else { + } - for (pl=order; *pl; pl++) - { - codec_t * cpy = NULL; - - // Each account will have a copy of the system-wide capabilities - codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) (size_t)atoi (*pl), NULL), &cpy); - if (cpy) { - cpy->is_active = TRUE; - codec_list_add (cpy, &codeclist); - } - else - ERROR ("SFLphone: Couldn't find codec"); } - // Test here if we just added some active codec. - active = (codeclist->length == 0) ? TRUE : FALSE; - - guint caps_size = codec_list_get_size (), i=0; - - for (i=0; i<caps_size; i++) { - - codec_t * current_cap = capabilities_get_nth (i); - // Check if this codec has already been enabled for this account - if (codec_list_get_by_payload ( (gconstpointer) (size_t)(current_cap->_payload), codeclist) == NULL) { - // codec_t *cpy; - // codec_create_new_from_caps (current_cap, &cpy); - current_cap->is_active = active; - codec_list_add (current_cap, &codeclist); - } - else { - } - - } - - (*account)->codecs = codeclist; - - // call dbus function with array of strings - codec_list_update_to_daemon (*account); - + (*account)->codecs = codeclist; + + // call dbus function with array of strings + codec_list_update_to_daemon (*account); + } void sflphone_fill_call_list (void) { - gchar** calls = (gchar**)dbus_get_call_list(); + gchar** calls = (gchar**) dbus_get_call_list(); gchar** pl; GHashTable *call_details; callable_obj_t *c; gchar *callID; - DEBUG("sflphone_fill_call_list"); + DEBUG ("sflphone_fill_call_list"); - if(calls) - { - for(pl=calls; *calls; calls++) - { - c = g_new0(callable_obj_t, 1); - callID = (gchar*)(*calls); - call_details = dbus_get_call_details(callID); + if (calls) { + for (pl=calls; *calls; calls++) { + c = g_new0 (callable_obj_t, 1); + callID = (gchar*) (*calls); + call_details = dbus_get_call_details (callID); create_new_call_from_details (callID, call_details, &c); - c->_callID = g_strdup(callID); + c->_callID = g_strdup (callID); c->_zrtp_confirmed = FALSE; // Add it to the list DEBUG ("Add call retrieved from server side: %s\n", c->_callID); @@ -1218,7 +1200,7 @@ void sflphone_fill_call_list (void) } -void sflphone_fill_conference_list(void) +void sflphone_fill_conference_list (void) { // TODO Fetch the active conferences at client startup @@ -1228,28 +1210,26 @@ void sflphone_fill_conference_list(void) gchar* conf_id; conference_obj_t* conf; - DEBUG("sflphone_fill_conference_list"); + DEBUG ("sflphone_fill_conference_list"); conferences = dbus_get_conference_list(); - if(conferences) - { - for (pl = conferences; *conferences; conferences++) - { - conf = g_new0(conference_obj_t, 1); - conf_id = (gchar*)(*conferences); - - DEBUG(" fetching conference: %s", conf_id); - - conference_details = (GHashTable*) dbus_get_conference_details(conf_id); - - create_new_conference_from_details (conf_id, conference_details, &conf); - - conf->_confID = g_strdup(conf_id); - - conferencelist_add(conf); - calltree_add_conference (current_calls, conf); - } + if (conferences) { + for (pl = conferences; *conferences; conferences++) { + conf = g_new0 (conference_obj_t, 1); + conf_id = (gchar*) (*conferences); + + DEBUG (" fetching conference: %s", conf_id); + + conference_details = (GHashTable*) dbus_get_conference_details (conf_id); + + create_new_conference_from_details (conf_id, conference_details, &conf); + + conf->_confID = g_strdup (conf_id); + + conferencelist_add (conf); + calltree_add_conference (current_calls, conf); + } } } @@ -1267,49 +1247,50 @@ void sflphone_fill_history (void) DEBUG ("Loading history ..."); entries = dbus_get_history (); + if (entries) { - while(g_hash_table_size (entries)) { + while (g_hash_table_size (entries)) { - is_first = TRUE; + is_first = TRUE; - // find lowest timestamp in map - g_hash_table_iter_init (&iter, entries); - while (g_hash_table_iter_next (&iter, &key, &value)) { + // find lowest timestamp in map + g_hash_table_iter_init (&iter, entries); - timestamp = atoi((gchar*)key); + while (g_hash_table_iter_next (&iter, &key, &value)) { - if(is_first) { + timestamp = atoi ( (gchar*) key); - // first iteration of the loop, init search - min_timestamp = timestamp; - key_to_min = key; + if (is_first) { - is_first = FALSE; - } - else { + // first iteration of the loop, init search + min_timestamp = timestamp; + key_to_min = key; - // if lower, replace - if(timestamp < min_timestamp) { + is_first = FALSE; + } else { - min_timestamp = timestamp; - key_to_min = key; - } - } - } + // if lower, replace + if (timestamp < min_timestamp) { - if(g_hash_table_lookup_extended(entries, key_to_min, &key, &value)) { + min_timestamp = timestamp; + key_to_min = key; + } + } + } + + if (g_hash_table_lookup_extended (entries, key_to_min, &key, &value)) { - // do something with key and value - create_history_entry_from_serialized_form ((gchar*)key, (gchar*)value, &history_entry); - DEBUG("HISTORY ENTRY: %i\n", history_entry->_time_start); - // Add it and update the GUI - calllist_add (history, history_entry); - - // remove entry from map - g_hash_table_remove(entries, key_to_min); - } - } + // do something with key and value + create_history_entry_from_serialized_form ( (gchar*) key, (gchar*) value, &history_entry); + DEBUG ("HISTORY ENTRY: %i\n", history_entry->_time_start); + // Add it and update the GUI + calllist_add (history, history_entry); + + // remove entry from map + g_hash_table_remove (entries, key_to_min); + } + } } } @@ -1324,131 +1305,136 @@ void sflphone_save_history (void) DEBUG ("Saving history ..."); - result = g_hash_table_new(NULL, g_str_equal); + result = g_hash_table_new (NULL, g_str_equal); items = history->callQueue; size = calllist_get_size (history); - for (i=0; i<size; i++) - { + for (i=0; i<size; i++) { current = g_queue_peek_nth (items, i); - if (current) - { + + if (current) { value = serialize_history_entry (current); key = convert_timestamp_to_gchar (current->_time_start); - g_hash_table_replace(result, (gpointer) key, - (gpointer) value); + g_hash_table_replace (result, (gpointer) key, + (gpointer) value); } } dbus_set_history (result); // Decrement the reference count - g_hash_table_unref(result); + g_hash_table_unref (result); } - void -sflphone_srtp_sdes_on(callable_obj_t * c) +void +sflphone_srtp_sdes_on (callable_obj_t * c) { c->_srtp_state = SRTP_STATE_SDES_SUCCESS; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_srtp_sdes_off(callable_obj_t * c) +void +sflphone_srtp_sdes_off (callable_obj_t * c) { c->_srtp_state = SRTP_STATE_UNLOCKED; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_srtp_zrtp_on( callable_obj_t * c) +void +sflphone_srtp_zrtp_on (callable_obj_t * c) { c->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_srtp_zrtp_off( callable_obj_t * c ) +void +sflphone_srtp_zrtp_off (callable_obj_t * c) { c->_srtp_state = SRTP_STATE_UNLOCKED; - calltree_update_call(current_calls, c, NULL); + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_srtp_zrtp_show_sas( callable_obj_t * c, const gchar* sas, const gboolean verified) +void +sflphone_srtp_zrtp_show_sas (callable_obj_t * c, const gchar* sas, const gboolean verified) { - if(c == NULL) { - DEBUG("Panic callable obj is NULL in %s at %d", __FILE__, __LINE__); + if (c == NULL) { + DEBUG ("Panic callable obj is NULL in %s at %d", __FILE__, __LINE__); } - c->_sas = g_strdup(sas); - if(verified == TRUE) { + + c->_sas = g_strdup (sas); + + if (verified == TRUE) { c->_srtp_state = SRTP_STATE_ZRTP_SAS_CONFIRMED; } else { c->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED; } - calltree_update_call(current_calls, c, NULL); + + calltree_update_call (current_calls, c, NULL); update_actions(); } - void -sflphone_srtp_zrtp_not_supported( callable_obj_t * c ) +void +sflphone_srtp_zrtp_not_supported (callable_obj_t * c) { - DEBUG("ZRTP not supported"); - main_window_zrtp_not_supported(c); + DEBUG ("ZRTP not supported"); + main_window_zrtp_not_supported (c); } /* Method on sflphoned */ - void -sflphone_set_confirm_go_clear( callable_obj_t * c ) +void +sflphone_set_confirm_go_clear (callable_obj_t * c) { - dbus_set_confirm_go_clear(c); + dbus_set_confirm_go_clear (c); } - void -sflphone_request_go_clear(void) +void +sflphone_request_go_clear (void) { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - if(selectedCall) { - dbus_request_go_clear(selectedCall); + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + + if (selectedCall) { + dbus_request_go_clear (selectedCall); } } /* Signal sent by sflphoned */ - void -sflphone_confirm_go_clear( callable_obj_t * c ) +void +sflphone_confirm_go_clear (callable_obj_t * c) { - main_window_confirm_go_clear(c); + main_window_confirm_go_clear (c); } - void -sflphone_call_state_changed( callable_obj_t * c, const gchar * description, const guint code) +void +sflphone_call_state_changed (callable_obj_t * c, const gchar * description, const guint code) { - DEBUG("sflphone_call_state_changed"); - if(c == NULL) { - DEBUG("Panic callable obj is NULL in %s at %d", __FILE__, __LINE__); + DEBUG ("sflphone_call_state_changed"); + + if (c == NULL) { + DEBUG ("Panic callable obj is NULL in %s at %d", __FILE__, __LINE__); } else { - //g_free(c->_state_code_description); + //g_free(c->_state_code_description); //DEBUG("sflphone_call_state_changed"); - c->_state_code_description = g_strdup(description); - c->_state_code = code; + c->_state_code_description = g_strdup (description); + c->_state_code = code; } - - calltree_update_call(current_calls, c, NULL); + + calltree_update_call (current_calls, c, NULL); update_actions(); } -void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, int size) { +void sflphone_get_interface_addr_from_name (char *iface_name, char **iface_addr, int size) +{ struct ifreq ifr; int fd; @@ -1459,26 +1445,26 @@ void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, struct sockaddr_in *saddr_in; struct in_addr *addr_in; - if((fd = socket (AF_INET, SOCK_DGRAM,0)) < 0) - DEBUG("getInterfaceAddrFromName error could not open socket\n"); + if ( (fd = socket (AF_INET, SOCK_DGRAM,0)) < 0) + DEBUG ("getInterfaceAddrFromName error could not open socket\n"); memset (&ifr, 0, sizeof (struct ifreq)); strcpy (ifr.ifr_name, iface_name); ifr.ifr_addr.sa_family = AF_INET; - if((err = ioctl(fd, SIOCGIFADDR, &ifr)) < 0) - DEBUG("getInterfaceAddrFromName use default interface (0.0.0.0)\n"); + if ( (err = ioctl (fd, SIOCGIFADDR, &ifr)) < 0) + DEBUG ("getInterfaceAddrFromName use default interface (0.0.0.0)\n"); + - - saddr_in = (struct sockaddr_in *)&ifr.ifr_addr; - addr_in = &(saddr_in->sin_addr); + saddr_in = (struct sockaddr_in *) &ifr.ifr_addr; + addr_in = & (saddr_in->sin_addr); - tmp_addr = (char *)addr_in; + tmp_addr = (char *) addr_in; - snprintf(*iface_addr, size, "%d.%d.%d.%d", - UC(tmp_addr[0]), UC(tmp_addr[1]), UC(tmp_addr[2]), UC(tmp_addr[3])); + snprintf (*iface_addr, size, "%d.%d.%d.%d", + UC (tmp_addr[0]), UC (tmp_addr[1]), UC (tmp_addr[2]), UC (tmp_addr[3])); - close(fd); + close (fd); } diff --git a/sflphone-client-gnome/src/actions.h b/sflphone-client-gnome/src/actions.h index 8be845e176769555f61d50653b4dc2d0f07b445e..57823abd4d52d514622cfd2bbf9a128aaf8f3a1a 100644 --- a/sflphone-client-gnome/src/actions.h +++ b/sflphone-client-gnome/src/actions.h @@ -54,13 +54,13 @@ * Initialize lists and configurations * @return TRUE if succeeded, FALSE otherwise */ -gboolean sflphone_init ( ) ; +gboolean sflphone_init () ; /** * Steps when closing the application. Will ask for confirmation if a call is in progress. * @return TRUE if the user wants to quit, FALSE otherwise. */ -gboolean sflphone_quit ( ) ; +gboolean sflphone_quit () ; /** * Hang up / refuse the current call @@ -88,7 +88,7 @@ callable_obj_t * sflphone_new_call(); * @param accountID The account the voice mails are for * @param count The number of voice mails */ -void sflphone_notify_voice_mail ( const gchar* accountID , guint count ); +void sflphone_notify_voice_mail (const gchar* accountID , guint count); /** * Prepare SFLphone to transfer a call and wait for the user to dial the number to transfer to @@ -110,43 +110,43 @@ void sflphone_pick_up (); * Put the call on hold state * @param c The current call */ -void sflphone_hold ( callable_obj_t * c); +void sflphone_hold (callable_obj_t * c); /** * Put the call in Ringing state * @param c* The current call */ -void sflphone_ringing(callable_obj_t * c ); +void sflphone_ringing (callable_obj_t * c); /** * Put the call in Busy state * @param c* The current call */ -void sflphone_busy( callable_obj_t * c ); +void sflphone_busy (callable_obj_t * c); /** * Put the call in Failure state * @param c* The current call */ -void sflphone_fail( callable_obj_t * c ); +void sflphone_fail (callable_obj_t * c); /** * Put the call in Current state * @param c The current call */ -void sflphone_current ( callable_obj_t * c); +void sflphone_current (callable_obj_t * c); /** * The callee has hung up * @param c The current call */ -void sflphone_hung_up( callable_obj_t * c); +void sflphone_hung_up (callable_obj_t * c); /** * Incoming call * @param c The incoming call */ -void sflphone_incoming_call ( callable_obj_t * c); +void sflphone_incoming_call (callable_obj_t * c); /** * Dial the number @@ -154,26 +154,26 @@ void sflphone_incoming_call ( callable_obj_t * c); * @param keyval The unique int representing the key * @param key The char value of the key */ -void sflphone_keypad ( guint keyval, gchar * key); +void sflphone_keypad (guint keyval, gchar * key); /** * Place a call with a filled callable_obj_t.to * @param c A call in CALL_STATE_DIALING state */ -void sflphone_place_call ( callable_obj_t * c ); +void sflphone_place_call (callable_obj_t * c); /** * Fetch the ip2ip profile through dbus and fill - * the internal hash table. + * the internal hash table. */ -void sflphone_fill_ip2ip_profile(void); +void sflphone_fill_ip2ip_profile (void); /** * @return The internal hash table representing - * the settings for the ip2ip profile. + * the settings for the ip2ip profile. */ void sflphone_get_ip2ip_properties (GHashTable **properties); - + /** * Initialize the accounts data structure */ @@ -210,95 +210,95 @@ void sflphone_save_history (void); /** * Action called when two single call are dragged on together to create a new conference */ -void sflphone_join_participant(const gchar* sel_callID, const gchar* drag_callID); +void sflphone_join_participant (const gchar* sel_callID, const gchar* drag_callID); /** * Action called when a new participant is dragged in */ -void sflphone_add_participant(const gchar* callID, const gchar* confID); +void sflphone_add_participant (const gchar* callID, const gchar* confID); /** * Action called when a conference participant is draged out */ -void sflphone_detach_participant(const gchar* callID); +void sflphone_detach_participant (const gchar* callID); /** * Action called when two conference are merged together */ -void sflphone_join_conference(const gchar* sel_confID, const gchar* drag_confID); +void sflphone_join_conference (const gchar* sel_confID, const gchar* drag_confID); -/** - * Nofity that the communication is +/** + * Nofity that the communication is * now secured using SRTP/SDES. * @param c* The current call */ -void sflphone_srtp_sdes_on(callable_obj_t * c); +void sflphone_srtp_sdes_on (callable_obj_t * c); -/** +/** * Notify that the SRTP/SDES session * is not secured */ -/** - * Nofity that the communication is +/** + * Nofity that the communication is * now secured using ZRTP. * @param c* The current call */ -void sflphone_srtp_zrtp_on( callable_obj_t * c); +void sflphone_srtp_zrtp_on (callable_obj_t * c); -/** +/** * Called when the ZRTP session goes * unsecured. * @param c* The current call */ -void sflphone_srtp_zrtp_off( callable_obj_t * c ); +void sflphone_srtp_zrtp_off (callable_obj_t * c); -/** +/** * Called when the sas has been computed * and is ready to be displayed. * @param c* The current call * @param sas* The Short Authentication String * @param verified* Weather the SAS was confirmed or not. */ -void sflphone_srtp_zrtp_show_sas( callable_obj_t * c, const gchar* sas, const gboolean verified); +void sflphone_srtp_zrtp_show_sas (callable_obj_t * c, const gchar* sas, const gboolean verified); -/** +/** * Called when the remote peer does not support ZRTP * @param c* The current call */ -void sflphone_srtp_zrtp_not_supported( callable_obj_t * c ); +void sflphone_srtp_zrtp_not_supported (callable_obj_t * c); -/** +/** * Called when user wants to confirm go clear request. * @param c* The call to confirm the go clear request. */ -void sflphone_set_confirm_go_clear( callable_obj_t * c ); +void sflphone_set_confirm_go_clear (callable_obj_t * c); -/** +/** * Called when user wants to confirm go clear request. * @param c* The call to confirm the go clear request. */ -void sflphone_confirm_go_clear( callable_obj_t * c ); +void sflphone_confirm_go_clear (callable_obj_t * c); /** * Called when user wants to clear. * @param c* The call on which to go clear */ -void sflphone_request_go_clear(void); +void sflphone_request_go_clear (void); -/** - * Called when the UI needs to be refreshed to +/** + * Called when the UI needs to be refreshed to * better inform the user about the current - * state of the call. + * state of the call. * @param c A pointer to the call that needs to be updated * @param description A textual description of the code * @param code The status code as in SIP or IAX */ -void sflphone_call_state_changed(callable_obj_t * c, const gchar * description, const guint code); +void sflphone_call_state_changed (callable_obj_t * c, const gchar * description, const guint code); /** * Resolve an interface address given its name */ -void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, int size); +void sflphone_get_interface_addr_from_name (char *iface_name, char **iface_addr, int size); #endif diff --git a/sflphone-client-gnome/src/callable_obj.c b/sflphone-client-gnome/src/callable_obj.c index 5295bcc56cad52c34642eb2cab38d457aaa37565..9a904e64adacdac262f689e916b1edf08283be8d 100644 --- a/sflphone-client-gnome/src/callable_obj.c +++ b/sflphone-client-gnome/src/callable_obj.c @@ -37,28 +37,24 @@ #define UNIX_WEEK 86400 * 6 #define UNIX_TWO_DAYS 86400 * 2 -gint is_callID_callstruct ( gconstpointer a, gconstpointer b) +gint is_callID_callstruct (gconstpointer a, gconstpointer b) { - callable_obj_t * c = (callable_obj_t*)a; - if(g_strcasecmp(c->_callID, (const gchar*) b) == 0) - { + callable_obj_t * c = (callable_obj_t*) a; + + if (g_strcasecmp (c->_callID, (const gchar*) b) == 0) { return 0; - } - else - { + } else { return 1; } } -gint get_state_callstruct ( gconstpointer a, gconstpointer b) +gint get_state_callstruct (gconstpointer a, gconstpointer b) { - callable_obj_t * c = (callable_obj_t*)a; - if( c->_state == *((call_state_t*)b)) - { + callable_obj_t * c = (callable_obj_t*) a; + + if (c->_state == * ( (call_state_t*) b)) { return 0; - } - else - { + } else { return 1; } } @@ -67,7 +63,7 @@ gchar* call_get_peer_name (const gchar *format) { const gchar *end, *name; - DEBUG(" callable_obj: %s", format); + DEBUG (" callable_obj: %s", format); end = g_strrstr (format, "<"); @@ -75,55 +71,56 @@ gchar* call_get_peer_name (const gchar *format) return g_strndup (format, 0); } else { name = format; - return g_strndup(name, end - name); + return g_strndup (name, end - name); } } gchar* call_get_peer_number (const gchar *format) { - DEBUG(" callable_obj: %s", format); + DEBUG (" callable_obj: %s", format); - gchar * number = g_strrstr(format, "<") + 1; - gchar * end = g_strrstr(format, ">"); + gchar * number = g_strrstr (format, "<") + 1; + gchar * end = g_strrstr (format, ">"); - if(end && number) - number = g_strndup(number, end - number ); + if (end && number) + number = g_strndup (number, end - number); else - number = g_strdup(format); - + number = g_strdup (format); + return number; } gchar* call_get_audio_codec (callable_obj_t *obj) { - gchar *audio_codec = ""; - codec_t *codec; - gchar *format =""; - int samplerate; - - if (obj) - { - audio_codec = dbus_get_current_codec_name (obj); - codec = codec_list_get_by_name (audio_codec, NULL); - if (codec){ - samplerate = codec->sample_rate; - format = g_markup_printf_escaped ("%s/%i", audio_codec, samplerate); - } - } - return format; + gchar *audio_codec = ""; + codec_t *codec; + gchar *format =""; + int samplerate; + + if (obj) { + audio_codec = dbus_get_current_codec_name (obj); + codec = codec_list_get_by_name (audio_codec, NULL); + + if (codec) { + samplerate = codec->sample_rate; + format = g_markup_printf_escaped ("%s/%i", audio_codec, samplerate); + } + } + + return format; } -void call_add_error(callable_obj_t * call, gpointer dialog) +void call_add_error (callable_obj_t * call, gpointer dialog) { g_ptr_array_add (call->_error_dialogs, dialog); } -void call_remove_error(callable_obj_t * call, gpointer dialog) +void call_remove_error (callable_obj_t * call, gpointer dialog) { g_ptr_array_remove (call->_error_dialogs, dialog); } -void call_remove_all_errors(callable_obj_t * call) +void call_remove_all_errors (callable_obj_t * call) { g_ptr_array_foreach (call->_error_dialogs, (GFunc) gtk_widget_destroy, NULL); } @@ -150,13 +147,14 @@ void create_new_call (callable_type_t type, call_state_t state, gchar* callID , obj->_peer_info = g_strdup (get_peer_info (peer_name, peer_number)); obj->_trsft_to = ""; - set_timestamp (&(obj->_time_start)); - set_timestamp (&(obj->_time_stop)); + set_timestamp (& (obj->_time_start)); + set_timestamp (& (obj->_time_stop)); if (g_strcasecmp (callID, "") == 0) call_id = generate_call_id (); else call_id = callID; + // Set the IDs obj->_callID = g_strdup (call_id); obj->_confID = NULL; @@ -179,11 +177,11 @@ void create_new_call_from_details (const gchar *call_id, GHashTable *details, ca if (g_strcasecmp (state_str, "CURRENT") == 0) state = CALL_STATE_CURRENT; - else if (g_strcasecmp (state_str, "RINGING") == 0) - state = CALL_STATE_RINGING; + else if (g_strcasecmp (state_str, "RINGING") == 0) + state = CALL_STATE_RINGING; - else if (g_strcasecmp (state_str, "INCOMING") == 0) - state = CALL_STATE_INCOMING; + else if (g_strcasecmp (state_str, "INCOMING") == 0) + state = CALL_STATE_INCOMING; else if (g_strcasecmp (state_str, "HOLD") == 0) state = CALL_STATE_HOLD; @@ -194,7 +192,7 @@ void create_new_call_from_details (const gchar *call_id, GHashTable *details, ca else state = CALL_STATE_FAILURE; - create_new_call (CALL, state, (gchar*)call_id, accountID, peer_name, call_get_peer_number(peer_number), &new_call); + create_new_call (CALL, state, (gchar*) call_id, accountID, peer_name, call_get_peer_number (peer_number), &new_call); *call = new_call; } @@ -210,16 +208,15 @@ void create_history_entry_from_serialized_form (gchar *timestamp, gchar *details // details is in serialized form, i e: calltype%to%from%callid - if ((ptr = g_strsplit(details, delim,5)) != NULL) { + if ( (ptr = g_strsplit (details, delim,5)) != NULL) { - while (ptr != NULL && token < 5) { - - switch (token) - { + while (ptr != NULL && token < 5) { + + switch (token) { case 0: history_state = get_history_state_from_id (*ptr); break; - case 1: + case 1: peer_number = *ptr; break; case 2: @@ -236,11 +233,12 @@ void create_history_entry_from_serialized_form (gchar *timestamp, gchar *details } token++; - ptr++; + ptr++; - } + } } + if (g_strcasecmp (peer_name, "empty") == 0) peer_name=""; @@ -262,7 +260,8 @@ void free_callable_obj_t (callable_obj_t *c) g_free (c); } -void attach_thumbnail (callable_obj_t *call, GdkPixbuf *pixbuf) { +void attach_thumbnail (callable_obj_t *call, GdkPixbuf *pixbuf) +{ call->_contact_thumbnail = pixbuf; } @@ -270,8 +269,8 @@ gchar* generate_call_id (void) { gchar *call_id; - call_id = g_new0(gchar, 30); - g_sprintf(call_id, "%d", rand()); + call_id = g_new0 (gchar, 30); + g_sprintf (call_id, "%d", rand()); return call_id; } @@ -279,11 +278,12 @@ gchar* get_peer_info (gchar* number, gchar* name) { gchar *info; - info = g_strconcat("\"", name, "\" <", number, ">", NULL); + info = g_strconcat ("\"", name, "\" <", number, ">", NULL); return info; } -history_state_t get_history_state_from_id (gchar *indice){ +history_state_t get_history_state_from_id (gchar *indice) +{ history_state_t state; @@ -308,34 +308,32 @@ gchar* get_call_duration (callable_obj_t *obj) start = obj->_time_start; end = obj->_time_stop; - + if (start == end) - return g_markup_printf_escaped("<small>Duration:</small> 0:00"); + return g_markup_printf_escaped ("<small>Duration:</small> 0:00"); - duration = (int) difftime(end, start); + duration = (int) difftime (end, start); - if( duration / 60 == 0 ) - { - if( duration < 10 ) - res = g_markup_printf_escaped("00:0%i", duration); + if (duration / 60 == 0) { + if (duration < 10) + res = g_markup_printf_escaped ("00:0%i", duration); else - res = g_markup_printf_escaped("00:%i", duration); - } - else - { - if( duration%60 < 10 ) - res = g_markup_printf_escaped("%i:0%i" , duration/60 , duration%60); + res = g_markup_printf_escaped ("00:%i", duration); + } else { + if (duration%60 < 10) + res = g_markup_printf_escaped ("%i:0%i" , duration/60 , duration%60); else - res = g_markup_printf_escaped("%i:%i" , duration/60 , duration%60); + res = g_markup_printf_escaped ("%i:%i" , duration/60 , duration%60); } - return g_markup_printf_escaped("<small>Duration:</small> %s", res); + + return g_markup_printf_escaped ("<small>Duration:</small> %s", res); } gchar* serialize_history_entry (callable_obj_t *entry) { // "0|514-276-5468|Savoir-faire Linux|144562458" for instance - + gchar* result; gchar* separator = "|"; gchar* history_state, *timestamp; @@ -345,21 +343,20 @@ gchar* serialize_history_entry (callable_obj_t *entry) // and the timestamps timestamp = convert_timestamp_to_gchar (entry->_time_stop); - result = g_strconcat (history_state, separator, - entry->_peer_number, separator, - g_strcasecmp (entry->_peer_name,"") ==0 ? "empty": entry->_peer_name, separator, - timestamp, separator, - g_strcasecmp (entry->_accountID,"") ==0 ? "empty": entry->_accountID, + result = g_strconcat (history_state, separator, + entry->_peer_number, separator, + g_strcasecmp (entry->_peer_name,"") ==0 ? "empty": entry->_peer_name, separator, + timestamp, separator, + g_strcasecmp (entry->_accountID,"") ==0 ? "empty": entry->_accountID, NULL); - + return result; } gchar* get_history_id_from_state (history_state_t state) { // Refer to history_state_t enum in callable_obj.h - switch (state) - { + switch (state) { case MISSED: return "0"; case INCOMING: @@ -371,37 +368,38 @@ gchar* get_history_id_from_state (history_state_t state) } } -gchar* get_formatted_start_timestamp (callable_obj_t *obj) { - +gchar* get_formatted_start_timestamp (callable_obj_t *obj) +{ + struct tm* ptr; time_t lt, now; unsigned char str[100]; - if (obj) - { - // Fetch the current timestamp - (void) time (&now); + if (obj) { + // Fetch the current timestamp + (void) time (&now); lt = obj->_time_start; ptr = localtime (<); - if (now - lt < UNIX_WEEK) { - if (now-lt < UNIX_DAY) { - strftime((char *)str, 100, N_("today at %R"), (const struct tm *)ptr); - } else { - if (now - lt < UNIX_TWO_DAYS) { - strftime((char *)str, 100, N_("yesterday at %R"), (const struct tm *)ptr); - } else { - strftime((char *)str, 100, N_("%A at %R"), (const struct tm *)ptr); - } - } - } else { - strftime((char *)str, 100, N_("%x at %R"), (const struct tm *)ptr); - } + if (now - lt < UNIX_WEEK) { + if (now-lt < UNIX_DAY) { + strftime ( (char *) str, 100, N_ ("today at %R"), (const struct tm *) ptr); + } else { + if (now - lt < UNIX_TWO_DAYS) { + strftime ( (char *) str, 100, N_ ("yesterday at %R"), (const struct tm *) ptr); + } else { + strftime ( (char *) str, 100, N_ ("%A at %R"), (const struct tm *) ptr); + } + } + } else { + strftime ( (char *) str, 100, N_ ("%x at %R"), (const struct tm *) ptr); + } // result function of the current locale - return g_markup_printf_escaped("\n%s\n" , str); + return g_markup_printf_escaped ("\n%s\n" , str); } + return ""; } @@ -410,13 +408,13 @@ void set_timestamp (time_t *timestamp) time_t tmp; // Set to the current value - (void) time(&tmp); + (void) time (&tmp); *timestamp=tmp; } gchar* convert_timestamp_to_gchar (time_t timestamp) { - return g_markup_printf_escaped ("%i", (int)timestamp); + return g_markup_printf_escaped ("%i", (int) timestamp); } time_t convert_gchar_to_timestamp (gchar *timestamp) @@ -424,15 +422,16 @@ time_t convert_gchar_to_timestamp (gchar *timestamp) return (time_t) atoi (timestamp); } - gchar* -get_peer_information (callable_obj_t *c) { - - gchar *res; +gchar* +get_peer_information (callable_obj_t *c) +{ - if (g_strcasecmp (c->_peer_name,"") == 0) - return g_strdup (c->_peer_number); - else - return g_strdup (c->_peer_name); + gchar *res; + + if (g_strcasecmp (c->_peer_name,"") == 0) + return g_strdup (c->_peer_number); + else + return g_strdup (c->_peer_name); } diff --git a/sflphone-client-gnome/src/callable_obj.h b/sflphone-client-gnome/src/callable_obj.h index acab0ed3ea55e59ac858a16bb433c75e931f4ba7..01114feeadc199a7130ee170b72c322e886c97e6 100644 --- a/sflphone-client-gnome/src/callable_obj.h +++ b/sflphone-client-gnome/src/callable_obj.h @@ -40,33 +40,30 @@ * @enum history_state * This enum have all the state a call can take in the history */ -typedef enum -{ - MISSED, - INCOMING, - OUTGOING +typedef enum { + MISSED, + INCOMING, + OUTGOING } history_state_t; /** * @enum contact_type * This enum have all types of contacts: HOME phone, cell phone, etc... */ -typedef enum -{ - CONTACT_PHONE_HOME, - CONTACT_PHONE_BUSINESS, - CONTACT_PHONE_MOBILE +typedef enum { + CONTACT_PHONE_HOME, + CONTACT_PHONE_BUSINESS, + CONTACT_PHONE_MOBILE } contact_type_t; /** * @enum callable_obj_type * This enum have all types of items */ -typedef enum -{ - CALL, - HISTORY_ENTRY, - CONTACT +typedef enum { + CALL, + HISTORY_ENTRY, + CONTACT } callable_type_t; @@ -74,16 +71,16 @@ typedef enum * This enum have all the states a call can take. */ typedef enum { - CALL_STATE_INVALID = 0, - CALL_STATE_INCOMING, - CALL_STATE_RINGING, - CALL_STATE_CURRENT, - CALL_STATE_DIALING, - CALL_STATE_HOLD, - CALL_STATE_FAILURE, - CALL_STATE_BUSY, - CALL_STATE_TRANSFERT, - CALL_STATE_RECORD, + CALL_STATE_INVALID = 0, + CALL_STATE_INCOMING, + CALL_STATE_RINGING, + CALL_STATE_CURRENT, + CALL_STATE_DIALING, + CALL_STATE_HOLD, + CALL_STATE_FAILURE, + CALL_STATE_BUSY, + CALL_STATE_TRANSFERT, + CALL_STATE_RECORD, } call_state_t; typedef enum { @@ -104,19 +101,19 @@ typedef struct { callable_type_t _type; // CALL - HISTORY ENTRY - CONTACT call_state_t _state; // The state of the call int _state_code; // The numeric state code as defined in SIP or IAX - gchar* _state_code_description; // A textual description of _state_code + gchar* _state_code_description; // A textual description of _state_code gchar* _callID; // The call ID gchar* _confID; // The conference ID (NULL if don't participate to a conference) gchar* _accountID; // The account the call is made with time_t _time_start; // The timestamp the call was initiating time_t _time_stop; // The timestamp the call was over history_state_t _history_state; // The history state if necessary - srtp_state_t _srtp_state; // The state of security on the call + srtp_state_t _srtp_state; // The state of security on the call gchar* _srtp_cipher; // Cipher used for the srtp session gchar* _sas; // The Short Authentication String that should be displayed - gboolean _zrtp_confirmed; // Override real state. Used for hold/unhold - // since rtp session is killed each time and - // libzrtpcpp does not remember state (yet?) + gboolean _zrtp_confirmed; // Override real state. Used for hold/unhold + // since rtp session is killed each time and + // libzrtpcpp does not remember state (yet?) /** * The information about the person we are talking */ @@ -137,8 +134,8 @@ typedef struct { * The thumbnail, if callable_obj_type=CONTACT */ GdkPixbuf *_contact_thumbnail; - - /** + + /** * Maintains a list of error dialogs * associated with that call so that * they could be destroyed at the right @@ -160,26 +157,26 @@ void create_new_call_from_details (const gchar *, GHashTable *, callable_obj_t * void create_history_entry_from_serialized_form (gchar *, gchar *, callable_obj_t **); -void call_add_error(callable_obj_t * call, gpointer dialog); +void call_add_error (callable_obj_t * call, gpointer dialog); -void call_remove_error(callable_obj_t * call, gpointer dialog); +void call_remove_error (callable_obj_t * call, gpointer dialog); -void call_remove_all_errors(callable_obj_t * call); +void call_remove_all_errors (callable_obj_t * call); -/* - * GCompareFunc to compare a callID (gchar* and a callable_obj_t) +/* + * GCompareFunc to compare a callID (gchar* and a callable_obj_t) */ -gint is_callID_callstruct ( gconstpointer, gconstpointer); +gint is_callID_callstruct (gconstpointer, gconstpointer); -/* - * GCompareFunc to get current call (gchar* and a callable_obj_t) +/* + * GCompareFunc to get current call (gchar* and a callable_obj_t) */ -gint get_state_callstruct ( gconstpointer, gconstpointer); +gint get_state_callstruct (gconstpointer, gconstpointer); -/** +/** * This function parse the callable_obj_t.from field to return the name * @param c The call - * @return The full name of the caller or an empty string + * @return The full name of the caller or an empty string */ gchar* call_get_peer_name (const gchar*); diff --git a/sflphone-client-gnome/src/codeclist.c b/sflphone-client-gnome/src/codeclist.c index 21037b01fb90572cc16ddf4c72234b11df2e7f7d..edf36173976d55ff74b6b5cf208d4ad38eada7b1 100644 --- a/sflphone-client-gnome/src/codeclist.c +++ b/sflphone-client-gnome/src/codeclist.c @@ -37,148 +37,159 @@ GQueue * codecsCapabilities = NULL; - gint +gint is_name_codecstruct (gconstpointer a, gconstpointer b) { - codec_t * c = (codec_t *)a; - if(strcmp(c->name, (const gchar *)b)==0) - return 0; - else - return 1; + codec_t * c = (codec_t *) a; + + if (strcmp (c->name, (const gchar *) b) ==0) + return 0; + else + return 1; } - gint +gint is_payload_codecstruct (gconstpointer a, gconstpointer b) { - codec_t * c = (codec_t *)a; - if(c->_payload == GPOINTER_TO_INT(b)) - return 0; - else - return 1; + codec_t * c = (codec_t *) a; + + if (c->_payload == GPOINTER_TO_INT (b)) + return 0; + else + return 1; } -void codec_list_init (GQueue **queue) { +void codec_list_init (GQueue **queue) +{ - // Create the queue object that will contain the audio codecs - *queue = g_queue_new(); + // Create the queue object that will contain the audio codecs + *queue = g_queue_new(); } -void codec_capabilities_load (void) { +void codec_capabilities_load (void) +{ - gchar **codecs = NULL, **pl = NULL, **specs = NULL; - guint payload; + gchar **codecs = NULL, **pl = NULL, **specs = NULL; + guint payload; - // Create the queue object that will contain the global list of audio codecs - if (codecsCapabilities != NULL) - g_queue_free (codecsCapabilities); + // Create the queue object that will contain the global list of audio codecs + if (codecsCapabilities != NULL) + g_queue_free (codecsCapabilities); - codecsCapabilities = g_queue_new(); + codecsCapabilities = g_queue_new(); - // This is a global list inherited by all accounts + // This is a global list inherited by all accounts codecs = (gchar**) dbus_codec_list (); - - // Add the codecs in the list - for (pl=codecs; *codecs; codecs++) { - - codec_t *c; - payload = atoi (*codecs); - specs = (gchar **) dbus_codec_details (payload); - codec_create_new_with_specs (payload, specs, TRUE, &c); - g_queue_push_tail (codecsCapabilities, (gpointer*) c); + + // Add the codecs in the list + for (pl=codecs; *codecs; codecs++) { + + codec_t *c; + payload = atoi (*codecs); + specs = (gchar **) dbus_codec_details (payload); + codec_create_new_with_specs (payload, specs, TRUE, &c); + g_queue_push_tail (codecsCapabilities, (gpointer*) c); } - // If we didn't load any codecs, problem ... - if (g_queue_get_length (codecsCapabilities) == 0) { + // If we didn't load any codecs, problem ... + if (g_queue_get_length (codecsCapabilities) == 0) { - // Error message - ERROR ("No audio codecs found"); - dbus_unregister(getpid()); - exit(0); + // Error message + ERROR ("No audio codecs found"); + dbus_unregister (getpid()); + exit (0); } } -void account_create_codec_list (account_t **acc) { +void account_create_codec_list (account_t **acc) +{ + + gchar **order = NULL; + GQueue *_codecs; - gchar **order = NULL; - GQueue *_codecs; + _codecs = (*acc)->codecs; - _codecs = (*acc)->codecs; - if (_codecs != NULL) - g_queue_free (_codecs); + if (_codecs != NULL) + g_queue_free (_codecs); - _codecs = g_queue_new (); - // _codecs = g_queue_copy (codecsCapabilities); + _codecs = g_queue_new (); + // _codecs = g_queue_copy (codecsCapabilities); - (*acc)->codecs = _codecs; - // order = (gchar**) dbus_get_active_codec_list (acc->accountID); + (*acc)->codecs = _codecs; + // order = (gchar**) dbus_get_active_codec_list (acc->accountID); } -void account_set_codec_list (account_t **acc) { +void account_set_codec_list (account_t **acc) +{ - // Reset the codec list - // account_create_codec_list (a); + // Reset the codec list + // account_create_codec_list (a); } -void codec_create_new (gint payload, gboolean active, codec_t **c) { +void codec_create_new (gint payload, gboolean active, codec_t **c) +{ - codec_t *codec; - gchar **specs; + codec_t *codec; + gchar **specs; - codec = g_new0 (codec_t, 1); - codec->_payload = payload; + codec = g_new0 (codec_t, 1); + codec->_payload = payload; specs = (gchar **) dbus_codec_details (payload); - codec->name = specs[0]; - codec->sample_rate = atoi (specs[1]); - codec->_bitrate = atoi (specs[2]); - codec->_bandwidth = atoi (specs[3]); - codec->is_active = active; + codec->name = specs[0]; + codec->sample_rate = atoi (specs[1]); + codec->_bitrate = atoi (specs[2]); + codec->_bandwidth = atoi (specs[3]); + codec->is_active = active; - *c = codec; + *c = codec; } -void codec_create_new_with_specs (gint payload, gchar **specs, gboolean active, codec_t **c) { +void codec_create_new_with_specs (gint payload, gchar **specs, gboolean active, codec_t **c) +{ - codec_t *codec; + codec_t *codec; - codec = g_new0 (codec_t, 1); - codec->_payload = payload; - codec->name = specs[0]; - codec->sample_rate = atoi (specs[1]); - codec->_bitrate = atoi (specs[2]); - codec->_bandwidth = atoi (specs[3]); - codec->is_active = active; + codec = g_new0 (codec_t, 1); + codec->_payload = payload; + codec->name = specs[0]; + codec->sample_rate = atoi (specs[1]); + codec->_bitrate = atoi (specs[2]); + codec->_bandwidth = atoi (specs[3]); + codec->is_active = active; - *c = codec; + *c = codec; } -void codec_create_new_from_caps (codec_t *original, codec_t **copy) { +void codec_create_new_from_caps (codec_t *original, codec_t **copy) +{ - codec_t *codec; + codec_t *codec; - if(!original) { - *copy = NULL; - return; - } + if (!original) { + *copy = NULL; + return; + } - codec = g_new0 (codec_t, 1); - codec->_payload = original->_payload; - codec->name = original->name; - codec->sample_rate = original->sample_rate; - codec->_bitrate = original->_bitrate; - codec->_bandwidth = original->_bandwidth; - codec->is_active = original->is_active; + codec = g_new0 (codec_t, 1); + codec->_payload = original->_payload; + codec->name = original->name; + codec->sample_rate = original->sample_rate; + codec->_bitrate = original->_bitrate; + codec->_bandwidth = original->_bandwidth; + codec->is_active = original->is_active; - *copy = codec; + *copy = codec; } -void codec_list_clear (GQueue **queue) { +void codec_list_clear (GQueue **queue) +{ - if (*queue != NULL) - g_queue_free (*queue); + if (*queue != NULL) + g_queue_free (*queue); - *queue = g_queue_new(); + *queue = g_queue_new(); } /*void codec_list_clear (void) { @@ -187,162 +198,174 @@ void codec_list_clear (GQueue **queue) { codecsCapabilities = g_queue_new(); }*/ -void codec_list_add(codec_t * c, GQueue **queue) { +void codec_list_add (codec_t * c, GQueue **queue) +{ - // Add a codec to a specific list - g_queue_push_tail (*queue, (gpointer *) c); + // Add a codec to a specific list + g_queue_push_tail (*queue, (gpointer *) c); } -void codec_set_active (codec_t **c) { +void codec_set_active (codec_t **c) +{ - if(c) - { - DEBUG("%s set active", (*c)->name); - (*c)->is_active = TRUE; - } + if (c) { + DEBUG ("%s set active", (*c)->name); + (*c)->is_active = TRUE; + } } -void codec_set_inactive (codec_t **c) { +void codec_set_inactive (codec_t **c) +{ - if(c){ - DEBUG("%s set active", (*c)->name); - (*c)->is_active = FALSE; - } + if (c) { + DEBUG ("%s set active", (*c)->name); + (*c)->is_active = FALSE; + } } -guint codec_list_get_size () { +guint codec_list_get_size () +{ - // The system wide codec list and the one per account have exactly the same size - // The only difference may be the order and the enabled codecs - return g_queue_get_length (codecsCapabilities); + // The system wide codec list and the one per account have exactly the same size + // The only difference may be the order and the enabled codecs + return g_queue_get_length (codecsCapabilities); } -codec_t* codec_list_get_by_name (gconstpointer name, GQueue *q) { +codec_t* codec_list_get_by_name (gconstpointer name, GQueue *q) +{ + + // If NULL is passed as argument, we look into the global capabilities + if (q == NULL) + q = codecsCapabilities; - // If NULL is passed as argument, we look into the global capabilities - if (q == NULL) - q = codecsCapabilities; + GList * c = g_queue_find_custom (q, name, is_name_codecstruct); - GList * c = g_queue_find_custom (q, name, is_name_codecstruct); - if(c) - return (codec_t *)c->data; - else - return NULL; + if (c) + return (codec_t *) c->data; + else + return NULL; } -codec_t* codec_list_get_by_payload (gconstpointer payload, GQueue *q) { +codec_t* codec_list_get_by_payload (gconstpointer payload, GQueue *q) +{ + + // If NULL is passed as argument, we look into the global capabilities + if (q == NULL) + q = codecsCapabilities; - // If NULL is passed as argument, we look into the global capabilities - if (q == NULL) - q = codecsCapabilities; + GList * c = g_queue_find_custom (q, payload, is_payload_codecstruct); - GList * c = g_queue_find_custom (q, payload, is_payload_codecstruct); - if(c) - return (codec_t *)c->data; - else - return NULL; + if (c) + return (codec_t *) c->data; + else + return NULL; } -codec_t* codec_list_get_nth (guint index, GQueue *q) { - return g_queue_peek_nth (q, index); +codec_t* codec_list_get_nth (guint index, GQueue *q) +{ + return g_queue_peek_nth (q, index); } -codec_t* capabilities_get_nth (guint index) { +codec_t* capabilities_get_nth (guint index) +{ - return g_queue_peek_nth (codecsCapabilities, index); + return g_queue_peek_nth (codecsCapabilities, index); } -void codec_set_prefered_order (guint index, GQueue *q) { +void codec_set_prefered_order (guint index, GQueue *q) +{ - codec_t * prefered = codec_list_get_nth (index, q); - g_queue_pop_nth (q, index); - g_queue_push_head (q, prefered); + codec_t * prefered = codec_list_get_nth (index, q); + g_queue_pop_nth (q, index); + g_queue_push_head (q, prefered); } -void codec_list_move_codec_up (guint index, GQueue **q) { +void codec_list_move_codec_up (guint index, GQueue **q) +{ - DEBUG("Codec list Size: %i \n", codec_list_get_size ()); + DEBUG ("Codec list Size: %i \n", codec_list_get_size ()); - GQueue *tmp = *q; + GQueue *tmp = *q; - if (index != 0) - { - gpointer codec = g_queue_pop_nth (tmp, index); - g_queue_push_nth (tmp, codec, index-1); - } + if (index != 0) { + gpointer codec = g_queue_pop_nth (tmp, index); + g_queue_push_nth (tmp, codec, index-1); + } - *q = tmp; + *q = tmp; } -void codec_list_move_codec_down (guint index, GQueue **q) { +void codec_list_move_codec_down (guint index, GQueue **q) +{ - DEBUG("Codec list Size: %i \n",codec_list_get_size()); + DEBUG ("Codec list Size: %i \n",codec_list_get_size()); - GQueue *tmp = *q; + GQueue *tmp = *q; - if (index != tmp->length) - { - gpointer codec = g_queue_pop_nth (tmp, index); - g_queue_push_nth (tmp, codec, index+1); - } - - *q = tmp; + if (index != tmp->length) { + gpointer codec = g_queue_pop_nth (tmp, index); + g_queue_push_nth (tmp, codec, index+1); + } + + *q = tmp; } -void codec_list_update_to_daemon (account_t *acc) { - - // String listing codecs payloads - const gchar** codecList; - - // Length of the codec list - int length = acc->codecs->length; - - // Initiate double array char list for one string - codecList = (void*)malloc(sizeof(void*)); - - // Get all codecs in queue - int c = 0; - unsigned int i = 0; - - for(i = 0; i < length; i++) - { - codec_t* currentCodec = codec_list_get_nth (i, acc->codecs); - // Assert not null - if(currentCodec) - { - // Save only if active - if(currentCodec->is_active) - { - // Reallocate memory each time more than one active codec is found - if(c!=0) - codecList = (void*)realloc(codecList, (c+1)*sizeof(void*)); - // Allocate memory for the payload - *(codecList+c) = (gchar*)malloc(sizeof(gchar*)); - char payload[10]; - // Put payload string in char array - sprintf(payload, "%d", currentCodec->_payload); - strcpy((char*)*(codecList+c), payload); - c++; - } - } - } - - // Allocate NULL array at the end for Dbus - codecList = (void*)realloc(codecList, (c+1)*sizeof(void*)); - *(codecList+c) = NULL; - - // call dbus function with array of strings - dbus_set_active_codec_list (codecList, acc->accountID); - - // Delete memory - for(i = 0; i < c; i++) { - free((gchar*)*(codecList+i)); - } - free(codecList); +void codec_list_update_to_daemon (account_t *acc) +{ + + // String listing codecs payloads + const gchar** codecList; + + // Length of the codec list + int length = acc->codecs->length; + + // Initiate double array char list for one string + codecList = (void*) malloc (sizeof (void*)); + + // Get all codecs in queue + int c = 0; + unsigned int i = 0; + + for (i = 0; i < length; i++) { + codec_t* currentCodec = codec_list_get_nth (i, acc->codecs); + + // Assert not null + if (currentCodec) { + // Save only if active + if (currentCodec->is_active) { + // Reallocate memory each time more than one active codec is found + if (c!=0) + codecList = (void*) realloc (codecList, (c+1) *sizeof (void*)); + + // Allocate memory for the payload + * (codecList+c) = (gchar*) malloc (sizeof (gchar*)); + char payload[10]; + // Put payload string in char array + sprintf (payload, "%d", currentCodec->_payload); + strcpy ( (char*) * (codecList+c), payload); + c++; + } + } + } + + // Allocate NULL array at the end for Dbus + codecList = (void*) realloc (codecList, (c+1) *sizeof (void*)); + * (codecList+c) = NULL; + + // call dbus function with array of strings + dbus_set_active_codec_list (codecList, acc->accountID); + + // Delete memory + for (i = 0; i < c; i++) { + free ( (gchar*) * (codecList+i)); + } + + free (codecList); } -GQueue* get_system_codec_list (void) { - return codecsCapabilities; +GQueue* get_system_codec_list (void) +{ + return codecsCapabilities; } diff --git a/sflphone-client-gnome/src/codeclist.h b/sflphone-client-gnome/src/codeclist.h index 0737f3853d10c77bb22bdca2efdb5cac89113bf6..253067a8df71f8fb3ad5cda7e697b8019ff15ec0 100644 --- a/sflphone-client-gnome/src/codeclist.h +++ b/sflphone-client-gnome/src/codeclist.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.net> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -38,19 +38,19 @@ */ typedef struct { - /** Payload of the codec */ - gint _payload; - /** Tells if the codec has been activated */ - gboolean is_active; - /** String description */ - gchar * name; - /** Sample rate */ - int sample_rate; - /** Bitrate */ - gdouble _bitrate; - /** Bandwidth */ - gdouble _bandwidth; -}codec_t; + /** Payload of the codec */ + gint _payload; + /** Tells if the codec has been activated */ + gboolean is_active; + /** String description */ + gchar * name; + /** Sample rate */ + int sample_rate; + /** Bitrate */ + gdouble _bitrate; + /** Bandwidth */ + gdouble _bandwidth; +} codec_t; /** @struct codec_t * @brief Codec information. @@ -58,29 +58,29 @@ typedef struct { * This match how the server internally works and the dbus API to save and retrieve the codecs details. */ -/** - * This function initialize a specific codec list. +/** + * This function initialize a specific codec list. */ void codec_list_init (GQueue **q); -/** - * This function initialize the system wide codec list. +/** + * This function initialize the system wide codec list. */ void codec_capabilities_load (void); -/** - * This function empty and free a specific codec list. +/** + * This function empty and free a specific codec list. */ void codec_list_clear (GQueue **q); -/** - * This function empty and free the system wide codec list. +/** + * This function empty and free the system wide codec list. */ void system_codec_list_clear (void); -/** - * This function append an codec to list. - * @param c The codec you want to add +/** + * This function append an codec to list. + * @param c The codec you want to add */ void codec_list_add (codec_t * c, GQueue **q); @@ -94,25 +94,25 @@ void codec_set_active (codec_t **c); * Set a codec inactive. An active codec won't be used for codec negociation * @param name The string description of the codec */ -void codec_set_inactive(codec_t **c); +void codec_set_inactive (codec_t **c); -/** +/** * Return the number of codecs in the list - * @return guint The number of codecs in the list + * @return guint The number of codecs in the list */ guint codec_list_get_size(); -/** - * Return the codec structure that corresponds to the string description +/** + * Return the codec structure that corresponds to the string description * @param name The string description of the codec - * @return codec_t* A codec or NULL + * @return codec_t* A codec or NULL */ -codec_t * codec_list_get_by_name(gconstpointer name, GQueue *q); +codec_t * codec_list_get_by_name (gconstpointer name, GQueue *q); -/** +/** * Return the codec at the nth position in the list * @param index The position of the codec you want - * @return codec_t* A codec or NULL + * @return codec_t* A codec or NULL */ codec_t* codec_list_get_nth (guint index, GQueue *q); codec_t* capabilities_get_nth (guint index); @@ -120,16 +120,16 @@ codec_t* capabilities_get_nth (guint index); /** * Set the prefered codec first in the codec list * @param index The position in the list of the prefered codec - */ + */ void codec_set_prefered_order (guint index, GQueue *q); -/** +/** * Move the codec from an unit up in the codec_list * @param index The current index in the list */ void codec_list_move_codec_up (guint index, GQueue **q); -/** +/** * Move the codec from an unit down in the codec_list * @param index The current index in the list */ @@ -145,7 +145,7 @@ codec_t* codec_list_get_by_payload (gconstpointer payload, GQueue *q); GQueue* get_system_codec_list (void); /** - * Instanciate a new codecs with the given payload. + * Instanciate a new codecs with the given payload. * Fetches codec specification through D-Bus * * @param payload The unique RTP payload diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c index 3b534e079ab6d5c9e53e8615b254ebdb444b1fa5..90f0ffd679adc1158fe5bacbc7d8f2d5d3d0d20b 100644 --- a/sflphone-client-gnome/src/conference_obj.c +++ b/sflphone-client-gnome/src/conference_obj.c @@ -32,22 +32,20 @@ #include <sflphone_const.h> #include <time.h> -gint is_confID_confstruct ( gconstpointer a, gconstpointer b) +gint is_confID_confstruct (gconstpointer a, gconstpointer b) { - conference_obj_t * c = (conference_obj_t*)a; - if(g_strcasecmp(c->_confID, (const gchar*) b) == 0) - { + conference_obj_t * c = (conference_obj_t*) a; + + if (g_strcasecmp (c->_confID, (const gchar*) b) == 0) { return 0; - } - else - { + } else { return 1; } } conference_obj_t* create_new_conference (conference_state_t state, const gchar* confID, conference_obj_t ** conf) { - DEBUG("create_new_conference"); + DEBUG ("create_new_conference"); // conference_obj_t *obj; conference_obj_t *new_conf; @@ -56,7 +54,7 @@ conference_obj_t* create_new_conference (conference_state_t state, const gchar* // Allocate memory new_conf = g_new0 (conference_obj_t, 1); - // Set state field + // Set state field new_conf->_state = state; // Set the ID field @@ -70,8 +68,8 @@ conference_obj_t* create_new_conference (conference_state_t state, const gchar* } conference_obj_t* create_new_conference_from_details (const gchar *conf_id, GHashTable *details, conference_obj_t ** conf) -{ - DEBUG("create_new_conference_from_details"); +{ + DEBUG ("create_new_conference_from_details"); conference_obj_t *new_conf; gchar* call_id; @@ -91,11 +89,11 @@ conference_obj_t* create_new_conference_from_details (const gchar *conf_id, GHas new_conf->participant_list = NULL; // get participant list - participants = dbus_get_participant_list(conf_id); + participants = dbus_get_participant_list (conf_id); // generate conference participant list - conference_participant_list_update(participants, new_conf); - + conference_participant_list_update (participants, new_conf); + state_str = g_hash_table_lookup (details, "CONF_STATE"); if (g_strcasecmp (state_str, "ACTIVE_ATACHED") == 0) @@ -114,49 +112,49 @@ void free_conference_obj_t (conference_obj_t *c) { g_free (c->_confID); - if(c->participant_list) + if (c->participant_list) g_slist_free (c->participant_list); g_free (c); } -void conference_add_participant(const gchar* call_id, conference_obj_t* conf) +void conference_add_participant (const gchar* call_id, conference_obj_t* conf) { // store the new participant list after appending participant id - conf->participant_list = g_slist_append(conf->participant_list, (gpointer)call_id); + conf->participant_list = g_slist_append (conf->participant_list, (gpointer) call_id); } -void conference_remove_participant(const gchar* call_id, conference_obj_t* conf) +void conference_remove_participant (const gchar* call_id, conference_obj_t* conf) { // store the new participant list after removing participant id - conf->participant_list = g_slist_remove(conf->participant_list, (gconstpointer)call_id); + conf->participant_list = g_slist_remove (conf->participant_list, (gconstpointer) call_id); } -GSList* conference_next_participant(GSList* participant) +GSList* conference_next_participant (GSList* participant) { - return g_slist_next(participant); + return g_slist_next (participant); } -GSList* conference_participant_list_update(gchar** participants, conference_obj_t* conf) +GSList* conference_participant_list_update (gchar** participants, conference_obj_t* conf) { gchar* call_id; gchar** part; - if(conf->participant_list) { - g_slist_free(conf->participant_list); - conf->participant_list = NULL; + if (conf->participant_list) { + g_slist_free (conf->participant_list); + conf->participant_list = NULL; } - DEBUG("Conference: Participant list update"); + DEBUG ("Conference: Participant list update"); for (part = participants; *part; part++) { - call_id = (gchar*)(*part); - DEBUG("Adding %s", call_id); - conference_add_participant(call_id, conf); + call_id = (gchar*) (*part); + DEBUG ("Adding %s", call_id); + conference_add_participant (call_id, conf); } } diff --git a/sflphone-client-gnome/src/conference_obj.h b/sflphone-client-gnome/src/conference_obj.h index 5215ee7bd5aebbc9bea181e6fb622a34b42c6a55..56f46e28dffa0b45bfc725356e8487c4e83b7b9d 100644 --- a/sflphone-client-gnome/src/conference_obj.h +++ b/sflphone-client-gnome/src/conference_obj.h @@ -41,12 +41,11 @@ /** @enum conference_state_t * This enum have all the states a conference can take. */ -typedef enum -{ - CONFERENCE_STATE_ACTIVE_ATACHED = 0, - CONFERENCE_STATE_ACTIVE_DETACHED, - CONFERENCE_STATE_RECORD, - CONFERENCE_STATE_HOLD +typedef enum { + CONFERENCE_STATE_ACTIVE_ATACHED = 0, + CONFERENCE_STATE_ACTIVE_DETACHED, + CONFERENCE_STATE_RECORD, + CONFERENCE_STATE_HOLD } conference_state_t; @@ -60,7 +59,7 @@ typedef struct { gchar* _confID; // The call ID gboolean _conference_secured; // the security state of the conference gboolean _conf_srtp_enabled; // security required for this conference - GSList* participant_list; // participant list for this + GSList* participant_list; // participant list for this } conference_obj_t; @@ -70,17 +69,17 @@ conference_obj_t* create_new_conference_from_details (const gchar *, GHashTable void free_conference_obj_t (conference_obj_t *c); -/* - * GCompareFunc to compare a confID (gchar* and a callable_obj_t) +/* + * GCompareFunc to compare a confID (gchar* and a callable_obj_t) */ -gint is_confID_confstruct ( gconstpointer, gconstpointer); +gint is_confID_confstruct (gconstpointer, gconstpointer); -void conference_add_participatn(const gchar*, conference_obj_t *); +void conference_add_participatn (const gchar*, conference_obj_t *); -void conference_remove_participant(const gchar*, conference_obj_t *); +void conference_remove_participant (const gchar*, conference_obj_t *); -GSList* conference_next_participant(GSList* participant); +GSList* conference_next_participant (GSList* participant); -GSList* conference_participant_list_update(gchar**, conference_obj_t*); +GSList* conference_participant_list_update (gchar**, conference_obj_t*); #endif diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.c b/sflphone-client-gnome/src/config/accountconfigdialog.c index b4a75d272c65753474e8d6689e5c5780857979e0..a83857539c410b31cabffe8b96e768e9859082b8 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountconfigdialog.c @@ -57,7 +57,7 @@ * TODO: tidy this up * by storing these variables * in a private structure. - * Local variables + * Local variables */ GtkDialog * dialog; GtkWidget * hbox; @@ -112,11 +112,11 @@ gchar *current_username; // Credentials enum { - COLUMN_CREDENTIAL_REALM, - COLUMN_CREDENTIAL_USERNAME, - COLUMN_CREDENTIAL_PASSWORD, - COLUMN_CREDENTIAL_DATA, - COLUMN_CREDENTIAL_COUNT + COLUMN_CREDENTIAL_REALM, + COLUMN_CREDENTIAL_USERNAME, + COLUMN_CREDENTIAL_PASSWORD, + COLUMN_CREDENTIAL_DATA, + COLUMN_CREDENTIAL_COUNT }; /* @@ -124,1216 +124,1227 @@ enum { */ static void show_password_cb (GtkWidget *widget, gpointer data) { - gtk_entry_set_visibility (GTK_ENTRY (data), !gtk_entry_get_visibility (GTK_ENTRY (data))); + gtk_entry_set_visibility (GTK_ENTRY (data), !gtk_entry_get_visibility (GTK_ENTRY (data))); } /* Signal to protocolComboBox 'changed' */ -void change_protocol_cb (account_t *currentAccount UNUSED) { - - gchar *protocol = gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox)); - - // Only if tabs are not NULL - if(security_tab && advanced_tab) { - if (g_strcasecmp (protocol, "IAX") == 0) { - gtk_widget_hide (GTK_WIDGET(security_tab)); - gtk_widget_hide (GTK_WIDGET(advanced_tab)); - } - else { - gtk_widget_show (GTK_WIDGET(security_tab)); - gtk_widget_show (GTK_WIDGET(advanced_tab)); - } - } +void change_protocol_cb (account_t *currentAccount UNUSED) +{ + + gchar *protocol = gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox)); + + // Only if tabs are not NULL + if (security_tab && advanced_tab) { + if (g_strcasecmp (protocol, "IAX") == 0) { + gtk_widget_hide (GTK_WIDGET (security_tab)); + gtk_widget_hide (GTK_WIDGET (advanced_tab)); + } else { + gtk_widget_show (GTK_WIDGET (security_tab)); + gtk_widget_show (GTK_WIDGET (advanced_tab)); + } + } } - int -is_iax_enabled(void) +int +is_iax_enabled (void) { - int res = dbus_is_iax2_enabled(); - if(res == 1) - return TRUE; - else - return FALSE; + int res = dbus_is_iax2_enabled(); + + if (res == 1) + return TRUE; + else + return FALSE; } - void -select_dtmf_type( void ) +void +select_dtmf_type (void) { - DEBUG("DTMF selection changed\n"); + DEBUG ("DTMF selection changed\n"); - if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(overrtp) ) ) - { - // dbus_set_audio_manager( ALSA ); - DEBUG("Selected DTMF over RTP"); - } - else { + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (overrtp))) { + // dbus_set_audio_manager( ALSA ); + DEBUG ("Selected DTMF over RTP"); + } else { - // dbus_set_audio_manager( PULSEAUDIO ); - DEBUG("Selected DTMF over SIP"); - } + // dbus_set_audio_manager( PULSEAUDIO ); + DEBUG ("Selected DTMF over SIP"); + } } -static GPtrArray* getNewCredential (GHashTable * properties) { +static GPtrArray* getNewCredential (GHashTable * properties) +{ - GtkTreeIter iter; - gboolean valid; - gint row_count = 0; + GtkTreeIter iter; + gboolean valid; + gint row_count = 0; + + valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (credentialStore), &iter); - valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(credentialStore), &iter); + GPtrArray *credential_array = g_ptr_array_new (); - GPtrArray *credential_array = g_ptr_array_new (); + gchar *username; + gchar *realm; + gchar *password; + GHashTable * new_table; - gchar *username; - gchar *realm; - gchar *password; - GHashTable * new_table; + gtk_tree_model_get (GTK_TREE_MODEL (credentialStore), &iter, + COLUMN_CREDENTIAL_REALM, &realm, + COLUMN_CREDENTIAL_USERNAME, &username, + COLUMN_CREDENTIAL_PASSWORD, &password, + -1); - gtk_tree_model_get (GTK_TREE_MODEL(credentialStore), &iter, - COLUMN_CREDENTIAL_REALM, &realm, - COLUMN_CREDENTIAL_USERNAME, &username, - COLUMN_CREDENTIAL_PASSWORD, &password, - -1); + g_hash_table_insert (properties, g_strdup (ACCOUNT_REALM), realm); - g_hash_table_insert(properties, g_strdup(ACCOUNT_REALM), realm); + // better use the current_username as it is the account username in the + // g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username); + g_hash_table_insert (properties, g_strdup (ACCOUNT_AUTHENTICATION_USERNAME), current_username); - // better use the current_username as it is the account username in the - // g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username); - g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), current_username); + // Do not change the password if nothing has been changed by the user + if (g_strcasecmp (password, PW_HIDDEN) != 0) + g_hash_table_insert (properties, g_strdup (ACCOUNT_PASSWORD), password); - // Do not change the password if nothing has been changed by the user - if (g_strcasecmp (password, PW_HIDDEN) != 0) - g_hash_table_insert(properties, g_strdup(ACCOUNT_PASSWORD), password); - - valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter); + valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (credentialStore), &iter); - while (valid) { - gtk_tree_model_get (GTK_TREE_MODEL(credentialStore), &iter, - COLUMN_CREDENTIAL_REALM, &realm, - COLUMN_CREDENTIAL_USERNAME, &username, - COLUMN_CREDENTIAL_PASSWORD, &password, - -1); + while (valid) { + gtk_tree_model_get (GTK_TREE_MODEL (credentialStore), &iter, + COLUMN_CREDENTIAL_REALM, &realm, + COLUMN_CREDENTIAL_USERNAME, &username, + COLUMN_CREDENTIAL_PASSWORD, &password, + -1); - DEBUG ("Row %d: %s %s %s", row_count, username, password, realm); + DEBUG ("Row %d: %s %s %s", row_count, username, password, realm); - new_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - g_hash_table_insert(new_table, g_strdup(ACCOUNT_REALM), realm); - g_hash_table_insert(new_table, g_strdup(ACCOUNT_USERNAME), username); - g_hash_table_insert(new_table, g_strdup(ACCOUNT_PASSWORD), password); + new_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + g_hash_table_insert (new_table, g_strdup (ACCOUNT_REALM), realm); + g_hash_table_insert (new_table, g_strdup (ACCOUNT_USERNAME), username); + g_hash_table_insert (new_table, g_strdup (ACCOUNT_PASSWORD), password); - g_ptr_array_add (credential_array, new_table); + g_ptr_array_add (credential_array, new_table); - row_count ++; + row_count ++; - valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter); - } + valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (credentialStore), &iter); + } - return credential_array; + return credential_array; } -static void update_credential_cb(GtkWidget *widget, gpointer data UNUSED) +static void update_credential_cb (GtkWidget *widget, gpointer data UNUSED) { - GtkTreeIter iter; - gtk_tree_model_get_iter_from_string ((GtkTreeModel *) credentialStore, &iter, "0"); - gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "column")); - // g_print ("set password to %s\n", (gchar *) gtk_entry_get_text(GTK_ENTRY(widget))); - gtk_list_store_set (GTK_LIST_STORE (credentialStore), &iter, column, (gchar *) gtk_entry_get_text(GTK_ENTRY(widget)), -1); + GtkTreeIter iter; + gtk_tree_model_get_iter_from_string ( (GtkTreeModel *) credentialStore, &iter, "0"); + gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "column")); + // g_print ("set password to %s\n", (gchar *) gtk_entry_get_text(GTK_ENTRY(widget))); + gtk_list_store_set (GTK_LIST_STORE (credentialStore), &iter, column, (gchar *) gtk_entry_get_text (GTK_ENTRY (widget)), -1); } -static GtkWidget* create_basic_tab (account_t **a) { +static GtkWidget* create_basic_tab (account_t **a) +{ - GtkWidget * frame; - GtkWidget * table; - account_t *currentAccount; - GtkWidget * clearTextCheckbox; + GtkWidget * frame; + GtkWidget * table; + account_t *currentAccount; + GtkWidget * clearTextCheckbox; #if GTK_CHECK_VERSION(2,16,0) #else - GtkWidget *image; + GtkWidget *image; #endif - // Default settings - gchar *curAccountID = ""; - gchar *curAccountEnabled = "true"; - gchar *curAccountType = "SIP"; - gchar *curAlias = ""; - gchar *curUsername = ""; - gchar *curRouteSet = ""; - gchar *curHostname = ""; - gchar *curPassword = ""; - /* TODO: add curProxy, and add boxes for Proxy support */ - gchar *curMailbox = ""; - gchar *curUseragent = ""; - - currentAccount = *a; - - int row = 0; - - // Load from SIP/IAX/Unknown ? - if(currentAccount) - { - curAccountID = currentAccount->accountID; - curAccountType = g_hash_table_lookup(currentAccount->properties, ACCOUNT_TYPE); - DEBUG("Config: Current accountType %s", curAccountType); - curAccountEnabled = g_hash_table_lookup(currentAccount->properties, ACCOUNT_ENABLED); - curAlias = g_hash_table_lookup(currentAccount->properties, ACCOUNT_ALIAS); - curHostname = g_hash_table_lookup(currentAccount->properties, ACCOUNT_HOSTNAME); - curPassword = g_hash_table_lookup(currentAccount->properties, ACCOUNT_PASSWORD); - curUsername = g_hash_table_lookup(currentAccount->properties, ACCOUNT_USERNAME); - // curRouteSet = g_hash_table_lookup(currentAccount->properties, ACCOUNT_ROUTE); - curMailbox = g_hash_table_lookup(currentAccount->properties, ACCOUNT_MAILBOX); - curUseragent = g_hash_table_lookup(currentAccount->properties, ACCOUNT_USERAGENT); - } - - gnome_main_section_new (_("Account Parameters"), &frame); - gtk_widget_show(frame); - - if(strcmp(curAccountType, "SIP") == 0) { - table = gtk_table_new (9, 2, FALSE/* homogeneous */); - } - else if(strcmp(curAccountType, "IAX") == 0) { - table = gtk_table_new (8, 2, FALSE); - } - - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_widget_show (table); - gtk_container_add( GTK_CONTAINER( frame) , table ); - - label = gtk_label_new_with_mnemonic (_("_Alias")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - entryAlias = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryAlias); - gtk_entry_set_text(GTK_ENTRY(entryAlias), curAlias); - gtk_table_attach ( GTK_TABLE( table ), entryAlias, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - - row++; - label = gtk_label_new_with_mnemonic (_("_Protocol")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - protocolComboBox = gtk_combo_box_new_text(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), protocolComboBox); - gtk_combo_box_append_text(GTK_COMBO_BOX(protocolComboBox), "SIP"); - if( is_iax_enabled() ) gtk_combo_box_append_text(GTK_COMBO_BOX(protocolComboBox), "IAX"); - if(strcmp(curAccountType, "SIP") == 0) - { - gtk_combo_box_set_active(GTK_COMBO_BOX(protocolComboBox),0); - } - else if(strcmp(curAccountType, "IAX") == 0) - { - gtk_combo_box_set_active(GTK_COMBO_BOX(protocolComboBox),1); - } - else - { - DEBUG("Config: Error: Account protocol not valid"); - /* Should never come here, add debug message. */ - gtk_combo_box_append_text(GTK_COMBO_BOX(protocolComboBox), _("Unknown")); - gtk_combo_box_set_active(GTK_COMBO_BOX(protocolComboBox),2); - } - gtk_table_attach ( GTK_TABLE( table ), protocolComboBox, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - /* Link signal 'changed' */ - g_signal_connect (G_OBJECT (GTK_COMBO_BOX(protocolComboBox)), "changed", - G_CALLBACK (change_protocol_cb), - currentAccount); - - row++; - label = gtk_label_new_with_mnemonic (_("_Host name")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - entryHostname = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryHostname); - gtk_entry_set_text(GTK_ENTRY(entryHostname), curHostname); - gtk_table_attach ( GTK_TABLE( table ), entryHostname, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - row++; - label = gtk_label_new_with_mnemonic (_("_User name")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + // Default settings + gchar *curAccountID = ""; + gchar *curAccountEnabled = "true"; + gchar *curAccountType = "SIP"; + gchar *curAlias = ""; + gchar *curUsername = ""; + gchar *curRouteSet = ""; + gchar *curHostname = ""; + gchar *curPassword = ""; + /* TODO: add curProxy, and add boxes for Proxy support */ + gchar *curMailbox = ""; + gchar *curUseragent = ""; + + currentAccount = *a; + + int row = 0; + + // Load from SIP/IAX/Unknown ? + if (currentAccount) { + curAccountID = currentAccount->accountID; + curAccountType = g_hash_table_lookup (currentAccount->properties, ACCOUNT_TYPE); + DEBUG ("Config: Current accountType %s", curAccountType); + curAccountEnabled = g_hash_table_lookup (currentAccount->properties, ACCOUNT_ENABLED); + curAlias = g_hash_table_lookup (currentAccount->properties, ACCOUNT_ALIAS); + curHostname = g_hash_table_lookup (currentAccount->properties, ACCOUNT_HOSTNAME); + curPassword = g_hash_table_lookup (currentAccount->properties, ACCOUNT_PASSWORD); + curUsername = g_hash_table_lookup (currentAccount->properties, ACCOUNT_USERNAME); + // curRouteSet = g_hash_table_lookup(currentAccount->properties, ACCOUNT_ROUTE); + curMailbox = g_hash_table_lookup (currentAccount->properties, ACCOUNT_MAILBOX); + curUseragent = g_hash_table_lookup (currentAccount->properties, ACCOUNT_USERAGENT); + } + + gnome_main_section_new (_ ("Account Parameters"), &frame); + gtk_widget_show (frame); + + if (strcmp (curAccountType, "SIP") == 0) { + table = gtk_table_new (9, 2, FALSE/* homogeneous */); + } else if (strcmp (curAccountType, "IAX") == 0) { + table = gtk_table_new (8, 2, FALSE); + } + + gtk_table_set_row_spacings (GTK_TABLE (table), 10); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + gtk_widget_show (table); + gtk_container_add (GTK_CONTAINER (frame) , table); + + label = gtk_label_new_with_mnemonic (_ ("_Alias")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + entryAlias = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryAlias); + gtk_entry_set_text (GTK_ENTRY (entryAlias), curAlias); + gtk_table_attach (GTK_TABLE (table), entryAlias, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + + row++; + label = gtk_label_new_with_mnemonic (_ ("_Protocol")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + protocolComboBox = gtk_combo_box_new_text(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), protocolComboBox); + gtk_combo_box_append_text (GTK_COMBO_BOX (protocolComboBox), "SIP"); + + if (is_iax_enabled()) gtk_combo_box_append_text (GTK_COMBO_BOX (protocolComboBox), "IAX"); + + if (strcmp (curAccountType, "SIP") == 0) { + gtk_combo_box_set_active (GTK_COMBO_BOX (protocolComboBox),0); + } else if (strcmp (curAccountType, "IAX") == 0) { + gtk_combo_box_set_active (GTK_COMBO_BOX (protocolComboBox),1); + } else { + DEBUG ("Config: Error: Account protocol not valid"); + /* Should never come here, add debug message. */ + gtk_combo_box_append_text (GTK_COMBO_BOX (protocolComboBox), _ ("Unknown")); + gtk_combo_box_set_active (GTK_COMBO_BOX (protocolComboBox),2); + } + + gtk_table_attach (GTK_TABLE (table), protocolComboBox, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + /* Link signal 'changed' */ + g_signal_connect (G_OBJECT (GTK_COMBO_BOX (protocolComboBox)), "changed", + G_CALLBACK (change_protocol_cb), + currentAccount); + + row++; + label = gtk_label_new_with_mnemonic (_ ("_Host name")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + entryHostname = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryHostname); + gtk_entry_set_text (GTK_ENTRY (entryHostname), curHostname); + gtk_table_attach (GTK_TABLE (table), entryHostname, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + row++; + label = gtk_label_new_with_mnemonic (_ ("_User name")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); #if GTK_CHECK_VERSION(2,16,0) - entryUsername = gtk_entry_new(); - gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (entryUsername), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file(ICONS_DIR "/stock_person.svg", NULL)); + entryUsername = gtk_entry_new(); + gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (entryUsername), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file (ICONS_DIR "/stock_person.svg", NULL)); #else - entryUsername = sexy_icon_entry_new(); - image = gtk_image_new_from_file( ICONS_DIR "/stock_person.svg" ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(entryUsername), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + entryUsername = sexy_icon_entry_new(); + image = gtk_image_new_from_file (ICONS_DIR "/stock_person.svg"); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (entryUsername), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); #endif - gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryUsername); - gtk_entry_set_text(GTK_ENTRY(entryUsername), curUsername); - gtk_table_attach ( GTK_TABLE( table ), entryUsername, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - if(strcmp(curAccountType, "SIP") == 0) { - g_signal_connect(G_OBJECT (entryUsername), "changed", G_CALLBACK (update_credential_cb), NULL); - g_object_set_data (G_OBJECT (entryUsername), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); - } - - // Route set can be update only for SIP account - // TODO: uncomment this code and implement route - /* - if(strcmp(curAccountType, "SIP") == 0) { - row++; - label = gtk_label_new_with_mnemonic(_("_Route (optional)")); - gtk_table_attach(GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - entryRouteSet = gtk_entry_new(); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), entryRouteSet); - gtk_entry_set_text(GTK_ENTRY(entryRouteSet), curRouteSet); - gtk_table_attach (GTK_TABLE(table), entryRouteSet, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - } - */ - - row++; - label = gtk_label_new_with_mnemonic (_("_Password")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryUsername); + gtk_entry_set_text (GTK_ENTRY (entryUsername), curUsername); + gtk_table_attach (GTK_TABLE (table), entryUsername, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + if (strcmp (curAccountType, "SIP") == 0) { + g_signal_connect (G_OBJECT (entryUsername), "changed", G_CALLBACK (update_credential_cb), NULL); + g_object_set_data (G_OBJECT (entryUsername), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); + } + + // Route set can be update only for SIP account + // TODO: uncomment this code and implement route + /* + if(strcmp(curAccountType, "SIP") == 0) { + row++; + label = gtk_label_new_with_mnemonic(_("_Route (optional)")); + gtk_table_attach(GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + entryRouteSet = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), entryRouteSet); + gtk_entry_set_text(GTK_ENTRY(entryRouteSet), curRouteSet); + gtk_table_attach (GTK_TABLE(table), entryRouteSet, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + } + */ + + row++; + label = gtk_label_new_with_mnemonic (_ ("_Password")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); #if GTK_CHECK_VERSION(2,16,0) - entryPassword = gtk_entry_new(); - GtkSettings *settings = gtk_settings_get_default (); - //g_object_set (G_OBJECT (settings), "gtk-entry-password-hint-timeout", 600, NULL); - gtk_entry_set_icon_from_stock (GTK_ENTRY (entryPassword), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); + entryPassword = gtk_entry_new(); + GtkSettings *settings = gtk_settings_get_default (); + //g_object_set (G_OBJECT (settings), "gtk-entry-password-hint-timeout", 600, NULL); + gtk_entry_set_icon_from_stock (GTK_ENTRY (entryPassword), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); #else - entryPassword = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(entryPassword), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + entryPassword = sexy_icon_entry_new(); + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (entryPassword), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); #endif - gtk_entry_set_visibility(GTK_ENTRY(entryPassword), FALSE); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryPassword); - gtk_entry_set_text(GTK_ENTRY(entryPassword), curPassword); - gtk_table_attach ( GTK_TABLE( table ), entryPassword, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - if(strcmp(curAccountType, "SIP") == 0) { - g_signal_connect (G_OBJECT (entryPassword), "changed", G_CALLBACK (update_credential_cb), NULL); - g_object_set_data (G_OBJECT (entryPassword), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); - } - - row++; - clearTextCheckbox = gtk_check_button_new_with_mnemonic (_("Show password")); - g_signal_connect (clearTextCheckbox, "toggled", G_CALLBACK (show_password_cb), entryPassword); - gtk_table_attach (GTK_TABLE (table), clearTextCheckbox, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - row++; - label = gtk_label_new_with_mnemonic (_("_Voicemail number")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - entryMailbox = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryMailbox); - gtk_entry_set_text(GTK_ENTRY(entryMailbox), curMailbox); - gtk_table_attach ( GTK_TABLE( table ), entryMailbox, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - row++; - label = gtk_label_new_with_mnemonic (_("_User-agent")); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - entryUseragent = gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryUseragent); - gtk_entry_set_text (GTK_ENTRY (entryUseragent), curUseragent); - gtk_table_attach ( GTK_TABLE( table ), entryUseragent, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - gtk_widget_show_all( table ); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - - *a = currentAccount; - return frame; + gtk_entry_set_visibility (GTK_ENTRY (entryPassword), FALSE); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryPassword); + gtk_entry_set_text (GTK_ENTRY (entryPassword), curPassword); + gtk_table_attach (GTK_TABLE (table), entryPassword, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + if (strcmp (curAccountType, "SIP") == 0) { + g_signal_connect (G_OBJECT (entryPassword), "changed", G_CALLBACK (update_credential_cb), NULL); + g_object_set_data (G_OBJECT (entryPassword), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); + } + + row++; + clearTextCheckbox = gtk_check_button_new_with_mnemonic (_ ("Show password")); + g_signal_connect (clearTextCheckbox, "toggled", G_CALLBACK (show_password_cb), entryPassword); + gtk_table_attach (GTK_TABLE (table), clearTextCheckbox, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + row++; + label = gtk_label_new_with_mnemonic (_ ("_Voicemail number")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + entryMailbox = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryMailbox); + gtk_entry_set_text (GTK_ENTRY (entryMailbox), curMailbox); + gtk_table_attach (GTK_TABLE (table), entryMailbox, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + row++; + label = gtk_label_new_with_mnemonic (_ ("_User-agent")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + entryUseragent = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryUseragent); + gtk_entry_set_text (GTK_ENTRY (entryUseragent), curUseragent); + gtk_table_attach (GTK_TABLE (table), entryUseragent, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + gtk_widget_show_all (table); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + + *a = currentAccount; + return frame; } -static void fill_treeview_with_credential (GtkListStore * credentialStore, account_t * account) +static void fill_treeview_with_credential (GtkListStore * credentialStore, account_t * account) { - GtkTreeIter iter; - gtk_list_store_clear(credentialStore); - gtk_list_store_append (credentialStore, &iter); - - /* This is the default, undeletable credential */ - gchar * authentication_name = g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME); - gchar * realm = g_hash_table_lookup(account->properties, ACCOUNT_REALM); - if (realm == NULL || (g_strcmp0(realm, "") == 0)) { - realm = g_strdup("*"); - } - - if((authentication_name == NULL) || (g_strcmp0(authentication_name, "") == 0)) { - gtk_list_store_set(credentialStore, &iter, - COLUMN_CREDENTIAL_REALM, realm, - COLUMN_CREDENTIAL_USERNAME, gtk_entry_get_text(GTK_ENTRY(entryUsername)), - COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)), - COLUMN_CREDENTIAL_DATA, account, - -1); - } else { - gtk_list_store_set(credentialStore, &iter, - COLUMN_CREDENTIAL_REALM, g_hash_table_lookup(account->properties, ACCOUNT_REALM), - COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME), - // COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)), - COLUMN_CREDENTIAL_PASSWORD, PW_HIDDEN, - COLUMN_CREDENTIAL_DATA, account, - -1); - g_signal_handlers_disconnect_by_func (G_OBJECT(entryUsername), G_CALLBACK(update_credential_cb), NULL); - } - - if(account->credential_information == NULL) { - DEBUG("No credential defined"); - return; - } - - unsigned int i; - for(i = 0; i < account->credential_information->len; i++) - { - GHashTable * element = g_ptr_array_index(account->credential_information, i); - gtk_list_store_append (credentialStore, &iter); - gtk_list_store_set(credentialStore, &iter, - COLUMN_CREDENTIAL_REALM, g_hash_table_lookup(element, ACCOUNT_REALM), - COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup(element, ACCOUNT_USERNAME), - COLUMN_CREDENTIAL_PASSWORD, g_hash_table_lookup(element, ACCOUNT_PASSWORD), - COLUMN_CREDENTIAL_DATA, element, // Pointer - -1); - } + GtkTreeIter iter; + gtk_list_store_clear (credentialStore); + gtk_list_store_append (credentialStore, &iter); + + /* This is the default, undeletable credential */ + gchar * authentication_name = g_hash_table_lookup (account->properties, ACCOUNT_AUTHENTICATION_USERNAME); + gchar * realm = g_hash_table_lookup (account->properties, ACCOUNT_REALM); + + if (realm == NULL || (g_strcmp0 (realm, "") == 0)) { + realm = g_strdup ("*"); + } + + if ( (authentication_name == NULL) || (g_strcmp0 (authentication_name, "") == 0)) { + gtk_list_store_set (credentialStore, &iter, + COLUMN_CREDENTIAL_REALM, realm, + COLUMN_CREDENTIAL_USERNAME, gtk_entry_get_text (GTK_ENTRY (entryUsername)), + COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text (GTK_ENTRY (entryPassword)), + COLUMN_CREDENTIAL_DATA, account, + -1); + } else { + gtk_list_store_set (credentialStore, &iter, + COLUMN_CREDENTIAL_REALM, g_hash_table_lookup (account->properties, ACCOUNT_REALM), + COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup (account->properties, ACCOUNT_AUTHENTICATION_USERNAME), + // COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)), + COLUMN_CREDENTIAL_PASSWORD, PW_HIDDEN, + COLUMN_CREDENTIAL_DATA, account, + -1); + g_signal_handlers_disconnect_by_func (G_OBJECT (entryUsername), G_CALLBACK (update_credential_cb), NULL); + } + + if (account->credential_information == NULL) { + DEBUG ("No credential defined"); + return; + } + + unsigned int i; + + for (i = 0; i < account->credential_information->len; i++) { + GHashTable * element = g_ptr_array_index (account->credential_information, i); + gtk_list_store_append (credentialStore, &iter); + gtk_list_store_set (credentialStore, &iter, + COLUMN_CREDENTIAL_REALM, g_hash_table_lookup (element, ACCOUNT_REALM), + COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup (element, ACCOUNT_USERNAME), + COLUMN_CREDENTIAL_PASSWORD, g_hash_table_lookup (element, ACCOUNT_PASSWORD), + COLUMN_CREDENTIAL_DATA, element, // Pointer + -1); + } } -static select_credential_cb(GtkTreeSelection *selection, GtkTreeModel *model) +static select_credential_cb (GtkTreeSelection *selection, GtkTreeModel *model) { - GtkTreeIter iter; - GtkTreePath *path; - if(gtk_tree_selection_get_selected (selection, NULL, &iter)) { - path = gtk_tree_model_get_path (model, &iter); - if(gtk_tree_path_get_indices (path)[0] == 0) { - gtk_widget_set_sensitive(GTK_WIDGET(deleteCredButton), FALSE); - } else { - gtk_widget_set_sensitive(GTK_WIDGET(deleteCredButton), TRUE); - } - } + GtkTreeIter iter; + GtkTreePath *path; + + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) { + path = gtk_tree_model_get_path (model, &iter); + + if (gtk_tree_path_get_indices (path) [0] == 0) { + gtk_widget_set_sensitive (GTK_WIDGET (deleteCredButton), FALSE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (deleteCredButton), TRUE); + } + } } static void add_credential_cb (GtkWidget *button, gpointer data) { - GtkTreeIter iter; - GtkTreeModel *model = (GtkTreeModel *)data; - - gtk_list_store_append (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - COLUMN_CREDENTIAL_REALM, "*", - COLUMN_CREDENTIAL_USERNAME, _("Authentication"), - COLUMN_CREDENTIAL_PASSWORD, _("Secret"), - -1); + GtkTreeIter iter; + GtkTreeModel *model = (GtkTreeModel *) data; + + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COLUMN_CREDENTIAL_REALM, "*", + COLUMN_CREDENTIAL_USERNAME, _ ("Authentication"), + COLUMN_CREDENTIAL_PASSWORD, _ ("Secret"), + -1); } -static void delete_credential_cb(GtkWidget *button, gpointer data) +static void delete_credential_cb (GtkWidget *button, gpointer data) { - GtkTreeIter iter; - GtkTreeView *treeview = (GtkTreeView *)data; - GtkTreeModel *model = gtk_tree_view_get_model (treeview); - GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); + GtkTreeIter iter; + GtkTreeView *treeview = (GtkTreeView *) data; + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); - if (gtk_tree_selection_get_selected (selection, NULL, &iter)) - { - GtkTreePath *path; - path = gtk_tree_model_get_path (model, &iter); - gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) { + GtkTreePath *path; + path = gtk_tree_model_get_path (model, &iter); + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); - gtk_tree_path_free (path); - } + gtk_tree_path_free (path); + } } -static void cell_edited_cb(GtkCellRendererText *renderer, gchar *path_desc, gchar *text, gpointer data) +static void cell_edited_cb (GtkCellRendererText *renderer, gchar *path_desc, gchar *text, gpointer data) { - GtkTreeModel *model = (GtkTreeModel *)data; - GtkTreePath *path = gtk_tree_path_new_from_string (path_desc); - GtkTreeIter iter; + GtkTreeModel *model = (GtkTreeModel *) data; + GtkTreePath *path = gtk_tree_path_new_from_string (path_desc); + GtkTreeIter iter; - gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (renderer), "column")); - DEBUG("path desc in cell_edited_cb: %s\n", text); + gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (renderer), "column")); + DEBUG ("path desc in cell_edited_cb: %s\n", text); - if(g_strcasecmp(path_desc, "0") == 0) { - if(g_strcasecmp(text, gtk_entry_get_text (GTK_ENTRY(entryUsername))) != 0) { - g_signal_handlers_disconnect_by_func (G_OBJECT(entryUsername), G_CALLBACK(update_credential_cb), NULL); - } + if (g_strcasecmp (path_desc, "0") == 0) { + if (g_strcasecmp (text, gtk_entry_get_text (GTK_ENTRY (entryUsername))) != 0) { + g_signal_handlers_disconnect_by_func (G_OBJECT (entryUsername), G_CALLBACK (update_credential_cb), NULL); + } - if (column == COLUMN_CREDENTIAL_PASSWORD) { - gtk_entry_set_text (GTK_ENTRY (entryPassword), text); - text = PW_HIDDEN; - } - } + if (column == COLUMN_CREDENTIAL_PASSWORD) { + gtk_entry_set_text (GTK_ENTRY (entryPassword), text); + text = PW_HIDDEN; + } + } - gtk_tree_model_get_iter (model, &iter, path); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, column, text, -1); - gtk_tree_path_free (path); + gtk_tree_model_get_iter (model, &iter, path); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, column, text, -1); + gtk_tree_path_free (path); } -static void editing_started_cb (GtkCellRenderer *cell, GtkCellEditable * editable, const gchar * path, gpointer data) { +static void editing_started_cb (GtkCellRenderer *cell, GtkCellEditable * editable, const gchar * path, gpointer data) +{ - DEBUG("Editing started"); - DEBUG("path desc in editing_started_cb: %s\n", path); + DEBUG ("Editing started"); + DEBUG ("path desc in editing_started_cb: %s\n", path); - // If we are dealing the first row - if (g_strcasecmp (path, "0") == 0) - { - gtk_entry_set_text (GTK_ENTRY (editable), gtk_entry_get_text (GTK_ENTRY (entryPassword))); - } + // If we are dealing the first row + if (g_strcasecmp (path, "0") == 0) { + gtk_entry_set_text (GTK_ENTRY (editable), gtk_entry_get_text (GTK_ENTRY (entryPassword))); + } } -static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer data) +static void show_advanced_zrtp_options_cb (GtkWidget *widget UNUSED, gpointer data) { - DEBUG("Advanced options for SRTP"); - if (g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "ZRTP") == 0) { - show_advanced_zrtp_options((GHashTable *) data); - } - else { - show_advanced_sdes_options((GHashTable *) data); + DEBUG ("Advanced options for SRTP"); + + if (g_strcasecmp (gtk_combo_box_get_active_text (GTK_COMBO_BOX (keyExchangeCombo)), (gchar *) "ZRTP") == 0) { + show_advanced_zrtp_options ( (GHashTable *) data); + } else { + show_advanced_sdes_options ( (GHashTable *) data); } } -static void show_advanced_tls_options_cb(GtkWidget *widget UNUSED, gpointer data) +static void show_advanced_tls_options_cb (GtkWidget *widget UNUSED, gpointer data) { - DEBUG("Advanced options for TLS"); - show_advanced_tls_options((GHashTable *) data); + DEBUG ("Advanced options for TLS"); + show_advanced_tls_options ( (GHashTable *) data); } -static void key_exchange_changed_cb(GtkWidget *widget, gpointer data) +static void key_exchange_changed_cb (GtkWidget *widget, gpointer data) { - DEBUG("Key exchange changed %s", gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo))); + DEBUG ("Key exchange changed %s", gtk_combo_box_get_active_text (GTK_COMBO_BOX (keyExchangeCombo))); - int isSdes = g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "SDES"); - int isZrtp = g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "ZRTP"); + int isSdes = g_strcasecmp (gtk_combo_box_get_active_text (GTK_COMBO_BOX (keyExchangeCombo)), (gchar *) "SDES"); + int isZrtp = g_strcasecmp (gtk_combo_box_get_active_text (GTK_COMBO_BOX (keyExchangeCombo)), (gchar *) "ZRTP"); - if ((isSdes == 0) || (isZrtp == 0)) { - gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), TRUE); + if ( (isSdes == 0) || (isZrtp == 0)) { + gtk_widget_set_sensitive (GTK_WIDGET (advancedZrtpButton), TRUE); } else { - gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); - + gtk_widget_set_sensitive (GTK_WIDGET (advancedZrtpButton), FALSE); + } } -static void use_sip_tls_cb(GtkWidget *widget, gpointer data) +static void use_sip_tls_cb (GtkWidget *widget, gpointer data) { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Using sips"); - gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); - // Uncheck stun - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useStunCheckBox), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(useStunCheckBox), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), TRUE); - gtk_widget_hide (stunServerLabel); - gtk_widget_hide (stunServerEntry); - - - - if(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { - gtk_widget_show(publishedAddressEntry); - gtk_widget_show(publishedPortSpinBox); - gtk_widget_show(publishedAddressLabel); - gtk_widget_show(publishedPortLabel); - } - - } else { - gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(useStunCheckBox), TRUE); - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox))) { - gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), FALSE); - gtk_widget_show(stunServerLabel); - gtk_widget_show(stunServerEntry); - gtk_widget_hide(publishedAddressEntry); - gtk_widget_hide(publishedPortSpinBox); - gtk_widget_hide(publishedAddressLabel); - gtk_widget_hide(publishedPortLabel); - } - else { - gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), TRUE); - gtk_widget_hide(stunServerLabel); - gtk_widget_hide(stunServerEntry); - } - - } + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + DEBUG ("Using sips"); + gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE); + // Uncheck stun + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (useStunCheckBox), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (useStunCheckBox), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (sameAsLocalRadioButton), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (publishedAddrRadioButton), TRUE); + gtk_widget_hide (stunServerLabel); + gtk_widget_hide (stunServerEntry); + + + + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton))) { + gtk_widget_show (publishedAddressEntry); + gtk_widget_show (publishedPortSpinBox); + gtk_widget_show (publishedAddressLabel); + gtk_widget_show (publishedPortLabel); + } + + } else { + gtk_widget_set_sensitive (GTK_WIDGET (data), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (useStunCheckBox), TRUE); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (useStunCheckBox))) { + gtk_widget_set_sensitive (GTK_WIDGET (sameAsLocalRadioButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (publishedAddrRadioButton), FALSE); + gtk_widget_show (stunServerLabel); + gtk_widget_show (stunServerEntry); + gtk_widget_hide (publishedAddressEntry); + gtk_widget_hide (publishedPortSpinBox); + gtk_widget_hide (publishedAddressLabel); + gtk_widget_hide (publishedPortLabel); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (sameAsLocalRadioButton), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (publishedAddrRadioButton), TRUE); + gtk_widget_hide (stunServerLabel); + gtk_widget_hide (stunServerEntry); + } + + } } -static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) { +static local_interface_changed_cb (GtkWidget * widget, gpointer data UNUSED) +{ - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton))) { - gchar *local_iface_name; - gchar *local_iface_addr; - local_iface_addr = g_malloc(36); + gchar *local_iface_name; + gchar *local_iface_addr; + local_iface_addr = g_malloc (36); - local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); - // sflphone_get_interface_addr_from_name((char *)local_interface); - sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr, 36); + local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); + // sflphone_get_interface_addr_from_name((char *)local_interface); + sflphone_get_interface_addr_from_name (local_iface_name, &local_iface_addr, 36); - gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); - gtk_entry_set_text (GTK_ENTRY(publishedAddressEntry), local_iface_addr); + gtk_entry_set_text (GTK_ENTRY (localAddressEntry), local_iface_addr); + gtk_entry_set_text (GTK_ENTRY (publishedAddressEntry), local_iface_addr); - // gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); - // gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); - g_free(local_iface_addr); - } + // gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); + // gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); + g_free (local_iface_addr); + } } -static set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED) +static set_published_addr_manually_cb (GtkWidget * widget, gpointer data UNUSED) { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Config: Showing manual publishing options"); - gtk_widget_show(publishedPortLabel); - gtk_widget_show(publishedPortSpinBox); - gtk_widget_show(publishedAddressLabel); - gtk_widget_show(publishedAddressEntry); - } else { - DEBUG("Config: Hiding manual publishing options"); - gtk_widget_hide(publishedPortLabel); - gtk_widget_hide(publishedPortSpinBox); - gtk_widget_hide(publishedAddressLabel); - gtk_widget_hide(publishedAddressEntry); - } + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + DEBUG ("Config: Showing manual publishing options"); + gtk_widget_show (publishedPortLabel); + gtk_widget_show (publishedPortSpinBox); + gtk_widget_show (publishedAddressLabel); + gtk_widget_show (publishedAddressEntry); + } else { + DEBUG ("Config: Hiding manual publishing options"); + gtk_widget_hide (publishedPortLabel); + gtk_widget_hide (publishedPortSpinBox); + gtk_widget_hide (publishedAddressLabel); + gtk_widget_hide (publishedAddressEntry); + } } -static use_stun_cb(GtkWidget *widget, gpointer data UNUSED) +static use_stun_cb (GtkWidget *widget, gpointer data UNUSED) { - gchar *local_interface; - gchar *local_address; - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { - - DEBUG("Config: Showing stun options, hiding Local/Published info"); - gtk_widget_show (stunServerLabel); - gtk_widget_show (stunServerEntry); - gtk_widget_set_sensitive (sameAsLocalRadioButton, FALSE); - gtk_widget_set_sensitive (publishedAddrRadioButton, FALSE); - - gtk_widget_hide (publishedAddressLabel); - gtk_widget_hide (publishedPortLabel); - gtk_widget_hide (publishedAddressEntry); - gtk_widget_hide (publishedPortSpinBox); - - } else { - - DEBUG("Config: hiding stun options, showing Local/Published info"); - - gtk_widget_hide (stunServerLabel); - gtk_widget_hide (stunServerEntry); - gtk_widget_set_sensitive (sameAsLocalRadioButton, TRUE); - gtk_widget_set_sensitive (publishedAddrRadioButton, TRUE); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton))) { - gtk_widget_show (publishedAddressLabel); - gtk_widget_show (publishedPortLabel); - gtk_widget_show (publishedAddressEntry); - gtk_widget_show (publishedPortSpinBox); - } - } + gchar *local_interface; + gchar *local_address; + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + + DEBUG ("Config: Showing stun options, hiding Local/Published info"); + gtk_widget_show (stunServerLabel); + gtk_widget_show (stunServerEntry); + gtk_widget_set_sensitive (sameAsLocalRadioButton, FALSE); + gtk_widget_set_sensitive (publishedAddrRadioButton, FALSE); + + gtk_widget_hide (publishedAddressLabel); + gtk_widget_hide (publishedPortLabel); + gtk_widget_hide (publishedAddressEntry); + gtk_widget_hide (publishedPortSpinBox); + + } else { + + DEBUG ("Config: hiding stun options, showing Local/Published info"); + + gtk_widget_hide (stunServerLabel); + gtk_widget_hide (stunServerEntry); + gtk_widget_set_sensitive (sameAsLocalRadioButton, TRUE); + gtk_widget_set_sensitive (publishedAddrRadioButton, TRUE); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton))) { + gtk_widget_show (publishedAddressLabel); + gtk_widget_show (publishedPortLabel); + gtk_widget_show (publishedAddressEntry); + gtk_widget_show (publishedPortSpinBox); + } + } } -static same_as_local_cb(GtkWidget * widget, gpointer data UNUSED) +static same_as_local_cb (GtkWidget * widget, gpointer data UNUSED) { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Same as local"); - gchar * local_interface; - gchar * local_address; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + DEBUG ("Same as local"); + gchar * local_interface; + gchar * local_address; - local_interface = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); - // sflphone_get_interface_addr_from_name((char *)local_interface); - local_address = dbus_get_address_from_interface_name(local_interface); + local_interface = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); + // sflphone_get_interface_addr_from_name((char *)local_interface); + local_address = dbus_get_address_from_interface_name (local_interface); - gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address); + gtk_entry_set_text (GTK_ENTRY (publishedAddressEntry), local_address); - gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); - } + gchar * local_port = (gchar *) gtk_entry_get_text (GTK_ENTRY (localPortSpinBox)); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (publishedPortSpinBox), g_ascii_strtod (local_port, NULL)); + } } -GtkWidget* create_credential_widget (account_t **a) { - - GtkWidget *frame, *table, *scrolledWindowCredential, *addButton; - GtkCellRenderer * renderer; - GtkTreeViewColumn * treeViewColumn; - GtkTreeSelection * treeSelection; - - /* Credentials tree view */ - gnome_main_section_new_with_table (_("Credential"), &frame, &table, 1, 1); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings(GTK_TABLE(table), 10); - - scrolledWindowCredential = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledWindowCredential), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledWindowCredential), GTK_SHADOW_IN); - gtk_table_attach_defaults (GTK_TABLE (table), scrolledWindowCredential, 0, 1, 0, 1); - - credentialStore = gtk_list_store_new(COLUMN_CREDENTIAL_COUNT, - G_TYPE_STRING, // Realm - G_TYPE_STRING, // Username - G_TYPE_STRING, // Password - G_TYPE_POINTER // Pointer to the Objectc - ); - - treeViewCredential = gtk_tree_view_new_with_model(GTK_TREE_MODEL(credentialStore)); - treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW (treeViewCredential)); - g_signal_connect(G_OBJECT (treeSelection), "changed", G_CALLBACK (select_credential_cb), credentialStore); - - renderer = gtk_cell_renderer_text_new(); - g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); - g_signal_connect(G_OBJECT (renderer), "edited", G_CALLBACK(cell_edited_cb), credentialStore); - g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_REALM)); - treeViewColumn = gtk_tree_view_column_new_with_attributes ("Realm", - renderer, - "markup", COLUMN_CREDENTIAL_REALM, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); - - renderer = gtk_cell_renderer_text_new(); - g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); - g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); - g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Authentication name"), - renderer, - "markup", COLUMN_CREDENTIAL_USERNAME, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); - - renderer = gtk_cell_renderer_text_new(); - g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); - g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); - g_signal_connect (renderer, "editing-started", G_CALLBACK (editing_started_cb), NULL); - g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Password"), - renderer, - "markup", COLUMN_CREDENTIAL_PASSWORD, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); - - gtk_container_add(GTK_CONTAINER(scrolledWindowCredential), treeViewCredential); - - fill_treeview_with_credential(credentialStore, *a); - - /* Credential Buttons */ - hbox = gtk_hbox_new(FALSE, 10); - gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 3, 1, 2); - - addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); - g_signal_connect (addButton, "clicked", G_CALLBACK (add_credential_cb), credentialStore); - gtk_box_pack_start(GTK_BOX(hbox), addButton, FALSE, FALSE, 0); - - deleteCredButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); - g_signal_connect (deleteCredButton, "clicked", G_CALLBACK (delete_credential_cb), treeViewCredential); - gtk_box_pack_start(GTK_BOX(hbox), deleteCredButton, FALSE, FALSE, 0); - - /* Dynamically resize the window to fit the scrolled window */ - GtkRequisition requisitionTable; - GtkRequisition requisitionTreeView; - gtk_widget_size_request (GTK_WIDGET(treeViewCredential), &requisitionTreeView); - gtk_widget_size_request (GTK_WIDGET(table), &requisitionTable); - gtk_widget_set_size_request (GTK_WIDGET(scrolledWindowCredential), 400, 120); - // same_as_local_cb (sameAsLocalRadioButton, NULL); - // set_published_addr_manually_cb (publishedAddrRadioButton, NULL); - - return frame; +GtkWidget* create_credential_widget (account_t **a) +{ + + GtkWidget *frame, *table, *scrolledWindowCredential, *addButton; + GtkCellRenderer * renderer; + GtkTreeViewColumn * treeViewColumn; + GtkTreeSelection * treeSelection; + + /* Credentials tree view */ + gnome_main_section_new_with_table (_ ("Credential"), &frame, &table, 1, 1); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + gtk_table_set_row_spacings (GTK_TABLE (table), 10); + + scrolledWindowCredential = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledWindowCredential), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledWindowCredential), GTK_SHADOW_IN); + gtk_table_attach_defaults (GTK_TABLE (table), scrolledWindowCredential, 0, 1, 0, 1); + + credentialStore = gtk_list_store_new (COLUMN_CREDENTIAL_COUNT, + G_TYPE_STRING, // Realm + G_TYPE_STRING, // Username + G_TYPE_STRING, // Password + G_TYPE_POINTER // Pointer to the Objectc + ); + + treeViewCredential = gtk_tree_view_new_with_model (GTK_TREE_MODEL (credentialStore)); + treeSelection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeViewCredential)); + g_signal_connect (G_OBJECT (treeSelection), "changed", G_CALLBACK (select_credential_cb), credentialStore); + + renderer = gtk_cell_renderer_text_new(); + g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); + g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_REALM)); + treeViewColumn = gtk_tree_view_column_new_with_attributes ("Realm", + renderer, + "markup", COLUMN_CREDENTIAL_REALM, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeViewCredential), treeViewColumn); + + renderer = gtk_cell_renderer_text_new(); + g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); + g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Authentication name"), + renderer, + "markup", COLUMN_CREDENTIAL_USERNAME, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeViewCredential), treeViewColumn); + + renderer = gtk_cell_renderer_text_new(); + g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); + g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); + g_signal_connect (renderer, "editing-started", G_CALLBACK (editing_started_cb), NULL); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Password"), + renderer, + "markup", COLUMN_CREDENTIAL_PASSWORD, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeViewCredential), treeViewColumn); + + gtk_container_add (GTK_CONTAINER (scrolledWindowCredential), treeViewCredential); + + fill_treeview_with_credential (credentialStore, *a); + + /* Credential Buttons */ + hbox = gtk_hbox_new (FALSE, 10); + gtk_table_attach_defaults (GTK_TABLE (table), hbox, 0, 3, 1, 2); + + addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); + g_signal_connect (addButton, "clicked", G_CALLBACK (add_credential_cb), credentialStore); + gtk_box_pack_start (GTK_BOX (hbox), addButton, FALSE, FALSE, 0); + + deleteCredButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); + g_signal_connect (deleteCredButton, "clicked", G_CALLBACK (delete_credential_cb), treeViewCredential); + gtk_box_pack_start (GTK_BOX (hbox), deleteCredButton, FALSE, FALSE, 0); + + /* Dynamically resize the window to fit the scrolled window */ + GtkRequisition requisitionTable; + GtkRequisition requisitionTreeView; + gtk_widget_size_request (GTK_WIDGET (treeViewCredential), &requisitionTreeView); + gtk_widget_size_request (GTK_WIDGET (table), &requisitionTable); + gtk_widget_set_size_request (GTK_WIDGET (scrolledWindowCredential), 400, 120); + // same_as_local_cb (sameAsLocalRadioButton, NULL); + // set_published_addr_manually_cb (publishedAddrRadioButton, NULL); + + return frame; } -GtkWidget* create_security_widget (account_t **a) { - - GtkWidget *frame, *table, *sipTlsAdvancedButton, *label; - gchar *curSRTPEnabled = NULL, *curKeyExchange = NULL, *curTLSEnabled = NULL; - - // Load from SIP/IAX/Unknown ? - if((*a)) { - curKeyExchange = g_hash_table_lookup ((*a)->properties, ACCOUNT_KEY_EXCHANGE); - if (curKeyExchange == NULL) { - curKeyExchange = "none"; - } - - curSRTPEnabled = g_hash_table_lookup ((*a)->properties, ACCOUNT_SRTP_ENABLED); - if (curSRTPEnabled == NULL) { - curSRTPEnabled = "false"; - } - - curTLSEnabled = g_hash_table_lookup ((*a)->properties, TLS_ENABLE); - if (curTLSEnabled == NULL) { - curTLSEnabled = "false"; - } - } - - gnome_main_section_new_with_table (_("Security"), &frame, &table, 2, 3); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings (GTK_TABLE(table), 10); - gtk_table_set_col_spacings (GTK_TABLE(table), 10); - - /* TLS subsection */ - sipTlsAdvancedButton = gtk_button_new_from_stock (GTK_STOCK_EDIT); - gtk_table_attach_defaults (GTK_TABLE (table), sipTlsAdvancedButton, 2, 3, 0, 1); - gtk_widget_set_sensitive (GTK_WIDGET (sipTlsAdvancedButton), FALSE); - g_signal_connect (G_OBJECT (sipTlsAdvancedButton), "clicked", G_CALLBACK (show_advanced_tls_options_cb), (*a)->properties); - - useSipTlsCheckBox = gtk_check_button_new_with_mnemonic(_("Use TLS transport (sips)")); - g_signal_connect (useSipTlsCheckBox, "toggled", G_CALLBACK(use_sip_tls_cb), sipTlsAdvancedButton); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox), (g_strcmp0(curTLSEnabled, "true") == 0) ? TRUE:FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), useSipTlsCheckBox, 0, 2, 0, 1); - - /* ZRTP subsection */ - label = gtk_label_new_with_mnemonic (_("SRTP key exchange")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - keyExchangeCombo = gtk_combo_box_new_text(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), keyExchangeCombo); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "ZRTP"); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "SDES"); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), _("Disabled")); - - advancedZrtpButton = gtk_button_new_from_stock(GTK_STOCK_PREFERENCES); - g_signal_connect(G_OBJECT(advancedZrtpButton), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb), (*a)->properties); - - if (g_strcmp0(curSRTPEnabled, "false") == 0) - { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); - gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); - } else { - if (strcmp(curKeyExchange, ZRTP) == 0) { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0); - } - else if (strcmp(curKeyExchange, SDES) == 0) { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),1); - } - else { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); - gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); - } - } - - g_signal_connect (G_OBJECT (GTK_COMBO_BOX(keyExchangeCombo)), "changed", G_CALLBACK (key_exchange_changed_cb), *a); - - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), keyExchangeCombo, 1, 2, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), advancedZrtpButton, 2, 3, 1, 2); - - gtk_widget_show_all(table); - - return frame; +GtkWidget* create_security_widget (account_t **a) +{ + + GtkWidget *frame, *table, *sipTlsAdvancedButton, *label; + gchar *curSRTPEnabled = NULL, *curKeyExchange = NULL, *curTLSEnabled = NULL; + + // Load from SIP/IAX/Unknown ? + if ( (*a)) { + curKeyExchange = g_hash_table_lookup ( (*a)->properties, ACCOUNT_KEY_EXCHANGE); + + if (curKeyExchange == NULL) { + curKeyExchange = "none"; + } + + curSRTPEnabled = g_hash_table_lookup ( (*a)->properties, ACCOUNT_SRTP_ENABLED); + + if (curSRTPEnabled == NULL) { + curSRTPEnabled = "false"; + } + + curTLSEnabled = g_hash_table_lookup ( (*a)->properties, TLS_ENABLE); + + if (curTLSEnabled == NULL) { + curTLSEnabled = "false"; + } + } + + gnome_main_section_new_with_table (_ ("Security"), &frame, &table, 2, 3); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + gtk_table_set_row_spacings (GTK_TABLE (table), 10); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + + /* TLS subsection */ + sipTlsAdvancedButton = gtk_button_new_from_stock (GTK_STOCK_EDIT); + gtk_table_attach_defaults (GTK_TABLE (table), sipTlsAdvancedButton, 2, 3, 0, 1); + gtk_widget_set_sensitive (GTK_WIDGET (sipTlsAdvancedButton), FALSE); + g_signal_connect (G_OBJECT (sipTlsAdvancedButton), "clicked", G_CALLBACK (show_advanced_tls_options_cb), (*a)->properties); + + useSipTlsCheckBox = gtk_check_button_new_with_mnemonic (_ ("Use TLS transport (sips)")); + g_signal_connect (useSipTlsCheckBox, "toggled", G_CALLBACK (use_sip_tls_cb), sipTlsAdvancedButton); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (useSipTlsCheckBox), (g_strcmp0 (curTLSEnabled, "true") == 0) ? TRUE:FALSE); + gtk_table_attach_defaults (GTK_TABLE (table), useSipTlsCheckBox, 0, 2, 0, 1); + + /* ZRTP subsection */ + label = gtk_label_new_with_mnemonic (_ ("SRTP key exchange")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + keyExchangeCombo = gtk_combo_box_new_text(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), keyExchangeCombo); + gtk_combo_box_append_text (GTK_COMBO_BOX (keyExchangeCombo), "ZRTP"); + gtk_combo_box_append_text (GTK_COMBO_BOX (keyExchangeCombo), "SDES"); + gtk_combo_box_append_text (GTK_COMBO_BOX (keyExchangeCombo), _ ("Disabled")); + + advancedZrtpButton = gtk_button_new_from_stock (GTK_STOCK_PREFERENCES); + g_signal_connect (G_OBJECT (advancedZrtpButton), "clicked", G_CALLBACK (show_advanced_zrtp_options_cb), (*a)->properties); + + if (g_strcmp0 (curSRTPEnabled, "false") == 0) { + gtk_combo_box_set_active (GTK_COMBO_BOX (keyExchangeCombo), 2); + gtk_widget_set_sensitive (GTK_WIDGET (advancedZrtpButton), FALSE); + } else { + if (strcmp (curKeyExchange, ZRTP) == 0) { + gtk_combo_box_set_active (GTK_COMBO_BOX (keyExchangeCombo),0); + } else if (strcmp (curKeyExchange, SDES) == 0) { + gtk_combo_box_set_active (GTK_COMBO_BOX (keyExchangeCombo),1); + } else { + gtk_combo_box_set_active (GTK_COMBO_BOX (keyExchangeCombo), 2); + gtk_widget_set_sensitive (GTK_WIDGET (advancedZrtpButton), FALSE); + } + } + + g_signal_connect (G_OBJECT (GTK_COMBO_BOX (keyExchangeCombo)), "changed", G_CALLBACK (key_exchange_changed_cb), *a); + + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); + gtk_table_attach_defaults (GTK_TABLE (table), keyExchangeCombo, 1, 2, 1, 2); + gtk_table_attach_defaults (GTK_TABLE (table), advancedZrtpButton, 2, 3, 1, 2); + + gtk_widget_show_all (table); + + return frame; } GtkWidget * create_security_tab (account_t **a) { - GtkWidget * frame; - GtkWidget * ret; - GtkWidget * hbox; + GtkWidget * frame; + GtkWidget * ret; + GtkWidget * hbox; - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); - // Credentials frame - frame = create_credential_widget (a); - gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + // Credentials frame + frame = create_credential_widget (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - // Security frame - frame = create_security_widget (a); - gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + // Security frame + frame = create_security_widget (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - gtk_widget_show_all(ret); + gtk_widget_show_all (ret); - return ret; - } + return ret; +} -GtkWidget* create_registration_expire (account_t **a) { +GtkWidget* create_registration_expire (account_t **a) +{ GtkWidget *table, *frame, *label; gchar *resolve_once=NULL, *account_expire=NULL; if (*a) { - resolve_once = g_hash_table_lookup ((*a)->properties, ACCOUNT_RESOLVE_ONCE); - account_expire = g_hash_table_lookup ((*a)->properties, ACCOUNT_REGISTRATION_EXPIRE); + resolve_once = g_hash_table_lookup ( (*a)->properties, ACCOUNT_RESOLVE_ONCE); + account_expire = g_hash_table_lookup ( (*a)->properties, ACCOUNT_REGISTRATION_EXPIRE); } - gnome_main_section_new_with_table (_("Registration"), &frame, &table, 2, 3); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings (GTK_TABLE (table), 5); - - label = gtk_label_new_with_mnemonic (_("Registration expire")); + gnome_main_section_new_with_table (_ ("Registration"), &frame, &table, 2, 3); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new_with_mnemonic (_ ("Registration expire")); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); expireSpinBox = gtk_spin_button_new_with_range (1, 65535, 1); gtk_label_set_mnemonic_widget (GTK_LABEL (label), expireSpinBox); gtk_spin_button_set_value (GTK_SPIN_BUTTON (expireSpinBox), g_ascii_strtod (account_expire, NULL)); gtk_table_attach_defaults (GTK_TABLE (table), expireSpinBox, 1, 2, 0, 1); - - entryResolveNameOnlyOnce = gtk_check_button_new_with_mnemonic (_("_Comply with RFC 3263")); + + entryResolveNameOnlyOnce = gtk_check_button_new_with_mnemonic (_ ("_Comply with RFC 3263")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (entryResolveNameOnlyOnce), - g_strcasecmp (resolve_once,"false") == 0 ? TRUE: FALSE); + g_strcasecmp (resolve_once,"false") == 0 ? TRUE: FALSE); gtk_table_attach_defaults (GTK_TABLE (table), entryResolveNameOnlyOnce, 0, 2, 1, 2); - gtk_widget_set_sensitive (GTK_WIDGET (entryResolveNameOnlyOnce ) , TRUE ); + gtk_widget_set_sensitive (GTK_WIDGET (entryResolveNameOnlyOnce) , TRUE); return frame; } -GtkWidget* create_network (account_t **a) { - +GtkWidget* create_network (account_t **a) +{ + GtkWidget *table, *frame, *label; gchar *local_interface, *local_port; if (*a) { - local_interface = g_hash_table_lookup ((*a)->properties, LOCAL_INTERFACE); - local_port = g_hash_table_lookup ((*a)->properties, LOCAL_PORT); + local_interface = g_hash_table_lookup ( (*a)->properties, LOCAL_INTERFACE); + local_port = g_hash_table_lookup ( (*a)->properties, LOCAL_PORT); } - gnome_main_section_new_with_table (_("Network Interface"), &frame, &table, 2, 3); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings( GTK_TABLE(table), 5); + gnome_main_section_new_with_table (_ ("Network Interface"), &frame, &table, 2, 3); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); /** - * Retreive the list of IP interface from the + * Retreive the list of IP interface from the * the daemon and build the combo box. */ - GtkListStore * ipInterfaceListStore; + GtkListStore * ipInterfaceListStore; GtkTreeIter iter; - ipInterfaceListStore = gtk_list_store_new( 1, G_TYPE_STRING ); - label = gtk_label_new_with_mnemonic (_("Local address")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + ipInterfaceListStore = gtk_list_store_new (1, G_TYPE_STRING); + label = gtk_label_new_with_mnemonic (_ ("Local address")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - GtkTreeIter current_local_iface_iter = iter; + GtkTreeIter current_local_iface_iter = iter; gchar ** iface_list = NULL; // iface_list = (gchar**) dbus_get_all_ip_interface(); iface_list = (gchar**) dbus_get_all_ip_interface_by_name(); gchar ** iface = NULL; - // flag to determine if local_address is found + // flag to determine if local_address is found gboolean iface_found = FALSE; gchar *local_iface_addr; - gchar *local_iface_name; + gchar *local_iface_name; + + local_iface_addr= g_malloc (36); - local_iface_addr= g_malloc(36); - if (iface_list != NULL) { // fill the iterface combo box - for (iface = iface_list; *iface; iface++) { - DEBUG("Interface %s", *iface); - gtk_list_store_append(ipInterfaceListStore, &iter ); - gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); - - // set the current local address - if (!iface_found && (g_strcmp0(*iface, local_interface) == 0)) { - DEBUG("Setting active local address combo box"); - current_local_iface_iter = iter; - iface_found = TRUE; - } - } - - if(!iface_found) { - DEBUG("Did not find local ip address, take fisrt in the list"); - gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ipInterfaceListStore), ¤t_local_iface_iter); - } - + for (iface = iface_list; *iface; iface++) { + DEBUG ("Interface %s", *iface); + gtk_list_store_append (ipInterfaceListStore, &iter); + gtk_list_store_set (ipInterfaceListStore, &iter, 0, *iface, -1); + + // set the current local address + if (!iface_found && (g_strcmp0 (*iface, local_interface) == 0)) { + DEBUG ("Setting active local address combo box"); + current_local_iface_iter = iter; + iface_found = TRUE; + } + } + + if (!iface_found) { + DEBUG ("Did not find local ip address, take fisrt in the list"); + gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ipInterfaceListStore), ¤t_local_iface_iter); + } + } - - - localAddressCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ipInterfaceListStore)); + + + localAddressCombo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (ipInterfaceListStore)); gtk_label_set_mnemonic_widget (GTK_LABEL (label), localAddressCombo); - gtk_table_attach ( GTK_TABLE( table ), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - g_object_unref(G_OBJECT(ipInterfaceListStore)); + gtk_table_attach (GTK_TABLE (table), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + g_object_unref (G_OBJECT (ipInterfaceListStore)); + - GtkCellRenderer * ipInterfaceCellRenderer; ipInterfaceCellRenderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, "text", 0, NULL); - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(localAddressCombo), ¤t_local_iface_iter); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (localAddressCombo), ipInterfaceCellRenderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (localAddressCombo), ipInterfaceCellRenderer, "text", 0, NULL); + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (localAddressCombo), ¤t_local_iface_iter); // Fill the text entry with the ip address of local interface selected localAddressEntry = gtk_entry_new(); local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); - sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr, 36); - gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); - gtk_widget_set_sensitive(localAddressEntry, FALSE); - gtk_table_attach ( GTK_TABLE( table ), localAddressEntry, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + sflphone_get_interface_addr_from_name (local_iface_name, &local_iface_addr, 36); + gtk_entry_set_text (GTK_ENTRY (localAddressEntry), local_iface_addr); + gtk_widget_set_sensitive (localAddressEntry, FALSE); + gtk_table_attach (GTK_TABLE (table), localAddressEntry, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + g_free (local_iface_addr); - g_free(local_iface_addr); - // Local port widget - label = gtk_label_new_with_mnemonic (_("Local port")); - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - localPortSpinBox = gtk_spin_button_new_with_range(1, 65535, 1); + label = gtk_label_new_with_mnemonic (_ ("Local port")); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + localPortSpinBox = gtk_spin_button_new_with_range (1, 65535, 1); gtk_label_set_mnemonic_widget (GTK_LABEL (label), localPortSpinBox); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(localPortSpinBox), g_ascii_strtod(local_port, NULL)); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (localPortSpinBox), g_ascii_strtod (local_port, NULL)); - gtk_table_attach_defaults(GTK_TABLE(table), localPortSpinBox, 1, 2, 1, 2); + gtk_table_attach_defaults (GTK_TABLE (table), localPortSpinBox, 1, 2, 1, 2); return frame; } -GtkWidget* create_published_address (account_t **a) { - - GtkWidget *table, *frame, *label; - gchar *use_tls, *published_address, *published_port, *local_address, *stun_enable, *stun_server, *published_sameas_local; - - // Get the user configuration - if (*a) { - - use_tls = g_hash_table_lookup ((*a)->properties, TLS_ENABLE); - published_sameas_local = g_hash_table_lookup ((*a)->properties, PUBLISHED_SAMEAS_LOCAL); - - if (g_strcasecmp (published_sameas_local, "true") == 0) { - published_address = dbus_get_address_from_interface_name (g_hash_table_lookup ((*a)->properties, LOCAL_INTERFACE)); - published_port = g_hash_table_lookup ((*a)->properties, LOCAL_PORT); - } - else { - published_address = g_hash_table_lookup ((*a)->properties, PUBLISHED_ADDRESS); - published_port = g_hash_table_lookup ((*a)->properties, PUBLISHED_PORT); - } - - stun_enable = g_hash_table_lookup ((*a)->properties, ACCOUNT_SIP_STUN_ENABLED); - stun_server = g_hash_table_lookup ((*a)->properties, ACCOUNT_SIP_STUN_SERVER); - published_sameas_local = g_hash_table_lookup ((*a)->properties, PUBLISHED_SAMEAS_LOCAL); - } - - gnome_main_section_new_with_table (_("Published address"), &frame, &table, 2, 3); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings (GTK_TABLE (table), 5); - - useStunCheckBox = gtk_check_button_new_with_mnemonic(_("Using STUN")); - gtk_table_attach_defaults(GTK_TABLE(table), useStunCheckBox, 0, 1, 0, 1); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(useStunCheckBox), - g_strcasecmp(stun_enable, "true") == 0 ? TRUE: FALSE); - gtk_widget_set_sensitive (GTK_WIDGET(useStunCheckBox), - g_strcasecmp(use_tls,"true") == 0 ? FALSE: TRUE); - - stunServerLabel = gtk_label_new_with_mnemonic (_("STUN server URL")); - gtk_table_attach_defaults(GTK_TABLE(table), stunServerLabel, 0, 1, 1, 2); - gtk_misc_set_alignment(GTK_MISC (stunServerLabel), 0, 0.5); - stunServerEntry = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (stunServerLabel), stunServerEntry); - gtk_entry_set_text(GTK_ENTRY(stunServerEntry), stun_server); - gtk_table_attach_defaults(GTK_TABLE(table), stunServerEntry, 1, 2, 1, 2); - - sameAsLocalRadioButton = gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("Same as local parameters")); - gtk_table_attach_defaults(GTK_TABLE(table), sameAsLocalRadioButton, 0, 2, 3, 4); - - publishedAddrRadioButton = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(sameAsLocalRadioButton), _("Set published address and port:")); - gtk_table_attach_defaults(GTK_TABLE(table), publishedAddrRadioButton, 0, 2, 4, 5); - - if (g_strcasecmp (published_sameas_local, "true") == 0) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), FALSE); - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), TRUE); - } - - publishedAddressLabel = gtk_label_new_with_mnemonic (_("Published address")); - gtk_table_attach_defaults( GTK_TABLE(table), publishedAddressLabel, 0, 1, 5, 6); - gtk_misc_set_alignment(GTK_MISC (publishedAddressLabel), 0, 0.5); - publishedAddressEntry = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (publishedAddressLabel), publishedAddressEntry); - - gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), published_address); - gtk_table_attach_defaults( GTK_TABLE(table), publishedAddressEntry, 1, 2, 5, 6); - - publishedPortLabel = gtk_label_new_with_mnemonic(_("Published port")); - gtk_table_attach_defaults(GTK_TABLE(table), publishedPortLabel, 0, 1, 6, 7); - gtk_misc_set_alignment(GTK_MISC (publishedPortLabel), 0, 0.5); - publishedPortSpinBox = gtk_spin_button_new_with_range(1, 65535, 1); - gtk_label_set_mnemonic_widget(GTK_LABEL (publishedPortLabel), publishedPortSpinBox); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(published_port, NULL)); - - gtk_table_attach_defaults(GTK_TABLE(table), publishedPortSpinBox, 1, 2, 6, 7); - - // This will trigger a signal, and the above two - // widgets need to be instanciated before that. - g_signal_connect(localAddressCombo, "changed", G_CALLBACK(local_interface_changed_cb), localAddressCombo); - - g_signal_connect(useStunCheckBox, "toggled", G_CALLBACK(use_stun_cb), useStunCheckBox); - - g_signal_connect(sameAsLocalRadioButton, "toggled", G_CALLBACK(same_as_local_cb), sameAsLocalRadioButton); - g_signal_connect(publishedAddrRadioButton, "toggled", G_CALLBACK(set_published_addr_manually_cb), publishedAddrRadioButton); - - set_published_addr_manually_cb(publishedAddrRadioButton, NULL); - - return frame; +GtkWidget* create_published_address (account_t **a) +{ + + GtkWidget *table, *frame, *label; + gchar *use_tls, *published_address, *published_port, *local_address, *stun_enable, *stun_server, *published_sameas_local; + + // Get the user configuration + if (*a) { + + use_tls = g_hash_table_lookup ( (*a)->properties, TLS_ENABLE); + published_sameas_local = g_hash_table_lookup ( (*a)->properties, PUBLISHED_SAMEAS_LOCAL); + + if (g_strcasecmp (published_sameas_local, "true") == 0) { + published_address = dbus_get_address_from_interface_name (g_hash_table_lookup ( (*a)->properties, LOCAL_INTERFACE)); + published_port = g_hash_table_lookup ( (*a)->properties, LOCAL_PORT); + } else { + published_address = g_hash_table_lookup ( (*a)->properties, PUBLISHED_ADDRESS); + published_port = g_hash_table_lookup ( (*a)->properties, PUBLISHED_PORT); + } + + stun_enable = g_hash_table_lookup ( (*a)->properties, ACCOUNT_SIP_STUN_ENABLED); + stun_server = g_hash_table_lookup ( (*a)->properties, ACCOUNT_SIP_STUN_SERVER); + published_sameas_local = g_hash_table_lookup ( (*a)->properties, PUBLISHED_SAMEAS_LOCAL); + } + + gnome_main_section_new_with_table (_ ("Published address"), &frame, &table, 2, 3); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + + useStunCheckBox = gtk_check_button_new_with_mnemonic (_ ("Using STUN")); + gtk_table_attach_defaults (GTK_TABLE (table), useStunCheckBox, 0, 1, 0, 1); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (useStunCheckBox), + g_strcasecmp (stun_enable, "true") == 0 ? TRUE: FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (useStunCheckBox), + g_strcasecmp (use_tls,"true") == 0 ? FALSE: TRUE); + + stunServerLabel = gtk_label_new_with_mnemonic (_ ("STUN server URL")); + gtk_table_attach_defaults (GTK_TABLE (table), stunServerLabel, 0, 1, 1, 2); + gtk_misc_set_alignment (GTK_MISC (stunServerLabel), 0, 0.5); + stunServerEntry = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (stunServerLabel), stunServerEntry); + gtk_entry_set_text (GTK_ENTRY (stunServerEntry), stun_server); + gtk_table_attach_defaults (GTK_TABLE (table), stunServerEntry, 1, 2, 1, 2); + + sameAsLocalRadioButton = gtk_radio_button_new_with_mnemonic_from_widget (NULL, _ ("Same as local parameters")); + gtk_table_attach_defaults (GTK_TABLE (table), sameAsLocalRadioButton, 0, 2, 3, 4); + + publishedAddrRadioButton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (sameAsLocalRadioButton), _ ("Set published address and port:")); + gtk_table_attach_defaults (GTK_TABLE (table), publishedAddrRadioButton, 0, 2, 4, 5); + + if (g_strcasecmp (published_sameas_local, "true") == 0) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), FALSE); + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), TRUE); + } + + publishedAddressLabel = gtk_label_new_with_mnemonic (_ ("Published address")); + gtk_table_attach_defaults (GTK_TABLE (table), publishedAddressLabel, 0, 1, 5, 6); + gtk_misc_set_alignment (GTK_MISC (publishedAddressLabel), 0, 0.5); + publishedAddressEntry = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (publishedAddressLabel), publishedAddressEntry); + + gtk_entry_set_text (GTK_ENTRY (publishedAddressEntry), published_address); + gtk_table_attach_defaults (GTK_TABLE (table), publishedAddressEntry, 1, 2, 5, 6); + + publishedPortLabel = gtk_label_new_with_mnemonic (_ ("Published port")); + gtk_table_attach_defaults (GTK_TABLE (table), publishedPortLabel, 0, 1, 6, 7); + gtk_misc_set_alignment (GTK_MISC (publishedPortLabel), 0, 0.5); + publishedPortSpinBox = gtk_spin_button_new_with_range (1, 65535, 1); + gtk_label_set_mnemonic_widget (GTK_LABEL (publishedPortLabel), publishedPortSpinBox); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (publishedPortSpinBox), g_ascii_strtod (published_port, NULL)); + + gtk_table_attach_defaults (GTK_TABLE (table), publishedPortSpinBox, 1, 2, 6, 7); + + // This will trigger a signal, and the above two + // widgets need to be instanciated before that. + g_signal_connect (localAddressCombo, "changed", G_CALLBACK (local_interface_changed_cb), localAddressCombo); + + g_signal_connect (useStunCheckBox, "toggled", G_CALLBACK (use_stun_cb), useStunCheckBox); + + g_signal_connect (sameAsLocalRadioButton, "toggled", G_CALLBACK (same_as_local_cb), sameAsLocalRadioButton); + g_signal_connect (publishedAddrRadioButton, "toggled", G_CALLBACK (set_published_addr_manually_cb), publishedAddrRadioButton); + + set_published_addr_manually_cb (publishedAddrRadioButton, NULL); + + return frame; } -GtkWidget* create_advanced_tab (account_t **a) { +GtkWidget* create_advanced_tab (account_t **a) +{ - // Build the advanced tab, to appear on the account configuration panel - DEBUG("Config: Build advanced tab") + // Build the advanced tab, to appear on the account configuration panel + DEBUG ("Config: Build advanced tab") - GtkWidget *ret, *frame; + GtkWidget *ret, *frame; - ret = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER(ret), 10); + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); - frame = create_registration_expire (a); - gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + frame = create_registration_expire (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - frame = create_network (a); - gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + frame = create_network (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - frame = create_published_address (a); - gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + frame = create_published_address (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - gtk_widget_show_all (ret); + gtk_widget_show_all (ret); - use_stun_cb (GTK_WIDGET (useStunCheckBox), NULL); + use_stun_cb (GTK_WIDGET (useStunCheckBox), NULL); - set_published_addr_manually_cb(GTK_WIDGET (publishedAddrRadioButton), NULL); + set_published_addr_manually_cb (GTK_WIDGET (publishedAddrRadioButton), NULL); - return ret; + return ret; } -GtkWidget* create_codecs_configuration (account_t **a) { +GtkWidget* create_codecs_configuration (account_t **a) +{ + + // Main widget + GtkWidget *ret, *codecs, *dtmf, *box, *frame, *sipinfo, *table; + account_t *currentAccount = *a; + gchar *currentDtmfType = ""; + gboolean dtmf_are_rtp = TRUE; + gpointer p; + + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); - // Main widget - GtkWidget *ret, *codecs, *dtmf, *box, *frame, *sipinfo, *table; - account_t *currentAccount = *a; - gchar *currentDtmfType = ""; - gboolean dtmf_are_rtp = TRUE; - gpointer p; + box = codecs_box (a); - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + // Box for the codecs + gnome_main_section_new (_ ("Codecs"), &codecs); + gtk_box_pack_start (GTK_BOX (ret), codecs, FALSE, FALSE, 0); + gtk_widget_set_size_request (GTK_WIDGET (codecs), -1, 200); + gtk_widget_show (codecs); + gtk_container_add (GTK_CONTAINER (codecs) , box); - box = codecs_box (a); + // Add DTMF type selection for SIP account only + p = g_hash_table_lookup (currentAccount->properties, g_strdup (ACCOUNT_TYPE)); - // Box for the codecs - gnome_main_section_new (_("Codecs"), &codecs); - gtk_box_pack_start (GTK_BOX(ret), codecs, FALSE, FALSE, 0); - gtk_widget_set_size_request (GTK_WIDGET (codecs), -1, 200); - gtk_widget_show (codecs); - gtk_container_add (GTK_CONTAINER (codecs) , box); + if (g_strcmp0 (p, "SIP") == 0) { - // Add DTMF type selection for SIP account only - p = g_hash_table_lookup(currentAccount->properties, g_strdup(ACCOUNT_TYPE)); - if(g_strcmp0(p, "SIP") == 0) { - - // Box for dtmf - gnome_main_section_new_with_table (_("DTMF"), &dtmf, &table, 1, 2); - gtk_box_pack_start (GTK_BOX(ret), dtmf, FALSE, FALSE, 0); - gtk_widget_show (dtmf); + // Box for dtmf + gnome_main_section_new_with_table (_ ("DTMF"), &dtmf, &table, 1, 2); + gtk_box_pack_start (GTK_BOX (ret), dtmf, FALSE, FALSE, 0); + gtk_widget_show (dtmf); - currentDtmfType = g_hash_table_lookup (currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE)); - if (g_strcasecmp(currentDtmfType, OVERRTP) != 0) { + currentDtmfType = g_hash_table_lookup (currentAccount->properties, g_strdup (ACCOUNT_DTMF_TYPE)); + + if (g_strcasecmp (currentDtmfType, OVERRTP) != 0) { dtmf_are_rtp = FALSE; - } + } - overrtp = gtk_radio_button_new_with_label( NULL, _("RTP") ); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(overrtp), dtmf_are_rtp); - gtk_table_attach ( GTK_TABLE( table ), overrtp, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + overrtp = gtk_radio_button_new_with_label (NULL, _ ("RTP")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (overrtp), dtmf_are_rtp); + gtk_table_attach (GTK_TABLE (table), overrtp, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - sipinfo = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(overrtp), _("SIP")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(sipinfo), !dtmf_are_rtp); - g_signal_connect(G_OBJECT(sipinfo), "clicked", G_CALLBACK(select_dtmf_type), NULL); - gtk_table_attach ( GTK_TABLE( table ), sipinfo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - } + sipinfo = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (overrtp), _ ("SIP")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sipinfo), !dtmf_are_rtp); + g_signal_connect (G_OBJECT (sipinfo), "clicked", G_CALLBACK (select_dtmf_type), NULL); + gtk_table_attach (GTK_TABLE (table), sipinfo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + } - gtk_widget_show_all(ret); + gtk_widget_show_all (ret); - return ret; + return ret; } -void show_account_window (account_t * a) { +void show_account_window (account_t * a) +{ GtkWidget * notebook; - GtkWidget *tab, *codecs_tab, *ip_tab; + GtkWidget *tab, *codecs_tab, *ip_tab; gint response; account_t *currentAccount; - - // In case the published address is same than local, - // we must resolve published address from interface name + + // In case the published address is same than local, + // we must resolve published address from interface name gchar * local_interface; gchar * published_address; - - currentAccount = a; + + currentAccount = a; if (currentAccount == NULL) { - currentAccount = g_new0(account_t, 1); - currentAccount->properties = dbus_account_details(NULL); - currentAccount->accountID = "new"; - sflphone_fill_codec_list_per_account (¤tAccount); - DEBUG("Config: Account is NULL. Will fetch default values"); + currentAccount = g_new0 (account_t, 1); + currentAccount->properties = dbus_account_details (NULL); + currentAccount->accountID = "new"; + sflphone_fill_codec_list_per_account (¤tAccount); + DEBUG ("Config: Account is NULL. Will fetch default values"); } - dialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Account settings"), - GTK_WINDOW(get_main_window()), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_APPLY, - GTK_RESPONSE_ACCEPT, - NULL)); - - gtk_dialog_set_has_separator(dialog, FALSE); - gtk_container_set_border_width (GTK_CONTAINER(dialog), 0); - + dialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_ ("Account settings"), + GTK_WINDOW (get_main_window()), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_APPLY, + GTK_RESPONSE_ACCEPT, + NULL)); + + gtk_dialog_set_has_separator (dialog, FALSE); + gtk_container_set_border_width (GTK_CONTAINER (dialog), 0); + notebook = gtk_notebook_new(); - gtk_box_pack_start(GTK_BOX (dialog->vbox), notebook, TRUE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(notebook), 10); - gtk_widget_show(notebook); + gtk_box_pack_start (GTK_BOX (dialog->vbox), notebook, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (notebook), 10); + gtk_widget_show (notebook); // We do not need the global settings for the IP2IP account if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { - - /* General Settings */ - tab = create_basic_tab(¤tAccount); - - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Basic"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); + + /* General Settings */ + tab = create_basic_tab (¤tAccount); + + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), tab, gtk_label_new (_ ("Basic"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), tab); } + /* Codecs */ codecs_tab = create_codecs_configuration (¤tAccount); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), codecs_tab, gtk_label_new(_("Codecs"))); - gtk_notebook_page_num (GTK_NOTEBOOK (notebook), codecs_tab); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), codecs_tab, gtk_label_new (_ ("Codecs"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), codecs_tab); // Get current protocol for this account protocol gchar *currentProtocol = "SIP"; - if(protocolComboBox) - currentProtocol = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); + + if (protocolComboBox) + currentProtocol = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox)); // Do not need advanced or security one for the IP2IP account if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { - /* Advanced */ - advanced_tab = create_advanced_tab(¤tAccount); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), advanced_tab, gtk_label_new(_("Advanced"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), advanced_tab); - - /* Security */ - security_tab = create_security_tab (¤tAccount); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), security_tab, gtk_label_new(_("Security"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook),security_tab); + /* Advanced */ + advanced_tab = create_advanced_tab (¤tAccount); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), advanced_tab, gtk_label_new (_ ("Advanced"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), advanced_tab); - } - else { + /* Security */ + security_tab = create_security_tab (¤tAccount); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), security_tab, gtk_label_new (_ ("Security"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook),security_tab); - /* Custom tab for the IP to IP profile */ - ip_tab = create_direct_ip_calls_tab (¤tAccount); - gtk_notebook_prepend_page (GTK_NOTEBOOK (notebook), ip_tab, gtk_label_new(_("Network"))); - gtk_notebook_page_num (GTK_NOTEBOOK (notebook), ip_tab); + } else { + + /* Custom tab for the IP to IP profile */ + ip_tab = create_direct_ip_calls_tab (¤tAccount); + gtk_notebook_prepend_page (GTK_NOTEBOOK (notebook), ip_tab, gtk_label_new (_ ("Network"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), ip_tab); } // Emit signal to hide advanced and security tabs in case of IAX - if(protocolComboBox) - g_signal_emit_by_name (GTK_WIDGET(protocolComboBox), "changed", NULL); + if (protocolComboBox) + g_signal_emit_by_name (GTK_WIDGET (protocolComboBox), "changed", NULL); gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook) , 0); @@ -1341,207 +1352,210 @@ void show_account_window (account_t * a) { /* Run dialog */ /**************/ response = gtk_dialog_run (GTK_DIALOG (dialog)); - + // Update protocol in case it changed gchar *proto = NULL; - if(protocolComboBox) - proto = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); + + if (protocolComboBox) + proto = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox)); else - proto = "SIP"; + proto = "SIP"; // If cancel button is pressed - if(response == GTK_RESPONSE_CANCEL) { - gtk_widget_destroy (GTK_WIDGET(dialog)); - return; + if (response == GTK_RESPONSE_CANCEL) { + gtk_widget_destroy (GTK_WIDGET (dialog)); + return; } - gchar *key = g_strdup(ACCOUNT_USERNAME); + gchar *key = g_strdup (ACCOUNT_USERNAME); - // If accept button is + // If accept button is if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_ALIAS), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_TYPE), - g_strdup(proto)); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_HOSTNAME), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryHostname)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_USERNAME), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_PASSWORD), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryPassword)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_MAILBOX), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox)))); - - // Variable used to update credentials - current_username = (gchar *)g_hash_table_lookup(currentAccount->properties, g_strdup(ACCOUNT_USERNAME)); + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_ALIAS), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (entryAlias)))); + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_TYPE), + g_strdup (proto)); + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_HOSTNAME), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (entryHostname)))); + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_USERNAME), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (entryUsername)))); + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_PASSWORD), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (entryPassword)))); + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_MAILBOX), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (entryMailbox)))); + + // Variable used to update credentials + current_username = (gchar *) g_hash_table_lookup (currentAccount->properties, g_strdup (ACCOUNT_USERNAME)); } if (proto && strcmp (proto, "SIP") == 0) { - - if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { - - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_RESOLVE_ONCE), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce)) ? "false": "true")); - - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_REGISTRATION_EXPIRE), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(expireSpinBox)))); - - /* - // TODO: uncomment this code and implement route - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_ROUTE), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryRouteSet)))); - */ - - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_USERAGENT), - g_strdup(gtk_entry_get_text (GTK_ENTRY(entryUseragent)))); - - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox)) ? "true":"false")); - - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), - g_strdup(gtk_entry_get_text(GTK_ENTRY(stunServerEntry)))); - - g_hash_table_replace(currentAccount->properties, g_strdup(PUBLISHED_SAMEAS_LOCAL), g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton)) ? "true":"false")); - - if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { - - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedPortSpinBox)))); - - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_ADDRESS), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedAddressEntry)))); - } - else { - - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); - local_interface = g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo))); - - published_address = dbus_get_address_from_interface_name(local_interface); - - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_ADDRESS), - published_address); - } - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(overrtp))) { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE), g_strdup(OVERRTP)); - } - else { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE), g_strdup(SIPINFO)); - } - - gchar* keyExchange = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)); - - if (g_strcasecmp(keyExchange, "ZRTP") == 0) { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(ZRTP)); - } - - else if(g_strcasecmp(keyExchange, "SDES") == 0) { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(SDES)); - } - - else { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("false")); - } - - g_hash_table_replace(currentAccount->properties, g_strdup(TLS_ENABLE), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox)) ? "true":"false")); - } - - g_hash_table_replace(currentAccount->properties, - g_strdup(LOCAL_INTERFACE), - g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)))); - - g_hash_table_replace(currentAccount->properties, - g_strdup(LOCAL_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); + + if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { + + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_RESOLVE_ONCE), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (entryResolveNameOnlyOnce)) ? "false": "true")); + + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_REGISTRATION_EXPIRE), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (expireSpinBox)))); + + /* + // TODO: uncomment this code and implement route + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_ROUTE), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryRouteSet)))); + */ + + g_hash_table_replace (currentAccount->properties, + g_strdup (ACCOUNT_USERAGENT), + g_strdup (gtk_entry_get_text (GTK_ENTRY (entryUseragent)))); + + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_SIP_STUN_ENABLED), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (useStunCheckBox)) ? "true":"false")); + + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_SIP_STUN_SERVER), + g_strdup (gtk_entry_get_text (GTK_ENTRY (stunServerEntry)))); + + g_hash_table_replace (currentAccount->properties, g_strdup (PUBLISHED_SAMEAS_LOCAL), g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton)) ? "true":"false")); + + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton))) { + + g_hash_table_replace (currentAccount->properties, + g_strdup (PUBLISHED_PORT), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (publishedPortSpinBox)))); + + g_hash_table_replace (currentAccount->properties, + g_strdup (PUBLISHED_ADDRESS), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (publishedAddressEntry)))); + } else { + + g_hash_table_replace (currentAccount->properties, + g_strdup (PUBLISHED_PORT), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (localPortSpinBox)))); + local_interface = g_strdup ( (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo))); + + published_address = dbus_get_address_from_interface_name (local_interface); + + g_hash_table_replace (currentAccount->properties, + g_strdup (PUBLISHED_ADDRESS), + published_address); + } + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (overrtp))) { + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_DTMF_TYPE), g_strdup (OVERRTP)); + } else { + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_DTMF_TYPE), g_strdup (SIPINFO)); + } + + gchar* keyExchange = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (keyExchangeCombo)); + + if (g_strcasecmp (keyExchange, "ZRTP") == 0) { + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_SRTP_ENABLED), g_strdup ("true")); + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_KEY_EXCHANGE), g_strdup (ZRTP)); + } + + else if (g_strcasecmp (keyExchange, "SDES") == 0) { + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_SRTP_ENABLED), g_strdup ("true")); + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_KEY_EXCHANGE), g_strdup (SDES)); + } + + else { + g_hash_table_replace (currentAccount->properties, g_strdup (ACCOUNT_SRTP_ENABLED), g_strdup ("false")); + } + + g_hash_table_replace (currentAccount->properties, g_strdup (TLS_ENABLE), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (useSipTlsCheckBox)) ? "true":"false")); + } + + g_hash_table_replace (currentAccount->properties, + g_strdup (LOCAL_INTERFACE), + g_strdup ( (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)))); + + g_hash_table_replace (currentAccount->properties, + g_strdup (LOCAL_PORT), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (localPortSpinBox)))); } - - if (currentProtocol && strcmp(currentProtocol, "SIP") == 0) { - - /* Set new credentials if any */ - DEBUG("Config: Setting credentials"); - if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { - - /* This hack is necessary because of the way the - * configuration file is made (.ini at that time). - * and deleting account per account is too much - * of a trouble. - */ - dbus_delete_all_credential(currentAccount); - - GPtrArray * credential = getNewCredential(currentAccount->properties); - currentAccount->credential_information = credential; - if(currentAccount->credential_information != NULL) { - int i; - for(i = 0; i < currentAccount->credential_information->len; i++) { - dbus_set_credential(currentAccount, i); - } - dbus_set_number_of_credential(currentAccount, currentAccount->credential_information->len); - } - } + + if (currentProtocol && strcmp (currentProtocol, "SIP") == 0) { + + /* Set new credentials if any */ + DEBUG ("Config: Setting credentials"); + + if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { + + /* This hack is necessary because of the way the + * configuration file is made (.ini at that time). + * and deleting account per account is too much + * of a trouble. + */ + dbus_delete_all_credential (currentAccount); + + GPtrArray * credential = getNewCredential (currentAccount->properties); + currentAccount->credential_information = credential; + + if (currentAccount->credential_information != NULL) { + int i; + + for (i = 0; i < currentAccount->credential_information->len; i++) { + dbus_set_credential (currentAccount, i); + } + + dbus_set_number_of_credential (currentAccount, currentAccount->credential_information->len); + } + } } /** @todo Verify if it's the best condition to check */ - if (g_strcasecmp(currentAccount->accountID, "new") == 0) { - dbus_add_account(currentAccount); - } - else { - dbus_set_account_details(currentAccount); + if (g_strcasecmp (currentAccount->accountID, "new") == 0) { + dbus_add_account (currentAccount); + } else { + dbus_set_account_details (currentAccount); } - + // Perpetuate changes to the deamon codec_list_update_to_daemon (currentAccount); - - gtk_widget_destroy (GTK_WIDGET(dialog)); -} -GtkWidget* create_direct_ip_calls_tab (account_t **a) { + gtk_widget_destroy (GTK_WIDGET (dialog)); +} - GtkWidget *ret, *frame, *label; - gchar *description; +GtkWidget* create_direct_ip_calls_tab (account_t **a) +{ + + GtkWidget *ret, *frame, *label; + gchar *description; - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); - description = g_markup_printf_escaped(_("This profile is used when you want to reach a remote peer simply by typing a sip URI such as <b>sip:remotepeer</b>. The settings you define here will also be used if no account can be matched to an incoming or outgoing call.")); - label = gtk_label_new (NULL); - gtk_label_set_markup (GTK_LABEL (label), description); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - gtk_box_pack_start (GTK_BOX (ret), label, FALSE, FALSE, 0); + description = g_markup_printf_escaped (_ ("This profile is used when you want to reach a remote peer simply by typing a sip URI such as <b>sip:remotepeer</b>. The settings you define here will also be used if no account can be matched to an incoming or outgoing call.")); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), description); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_box_pack_start (GTK_BOX (ret), label, FALSE, FALSE, 0); - GtkRequisition requisition; - gtk_widget_size_request (GTK_WIDGET (ret), &requisition); - gtk_widget_set_size_request (GTK_WIDGET (label), 350, -1); - gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + GtkRequisition requisition; + gtk_widget_size_request (GTK_WIDGET (ret), &requisition); + gtk_widget_set_size_request (GTK_WIDGET (label), 350, -1); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - frame = create_network (a); - gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + frame = create_network (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - frame = create_security_widget (a); - gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + frame = create_security_widget (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - gtk_widget_show_all (ret); - return ret; + gtk_widget_show_all (ret); + return ret; } diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.h b/sflphone-client-gnome/src/config/accountconfigdialog.h index dee7c8d33e3742dbc8600985d8d480f7a2653531..ecfd97cf1b9c9d1c1751f98935b47539f2b5ed0d 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.h +++ b/sflphone-client-gnome/src/config/accountconfigdialog.h @@ -2,17 +2,17 @@ * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -28,7 +28,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __ACCOUNTWINDOW_H__ #define __ACCOUNTWINDOW_H__ /** @file accountconfigdialog.h @@ -39,10 +39,10 @@ #include "preferencesdialog.h" #include "accountlist.h" -/** - * Display the main account widget +/** + * Display the main account widget * @param a The account you want to edit or null for a new account - */ + */ void show_account_window (account_t *a); GtkWidget* create_registration_expire (account_t **a); @@ -50,4 +50,4 @@ GtkWidget* create_registration_expire (account_t **a); GtkWidget* create_direct_ip_calls_tab (account_t **a); -#endif +#endif diff --git a/sflphone-client-gnome/src/config/accountlistconfigdialog.c b/sflphone-client-gnome/src/config/accountlistconfigdialog.c index 0c6a975e8e342d29ee5d039adf1729361034ed48..bf9887cfabd8e19e2d1ec4fb662ed27234fe472e 100644 --- a/sflphone-client-gnome/src/config/accountlistconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountlistconfigdialog.c @@ -2,17 +2,17 @@ * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -50,49 +50,51 @@ GtkListStore * accountStore; GtkDialog * accountListDialog = NULL; -account_t * selectedAccount = NULL; +account_t * selectedAccount = NULL; // Account properties enum { - COLUMN_ACCOUNT_ALIAS, - COLUMN_ACCOUNT_TYPE, - COLUMN_ACCOUNT_STATUS, - COLUMN_ACCOUNT_ACTIVE, - COLUMN_ACCOUNT_DATA, - COLUMN_ACCOUNT_COUNT + COLUMN_ACCOUNT_ALIAS, + COLUMN_ACCOUNT_TYPE, + COLUMN_ACCOUNT_STATUS, + COLUMN_ACCOUNT_ACTIVE, + COLUMN_ACCOUNT_DATA, + COLUMN_ACCOUNT_COUNT }; /** * Fills the treelist with accounts */ -void account_list_config_dialog_fill() { +void account_list_config_dialog_fill() +{ - if (accountListDialog == NULL) { - DEBUG("Dialog is not opened"); - return; - } + if (accountListDialog == NULL) { + DEBUG ("Dialog is not opened"); + return; + } - GtkTreeIter iter; + GtkTreeIter iter; - gtk_list_store_clear(accountStore); + gtk_list_store_clear (accountStore); - unsigned int i; - for(i = 0; i < account_list_get_size(); i++) { - account_t * a = account_list_get_nth (i); + unsigned int i; - if (a) { - gtk_list_store_append (accountStore, &iter); + for (i = 0; i < account_list_get_size(); i++) { + account_t * a = account_list_get_nth (i); - DEBUG("Filling accounts: Account is enabled :%s", g_hash_table_lookup(a->properties, ACCOUNT_ENABLED)); + if (a) { + gtk_list_store_append (accountStore, &iter); - gtk_list_store_set(accountStore, &iter, - COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name - COLUMN_ACCOUNT_TYPE, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol - COLUMN_ACCOUNT_STATUS, account_state_name(a->state), // Status - COLUMN_ACCOUNT_ACTIVE, (g_strcasecmp(g_hash_table_lookup(a->properties, ACCOUNT_ENABLED),"true") == 0)? TRUE:FALSE, // Enable/Disable - COLUMN_ACCOUNT_DATA, a, // Pointer - -1); - } - } + DEBUG ("Filling accounts: Account is enabled :%s", g_hash_table_lookup (a->properties, ACCOUNT_ENABLED)); + + gtk_list_store_set (accountStore, &iter, + COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup (a->properties, ACCOUNT_ALIAS), // Name + COLUMN_ACCOUNT_TYPE, g_hash_table_lookup (a->properties, ACCOUNT_TYPE), // Protocol + COLUMN_ACCOUNT_STATUS, account_state_name (a->state), // Status + COLUMN_ACCOUNT_ACTIVE, (g_strcasecmp (g_hash_table_lookup (a->properties, ACCOUNT_ENABLED),"true") == 0) ? TRUE:FALSE, // Enable/Disable + COLUMN_ACCOUNT_DATA, a, // Pointer + -1); + } + } } @@ -101,497 +103,507 @@ void account_list_config_dialog_fill() { /** * Call back when the user click on an account in the list */ - static void -select_account_cb(GtkTreeSelection *selection, GtkTreeModel *model) +static void +select_account_cb (GtkTreeSelection *selection, GtkTreeModel *model) { - GtkTreeIter iter; - GValue val; - gchar *state; - - memset (&val, 0, sizeof(val)); - if (!gtk_tree_selection_get_selected(selection, &model, &iter)) - { - selectedAccount = NULL; - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(editButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); - return; - } - - // The Gvalue will be initialized in the following function - gtk_tree_model_get_value(model, &iter, COLUMN_ACCOUNT_DATA, &val); - - selectedAccount = (account_t*)g_value_get_pointer(&val); - g_value_unset(&val); - - if(selectedAccount != NULL) { - gtk_widget_set_sensitive(GTK_WIDGET(editButton), TRUE); - if (g_strcasecmp (selectedAccount->accountID, IP2IP) != 0) { - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), TRUE); - - /* Update status bar about current registration state */ - gtk_statusbar_pop (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION); - - if (selectedAccount->protocol_state_description != NULL - && selectedAccount->protocol_state_code != 0) { - - gchar * response = g_strdup_printf( - _("Server returned \"%s\" (%d)"), - selectedAccount->protocol_state_description, - selectedAccount->protocol_state_code); - gchar * message = g_strconcat( - account_state_name(selectedAccount->state), - ". ", - response, - NULL); - - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); - - g_free(response); - g_free(message); - - } else { - state = (gchar*) account_state_name (selectedAccount->state); - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, state); - } - } - else { - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); - } - } - - DEBUG("Selecting account in account window"); + GtkTreeIter iter; + GValue val; + gchar *state; + + memset (&val, 0, sizeof (val)); + + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) { + selectedAccount = NULL; + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveUpButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveDownButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (editButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (deleteButton), FALSE); + return; + } + + // The Gvalue will be initialized in the following function + gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_DATA, &val); + + selectedAccount = (account_t*) g_value_get_pointer (&val); + g_value_unset (&val); + + if (selectedAccount != NULL) { + gtk_widget_set_sensitive (GTK_WIDGET (editButton), TRUE); + + if (g_strcasecmp (selectedAccount->accountID, IP2IP) != 0) { + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveUpButton), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveDownButton), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (deleteButton), TRUE); + + /* Update status bar about current registration state */ + gtk_statusbar_pop (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION); + + if (selectedAccount->protocol_state_description != NULL + && selectedAccount->protocol_state_code != 0) { + + gchar * response = g_strdup_printf ( + _ ("Server returned \"%s\" (%d)"), + selectedAccount->protocol_state_description, + selectedAccount->protocol_state_code); + gchar * message = g_strconcat ( + account_state_name (selectedAccount->state), + ". ", + response, + NULL); + + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); + + g_free (response); + g_free (message); + + } else { + state = (gchar*) account_state_name (selectedAccount->state); + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, state); + } + } else { + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveUpButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveDownButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (deleteButton), FALSE); + } + } + + DEBUG ("Selecting account in account window"); } -static void enable_account_cb (GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data ) { - - GtkTreeIter iter; - GtkTreePath *treePath; - GtkTreeModel *model; - gboolean enable; - account_t* acc ; - - // The IP2IP profile can't be disabled - if (g_strcasecmp (path, "0") == 0) - return; - - // Get pointer on object - treePath = gtk_tree_path_new_from_string(path); - model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); - gtk_tree_model_get_iter(model, &iter, treePath); - gtk_tree_model_get(model, &iter, - COLUMN_ACCOUNT_ACTIVE, &enable, - COLUMN_ACCOUNT_DATA, &acc, - -1); - - enable = !enable; - - DEBUG("Account is %d enabled", enable); - // Store value - gtk_list_store_set(GTK_LIST_STORE(model), &iter, - COLUMN_ACCOUNT_ACTIVE, enable, - -1); - - // Modify account state - gchar * registrationState; - if (enable == TRUE) { - registrationState = g_strdup("true"); - } else { - registrationState = g_strdup("false"); - } - DEBUG("Replacing with %s", registrationState); - g_hash_table_replace( acc->properties , g_strdup(ACCOUNT_ENABLED), registrationState); - - dbus_send_register(acc->accountID, enable); +static void enable_account_cb (GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data) +{ + + GtkTreeIter iter; + GtkTreePath *treePath; + GtkTreeModel *model; + gboolean enable; + account_t* acc ; + + // The IP2IP profile can't be disabled + if (g_strcasecmp (path, "0") == 0) + return; + + // Get pointer on object + treePath = gtk_tree_path_new_from_string (path); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (data)); + gtk_tree_model_get_iter (model, &iter, treePath); + gtk_tree_model_get (model, &iter, + COLUMN_ACCOUNT_ACTIVE, &enable, + COLUMN_ACCOUNT_DATA, &acc, + -1); + + enable = !enable; + + DEBUG ("Account is %d enabled", enable); + // Store value + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COLUMN_ACCOUNT_ACTIVE, enable, + -1); + + // Modify account state + gchar * registrationState; + + if (enable == TRUE) { + registrationState = g_strdup ("true"); + } else { + registrationState = g_strdup ("false"); + } + + DEBUG ("Replacing with %s", registrationState); + g_hash_table_replace (acc->properties , g_strdup (ACCOUNT_ENABLED), registrationState); + + dbus_send_register (acc->accountID, enable); } /** * Move account in list depending on direction and selected account */ -static void account_move (gboolean moveUp, gpointer data) { - - GtkTreeIter iter; - GtkTreeIter *iter2; - GtkTreeView *treeView; - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkTreePath *treePath; - gchar *path; - - // Get view, model and selection of codec store - treeView = GTK_TREE_VIEW (data); - model = gtk_tree_view_get_model (GTK_TREE_VIEW(treeView)); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(treeView)); - - // Find selected iteration and create a copy - gtk_tree_selection_get_selected (GTK_TREE_SELECTION(selection), &model, &iter); - iter2 = gtk_tree_iter_copy (&iter); - - // Find path of iteration - path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter); - - // The first real account in the list can't move up because of the IP2IP account - // It can still move down though - if (g_strcasecmp (path, "1") == 0 && moveUp) - return; - - 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 - if(moveUp) - gtk_tree_path_prev(treePath); - else - gtk_tree_path_next(treePath); - gtk_tree_model_get_iter(model, &iter, treePath); - - // Swap iterations if valid - if(gtk_list_store_iter_is_valid(GTK_LIST_STORE(model), &iter)) - gtk_list_store_swap(GTK_LIST_STORE(model), &iter, iter2); - - // Scroll to new position - gtk_tree_view_scroll_to_cell (treeView, treePath, NULL, FALSE, 0, 0); - - // Free resources - gtk_tree_path_free(treePath); - gtk_tree_iter_free(iter2); - g_free(path); - - // Perpetuate changes in account queue - if(moveUp) - account_list_move_up(indice); - else - account_list_move_down(indice); - - - // Set the order in the configuration file - dbus_set_accounts_order (account_list_get_ordered_list ()); +static void account_move (gboolean moveUp, gpointer data) +{ + + GtkTreeIter iter; + GtkTreeIter *iter2; + GtkTreeView *treeView; + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreePath *treePath; + gchar *path; + + // Get view, model and selection of codec store + treeView = GTK_TREE_VIEW (data); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeView)); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeView)); + + // Find selected iteration and create a copy + gtk_tree_selection_get_selected (GTK_TREE_SELECTION (selection), &model, &iter); + iter2 = gtk_tree_iter_copy (&iter); + + // Find path of iteration + path = gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL (model), &iter); + + // The first real account in the list can't move up because of the IP2IP account + // It can still move down though + if (g_strcasecmp (path, "1") == 0 && moveUp) + return; + + 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 + if (moveUp) + gtk_tree_path_prev (treePath); + else + gtk_tree_path_next (treePath); + + gtk_tree_model_get_iter (model, &iter, treePath); + + // Swap iterations if valid + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE (model), &iter)) + gtk_list_store_swap (GTK_LIST_STORE (model), &iter, iter2); + + // Scroll to new position + gtk_tree_view_scroll_to_cell (treeView, treePath, NULL, FALSE, 0, 0); + + // Free resources + gtk_tree_path_free (treePath); + gtk_tree_iter_free (iter2); + g_free (path); + + // Perpetuate changes in account queue + if (moveUp) + account_list_move_up (indice); + else + account_list_move_down (indice); + + + // Set the order in the configuration file + dbus_set_accounts_order (account_list_get_ordered_list ()); } /** * Called from move up account button signal */ - static void -account_move_up_cb(GtkButton *button UNUSED, gpointer data) +static void +account_move_up_cb (GtkButton *button UNUSED, gpointer data) { - // Change tree view ordering and get indice changed - account_move(TRUE, data); + // Change tree view ordering and get indice changed + account_move (TRUE, data); } /** * Called from move down account button signal */ - static void -account_move_down_cb(GtkButton *button UNUSED, gpointer data) +static void +account_move_down_cb (GtkButton *button UNUSED, gpointer data) { - // Change tree view ordering and get indice changed - account_move(FALSE, data); + // Change tree view ordering and get indice changed + account_move (FALSE, data); } - static void +static void help_contents_cb (GtkWidget * widget, - gpointer data UNUSED) + gpointer data UNUSED) { - GError *error = NULL; + GError *error = NULL; - //gboolean success = gtk_show_uri (NULL, "ghelp: sflphone.xml", GDK_CURRENT_TIME, &error); - gnome_help_display ("sflphone.xml", "accounts", &error); + //gboolean success = gtk_show_uri (NULL, "ghelp: sflphone.xml", GDK_CURRENT_TIME, &error); + gnome_help_display ("sflphone.xml", "accounts", &error); - if (error != NULL) - { - g_warning ("%s", error->message); + if (error != NULL) { + g_warning ("%s", error->message); - g_error_free (error); - } + g_error_free (error); + } } - static void +static void close_dialog_cb (GtkWidget * widget, - gpointer data UNUSED) + gpointer data UNUSED) { - gtk_dialog_response(GTK_DIALOG(accountListDialog), GTK_RESPONSE_ACCEPT); + gtk_dialog_response (GTK_DIALOG (accountListDialog), GTK_RESPONSE_ACCEPT); } -void highlight_ip_profile (GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { - - GValue val; - account_t *current; - - memset (&val, 0, sizeof(val)); - gtk_tree_model_get_value(tree_model, iter, COLUMN_ACCOUNT_DATA, &val); - current = (account_t*) g_value_get_pointer(&val); - - g_value_unset (&val); - - if (current != NULL) { +void highlight_ip_profile (GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) +{ - // Make the first line appear differently - (g_strcasecmp (current->accountID, IP2IP) == 0) ? g_object_set (G_OBJECT (rend), "weight", PANGO_WEIGHT_THIN, - "style", PANGO_STYLE_ITALIC, - "stretch", PANGO_STRETCH_ULTRA_EXPANDED, - "scale", 0.95, - NULL) : - g_object_set (G_OBJECT (rend), "weight", PANGO_WEIGHT_MEDIUM, - "style", PANGO_STYLE_NORMAL, - "stretch", PANGO_STRETCH_NORMAL, - "scale", 1.0, - NULL) ; - } + GValue val; + account_t *current; + + memset (&val, 0, sizeof (val)); + gtk_tree_model_get_value (tree_model, iter, COLUMN_ACCOUNT_DATA, &val); + current = (account_t*) g_value_get_pointer (&val); + + g_value_unset (&val); + + if (current != NULL) { + + // Make the first line appear differently + (g_strcasecmp (current->accountID, IP2IP) == 0) ? g_object_set (G_OBJECT (rend), "weight", PANGO_WEIGHT_THIN, + "style", PANGO_STYLE_ITALIC, + "stretch", PANGO_STRETCH_ULTRA_EXPANDED, + "scale", 0.95, + NULL) : + g_object_set (G_OBJECT (rend), "weight", PANGO_WEIGHT_MEDIUM, + "style", PANGO_STYLE_NORMAL, + "stretch", PANGO_STRETCH_NORMAL, + "scale", 1.0, + NULL) ; + } } -void highlight_registration (GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { +void highlight_registration (GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) +{ - GValue val; - account_t *current; - GdkColor green = {0, 255, 0, 0}; + GValue val; + account_t *current; + GdkColor green = {0, 255, 0, 0}; - memset (&val, 0, sizeof(val)); - gtk_tree_model_get_value(tree_model, iter, COLUMN_ACCOUNT_DATA, &val); - current = (account_t*) g_value_get_pointer(&val); + memset (&val, 0, sizeof (val)); + gtk_tree_model_get_value (tree_model, iter, COLUMN_ACCOUNT_DATA, &val); + current = (account_t*) g_value_get_pointer (&val); - g_value_unset (&val); + g_value_unset (&val); - if (current != NULL) { - if (g_strcasecmp (current->accountID, IP2IP) != 0) { - // Color the account state: green -> registered, otherwise red - (current->state == ACCOUNT_STATE_REGISTERED) ? g_object_set (G_OBJECT (rend), "foreground", "Dark Green", NULL) : - g_object_set (G_OBJECT (rend), "foreground", "Dark Red", NULL); - } - else - g_object_set (G_OBJECT (rend), "foreground", "Black", NULL); - } + if (current != NULL) { + if (g_strcasecmp (current->accountID, IP2IP) != 0) { + // Color the account state: green -> registered, otherwise red + (current->state == ACCOUNT_STATE_REGISTERED) ? g_object_set (G_OBJECT (rend), "foreground", "Dark Green", NULL) : + g_object_set (G_OBJECT (rend), "foreground", "Dark Red", NULL); + } else + g_object_set (G_OBJECT (rend), "foreground", "Black", NULL); + } } /** * Account settings tab */ -GtkWidget* create_account_list(GtkDialog * dialog) { - - GtkWidget *table, *scrolledWindow, *buttonBox; - GtkCellRenderer *renderer; - GtkTreeView * treeView; - GtkTreeViewColumn *treeViewColumn; - GtkTreeSelection *treeSelection; - GtkRequisition requisition; - - selectedAccount = NULL; - - table = gtk_table_new (1, 2, FALSE/* homogeneous */); - gtk_table_set_col_spacings(GTK_TABLE(table), 10); - gtk_container_set_border_width (GTK_CONTAINER (table), 10); - - scrolledWindow = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_SHADOW_IN); - gtk_table_attach (GTK_TABLE(table), scrolledWindow, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - accountStore = gtk_list_store_new(COLUMN_ACCOUNT_COUNT, - G_TYPE_STRING, // Name - G_TYPE_STRING, // Protocol - G_TYPE_STRING, // Status - G_TYPE_BOOLEAN, // Enabled / Disabled - G_TYPE_POINTER // Pointer to the Object - ); - - account_list_config_dialog_fill(); - - treeView = GTK_TREE_VIEW (gtk_tree_view_new_with_model (GTK_TREE_MODEL(accountStore))); - treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW (treeView)); - g_signal_connect(G_OBJECT (treeSelection), "changed", - G_CALLBACK (select_account_cb), - accountStore); - - renderer = gtk_cell_renderer_toggle_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes("Enabled", renderer, "active", COLUMN_ACCOUNT_ACTIVE , NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(treeView), treeViewColumn); - g_signal_connect (G_OBJECT(renderer) , "toggled" , G_CALLBACK (enable_account_cb), (gpointer)treeView ); - - // gtk_cell_renderer_toggle_set_activatable (renderer, FALSE); - - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes ("Alias", - renderer, - "markup", COLUMN_ACCOUNT_ALIAS, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - - // A double click on the account line opens the window to edit the account - g_signal_connect( G_OBJECT( treeView ) , "row-activated" , G_CALLBACK( edit_account_cb ) , NULL ); - gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); - - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Protocol"), - renderer, - "markup", COLUMN_ACCOUNT_TYPE, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); - - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Status"), - renderer, - "markup", COLUMN_ACCOUNT_STATUS, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - // Highlight IP profile - gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); - // Highlight account registration state - gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_registration, NULL, NULL); - - g_object_unref(G_OBJECT(accountStore)); - - gtk_container_add (GTK_CONTAINER(scrolledWindow), GTK_WIDGET (treeView)); - - /* The buttons to press! */ - buttonBox = gtk_vbutton_box_new(); - gtk_box_set_spacing(GTK_BOX(buttonBox), 10); - gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonBox), GTK_BUTTONBOX_START); - gtk_table_attach (GTK_TABLE(table), buttonBox, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - accountMoveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), accountMoveUpButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(accountMoveUpButton), "clicked", G_CALLBACK(account_move_up_cb), treeView); - - accountMoveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), accountMoveDownButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(accountMoveDownButton), "clicked", G_CALLBACK(account_move_down_cb), treeView); - - addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); - g_signal_connect_swapped(G_OBJECT(addButton), "clicked", - G_CALLBACK(add_account_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonBox), addButton, FALSE, FALSE, 0); - - editButton = gtk_button_new_from_stock (GTK_STOCK_EDIT); - gtk_widget_set_sensitive(GTK_WIDGET(editButton), FALSE); - g_signal_connect_swapped(G_OBJECT(editButton), "clicked", - G_CALLBACK(edit_account_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonBox), editButton, FALSE, FALSE, 0); - - deleteButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); - gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); - g_signal_connect_swapped(G_OBJECT(deleteButton), "clicked", - G_CALLBACK(delete_account_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonBox), deleteButton, FALSE, FALSE, 0); - - /* help and close buttons */ - GtkWidget * buttonHbox = gtk_hbutton_box_new(); - gtk_table_attach(GTK_TABLE(table), buttonHbox, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); - - GtkWidget * helpButton = gtk_button_new_from_stock (GTK_STOCK_HELP); - g_signal_connect_swapped(G_OBJECT(helpButton), "clicked", - G_CALLBACK(help_contents_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonHbox), helpButton, FALSE, FALSE, 0); - - GtkWidget * closeButton = gtk_button_new_from_stock (GTK_STOCK_CLOSE); - g_signal_connect_swapped(G_OBJECT(closeButton), "clicked", G_CALLBACK(close_dialog_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonHbox), closeButton, FALSE, FALSE, 0); - - gtk_widget_show_all(table); - // account_list_config_dialog_fill(); - - /* Resize the scrolledWindow for a better view */ - gtk_widget_size_request(GTK_WIDGET(treeView), &requisition); - gtk_widget_set_size_request(GTK_WIDGET(scrolledWindow), requisition.width + 20, requisition.height); - GtkRequisition requisitionButton; - gtk_widget_size_request(GTK_WIDGET(deleteButton), &requisitionButton); - gtk_widget_set_size_request(GTK_WIDGET(closeButton), requisitionButton.width, -1); - gtk_widget_set_size_request(GTK_WIDGET(helpButton), requisitionButton.width, -1); - - gtk_widget_show_all(table); - - return table; +GtkWidget* create_account_list (GtkDialog * dialog) +{ + + GtkWidget *table, *scrolledWindow, *buttonBox; + GtkCellRenderer *renderer; + GtkTreeView * treeView; + GtkTreeViewColumn *treeViewColumn; + GtkTreeSelection *treeSelection; + GtkRequisition requisition; + + selectedAccount = NULL; + + table = gtk_table_new (1, 2, FALSE/* homogeneous */); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + + scrolledWindow = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledWindow), GTK_SHADOW_IN); + gtk_table_attach (GTK_TABLE (table), scrolledWindow, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + accountStore = gtk_list_store_new (COLUMN_ACCOUNT_COUNT, + G_TYPE_STRING, // Name + G_TYPE_STRING, // Protocol + G_TYPE_STRING, // Status + G_TYPE_BOOLEAN, // Enabled / Disabled + G_TYPE_POINTER // Pointer to the Object + ); + + account_list_config_dialog_fill(); + + treeView = GTK_TREE_VIEW (gtk_tree_view_new_with_model (GTK_TREE_MODEL (accountStore))); + treeSelection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeView)); + g_signal_connect (G_OBJECT (treeSelection), "changed", + G_CALLBACK (select_account_cb), + accountStore); + + renderer = gtk_cell_renderer_toggle_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes ("Enabled", renderer, "active", COLUMN_ACCOUNT_ACTIVE , NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeView), treeViewColumn); + g_signal_connect (G_OBJECT (renderer) , "toggled" , G_CALLBACK (enable_account_cb), (gpointer) treeView); + + // gtk_cell_renderer_toggle_set_activatable (renderer, FALSE); + + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes ("Alias", + renderer, + "markup", COLUMN_ACCOUNT_ALIAS, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeView), treeViewColumn); + + // A double click on the account line opens the window to edit the account + g_signal_connect (G_OBJECT (treeView) , "row-activated" , G_CALLBACK (edit_account_cb) , NULL); + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); + + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Protocol"), + renderer, + "markup", COLUMN_ACCOUNT_TYPE, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeView), treeViewColumn); + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); + + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Status"), + renderer, + "markup", COLUMN_ACCOUNT_STATUS, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeView), treeViewColumn); + // Highlight IP profile + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); + // Highlight account registration state + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_registration, NULL, NULL); + + g_object_unref (G_OBJECT (accountStore)); + + gtk_container_add (GTK_CONTAINER (scrolledWindow), GTK_WIDGET (treeView)); + + /* The buttons to press! */ + buttonBox = gtk_vbutton_box_new(); + gtk_box_set_spacing (GTK_BOX (buttonBox), 10); + gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonBox), GTK_BUTTONBOX_START); + gtk_table_attach (GTK_TABLE (table), buttonBox, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + accountMoveUpButton = gtk_button_new_from_stock (GTK_STOCK_GO_UP); + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveUpButton), FALSE); + gtk_box_pack_start (GTK_BOX (buttonBox), accountMoveUpButton, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (accountMoveUpButton), "clicked", G_CALLBACK (account_move_up_cb), treeView); + + accountMoveDownButton = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN); + gtk_widget_set_sensitive (GTK_WIDGET (accountMoveDownButton), FALSE); + gtk_box_pack_start (GTK_BOX (buttonBox), accountMoveDownButton, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (accountMoveDownButton), "clicked", G_CALLBACK (account_move_down_cb), treeView); + + addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); + g_signal_connect_swapped (G_OBJECT (addButton), "clicked", + G_CALLBACK (add_account_cb), NULL); + gtk_box_pack_start (GTK_BOX (buttonBox), addButton, FALSE, FALSE, 0); + + editButton = gtk_button_new_from_stock (GTK_STOCK_EDIT); + gtk_widget_set_sensitive (GTK_WIDGET (editButton), FALSE); + g_signal_connect_swapped (G_OBJECT (editButton), "clicked", + G_CALLBACK (edit_account_cb), NULL); + gtk_box_pack_start (GTK_BOX (buttonBox), editButton, FALSE, FALSE, 0); + + deleteButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); + gtk_widget_set_sensitive (GTK_WIDGET (deleteButton), FALSE); + g_signal_connect_swapped (G_OBJECT (deleteButton), "clicked", + G_CALLBACK (delete_account_cb), NULL); + gtk_box_pack_start (GTK_BOX (buttonBox), deleteButton, FALSE, FALSE, 0); + + /* help and close buttons */ + GtkWidget * buttonHbox = gtk_hbutton_box_new(); + gtk_table_attach (GTK_TABLE (table), buttonHbox, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + + GtkWidget * helpButton = gtk_button_new_from_stock (GTK_STOCK_HELP); + g_signal_connect_swapped (G_OBJECT (helpButton), "clicked", + G_CALLBACK (help_contents_cb), NULL); + gtk_box_pack_start (GTK_BOX (buttonHbox), helpButton, FALSE, FALSE, 0); + + GtkWidget * closeButton = gtk_button_new_from_stock (GTK_STOCK_CLOSE); + g_signal_connect_swapped (G_OBJECT (closeButton), "clicked", G_CALLBACK (close_dialog_cb), NULL); + gtk_box_pack_start (GTK_BOX (buttonHbox), closeButton, FALSE, FALSE, 0); + + gtk_widget_show_all (table); + // account_list_config_dialog_fill(); + + /* Resize the scrolledWindow for a better view */ + gtk_widget_size_request (GTK_WIDGET (treeView), &requisition); + gtk_widget_set_size_request (GTK_WIDGET (scrolledWindow), requisition.width + 20, requisition.height); + GtkRequisition requisitionButton; + gtk_widget_size_request (GTK_WIDGET (deleteButton), &requisitionButton); + gtk_widget_set_size_request (GTK_WIDGET (closeButton), requisitionButton.width, -1); + gtk_widget_set_size_request (GTK_WIDGET (helpButton), requisitionButton.width, -1); + + gtk_widget_show_all (table); + + return table; } - void -show_account_list_config_dialog(void) +void +show_account_list_config_dialog (void) { - GtkWidget * accountFrame; - GtkWidget * tab; - - accountListDialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Accounts"), - GTK_WINDOW(get_main_window()), - GTK_DIALOG_DESTROY_WITH_PARENT, - NULL)); - - /* Set window properties */ - gtk_dialog_set_has_separator(accountListDialog, FALSE); - gtk_container_set_border_width(GTK_CONTAINER(accountListDialog), 0); - gtk_window_set_resizable(GTK_WINDOW(accountListDialog), FALSE); - - gnome_main_section_new (_("Configured Accounts"), &accountFrame); - gtk_box_pack_start( GTK_BOX(accountListDialog->vbox ), accountFrame , TRUE, TRUE, 0); - gtk_widget_show(accountFrame); - - /* Accounts tab */ - tab = create_account_list(accountListDialog); - gtk_widget_show(tab); - gtk_container_add(GTK_CONTAINER(accountFrame), tab); - - /* Status bar for the account list */ - status_bar = gtk_statusbar_new(); - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (status_bar), FALSE); - gtk_widget_show(status_bar); - gtk_box_pack_start(GTK_BOX(accountListDialog->vbox ), status_bar, TRUE, TRUE, 0); - - int number_accounts = account_list_get_registered_accounts (); - if (number_accounts) { - gchar * message = g_strdup_printf(n_("There is %d active account", - "There are %d active accounts", number_accounts), - number_accounts); - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); - g_free(message); - } else { - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, _("You have no active account")); - } - - gtk_dialog_run(accountListDialog); - - status_bar_display_account (); - - gtk_widget_destroy(GTK_WIDGET(accountListDialog)); - - accountListDialog = NULL; - - update_actions (); + GtkWidget * accountFrame; + GtkWidget * tab; + + accountListDialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_ ("Accounts"), + GTK_WINDOW (get_main_window()), + GTK_DIALOG_DESTROY_WITH_PARENT, + NULL)); + + /* Set window properties */ + gtk_dialog_set_has_separator (accountListDialog, FALSE); + gtk_container_set_border_width (GTK_CONTAINER (accountListDialog), 0); + gtk_window_set_resizable (GTK_WINDOW (accountListDialog), FALSE); + + gnome_main_section_new (_ ("Configured Accounts"), &accountFrame); + gtk_box_pack_start (GTK_BOX (accountListDialog->vbox), accountFrame , TRUE, TRUE, 0); + gtk_widget_show (accountFrame); + + /* Accounts tab */ + tab = create_account_list (accountListDialog); + gtk_widget_show (tab); + gtk_container_add (GTK_CONTAINER (accountFrame), tab); + + /* Status bar for the account list */ + status_bar = gtk_statusbar_new(); + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (status_bar), FALSE); + gtk_widget_show (status_bar); + gtk_box_pack_start (GTK_BOX (accountListDialog->vbox), status_bar, TRUE, TRUE, 0); + + int number_accounts = account_list_get_registered_accounts (); + + if (number_accounts) { + gchar * message = g_strdup_printf (n_ ("There is %d active account", + "There are %d active accounts", number_accounts), + number_accounts); + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); + g_free (message); + } else { + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, _ ("You have no active account")); + } + + gtk_dialog_run (accountListDialog); + + status_bar_display_account (); + + gtk_widget_destroy (GTK_WIDGET (accountListDialog)); + + accountListDialog = NULL; + + update_actions (); } /** * Delete an account */ -static void delete_account_cb (void) { - - if(selectedAccount != NULL) { - dbus_remove_account(selectedAccount->accountID); - } +static void delete_account_cb (void) +{ + + if (selectedAccount != NULL) { + dbus_remove_account (selectedAccount->accountID); + } } /** * Edit an account */ -static void edit_account_cb (void) { +static void edit_account_cb (void) +{ - if(selectedAccount != NULL) { - show_account_window (selectedAccount); - } + if (selectedAccount != NULL) { + show_account_window (selectedAccount); + } } /** * Add an account */ -static void add_account_cb (void) { +static void add_account_cb (void) +{ - show_account_window (NULL); + show_account_window (NULL); } diff --git a/sflphone-client-gnome/src/config/accountlistconfigdialog.h b/sflphone-client-gnome/src/config/accountlistconfigdialog.h index a1ec479f2b6d274d4b2d81b0cb5fba673e56c605..d2b4c5e0e163efd3e36148962f7351bac813f86c 100644 --- a/sflphone-client-gnome/src/config/accountlistconfigdialog.h +++ b/sflphone-client-gnome/src/config/accountlistconfigdialog.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -34,9 +34,9 @@ #include <sflphone_const.h> -void show_account_list_config_dialog(void); -void account_list_config_dialog_fill(void); - +void show_account_list_config_dialog (void); +void account_list_config_dialog_fill (void); + static void delete_account_cb (void); static void add_account_cb (void); diff --git a/sflphone-client-gnome/src/config/addressbook-config.c b/sflphone-client-gnome/src/config/addressbook-config.c index 34a2d05583f31cab857c00a11cfdbb0f90253c28..ae08d55b2fea17e50bab04607871322b6c74a4f6 100644 --- a/sflphone-client-gnome/src/config/addressbook-config.c +++ b/sflphone-client-gnome/src/config/addressbook-config.c @@ -38,13 +38,12 @@ GtkWidget *book_tree_view; GtkWidget *photo, *cards_label, *scale_label, *scrolled_label, *scrolled_window, *scale_button, *business, *mobile, *home; -enum -{ +enum { COLUMN_BOOK_ACTIVE, COLUMN_BOOK_NAME, COLUMN_BOOK_UID }; - void -addressbook_config_load_parameters(AddressBook_Config **settings) +void +addressbook_config_load_parameters (AddressBook_Config **settings) { GHashTable *_params = NULL; @@ -56,143 +55,138 @@ addressbook_config_load_parameters(AddressBook_Config **settings) // Fetch the settings from D-Bus _params = (GHashTable*) dbus_get_addressbook_settings(); - if (_params == NULL) - { + if (_params == NULL) { _settings->enable = 1; _settings->max_results = 30; _settings->display_contact_photo = 0; _settings->search_phone_business = 1; _settings->search_phone_home = 1; _settings->search_phone_mobile = 1; - } - else - { - _settings->enable = (gint64) (g_hash_table_lookup (_params, - ADDRESSBOOK_ENABLE)); - _settings->max_results = (gint64) (g_hash_table_lookup(_params, - ADDRESSBOOK_MAX_RESULTS)); - _settings->display_contact_photo = (gint64) (g_hash_table_lookup(_params, - ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)); - _settings->search_phone_business = (gint64) (g_hash_table_lookup(_params, - ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)); - _settings->search_phone_home = (gint64) (g_hash_table_lookup(_params, - ADDRESSBOOK_DISPLAY_PHONE_HOME)); - _settings->search_phone_mobile = (gint64) (g_hash_table_lookup(_params, - ADDRESSBOOK_DISPLAY_PHONE_MOBILE)); + } else { + _settings->enable = (gint64) (g_hash_table_lookup (_params, + ADDRESSBOOK_ENABLE)); + _settings->max_results = (gint64) (g_hash_table_lookup (_params, + ADDRESSBOOK_MAX_RESULTS)); + _settings->display_contact_photo = (gint64) (g_hash_table_lookup (_params, + ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)); + _settings->search_phone_business = (gint64) (g_hash_table_lookup (_params, + ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)); + _settings->search_phone_home = (gint64) (g_hash_table_lookup (_params, + ADDRESSBOOK_DISPLAY_PHONE_HOME)); + _settings->search_phone_mobile = (gint64) (g_hash_table_lookup (_params, + ADDRESSBOOK_DISPLAY_PHONE_MOBILE)); } *settings = _settings; } - void -addressbook_config_save_parameters(void) +void +addressbook_config_save_parameters (void) { GHashTable *params = NULL; - params = g_hash_table_new(NULL, g_str_equal); - g_hash_table_replace(params, (gpointer) ADDRESSBOOK_ENABLE, - (gpointer) addressbook_config->enable); - g_hash_table_replace(params, (gpointer) ADDRESSBOOK_MAX_RESULTS, - (gpointer) addressbook_config->max_results); - g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, - (gpointer) addressbook_config->display_contact_photo); - g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, - (gpointer) addressbook_config->search_phone_business); - g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_HOME, - (gpointer) addressbook_config->search_phone_home); - g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_MOBILE, - (gpointer) addressbook_config->search_phone_mobile); - - dbus_set_addressbook_settings(params); + params = g_hash_table_new (NULL, g_str_equal); + g_hash_table_replace (params, (gpointer) ADDRESSBOOK_ENABLE, + (gpointer) addressbook_config->enable); + g_hash_table_replace (params, (gpointer) ADDRESSBOOK_MAX_RESULTS, + (gpointer) addressbook_config->max_results); + g_hash_table_replace (params, (gpointer) ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, + (gpointer) addressbook_config->display_contact_photo); + g_hash_table_replace (params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, + (gpointer) addressbook_config->search_phone_business); + g_hash_table_replace (params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_HOME, + (gpointer) addressbook_config->search_phone_home); + g_hash_table_replace (params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_MOBILE, + (gpointer) addressbook_config->search_phone_mobile); + + dbus_set_addressbook_settings (params); // Decrement the reference count - g_hash_table_unref(params); + g_hash_table_unref (params); } void -enable_options(){ - - if (!addressbook_config->enable) - { - DEBUG("Disable addressbook options\n"); - gtk_widget_set_sensitive(photo, FALSE); - gtk_widget_set_sensitive(scrolled_label, FALSE); - gtk_widget_set_sensitive(cards_label, FALSE); - gtk_widget_set_sensitive(scrolled_window, FALSE); - gtk_widget_set_sensitive(scale_button, FALSE); - gtk_widget_set_sensitive(scale_label, FALSE); - gtk_widget_set_sensitive(business, FALSE); - gtk_widget_set_sensitive(mobile, FALSE); - gtk_widget_set_sensitive(home, FALSE); - gtk_widget_set_sensitive(book_tree_view, FALSE); - - - } - else - { - DEBUG("Enable addressbook options\n"); - gtk_widget_set_sensitive(photo, TRUE); - gtk_widget_set_sensitive(scrolled_label, TRUE); - gtk_widget_set_sensitive(cards_label, TRUE); - gtk_widget_set_sensitive(scrolled_window, TRUE); - gtk_widget_set_sensitive(scale_button, TRUE); - gtk_widget_set_sensitive(scale_label, TRUE); - gtk_widget_set_sensitive(business, TRUE); - gtk_widget_set_sensitive(mobile, TRUE); - gtk_widget_set_sensitive(home, TRUE); - gtk_widget_set_sensitive(book_tree_view, TRUE); +enable_options() +{ + + if (!addressbook_config->enable) { + DEBUG ("Disable addressbook options\n"); + gtk_widget_set_sensitive (photo, FALSE); + gtk_widget_set_sensitive (scrolled_label, FALSE); + gtk_widget_set_sensitive (cards_label, FALSE); + gtk_widget_set_sensitive (scrolled_window, FALSE); + gtk_widget_set_sensitive (scale_button, FALSE); + gtk_widget_set_sensitive (scale_label, FALSE); + gtk_widget_set_sensitive (business, FALSE); + gtk_widget_set_sensitive (mobile, FALSE); + gtk_widget_set_sensitive (home, FALSE); + gtk_widget_set_sensitive (book_tree_view, FALSE); + + + } else { + DEBUG ("Enable addressbook options\n"); + gtk_widget_set_sensitive (photo, TRUE); + gtk_widget_set_sensitive (scrolled_label, TRUE); + gtk_widget_set_sensitive (cards_label, TRUE); + gtk_widget_set_sensitive (scrolled_window, TRUE); + gtk_widget_set_sensitive (scale_button, TRUE); + gtk_widget_set_sensitive (scale_label, TRUE); + gtk_widget_set_sensitive (business, TRUE); + gtk_widget_set_sensitive (mobile, TRUE); + gtk_widget_set_sensitive (home, TRUE); + gtk_widget_set_sensitive (book_tree_view, TRUE); } } - static void +static void enable_cb (GtkWidget *widget) { addressbook_config->enable - = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); enable_options(); - + } - static void +static void max_results_cb (GtkSpinButton *button) { - addressbook_config->max_results = gtk_spin_button_get_value_as_int(button); + addressbook_config->max_results = gtk_spin_button_get_value_as_int (button); } - static void -display_contact_photo_cb(GtkWidget *widget) +static void +display_contact_photo_cb (GtkWidget *widget) { addressbook_config->display_contact_photo - = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); } - static void -search_phone_business_cb(GtkWidget *widget) +static void +search_phone_business_cb (GtkWidget *widget) { addressbook_config->search_phone_business - = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); } - static void -search_phone_home_cb(GtkWidget *widget) +static void +search_phone_home_cb (GtkWidget *widget) { - addressbook_config->search_phone_home = (guint) gtk_toggle_button_get_active( - GTK_TOGGLE_BUTTON(widget)); + addressbook_config->search_phone_home = (guint) gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON (widget)); } - static void -search_phone_mobile_cb(GtkWidget *widget) +static void +search_phone_mobile_cb (GtkWidget *widget) { addressbook_config->search_phone_mobile - = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); } /** @@ -200,8 +194,8 @@ search_phone_mobile_cb(GtkWidget *widget) * and in configuration files */ static void -addressbook_config_book_active_toggled( - GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data) +addressbook_config_book_active_toggled ( + GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data) { GtkTreeIter iter; GtkTreePath *treePath; @@ -211,66 +205,64 @@ addressbook_config_book_active_toggled( gchar* uid; // Get path of clicked book active toggle box - treePath = gtk_tree_path_new_from_string(path); - model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); - gtk_tree_model_get_iter(model, &iter, treePath); + treePath = gtk_tree_path_new_from_string (path); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (data)); + gtk_tree_model_get_iter (model, &iter, treePath); // Get active value at iteration - gtk_tree_model_get(model, &iter, COLUMN_BOOK_ACTIVE, &active, - COLUMN_BOOK_UID, &uid, COLUMN_BOOK_NAME, &name, -1); + gtk_tree_model_get (model, &iter, COLUMN_BOOK_ACTIVE, &active, + COLUMN_BOOK_UID, &uid, COLUMN_BOOK_NAME, &name, -1); // Toggle active value active = !active; // Store value - gtk_list_store_set(GTK_LIST_STORE(model), &iter, COLUMN_BOOK_ACTIVE, active, -1); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, COLUMN_BOOK_ACTIVE, active, -1); - gtk_tree_path_free(treePath); + gtk_tree_path_free (treePath); // Update current memory stored books data - books_get_book_data_by_uid(uid)->active = active; + books_get_book_data_by_uid (uid)->active = active; // Save data gboolean valid; // Initiate double array char list for one string - const gchar** list = (void*) malloc(sizeof(void*)); + const gchar** list = (void*) malloc (sizeof (void*)); int c = 0; /* Get the first iter in the list */ - valid = gtk_tree_model_get_iter_first(model, &iter); + valid = gtk_tree_model_get_iter_first (model, &iter); - while (valid) - { + while (valid) { // Get active value at iteration - gtk_tree_model_get(model, &iter, COLUMN_BOOK_ACTIVE, &active, - COLUMN_BOOK_UID, &uid, COLUMN_BOOK_NAME, &name, -1); + gtk_tree_model_get (model, &iter, COLUMN_BOOK_ACTIVE, &active, + COLUMN_BOOK_UID, &uid, COLUMN_BOOK_NAME, &name, -1); - if (active) - { + if (active) { // Reallocate memory each time if (c != 0) - list = (void*) realloc(list, (c + 1) * sizeof(void*)); + list = (void*) realloc (list, (c + 1) * sizeof (void*)); - *(list + c) = uid; + * (list + c) = uid; c++; } - valid = gtk_tree_model_iter_next(model, &iter); + valid = gtk_tree_model_iter_next (model, &iter); } // Allocate NULL array at the end for Dbus - list = (void*) realloc(list, (c + 1) * sizeof(void*)); - *(list + c) = NULL; + list = (void*) realloc (list, (c + 1) * sizeof (void*)); + * (list + c) = NULL; // Call daemon to store in config file - dbus_set_addressbook_list(list); + dbus_set_addressbook_list (list); - free(list); + free (list); } - static void +static void addressbook_config_fill_book_list() { GtkTreeIter list_store_iterator; @@ -280,24 +272,23 @@ addressbook_config_fill_book_list() GSList *books_data = addressbook_get_books_data(); // Get model of view and clear it - store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(book_tree_view))); - gtk_list_store_clear(store); + store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (book_tree_view))); + gtk_list_store_clear (store); // Populate window for (book_list_iterator = books_data; book_list_iterator != NULL; book_list_iterator - = book_list_iterator->next) - { + = book_list_iterator->next) { book_data = (book_data_t *) book_list_iterator->data; - gtk_list_store_append(store, &list_store_iterator); - gtk_list_store_set(store, &list_store_iterator, COLUMN_BOOK_ACTIVE, - book_data->active, COLUMN_BOOK_UID, book_data->uid, COLUMN_BOOK_NAME, - book_data->name, -1); + gtk_list_store_append (store, &list_store_iterator); + gtk_list_store_set (store, &list_store_iterator, COLUMN_BOOK_ACTIVE, + book_data->active, COLUMN_BOOK_UID, book_data->uid, COLUMN_BOOK_NAME, + book_data->name, -1); } - store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(book_tree_view))); + store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (book_tree_view))); } - GtkWidget* +GtkWidget* create_addressbook_settings() { @@ -309,140 +300,140 @@ create_addressbook_settings() GtkTreeViewColumn *tree_view_column; // Load the user value - addressbook_config_load_parameters(&addressbook_config); + addressbook_config_load_parameters (&addressbook_config); - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); - gnome_main_section_new_with_table (_("General"), &result_frame, &table, 3, 3); - gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0); + gnome_main_section_new_with_table (_ ("General"), &result_frame, &table, 3, 3); + gtk_box_pack_start (GTK_BOX (ret), result_frame, FALSE, FALSE, 0); // gtk_widget_show (result_frame); // PHOTO DISPLAY - item = gtk_check_button_new_with_mnemonic( _("_Use Evolution address books")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->enable); - g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (enable_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + item = gtk_check_button_new_with_mnemonic (_ ("_Use Evolution address books")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), addressbook_config->enable); + g_signal_connect (G_OBJECT (item) , "clicked" , G_CALLBACK (enable_cb), NULL); + gtk_table_attach (GTK_TABLE (table), item, 1, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); // SCALE BUTTON - NUMBER OF RESULTS - scale_button = gtk_hbox_new(FALSE, 0); - scale_label = gtk_label_new (_("Download limit :")); - gtk_box_pack_start(GTK_BOX(scale_button),scale_label,FALSE,FALSE,0); - value = gtk_spin_button_new_with_range(1, 500, 1); + scale_button = gtk_hbox_new (FALSE, 0); + scale_label = gtk_label_new (_ ("Download limit :")); + gtk_box_pack_start (GTK_BOX (scale_button),scale_label,FALSE,FALSE,0); + value = gtk_spin_button_new_with_range (1, 500, 1); gtk_label_set_mnemonic_widget (GTK_LABEL (scale_label), value); - gtk_spin_button_set_value (GTK_SPIN_BUTTON( value ) , addressbook_config->max_results); - g_signal_connect (G_OBJECT (value) , "value-changed" , G_CALLBACK(max_results_cb), NULL ); - gtk_box_pack_start(GTK_BOX(scale_button),value,TRUE,TRUE,10); - gtk_table_attach ( GTK_TABLE( table ), scale_button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND |GTK_FILL, 0, 0); - cards_label = gtk_label_new(_("cards")); - gtk_table_attach( GTK_TABLE(table), cards_label, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_show_all(scale_button); - + gtk_spin_button_set_value (GTK_SPIN_BUTTON (value) , addressbook_config->max_results); + g_signal_connect (G_OBJECT (value) , "value-changed" , G_CALLBACK (max_results_cb), NULL); + gtk_box_pack_start (GTK_BOX (scale_button),value,TRUE,TRUE,10); + gtk_table_attach (GTK_TABLE (table), scale_button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND |GTK_FILL, 0, 0); + cards_label = gtk_label_new (_ ("cards")); + gtk_table_attach (GTK_TABLE (table), cards_label, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_show_all (scale_button); + // PHOTO DISPLAY - photo = gtk_check_button_new_with_mnemonic( _("_Display contact photo if available")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(photo), addressbook_config->display_contact_photo); - g_signal_connect (G_OBJECT(photo) , "clicked" , G_CALLBACK (display_contact_photo_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), photo, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + photo = gtk_check_button_new_with_mnemonic (_ ("_Display contact photo if available")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (photo), addressbook_config->display_contact_photo); + g_signal_connect (G_OBJECT (photo) , "clicked" , G_CALLBACK (display_contact_photo_cb), NULL); + gtk_table_attach (GTK_TABLE (table), photo, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + // Fields - gnome_main_section_new_with_table (_("Fields from Evolution's address books"), &result_frame, &table, 1, 3); - gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0); + gnome_main_section_new_with_table (_ ("Fields from Evolution's address books"), &result_frame, &table, 1, 3); + gtk_box_pack_start (GTK_BOX (ret), result_frame, FALSE, FALSE, 0); // gtk_widget_show (result_frame); - business = gtk_check_button_new_with_mnemonic( _("_Work")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(business), addressbook_config->search_phone_business); - g_signal_connect (G_OBJECT(business) , "clicked" , G_CALLBACK (search_phone_business_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), business, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive(business, FALSE); + business = gtk_check_button_new_with_mnemonic (_ ("_Work")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (business), addressbook_config->search_phone_business); + g_signal_connect (G_OBJECT (business) , "clicked" , G_CALLBACK (search_phone_business_cb) , NULL); + gtk_table_attach (GTK_TABLE (table), business, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (business, FALSE); - home = gtk_check_button_new_with_mnemonic( _("_Home")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(home), addressbook_config->search_phone_home); - g_signal_connect (G_OBJECT(home) , "clicked" , G_CALLBACK (search_phone_home_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), home, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive(home, FALSE); + home = gtk_check_button_new_with_mnemonic (_ ("_Home")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (home), addressbook_config->search_phone_home); + g_signal_connect (G_OBJECT (home) , "clicked" , G_CALLBACK (search_phone_home_cb) , NULL); + gtk_table_attach (GTK_TABLE (table), home, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (home, FALSE); + + mobile = gtk_check_button_new_with_mnemonic (_ ("_Mobile")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mobile), addressbook_config->search_phone_mobile); + g_signal_connect (G_OBJECT (mobile) , "clicked" , G_CALLBACK (search_phone_mobile_cb) , NULL); + gtk_table_attach (GTK_TABLE (table), mobile, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - mobile = gtk_check_button_new_with_mnemonic( _("_Mobile")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(mobile), addressbook_config->search_phone_mobile); - g_signal_connect (G_OBJECT(mobile) , "clicked" , G_CALLBACK (search_phone_mobile_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), mobile, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - // Address Book - gnome_main_section_new_with_table (_("Address Books"), &result_frame, &table, 2, 3); - gtk_box_pack_start(GTK_BOX(ret), result_frame, TRUE, TRUE, 0); + gnome_main_section_new_with_table (_ ("Address Books"), &result_frame, &table, 2, 3); + gtk_box_pack_start (GTK_BOX (ret), result_frame, TRUE, TRUE, 0); gtk_widget_show (result_frame); - scrolled_label = gtk_label_new (_("Select which Evolution address books to use")); - gtk_misc_set_alignment(GTK_MISC(scrolled_label), 0.00, 0.2); - - gtk_table_attach ( GTK_TABLE( table ), scrolled_label, 1, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive(scrolled_label, FALSE); + scrolled_label = gtk_label_new (_ ("Select which Evolution address books to use")); + gtk_misc_set_alignment (GTK_MISC (scrolled_label), 0.00, 0.2); + + gtk_table_attach (GTK_TABLE (table), scrolled_label, 1, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (scrolled_label, FALSE); - scrolled_window = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_IN); + scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN); - gtk_table_attach ( GTK_TABLE( table ), scrolled_window, 1, 4, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE (table), scrolled_window, 1, 4, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - store = gtk_list_store_new(3, - G_TYPE_BOOLEAN, // Active - G_TYPE_STRING, // uid - G_TYPE_STRING // Name - ); + store = gtk_list_store_new (3, + G_TYPE_BOOLEAN, // Active + G_TYPE_STRING, // uid + G_TYPE_STRING // Name + ); // Create tree view with list store - book_tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + book_tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); // Get tree selection manager - tree_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(book_tree_view)); + tree_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (book_tree_view)); // Active column renderer = gtk_cell_renderer_toggle_new(); - tree_view_column = gtk_tree_view_column_new_with_attributes("", renderer, "active", COLUMN_BOOK_ACTIVE, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(book_tree_view), tree_view_column); + tree_view_column = gtk_tree_view_column_new_with_attributes ("", renderer, "active", COLUMN_BOOK_ACTIVE, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (book_tree_view), tree_view_column); // Toggle active property on clicked - g_signal_connect(G_OBJECT(renderer), "toggled", G_CALLBACK(addressbook_config_book_active_toggled), (gpointer)book_tree_view); + g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (addressbook_config_book_active_toggled), (gpointer) book_tree_view); // Name column renderer = gtk_cell_renderer_text_new(); - tree_view_column = gtk_tree_view_column_new_with_attributes(_("Name"), renderer, "markup", COLUMN_BOOK_NAME, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(book_tree_view), tree_view_column); + tree_view_column = gtk_tree_view_column_new_with_attributes (_ ("Name"), renderer, "markup", COLUMN_BOOK_NAME, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (book_tree_view), tree_view_column); - g_object_unref(G_OBJECT(store)); - gtk_container_add(GTK_CONTAINER(scrolled_window), book_tree_view); + g_object_unref (G_OBJECT (store)); + gtk_container_add (GTK_CONTAINER (scrolled_window), book_tree_view); addressbook_config_fill_book_list(); - gtk_widget_show_all(ret); + gtk_widget_show_all (ret); enable_options(); return ret; } - gboolean -addressbook_display(AddressBook_Config *settings, const gchar *field) +gboolean +addressbook_display (AddressBook_Config *settings, const gchar *field) { gboolean display = FALSE; - if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO) == 0) + if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO) == 0) display = (settings->display_contact_photo == 1) ? TRUE : FALSE; - else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS) == 0) + else if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS) == 0) display = (settings->search_phone_business == 1) ? TRUE : FALSE; - else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_HOME) == 0) + else if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_PHONE_HOME) == 0) display = (settings->search_phone_home == 1) ? TRUE : FALSE; - else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_MOBILE) == 0) + else if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_PHONE_MOBILE) == 0) display = (settings->search_phone_mobile == 1) ? TRUE : FALSE; else diff --git a/sflphone-client-gnome/src/config/addressbook-config.h b/sflphone-client-gnome/src/config/addressbook-config.h index fb419e876db7d59fd59f0de69909211ccff7078e..2a534e5ebac8625196246cd0930948eed1aecb15 100644 --- a/sflphone-client-gnome/src/config/addressbook-config.h +++ b/sflphone-client-gnome/src/config/addressbook-config.h @@ -46,10 +46,9 @@ G_BEGIN_DECLS #define ADDRESSBOOK_DISPLAY_PHONE_HOME "ADDRESSBOOK_DISPLAY_PHONE_HOME" #define ADDRESSBOOK_DISPLAY_PHONE_MOBILE "ADDRESSBOOK_DISPLAY_PHONE_MOBILE" -typedef struct _AddressBook_Config -{ - // gint64: a signed integer guaranteed to be 64 bits on all platforms - // To print or scan values of this type, use G_GINT64_MODIFIER and/or G_GINT64_FORMAT +typedef struct _AddressBook_Config { + // gint64: a signed integer guaranteed to be 64 bits on all platforms + // To print or scan values of this type, use G_GINT64_MODIFIER and/or G_GINT64_FORMAT gint64 enable; gint64 max_results; gint64 display_contact_photo; @@ -62,7 +61,7 @@ typedef struct _AddressBook_Config * Save the parameters through D-BUS */ void -addressbook_config_save_parameters(void); +addressbook_config_save_parameters (void); /** * Initialize the address book structure, and retrieve the saved parameters through D-Bus @@ -70,10 +69,10 @@ addressbook_config_save_parameters(void); * @param settings The addressbook structure */ void -addressbook_config_load_parameters(AddressBook_Config **settings); +addressbook_config_load_parameters (AddressBook_Config **settings); gboolean -addressbook_display(AddressBook_Config *settings, const gchar *field); +addressbook_display (AddressBook_Config *settings, const gchar *field); GtkWidget* create_addressbook_settings(); diff --git a/sflphone-client-gnome/src/config/assistant.c b/sflphone-client-gnome/src/config/assistant.c index 7b5c342a81312a6c0b292aa3bdcd9511a980de53..8b1f7d3a288e589e2a70f0fb1818a2d921436a5a 100644 --- a/sflphone-client-gnome/src/config/assistant.c +++ b/sflphone-client-gnome/src/config/assistant.c @@ -54,25 +54,26 @@ char message[1024]; /** * Forward function */ -static gint forward_page_func( gint current_page , gpointer data ); +static gint forward_page_func (gint current_page , gpointer data); /** * Page template */ -static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section); -void prefill_sip(void) ; - -void set_account_type( GtkWidget* widget , gpointer data UNUSED ) { - if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget )) ){ - account_type = _SIP; - }else{ - account_type = _IAX ; - } +static GtkWidget* create_vbox (GtkAssistantPageType type, const gchar *title, const gchar *section); +void prefill_sip (void) ; + +void set_account_type (GtkWidget* widget , gpointer data UNUSED) +{ + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + account_type = _SIP; + } else { + account_type = _IAX ; + } } static void show_password_cb (GtkWidget *widget, gpointer data) { - gtk_entry_set_visibility (GTK_ENTRY (data), !gtk_entry_get_visibility (GTK_ENTRY (data))); + gtk_entry_set_visibility (GTK_ENTRY (data), !gtk_entry_get_visibility (GTK_ENTRY (data))); } @@ -80,36 +81,38 @@ static void show_password_cb (GtkWidget *widget, gpointer data) * Fills string message with the final message of account registration * with alias, server and username specified. */ -void getMessageSummary( char * message , const gchar * alias, const gchar * server, const gchar * username, const gboolean zrtp) +void getMessageSummary (char * message , const gchar * alias, const gchar * server, const gchar * username, const gboolean zrtp) { - char var[64]; - sprintf( message, _("This assistant is now finished.")); - strcat( message, "\n" ); - strcat( message, _("You can at any time check your registration state or modify your accounts parameters in the Options/Accounts window.")); - strcat( message, "\n\n"); - - strcat( message, _("Alias")); - sprintf( var, " : %s\n", alias); - strcat( message, var); - - strcat( message, _("Server")); - sprintf( var, " : %s\n", server); - strcat( message, var); - - strcat( message, _("Username")); - sprintf( var, " : %s\n", username); - strcat( message, var); - - strcat( message, _("Security: ")); - if (zrtp) { - strcat( message, _("SRTP/ZRTP draft-zimmermann")); - } else { - strcat( message, _("None")); - } + char var[64]; + sprintf (message, _ ("This assistant is now finished.")); + strcat (message, "\n"); + strcat (message, _ ("You can at any time check your registration state or modify your accounts parameters in the Options/Accounts window.")); + strcat (message, "\n\n"); + + strcat (message, _ ("Alias")); + sprintf (var, " : %s\n", alias); + strcat (message, var); + + strcat (message, _ ("Server")); + sprintf (var, " : %s\n", server); + strcat (message, var); + + strcat (message, _ ("Username")); + sprintf (var, " : %s\n", username); + strcat (message, var); + + strcat (message, _ ("Security: ")); + + if (zrtp) { + strcat (message, _ ("SRTP/ZRTP draft-zimmermann")); + } else { + strcat (message, _ ("None")); + } } -void set_sflphone_org( GtkWidget* widget , gpointer data UNUSED ) { - use_sflphone_org = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))?1:0) ; +void set_sflphone_org (GtkWidget* widget , gpointer data UNUSED) +{ + use_sflphone_org = (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ?1:0) ; } @@ -118,9 +121,11 @@ void set_sflphone_org( GtkWidget* widget , gpointer data UNUSED ) { * Callback when the close button of the dialog is clicked * Action : close the assistant widget and get back to sflphone main window */ -static void close_callback( void ) { - gtk_widget_destroy(wiz->assistant); - g_free(wiz); wiz = NULL; +static void close_callback (void) +{ + gtk_widget_destroy (wiz->assistant); + g_free (wiz); + wiz = NULL; status_bar_display_account (); } @@ -129,10 +134,12 @@ static void close_callback( void ) { * Callback when the cancel button of the dialog is clicked * Action : close the assistant widget and get back to sflphone main window */ -static void cancel_callback( void ) { - gtk_widget_destroy(wiz->assistant); - g_free(wiz); wiz = NULL; - +static void cancel_callback (void) +{ + gtk_widget_destroy (wiz->assistant); + g_free (wiz); + wiz = NULL; + status_bar_display_account (); } @@ -140,536 +147,564 @@ static void cancel_callback( void ) { * Callback when the button apply is clicked * Action : Set the account parameters with the entries values and called dbus_add_account */ -static void sip_apply_callback( void ) { - if(use_sflphone_org){ - prefill_sip(); - account_type = _SIP; - } - if( account_type == _SIP ) { - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ALIAS), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_alias)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ENABLED), g_strdup("true")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_MAILBOX), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_voicemail)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_TYPE), g_strdup("SIP")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_HOSTNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_server)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_password)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_USERNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_username)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), g_strdup((gchar *)(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->enable))? "true":"false"))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->addr)))); - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable)) == TRUE) { - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup((gchar *)"true")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup((gchar *)ZRTP)); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ZRTP_DISPLAY_SAS), g_strdup((gchar *)"true")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ZRTP_NOT_SUPP_WARNING), g_strdup((gchar *)"true")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ZRTP_HELLO_HASH), g_strdup((gchar *)"true")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_DISPLAY_SAS_ONCE), g_strdup((gchar *)"false")); +static void sip_apply_callback (void) +{ + if (use_sflphone_org) { + prefill_sip(); + account_type = _SIP; + } + + if (account_type == _SIP) { + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_ALIAS), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->sip_alias)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_ENABLED), g_strdup ("true")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_MAILBOX), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->sip_voicemail)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_TYPE), g_strdup ("SIP")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_HOSTNAME), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->sip_server)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_PASSWORD), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->sip_password)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_USERNAME), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->sip_username)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_SIP_STUN_ENABLED), g_strdup ( (gchar *) (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wiz->enable)) ? "true":"false"))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_SIP_STUN_SERVER), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->addr)))); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wiz->zrtp_enable)) == TRUE) { + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_SRTP_ENABLED), g_strdup ( (gchar *) "true")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_KEY_EXCHANGE), g_strdup ( (gchar *) ZRTP)); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_ZRTP_DISPLAY_SAS), g_strdup ( (gchar *) "true")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_ZRTP_NOT_SUPP_WARNING), g_strdup ( (gchar *) "true")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_ZRTP_HELLO_HASH), g_strdup ( (gchar *) "true")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_DISPLAY_SAS_ONCE), g_strdup ( (gchar *) "false")); } - // Add default interface info - gchar ** iface_list = NULL; - iface_list = (gchar**) dbus_get_all_ip_interface_by_name(); + // Add default interface info + gchar ** iface_list = NULL; + iface_list = (gchar**) dbus_get_all_ip_interface_by_name(); gchar ** iface = NULL; - // select the first interface available - iface = iface_list; - DEBUG("Selected interface %s", *iface); + // select the first interface available + iface = iface_list; + DEBUG ("Selected interface %s", *iface); - g_hash_table_insert(current->properties, g_strdup(LOCAL_INTERFACE), g_strdup((gchar *)*iface)); + g_hash_table_insert (current->properties, g_strdup (LOCAL_INTERFACE), g_strdup ( (gchar *) *iface)); - g_hash_table_insert(current->properties, g_strdup(PUBLISHED_ADDRESS), g_strdup((gchar *)*iface)); + g_hash_table_insert (current->properties, g_strdup (PUBLISHED_ADDRESS), g_strdup ( (gchar *) *iface)); - dbus_add_account( current ); - getMessageSummary(message, - gtk_entry_get_text (GTK_ENTRY(wiz->sip_alias)), - gtk_entry_get_text (GTK_ENTRY(wiz->sip_server)), - gtk_entry_get_text (GTK_ENTRY(wiz->sip_username)), - (gboolean)(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable))) - ); + dbus_add_account (current); + getMessageSummary (message, + gtk_entry_get_text (GTK_ENTRY (wiz->sip_alias)), + gtk_entry_get_text (GTK_ENTRY (wiz->sip_server)), + gtk_entry_get_text (GTK_ENTRY (wiz->sip_username)), + (gboolean) (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wiz->zrtp_enable))) + ); - gtk_label_set_text (GTK_LABEL(wiz->label_summary), message); - } + gtk_label_set_text (GTK_LABEL (wiz->label_summary), message); + } } /** * Callback when the button apply is clicked * Action : Set the account parameters with the entries values and called dbus_add_account */ -static void iax_apply_callback( void ) { - if( account_type == _IAX) { - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ALIAS), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_alias)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ENABLED), g_strdup("true")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_MAILBOX), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_voicemail)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_TYPE), g_strdup("IAX")); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_USERNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_username)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_HOSTNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_server)))); - g_hash_table_insert(current->properties, g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_password)))); - - dbus_add_account( current ); - getMessageSummary(message, - gtk_entry_get_text (GTK_ENTRY(wiz->iax_alias)), - gtk_entry_get_text (GTK_ENTRY(wiz->iax_server)), - gtk_entry_get_text (GTK_ENTRY(wiz->iax_username)), - FALSE - ) ; - - gtk_label_set_text (GTK_LABEL(wiz->label_summary), message); - } +static void iax_apply_callback (void) +{ + if (account_type == _IAX) { + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_ALIAS), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->iax_alias)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_ENABLED), g_strdup ("true")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_MAILBOX), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->iax_voicemail)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_TYPE), g_strdup ("IAX")); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_USERNAME), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->iax_username)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_HOSTNAME), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->iax_server)))); + g_hash_table_insert (current->properties, g_strdup (ACCOUNT_PASSWORD), g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (wiz->iax_password)))); + + dbus_add_account (current); + getMessageSummary (message, + gtk_entry_get_text (GTK_ENTRY (wiz->iax_alias)), + gtk_entry_get_text (GTK_ENTRY (wiz->iax_server)), + gtk_entry_get_text (GTK_ENTRY (wiz->iax_username)), + FALSE + ) ; + + gtk_label_set_text (GTK_LABEL (wiz->label_summary), message); + } } -void enable_stun( GtkWidget* widget ) { - gtk_widget_set_sensitive( GTK_WIDGET( wiz->addr ), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); +void enable_stun (GtkWidget* widget) +{ + gtk_widget_set_sensitive (GTK_WIDGET (wiz->addr), gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); } -void build_wizard( void ) { - use_sflphone_org = 1; - if (wiz) - return ; - - wiz = ( struct _wizard* )g_malloc( sizeof( struct _wizard)); - current = g_new0(account_t, 1); - current->properties = NULL; - current->properties = dbus_account_details(NULL); - if (current->properties == NULL) { - DEBUG("Failed to get default values. Creating from scratch"); - current->properties = g_hash_table_new(NULL, g_str_equal); - } +void build_wizard (void) +{ + use_sflphone_org = 1; + + if (wiz) + return ; + + wiz = (struct _wizard*) g_malloc (sizeof (struct _wizard)); + current = g_new0 (account_t, 1); + current->properties = NULL; + current->properties = dbus_account_details (NULL); + + if (current->properties == NULL) { + DEBUG ("Failed to get default values. Creating from scratch"); + current->properties = g_hash_table_new (NULL, g_str_equal); + } + current->accountID = "new"; - wiz->assistant = gtk_assistant_new(); + wiz->assistant = gtk_assistant_new(); - gtk_window_set_title( GTK_WINDOW(wiz->assistant), _("SFLphone account creation wizard") ); - gtk_window_set_position(GTK_WINDOW(wiz->assistant), GTK_WIN_POS_CENTER); - gtk_window_set_default_size(GTK_WINDOW(wiz->assistant), 200 , 200); + gtk_window_set_title (GTK_WINDOW (wiz->assistant), _ ("SFLphone account creation wizard")); + gtk_window_set_position (GTK_WINDOW (wiz->assistant), GTK_WIN_POS_CENTER); + gtk_window_set_default_size (GTK_WINDOW (wiz->assistant), 200 , 200); - build_intro(); - build_sfl_or_account(); - build_select_account(); - build_sip_account_configuration(); - build_nat_settings(); - build_iax_account_configuration(); - build_email_configuration(); - build_summary(); + build_intro(); + build_sfl_or_account(); + build_select_account(); + build_sip_account_configuration(); + build_nat_settings(); + build_iax_account_configuration(); + build_email_configuration(); + build_summary(); - g_signal_connect(G_OBJECT(wiz->assistant), "close" , G_CALLBACK(close_callback), NULL); + g_signal_connect (G_OBJECT (wiz->assistant), "close" , G_CALLBACK (close_callback), NULL); - g_signal_connect(G_OBJECT(wiz->assistant), "cancel" , G_CALLBACK(cancel_callback), NULL); + g_signal_connect (G_OBJECT (wiz->assistant), "cancel" , G_CALLBACK (cancel_callback), NULL); - gtk_widget_show_all(wiz->assistant); + gtk_widget_show_all (wiz->assistant); - gtk_assistant_set_forward_page_func( GTK_ASSISTANT( wiz->assistant ), (GtkAssistantPageFunc) forward_page_func , NULL , NULL ); - gtk_assistant_update_buttons_state(GTK_ASSISTANT(wiz->assistant)); + gtk_assistant_set_forward_page_func (GTK_ASSISTANT (wiz->assistant), (GtkAssistantPageFunc) forward_page_func , NULL , NULL); + gtk_assistant_update_buttons_state (GTK_ASSISTANT (wiz->assistant)); } -GtkWidget* build_intro() { - GtkWidget *label; +GtkWidget* build_intro() +{ + GtkWidget *label; - wiz->intro = create_vbox( GTK_ASSISTANT_PAGE_INTRO , "SFLphone GNOME client" , _("Welcome to the Account creation wizard of SFLphone!")); - label = gtk_label_new(_("This installation wizard will help you configure an account.")) ; - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_widget_set_size_request(GTK_WIDGET(label), 380, -1); - gtk_box_pack_start(GTK_BOX(wiz->intro), label, FALSE, TRUE, 0); + wiz->intro = create_vbox (GTK_ASSISTANT_PAGE_INTRO , "SFLphone GNOME client" , _ ("Welcome to the Account creation wizard of SFLphone!")); + label = gtk_label_new (_ ("This installation wizard will help you configure an account.")) ; + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + gtk_widget_set_size_request (GTK_WIDGET (label), 380, -1); + gtk_box_pack_start (GTK_BOX (wiz->intro), label, FALSE, TRUE, 0); - gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->intro, TRUE); - return wiz->intro; + gtk_assistant_set_page_complete (GTK_ASSISTANT (wiz->assistant), wiz->intro, TRUE); + return wiz->intro; } -GtkWidget* build_select_account() { - GtkWidget* sip; - GtkWidget* iax; +GtkWidget* build_select_account() +{ + GtkWidget* sip; + GtkWidget* iax; - wiz->protocols = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("VoIP Protocols") , _("Select an account type")); + wiz->protocols = create_vbox (GTK_ASSISTANT_PAGE_CONTENT , _ ("VoIP Protocols") , _ ("Select an account type")); - sip = gtk_radio_button_new_with_label(NULL, _("SIP (Session Initiation Protocol)")); - gtk_box_pack_start( GTK_BOX(wiz->protocols) , sip , TRUE, TRUE, 0); - iax = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sip), _("IAX2 (InterAsterix Exchange)")); - gtk_box_pack_start( GTK_BOX(wiz->protocols) , iax , TRUE, TRUE, 0); + sip = gtk_radio_button_new_with_label (NULL, _ ("SIP (Session Initiation Protocol)")); + gtk_box_pack_start (GTK_BOX (wiz->protocols) , sip , TRUE, TRUE, 0); + iax = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (sip), _ ("IAX2 (InterAsterix Exchange)")); + gtk_box_pack_start (GTK_BOX (wiz->protocols) , iax , TRUE, TRUE, 0); - g_signal_connect(G_OBJECT( sip ) , "clicked" , G_CALLBACK( set_account_type ) , NULL ); + g_signal_connect (G_OBJECT (sip) , "clicked" , G_CALLBACK (set_account_type) , NULL); - gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->protocols, TRUE); - return wiz->protocols; + gtk_assistant_set_page_complete (GTK_ASSISTANT (wiz->assistant), wiz->protocols, TRUE); + return wiz->protocols; } -GtkWidget* build_sfl_or_account() { - GtkWidget* sfl; - GtkWidget* cus; +GtkWidget* build_sfl_or_account() +{ + GtkWidget* sfl; + GtkWidget* cus; - wiz->sflphone_org = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("Account") , _("Please select one of the following options")); + wiz->sflphone_org = create_vbox (GTK_ASSISTANT_PAGE_CONTENT , _ ("Account") , _ ("Please select one of the following options")); - sfl = gtk_radio_button_new_with_label( NULL, _("Create a free SIP/IAX2 account on sflphone.org")); - gtk_box_pack_start( GTK_BOX(wiz->sflphone_org) , sfl , TRUE, TRUE, 0); - cus = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sfl), _("Register an existing SIP or IAX2 account")); - gtk_box_pack_start( GTK_BOX(wiz->sflphone_org) , cus , TRUE, TRUE, 0); - g_signal_connect(G_OBJECT( sfl ) , "clicked" , G_CALLBACK( set_sflphone_org ) , NULL ); + sfl = gtk_radio_button_new_with_label (NULL, _ ("Create a free SIP/IAX2 account on sflphone.org")); + gtk_box_pack_start (GTK_BOX (wiz->sflphone_org) , sfl , TRUE, TRUE, 0); + cus = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (sfl), _ ("Register an existing SIP or IAX2 account")); + gtk_box_pack_start (GTK_BOX (wiz->sflphone_org) , cus , TRUE, TRUE, 0); + g_signal_connect (G_OBJECT (sfl) , "clicked" , G_CALLBACK (set_sflphone_org) , NULL); - return wiz->sflphone_org; + return wiz->sflphone_org; } -GtkWidget* build_sip_account_configuration( void ) { - GtkWidget* table; - GtkWidget* label; +GtkWidget* build_sip_account_configuration (void) +{ + GtkWidget* table; + GtkWidget* label; GtkWidget *image; - GtkWidget * clearTextCheckbox; - - wiz->sip_account = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("SIP account settings") , _("Please fill the following information")); - // table - table = gtk_table_new ( 7, 2 , FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_box_pack_start( GTK_BOX(wiz->sip_account) , table , TRUE, TRUE, 0); - - // alias field - label = gtk_label_new_with_mnemonic (_("_Alias")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->sip_alias = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_alias); - gtk_table_attach ( GTK_TABLE( table ), wiz->sip_alias, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // server field - label = gtk_label_new_with_mnemonic (_("_Host name")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->sip_server = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_server); - gtk_table_attach ( GTK_TABLE( table ), wiz->sip_server, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // username field - label = gtk_label_new_with_mnemonic (_("_User name")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + GtkWidget * clearTextCheckbox; + + wiz->sip_account = create_vbox (GTK_ASSISTANT_PAGE_CONTENT , _ ("SIP account settings") , _ ("Please fill the following information")); + // table + table = gtk_table_new (7, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings (GTK_TABLE (table), 10); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + gtk_box_pack_start (GTK_BOX (wiz->sip_account) , table , TRUE, TRUE, 0); + + // alias field + label = gtk_label_new_with_mnemonic (_ ("_Alias")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->sip_alias = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_alias); + gtk_table_attach (GTK_TABLE (table), wiz->sip_alias, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // server field + label = gtk_label_new_with_mnemonic (_ ("_Host name")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->sip_server = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_server); + gtk_table_attach (GTK_TABLE (table), wiz->sip_server, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // username field + label = gtk_label_new_with_mnemonic (_ ("_User name")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); #if GTK_CHECK_VERSION(2,16,0) - wiz->sip_username = gtk_entry_new(); - gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (wiz->sip_username), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file(ICONS_DIR "/stock_person.svg", NULL)); + wiz->sip_username = gtk_entry_new(); + gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (wiz->sip_username), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file (ICONS_DIR "/stock_person.svg", NULL)); #else - wiz->sip_username = sexy_icon_entry_new(); - image = gtk_image_new_from_file( ICONS_DIR "/stock_person.svg" ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->sip_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + wiz->sip_username = sexy_icon_entry_new(); + image = gtk_image_new_from_file (ICONS_DIR "/stock_person.svg"); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (wiz->sip_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); #endif - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_username); - gtk_table_attach ( GTK_TABLE( table ), wiz->sip_username, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // password field - - label = gtk_label_new_with_mnemonic (_("_Password")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_username); + gtk_table_attach (GTK_TABLE (table), wiz->sip_username, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // password field + + label = gtk_label_new_with_mnemonic (_ ("_Password")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); #if GTK_CHECK_VERSION(2,16,0) - wiz->sip_password = gtk_entry_new(); + wiz->sip_password = gtk_entry_new(); gtk_entry_set_icon_from_stock (GTK_ENTRY (wiz->sip_password), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); #else - - wiz->sip_password = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->sip_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + + wiz->sip_password = sexy_icon_entry_new(); + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (wiz->sip_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); #endif - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_password); - gtk_entry_set_visibility(GTK_ENTRY(wiz->sip_password), FALSE); - gtk_table_attach ( GTK_TABLE( table ), wiz->sip_password, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - clearTextCheckbox = gtk_check_button_new_with_mnemonic (_("Show password")); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_password); + gtk_entry_set_visibility (GTK_ENTRY (wiz->sip_password), FALSE); + gtk_table_attach (GTK_TABLE (table), wiz->sip_password, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + clearTextCheckbox = gtk_check_button_new_with_mnemonic (_ ("Show password")); g_signal_connect (clearTextCheckbox, "toggled", G_CALLBACK (show_password_cb), wiz->sip_password); gtk_table_attach (GTK_TABLE (table), clearTextCheckbox, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); // voicemail number field - label = gtk_label_new_with_mnemonic (_("_Voicemail number")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->sip_voicemail = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_voicemail); - gtk_table_attach ( GTK_TABLE( table ), wiz->sip_voicemail, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new_with_mnemonic (_ ("_Voicemail number")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->sip_voicemail = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_voicemail); + gtk_table_attach (GTK_TABLE (table), wiz->sip_voicemail, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); // Security options - wiz->zrtp_enable = gtk_check_button_new_with_mnemonic(_("Secure communications with _ZRTP")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable), FALSE); - gtk_table_attach ( GTK_TABLE( table ), wiz->zrtp_enable, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( wiz->zrtp_enable ) , TRUE ); - - //gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->sip_account, TRUE); - return wiz->sip_account; + wiz->zrtp_enable = gtk_check_button_new_with_mnemonic (_ ("Secure communications with _ZRTP")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wiz->zrtp_enable), FALSE); + gtk_table_attach (GTK_TABLE (table), wiz->zrtp_enable, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (wiz->zrtp_enable) , TRUE); + + //gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->sip_account, TRUE); + return wiz->sip_account; } -GtkWidget* build_email_configuration( void ) { - GtkWidget* label; - GtkWidget* table; +GtkWidget* build_email_configuration (void) +{ + GtkWidget* label; + GtkWidget* table; - wiz->email = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("Optional email address") , _("This email address will be used to send your voicemail messages.")); + wiz->email = create_vbox (GTK_ASSISTANT_PAGE_CONTENT , _ ("Optional email address") , _ ("This email address will be used to send your voicemail messages.")); - table = gtk_table_new ( 4, 2 , FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_box_pack_start( GTK_BOX(wiz->email) , table , TRUE, TRUE, 0); + table = gtk_table_new (4, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings (GTK_TABLE (table), 10); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + gtk_box_pack_start (GTK_BOX (wiz->email) , table , TRUE, TRUE, 0); - // email field - label = gtk_label_new_with_mnemonic (_("_Email address")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->mailbox = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->mailbox); - gtk_table_attach ( GTK_TABLE( table ), wiz->mailbox, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + // email field + label = gtk_label_new_with_mnemonic (_ ("_Email address")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->mailbox = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->mailbox); + gtk_table_attach (GTK_TABLE (table), wiz->mailbox, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); // Security options - wiz->zrtp_enable = gtk_check_button_new_with_mnemonic(_("Secure communications with _ZRTP")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable), FALSE); - gtk_table_attach ( GTK_TABLE( table ), wiz->zrtp_enable, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( wiz->zrtp_enable ) , TRUE ); - - return wiz->email; + wiz->zrtp_enable = gtk_check_button_new_with_mnemonic (_ ("Secure communications with _ZRTP")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wiz->zrtp_enable), FALSE); + gtk_table_attach (GTK_TABLE (table), wiz->zrtp_enable, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (wiz->zrtp_enable) , TRUE); + + return wiz->email; } -GtkWidget* build_iax_account_configuration( void ) { - GtkWidget* label; - GtkWidget* table; +GtkWidget* build_iax_account_configuration (void) +{ + GtkWidget* label; + GtkWidget* table; GtkWidget *image; - GtkWidget * clearTextCheckbox; - - wiz->iax_account = create_vbox( GTK_ASSISTANT_PAGE_CONFIRM , _("IAX2 account settings") , _("Please fill the following information")); - - table = gtk_table_new ( 6, 2 , FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_box_pack_start( GTK_BOX(wiz->iax_account) , table , TRUE, TRUE, 0); - - // alias field - label = gtk_label_new_with_mnemonic (_("_Alias")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->iax_alias = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_alias); - gtk_table_attach ( GTK_TABLE( table ), wiz->iax_alias, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // server field - label = gtk_label_new_with_mnemonic (_("_Host name")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->iax_server = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_server); - gtk_table_attach ( GTK_TABLE( table ), wiz->iax_server, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // username field - label = gtk_label_new_with_mnemonic (_("_User name")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + GtkWidget * clearTextCheckbox; + + wiz->iax_account = create_vbox (GTK_ASSISTANT_PAGE_CONFIRM , _ ("IAX2 account settings") , _ ("Please fill the following information")); + + table = gtk_table_new (6, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings (GTK_TABLE (table), 10); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + gtk_box_pack_start (GTK_BOX (wiz->iax_account) , table , TRUE, TRUE, 0); + + // alias field + label = gtk_label_new_with_mnemonic (_ ("_Alias")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->iax_alias = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_alias); + gtk_table_attach (GTK_TABLE (table), wiz->iax_alias, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // server field + label = gtk_label_new_with_mnemonic (_ ("_Host name")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->iax_server = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_server); + gtk_table_attach (GTK_TABLE (table), wiz->iax_server, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // username field + label = gtk_label_new_with_mnemonic (_ ("_User name")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); #if GTK_CHECK_VERSION(2,16,0) - wiz->iax_username = gtk_entry_new(); - gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (wiz->iax_username), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file(ICONS_DIR "/stock_person.svg", NULL)); + wiz->iax_username = gtk_entry_new(); + gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (wiz->iax_username), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file (ICONS_DIR "/stock_person.svg", NULL)); #else - wiz->iax_username = sexy_icon_entry_new(); - image = gtk_image_new_from_file( ICONS_DIR "/stock_person.svg" ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->iax_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + wiz->iax_username = sexy_icon_entry_new(); + image = gtk_image_new_from_file (ICONS_DIR "/stock_person.svg"); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (wiz->iax_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); #endif - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_username); - gtk_table_attach ( GTK_TABLE( table ), wiz->iax_username, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_username); + gtk_table_attach (GTK_TABLE (table), wiz->iax_username, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - // password field - label = gtk_label_new_with_mnemonic (_("_Password")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + // password field + label = gtk_label_new_with_mnemonic (_ ("_Password")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); #if GTK_CHECK_VERSION(2,16,0) - wiz->iax_password = gtk_entry_new(); + wiz->iax_password = gtk_entry_new(); gtk_entry_set_icon_from_stock (GTK_ENTRY (wiz->iax_password), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); #else - wiz->iax_password = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->iax_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + wiz->iax_password = sexy_icon_entry_new(); + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (wiz->iax_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); #endif - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_password); - gtk_entry_set_visibility(GTK_ENTRY(wiz->iax_password), FALSE); - gtk_table_attach ( GTK_TABLE( table ), wiz->iax_password, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_password); + gtk_entry_set_visibility (GTK_ENTRY (wiz->iax_password), FALSE); + gtk_table_attach (GTK_TABLE (table), wiz->iax_password, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - clearTextCheckbox = gtk_check_button_new_with_mnemonic (_("Show password")); + clearTextCheckbox = gtk_check_button_new_with_mnemonic (_ ("Show password")); g_signal_connect (clearTextCheckbox, "toggled", G_CALLBACK (show_password_cb), wiz->iax_password); gtk_table_attach (GTK_TABLE (table), clearTextCheckbox, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); // voicemail number field - label = gtk_label_new_with_mnemonic (_("_Voicemail number")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->iax_voicemail = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_voicemail); - gtk_table_attach ( GTK_TABLE( table ), wiz->iax_voicemail, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new_with_mnemonic (_ ("_Voicemail number")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->iax_voicemail = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_voicemail); + gtk_table_attach (GTK_TABLE (table), wiz->iax_voicemail, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - current -> state = ACCOUNT_STATE_UNREGISTERED; + current -> state = ACCOUNT_STATE_UNREGISTERED; - g_signal_connect( G_OBJECT( wiz->assistant ) , "apply" , G_CALLBACK( iax_apply_callback ), NULL); + g_signal_connect (G_OBJECT (wiz->assistant) , "apply" , G_CALLBACK (iax_apply_callback), NULL); - return wiz->iax_account; + return wiz->iax_account; } -GtkWidget* build_nat_settings( void ) { - GtkWidget* label; - GtkWidget* table; - - wiz->nat = create_vbox( GTK_ASSISTANT_PAGE_CONFIRM , _("Network Address Translation (NAT)") , _("You should probably enable this if you are behind a firewall.")); - - // table - table = gtk_table_new ( 2, 2 , FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_box_pack_start( GTK_BOX(wiz->nat), table , TRUE, TRUE, 0); - - // enable - wiz->enable = gtk_check_button_new_with_mnemonic(_("E_nable STUN")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->enable), FALSE); - gtk_table_attach ( GTK_TABLE( table ), wiz->enable, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( wiz->enable ) , TRUE ); - g_signal_connect( G_OBJECT( GTK_TOGGLE_BUTTON(wiz->enable)) , "toggled" , G_CALLBACK( enable_stun ), NULL); - - // server address - label = gtk_label_new_with_mnemonic (_("_STUN server")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - wiz->addr = gtk_entry_new(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->addr); - gtk_table_attach ( GTK_TABLE( table ), wiz->addr, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( wiz->addr ), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->enable))); - - g_signal_connect( G_OBJECT( wiz->assistant ) , "apply" , G_CALLBACK( sip_apply_callback ), NULL); - - return wiz->nat; +GtkWidget* build_nat_settings (void) +{ + GtkWidget* label; + GtkWidget* table; + + wiz->nat = create_vbox (GTK_ASSISTANT_PAGE_CONFIRM , _ ("Network Address Translation (NAT)") , _ ("You should probably enable this if you are behind a firewall.")); + + // table + table = gtk_table_new (2, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings (GTK_TABLE (table), 10); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + gtk_box_pack_start (GTK_BOX (wiz->nat), table , TRUE, TRUE, 0); + + // enable + wiz->enable = gtk_check_button_new_with_mnemonic (_ ("E_nable STUN")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wiz->enable), FALSE); + gtk_table_attach (GTK_TABLE (table), wiz->enable, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (wiz->enable) , TRUE); + g_signal_connect (G_OBJECT (GTK_TOGGLE_BUTTON (wiz->enable)) , "toggled" , G_CALLBACK (enable_stun), NULL); + + // server address + label = gtk_label_new_with_mnemonic (_ ("_STUN server")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + wiz->addr = gtk_entry_new(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->addr); + gtk_table_attach (GTK_TABLE (table), wiz->addr, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (wiz->addr), gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wiz->enable))); + + g_signal_connect (G_OBJECT (wiz->assistant) , "apply" , G_CALLBACK (sip_apply_callback), NULL); + + return wiz->nat; } -GtkWidget* build_summary() { - wiz->summary = create_vbox( GTK_ASSISTANT_PAGE_SUMMARY , _("Account Registration") , _("Congratulations!")); +GtkWidget* build_summary() +{ + wiz->summary = create_vbox (GTK_ASSISTANT_PAGE_SUMMARY , _ ("Account Registration") , _ ("Congratulations!")); - strcpy(message,""); - wiz->label_summary = gtk_label_new(message) ; - gtk_label_set_selectable (GTK_LABEL(wiz->label_summary), TRUE); - gtk_misc_set_alignment(GTK_MISC(wiz->label_summary), 0, 0); - gtk_label_set_line_wrap(GTK_LABEL(wiz->label_summary), TRUE); - //gtk_widget_set_size_request(GTK_WIDGET(wiz->label_summary), 380, -1); - gtk_box_pack_start(GTK_BOX(wiz->summary), wiz->label_summary, FALSE, TRUE, 0); + strcpy (message,""); + wiz->label_summary = gtk_label_new (message) ; + gtk_label_set_selectable (GTK_LABEL (wiz->label_summary), TRUE); + gtk_misc_set_alignment (GTK_MISC (wiz->label_summary), 0, 0); + gtk_label_set_line_wrap (GTK_LABEL (wiz->label_summary), TRUE); + //gtk_widget_set_size_request(GTK_WIDGET(wiz->label_summary), 380, -1); + gtk_box_pack_start (GTK_BOX (wiz->summary), wiz->label_summary, FALSE, TRUE, 0); - return wiz->summary; + return wiz->summary; } -GtkWidget* build_registration_error() { - GtkWidget *label; - wiz->reg_failed = create_vbox( GTK_ASSISTANT_PAGE_SUMMARY , "Account Registration" , "Registration error"); +GtkWidget* build_registration_error() +{ + GtkWidget *label; + wiz->reg_failed = create_vbox (GTK_ASSISTANT_PAGE_SUMMARY , "Account Registration" , "Registration error"); - label = gtk_label_new(" Please correct the information.") ; - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_widget_set_size_request(GTK_WIDGET(label), 380, -1); - gtk_box_pack_start(GTK_BOX(wiz->reg_failed), label, FALSE, TRUE, 0); + label = gtk_label_new (" Please correct the information.") ; + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + gtk_widget_set_size_request (GTK_WIDGET (label), 380, -1); + gtk_box_pack_start (GTK_BOX (wiz->reg_failed), label, FALSE, TRUE, 0); - return wiz->reg_failed; + return wiz->reg_failed; } -void set_sip_infos_sentivite(gboolean b) { - gtk_widget_set_sensitive(GTK_WIDGET(wiz->sip_alias), b); - gtk_widget_set_sensitive(GTK_WIDGET(wiz->sip_server), b); - gtk_widget_set_sensitive(GTK_WIDGET(wiz->sip_username), b); - gtk_widget_set_sensitive(GTK_WIDGET(wiz->sip_password), b); +void set_sip_infos_sentivite (gboolean b) +{ + gtk_widget_set_sensitive (GTK_WIDGET (wiz->sip_alias), b); + gtk_widget_set_sensitive (GTK_WIDGET (wiz->sip_server), b); + gtk_widget_set_sensitive (GTK_WIDGET (wiz->sip_username), b); + gtk_widget_set_sensitive (GTK_WIDGET (wiz->sip_password), b); } -void prefill_sip(void) { - if (use_sflphone_org == 1) { - char alias[300]; - char *email; - email = (char *)gtk_entry_get_text (GTK_ENTRY(wiz->mailbox) ); - rest_account ra = get_rest_account(SFLPHONE_ORG_SERVER,email); - if (ra.success) { - set_sip_infos_sentivite(FALSE); - strcpy(alias,ra.user); - strcat(alias,"@"); - strcat(alias,"sip.sflphone.org"); - gtk_entry_set_text (GTK_ENTRY(wiz->sip_alias),alias ); - gtk_entry_set_text (GTK_ENTRY(wiz->sip_server), SFLPHONE_ORG_SERVER); - gtk_entry_set_text (GTK_ENTRY(wiz->sip_username), ra.user); - gtk_entry_set_text (GTK_ENTRY(wiz->sip_password), ra.passwd); - } - } +void prefill_sip (void) +{ + if (use_sflphone_org == 1) { + char alias[300]; + char *email; + email = (char *) gtk_entry_get_text (GTK_ENTRY (wiz->mailbox)); + rest_account ra = get_rest_account (SFLPHONE_ORG_SERVER,email); + + if (ra.success) { + set_sip_infos_sentivite (FALSE); + strcpy (alias,ra.user); + strcat (alias,"@"); + strcat (alias,"sip.sflphone.org"); + gtk_entry_set_text (GTK_ENTRY (wiz->sip_alias),alias); + gtk_entry_set_text (GTK_ENTRY (wiz->sip_server), SFLPHONE_ORG_SERVER); + gtk_entry_set_text (GTK_ENTRY (wiz->sip_username), ra.user); + gtk_entry_set_text (GTK_ENTRY (wiz->sip_password), ra.passwd); + } + } } typedef enum { - PAGE_INTRO, - PAGE_SFL, - PAGE_TYPE, - PAGE_SIP, - PAGE_STUN, - PAGE_IAX, - PAGE_EMAIL, - PAGE_SUMMARY + PAGE_INTRO, + PAGE_SFL, + PAGE_TYPE, + PAGE_SIP, + PAGE_STUN, + PAGE_IAX, + PAGE_EMAIL, + PAGE_SUMMARY } assistant_state; -static gint forward_page_func( gint current_page , gpointer data UNUSED) { - gint next_page = 0; - - switch( current_page ){ - case PAGE_INTRO: - next_page = PAGE_SFL; - break; - case PAGE_SFL: - if (use_sflphone_org) { - next_page = PAGE_EMAIL; - } else - next_page = PAGE_TYPE; - break; - case PAGE_TYPE: - if( account_type == _SIP ) { - set_sip_infos_sentivite(TRUE); - next_page = PAGE_SIP; - } else - next_page = PAGE_IAX; - break; - case PAGE_SIP: - next_page = PAGE_STUN; - break; - case PAGE_EMAIL: - next_page = PAGE_STUN; - break; - case PAGE_STUN: - next_page = PAGE_SUMMARY; - break; - case PAGE_IAX: - next_page = PAGE_SUMMARY; - break; - case PAGE_SUMMARY: - next_page = PAGE_SUMMARY; - break; - default: - next_page = -1; - } - return next_page; +static gint forward_page_func (gint current_page , gpointer data UNUSED) +{ + gint next_page = 0; + + switch (current_page) { + case PAGE_INTRO: + next_page = PAGE_SFL; + break; + case PAGE_SFL: + + if (use_sflphone_org) { + next_page = PAGE_EMAIL; + } else + next_page = PAGE_TYPE; + + break; + case PAGE_TYPE: + + if (account_type == _SIP) { + set_sip_infos_sentivite (TRUE); + next_page = PAGE_SIP; + } else + next_page = PAGE_IAX; + + break; + case PAGE_SIP: + next_page = PAGE_STUN; + break; + case PAGE_EMAIL: + next_page = PAGE_STUN; + break; + case PAGE_STUN: + next_page = PAGE_SUMMARY; + break; + case PAGE_IAX: + next_page = PAGE_SUMMARY; + break; + case PAGE_SUMMARY: + next_page = PAGE_SUMMARY; + break; + default: + next_page = -1; + } + + return next_page; } -static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section) { - GtkWidget *vbox; - GtkWidget *label; - gchar *str; +static GtkWidget* create_vbox (GtkAssistantPageType type, const gchar *title, const gchar *section) +{ + GtkWidget *vbox; + GtkWidget *label; + gchar *str; + + vbox = gtk_vbox_new (FALSE, 6); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 24); - vbox = gtk_vbox_new(FALSE, 6); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 24); + gtk_assistant_append_page (GTK_ASSISTANT (wiz->assistant), vbox); + gtk_assistant_set_page_type (GTK_ASSISTANT (wiz->assistant), vbox, type); + str = g_strdup_printf (" %s", title); + gtk_assistant_set_page_title (GTK_ASSISTANT (wiz->assistant), vbox, str); - gtk_assistant_append_page(GTK_ASSISTANT(wiz->assistant), vbox); - gtk_assistant_set_page_type(GTK_ASSISTANT(wiz->assistant), vbox, type); - str = g_strdup_printf(" %s", title); - gtk_assistant_set_page_title(GTK_ASSISTANT(wiz->assistant), vbox, str); + g_free (str); - g_free(str); + gtk_assistant_set_page_complete (GTK_ASSISTANT (wiz->assistant), vbox, TRUE); - gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), vbox, TRUE); + wiz->logo = gdk_pixbuf_new_from_file (LOGO, NULL); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (wiz->assistant),vbox, wiz->logo); + g_object_unref (wiz->logo); - wiz->logo = gdk_pixbuf_new_from_file(LOGO, NULL); - gtk_assistant_set_page_header_image(GTK_ASSISTANT(wiz->assistant),vbox, wiz->logo); - g_object_unref(wiz->logo); + if (section) { + label = gtk_label_new (NULL); + str = g_strdup_printf ("<b>%s</b>\n", section); + gtk_label_set_markup (GTK_LABEL (label), str); + g_free (str); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + } - if (section) { - label = gtk_label_new(NULL); - str = g_strdup_printf("<b>%s</b>\n", section); - gtk_label_set_markup(GTK_LABEL(label), str); - g_free(str); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - } - return vbox; + return vbox; } #endif // GTK_CHECK_VERSION diff --git a/sflphone-client-gnome/src/config/assistant.h b/sflphone-client-gnome/src/config/assistant.h index 2ac083e04cb5d26ab14208291d50896a2bbe5f00..314ac7624e3e14e1fc0e3d6f3e66f5aedb486eb8 100644 --- a/sflphone-client-gnome/src/config/assistant.h +++ b/sflphone-client-gnome/src/config/assistant.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -42,49 +42,48 @@ #define _SIP 0 #define _IAX 1 -struct _wizard -{ - GtkWidget *window; - GtkWidget *assistant; - GdkPixbuf *logo; - GtkWidget *intro; - /** Page 1 - Protocol selection */ - GtkWidget *account_type; - GtkWidget *protocols; - GtkWidget *sip; - GtkWidget *email; - GtkWidget *iax; - /** Page 2 - SIP account creation */ - GtkWidget *sip_account; - GtkWidget *sip_alias; - GtkWidget *sip_server; - GtkWidget *sip_username; - GtkWidget *sip_password; - GtkWidget *sip_voicemail; - GtkWidget *test; - GtkWidget *state; - GtkWidget *mailbox; - GtkWidget *zrtp_enable; - /** Page 3 - IAX account creation */ - GtkWidget *iax_account; - GtkWidget *iax_alias; - GtkWidget *iax_server; - GtkWidget *iax_username; - GtkWidget *iax_password; - GtkWidget *iax_voicemail; - /** Page 4 - Nat detection */ - GtkWidget *nat; - GtkWidget *enable; - GtkWidget *addr; - /** Page 5 - Registration successful*/ - GtkWidget *summary; - GtkWidget *label_summary; - /** Page 6 - Registration failed*/ - GtkWidget *reg_failed; - - GtkWidget *sflphone_org; - -}; +struct _wizard { + GtkWidget *window; + GtkWidget *assistant; + GdkPixbuf *logo; + GtkWidget *intro; + /** Page 1 - Protocol selection */ + GtkWidget *account_type; + GtkWidget *protocols; + GtkWidget *sip; + GtkWidget *email; + GtkWidget *iax; + /** Page 2 - SIP account creation */ + GtkWidget *sip_account; + GtkWidget *sip_alias; + GtkWidget *sip_server; + GtkWidget *sip_username; + GtkWidget *sip_password; + GtkWidget *sip_voicemail; + GtkWidget *test; + GtkWidget *state; + GtkWidget *mailbox; + GtkWidget *zrtp_enable; + /** Page 3 - IAX account creation */ + GtkWidget *iax_account; + GtkWidget *iax_alias; + GtkWidget *iax_server; + GtkWidget *iax_username; + GtkWidget *iax_password; + GtkWidget *iax_voicemail; + /** Page 4 - Nat detection */ + GtkWidget *nat; + GtkWidget *enable; + GtkWidget *addr; + /** Page 5 - Registration successful*/ + GtkWidget *summary; + GtkWidget *label_summary; + /** Page 6 - Registration failed*/ + GtkWidget *reg_failed; + + GtkWidget *sflphone_org; + +}; /** * @file druid.h @@ -94,7 +93,7 @@ struct _wizard /** * Callbacks functions */ -void set_account_type( GtkWidget* widget , gpointer data ); +void set_account_type (GtkWidget* widget , gpointer data); //static void cancel_callback( void ); @@ -103,20 +102,20 @@ void set_account_type( GtkWidget* widget , gpointer data ); //static void sip_apply_callback( void ); //static void iax_apply_callback( void ); -void enable_stun( GtkWidget *widget ); +void enable_stun (GtkWidget *widget); /** * Related-pages function */ void build_wizard(); -GtkWidget* build_intro( void ); -GtkWidget* build_select_account( void ); -GtkWidget* build_sip_account_configuration( void ); -GtkWidget* build_nat_settings( void ); -GtkWidget* build_iax_account_configuration( void ); -GtkWidget* build_summary( void ); -GtkWidget* build_registration_error( void ); -GtkWidget* build_email_configuration( void ); +GtkWidget* build_intro (void); +GtkWidget* build_select_account (void); +GtkWidget* build_sip_account_configuration (void); +GtkWidget* build_nat_settings (void); +GtkWidget* build_iax_account_configuration (void); +GtkWidget* build_summary (void); +GtkWidget* build_registration_error (void); +GtkWidget* build_email_configuration (void); GtkWidget* build_sfl_or_account (void); /** diff --git a/sflphone-client-gnome/src/config/audioconf.c b/sflphone-client-gnome/src/config/audioconf.c index d27b64d2f246e92d73b701036bafc14fbf3a4199..4dd871fdffc2e3b0ca944121274312b66b38d8e2 100644 --- a/sflphone-client-gnome/src/config/audioconf.c +++ b/sflphone-client-gnome/src/config/audioconf.c @@ -52,111 +52,111 @@ GtkWidget *noise_conf; // Codec properties ID enum { - COLUMN_CODEC_ACTIVE, - COLUMN_CODEC_NAME, - COLUMN_CODEC_FREQUENCY, - COLUMN_CODEC_BITRATE, - COLUMN_CODEC_BANDWIDTH, - CODEC_COLUMN_COUNT + COLUMN_CODEC_ACTIVE, + COLUMN_CODEC_NAME, + COLUMN_CODEC_FREQUENCY, + COLUMN_CODEC_BITRATE, + COLUMN_CODEC_BANDWIDTH, + CODEC_COLUMN_COUNT }; /** * Fills the tree list with supported codecs */ -void preferences_dialog_fill_codec_list (account_t **a) { - - GtkListStore *codecStore; - GtkTreeIter iter; - GQueue *current; - - // Get model of view and clear it - codecStore = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (codecTreeView))); - gtk_list_store_clear (codecStore); - - if ((*a) != NULL) { - current = (*a)->codecs; - } - else { - // Failover - current = get_system_codec_list (); - } - - - // Insert codecs - unsigned int i; - for(i = 0; i < current->length; i++) - { - codec_t *c = codec_list_get_nth (i, current); - if (c) - { - DEBUG ("%s", c->name); - gtk_list_store_append (codecStore, &iter); - gtk_list_store_set (codecStore, &iter, - COLUMN_CODEC_ACTIVE, c->is_active, // Active - COLUMN_CODEC_NAME, c->name, // Name - COLUMN_CODEC_FREQUENCY, g_strdup_printf("%d kHz", c->sample_rate/1000), // Frequency (kHz) - COLUMN_CODEC_BITRATE, g_strdup_printf("%.1f kbps", c->_bitrate), // Bitrate (kbps) - COLUMN_CODEC_BANDWIDTH, g_strdup_printf("%.1f kbps", c->_bandwidth), // Bandwidth (kpbs) - -1); - } - } +void preferences_dialog_fill_codec_list (account_t **a) +{ + + GtkListStore *codecStore; + GtkTreeIter iter; + GQueue *current; + + // Get model of view and clear it + codecStore = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (codecTreeView))); + gtk_list_store_clear (codecStore); + + if ( (*a) != NULL) { + current = (*a)->codecs; + } else { + // Failover + current = get_system_codec_list (); + } + + + // Insert codecs + unsigned int i; + + for (i = 0; i < current->length; i++) { + codec_t *c = codec_list_get_nth (i, current); + + if (c) { + DEBUG ("%s", c->name); + gtk_list_store_append (codecStore, &iter); + gtk_list_store_set (codecStore, &iter, + COLUMN_CODEC_ACTIVE, c->is_active, // Active + COLUMN_CODEC_NAME, c->name, // Name + COLUMN_CODEC_FREQUENCY, g_strdup_printf ("%d kHz", c->sample_rate/1000), // Frequency (kHz) + COLUMN_CODEC_BITRATE, g_strdup_printf ("%.1f kbps", c->_bitrate), // Bitrate (kbps) + COLUMN_CODEC_BANDWIDTH, g_strdup_printf ("%.1f kbps", c->_bandwidth), // Bandwidth (kpbs) + -1); + } + } } /** * Fill store with output audio plugins */ - void +void preferences_dialog_fill_audio_plugin_list() { - GtkTreeIter iter; - gchar** list; - gchar* managerName; - - gtk_list_store_clear(pluginlist); - - // Call dbus to retreive list - list = dbus_get_audio_plugin_list(); - // For each API name included in list - int c = 0; - - if (list != NULL){ - for(managerName = list[c]; managerName != NULL; managerName = list[c]) - { - c++; - gtk_list_store_append(pluginlist, &iter); - gtk_list_store_set(pluginlist, &iter, 0 , managerName, -1); - } - } - list = NULL; + GtkTreeIter iter; + gchar** list; + gchar* managerName; + + gtk_list_store_clear (pluginlist); + + // Call dbus to retreive list + list = dbus_get_audio_plugin_list(); + // For each API name included in list + int c = 0; + + if (list != NULL) { + for (managerName = list[c]; managerName != NULL; managerName = list[c]) { + c++; + gtk_list_store_append (pluginlist, &iter); + gtk_list_store_set (pluginlist, &iter, 0 , managerName, -1); + } + } + + list = NULL; } /** * Fill output audio device store */ - void +void preferences_dialog_fill_output_audio_device_list() { - GtkTreeIter iter; - gchar** list; - gchar** audioDevice; - int index; - - gtk_list_store_clear(outputlist); - - // Call dbus to retreive list - list = dbus_get_audio_output_device_list(); - - // For each device name included in list - int c = 0; - for(audioDevice = list; *list ; list++) - { - index = dbus_get_audio_device_index( *list ); - gtk_list_store_append(outputlist, &iter); - gtk_list_store_set(outputlist, &iter, 0, *list, 1, index, -1); - c++; - } + GtkTreeIter iter; + gchar** list; + gchar** audioDevice; + int index; + + gtk_list_store_clear (outputlist); + + // Call dbus to retreive list + list = dbus_get_audio_output_device_list(); + + // For each device name included in list + int c = 0; + + for (audioDevice = list; *list ; list++) { + index = dbus_get_audio_device_index (*list); + gtk_list_store_append (outputlist, &iter); + gtk_list_store_set (outputlist, &iter, 0, *list, 1, index, -1); + c++; + } } @@ -173,18 +173,19 @@ preferences_dialog_fill_ringtone_audio_device_list() gchar** audioDevice; int index; - gtk_list_store_clear(ringtonelist); + gtk_list_store_clear (ringtonelist); // Call dbus to retreive output device list = dbus_get_audio_output_device_list(); // For each device name in the list int c = 0; - for(audioDevice = list; *list; list++) { - index = dbus_get_audio_device_index( *list ); - gtk_list_store_append(ringtonelist, &iter); - gtk_list_store_set(ringtonelist, &iter, 0, *list, 1, index, -1); - c++; + + for (audioDevice = list; *list; list++) { + index = dbus_get_audio_device_index (*list); + gtk_list_store_append (ringtonelist, &iter); + gtk_list_store_set (ringtonelist, &iter, 0, *list, 1, index, -1); + c++; } } @@ -193,899 +194,902 @@ preferences_dialog_fill_ringtone_audio_device_list() /** * Select active output audio device */ - void +void select_active_output_audio_device() { - if( SHOW_ALSA_CONF ) - { - - GtkTreeModel* model; - GtkTreeIter iter; - gchar** devices; - int currentDeviceIndex; - int deviceIndex; - - // Select active output device on server - devices = dbus_get_current_audio_devices_index(); - currentDeviceIndex = atoi(devices[0]); - DEBUG("audio device index for output = %d", currentDeviceIndex); - model = gtk_combo_box_get_model(GTK_COMBO_BOX(output)); - - // Find the currently set output device - gtk_tree_model_get_iter_first(model, &iter); - do { - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); - if(deviceIndex == currentDeviceIndex) - { - // Set current iteration the active one - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(output), &iter); - return; - } - } while(gtk_tree_model_iter_next(model, &iter)); - - // No index was found, select first one - WARN("Warning : No active output device found"); - gtk_combo_box_set_active(GTK_COMBO_BOX(output), 0); - } + if (SHOW_ALSA_CONF) { + + GtkTreeModel* model; + GtkTreeIter iter; + gchar** devices; + int currentDeviceIndex; + int deviceIndex; + + // Select active output device on server + devices = dbus_get_current_audio_devices_index(); + currentDeviceIndex = atoi (devices[0]); + DEBUG ("audio device index for output = %d", currentDeviceIndex); + model = gtk_combo_box_get_model (GTK_COMBO_BOX (output)); + + // Find the currently set output device + gtk_tree_model_get_iter_first (model, &iter); + + do { + gtk_tree_model_get (model, &iter, 1, &deviceIndex, -1); + + if (deviceIndex == currentDeviceIndex) { + // Set current iteration the active one + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (output), &iter); + return; + } + } while (gtk_tree_model_iter_next (model, &iter)); + + // No index was found, select first one + WARN ("Warning : No active output device found"); + gtk_combo_box_set_active (GTK_COMBO_BOX (output), 0); + } } /** * Select active output audio device */ - void +void select_active_ringtone_audio_device() { - if( SHOW_ALSA_CONF ) - { - - GtkTreeModel* model; - GtkTreeIter iter; - gchar** devices; - int currentDeviceIndex; - int deviceIndex; - - // Select active ringtone device on server - devices = dbus_get_current_audio_devices_index(); - currentDeviceIndex = atoi(devices[2]); - DEBUG("audio device index for ringtone = %d", currentDeviceIndex); - model = gtk_combo_box_get_model(GTK_COMBO_BOX(ringtone)); - - // Find the currently set ringtone device - gtk_tree_model_get_iter_first(model, &iter); - do { - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); - if(deviceIndex == currentDeviceIndex) - { - // Set current iteration the active one - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(ringtone), &iter); - return; - } - } while(gtk_tree_model_iter_next(model, &iter)); - - // No index was found, select first one - WARN("Warning : No active ringtone device found"); - gtk_combo_box_set_active(GTK_COMBO_BOX(ringtone), 0); - } + if (SHOW_ALSA_CONF) { + + GtkTreeModel* model; + GtkTreeIter iter; + gchar** devices; + int currentDeviceIndex; + int deviceIndex; + + // Select active ringtone device on server + devices = dbus_get_current_audio_devices_index(); + currentDeviceIndex = atoi (devices[2]); + DEBUG ("audio device index for ringtone = %d", currentDeviceIndex); + model = gtk_combo_box_get_model (GTK_COMBO_BOX (ringtone)); + + // Find the currently set ringtone device + gtk_tree_model_get_iter_first (model, &iter); + + do { + gtk_tree_model_get (model, &iter, 1, &deviceIndex, -1); + + if (deviceIndex == currentDeviceIndex) { + // Set current iteration the active one + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (ringtone), &iter); + return; + } + } while (gtk_tree_model_iter_next (model, &iter)); + + // No index was found, select first one + WARN ("Warning : No active ringtone device found"); + gtk_combo_box_set_active (GTK_COMBO_BOX (ringtone), 0); + } } /** * Fill input audio device store */ - void +void preferences_dialog_fill_input_audio_device_list() { - GtkTreeIter iter; - gchar** list; - gchar** audioDevice; - int index ; - gtk_list_store_clear(inputlist); - - // Call dbus to retreive list - list = dbus_get_audio_input_device_list(); - - // For each device name included in list - //int c = 0; - for(audioDevice = list; *list; list++) - { - index = dbus_get_audio_device_index( *list ); - gtk_list_store_append(inputlist, &iter); - gtk_list_store_set(inputlist, &iter, 0, *list, 1, index, -1); - //c++; - } + GtkTreeIter iter; + gchar** list; + gchar** audioDevice; + int index ; + gtk_list_store_clear (inputlist); + + // Call dbus to retreive list + list = dbus_get_audio_input_device_list(); + + // For each device name included in list + //int c = 0; + for (audioDevice = list; *list; list++) { + index = dbus_get_audio_device_index (*list); + gtk_list_store_append (inputlist, &iter); + gtk_list_store_set (inputlist, &iter, 0, *list, 1, index, -1); + //c++; + } } /** * Select active input audio device */ - void +void select_active_input_audio_device() { - if( SHOW_ALSA_CONF) - { - - GtkTreeModel* model; - GtkTreeIter iter; - gchar** devices; - int currentDeviceIndex; - int deviceIndex; - - // Select active input device on server - devices = dbus_get_current_audio_devices_index(); - currentDeviceIndex = atoi(devices[1]); - model = gtk_combo_box_get_model(GTK_COMBO_BOX(input)); - - // Find the currently set input device - gtk_tree_model_get_iter_first(model, &iter); - do { - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); - if(deviceIndex == currentDeviceIndex) - { - // Set current iteration the active one - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(input), &iter); - return; - } - } while(gtk_tree_model_iter_next(model, &iter)); - - // No index was found, select first one - WARN("Warning : No active input device found"); - gtk_combo_box_set_active(GTK_COMBO_BOX(input), 0); - } + if (SHOW_ALSA_CONF) { + + GtkTreeModel* model; + GtkTreeIter iter; + gchar** devices; + int currentDeviceIndex; + int deviceIndex; + + // Select active input device on server + devices = dbus_get_current_audio_devices_index(); + currentDeviceIndex = atoi (devices[1]); + model = gtk_combo_box_get_model (GTK_COMBO_BOX (input)); + + // Find the currently set input device + gtk_tree_model_get_iter_first (model, &iter); + + do { + gtk_tree_model_get (model, &iter, 1, &deviceIndex, -1); + + if (deviceIndex == currentDeviceIndex) { + // Set current iteration the active one + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (input), &iter); + return; + } + } while (gtk_tree_model_iter_next (model, &iter)); + + // No index was found, select first one + WARN ("Warning : No active input device found"); + gtk_combo_box_set_active (GTK_COMBO_BOX (input), 0); + } } /** * Select the output audio plugin by calling the server */ - static void -select_output_audio_plugin(GtkComboBox* widget, gpointer data UNUSED) +static void +select_output_audio_plugin (GtkComboBox* widget, gpointer data UNUSED) { - GtkTreeModel* model; - GtkTreeIter iter; - int comboBoxIndex; - gchar* pluginName; - - comboBoxIndex = gtk_combo_box_get_active(widget); - - if(comboBoxIndex >= 0) - { - model = gtk_combo_box_get_model(widget); - gtk_combo_box_get_active_iter(widget, &iter); - gtk_tree_model_get(model, &iter, 0, &pluginName, -1); - dbus_set_output_audio_plugin(pluginName); - //update_combo_box( pluginName); - } + GtkTreeModel* model; + GtkTreeIter iter; + int comboBoxIndex; + gchar* pluginName; + + comboBoxIndex = gtk_combo_box_get_active (widget); + + if (comboBoxIndex >= 0) { + model = gtk_combo_box_get_model (widget); + gtk_combo_box_get_active_iter (widget, &iter); + gtk_tree_model_get (model, &iter, 0, &pluginName, -1); + dbus_set_output_audio_plugin (pluginName); + //update_combo_box( pluginName); + } } /** * Select active output audio plugin */ - void +void select_active_output_audio_plugin() { - GtkTreeModel* model; - GtkTreeIter iter; - gchar* pluginname; - gchar* tmp; - - // Select active output device on server - pluginname = dbus_get_current_audio_output_plugin(); - tmp = pluginname; - model = gtk_combo_box_get_model(GTK_COMBO_BOX(plugin)); - - // Find the currently alsa plugin - gtk_tree_model_get_iter_first(model, &iter); - do { - gtk_tree_model_get(model, &iter, 0, &pluginname , -1); - if( g_strcasecmp( tmp , pluginname ) == 0 ) - { - // Set current iteration the active one - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(plugin), &iter); - //update_combo_box( plugin ); - return; - } - } while(gtk_tree_model_iter_next(model, &iter)); - - // No index was found, select first one - WARN("Warning : No active output device found"); - gtk_combo_box_set_active(GTK_COMBO_BOX(plugin), 0); + GtkTreeModel* model; + GtkTreeIter iter; + gchar* pluginname; + gchar* tmp; + + // Select active output device on server + pluginname = dbus_get_current_audio_output_plugin(); + tmp = pluginname; + model = gtk_combo_box_get_model (GTK_COMBO_BOX (plugin)); + + // Find the currently alsa plugin + gtk_tree_model_get_iter_first (model, &iter); + + do { + gtk_tree_model_get (model, &iter, 0, &pluginname , -1); + + if (g_strcasecmp (tmp , pluginname) == 0) { + // Set current iteration the active one + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (plugin), &iter); + //update_combo_box( plugin ); + return; + } + } while (gtk_tree_model_iter_next (model, &iter)); + + // No index was found, select first one + WARN ("Warning : No active output device found"); + gtk_combo_box_set_active (GTK_COMBO_BOX (plugin), 0); } /** * Set the audio output device on the server with its index */ - static void -select_audio_output_device(GtkComboBox* comboBox, gpointer data UNUSED) +static void +select_audio_output_device (GtkComboBox* comboBox, gpointer data UNUSED) { - GtkTreeModel* model; - GtkTreeIter iter; - int comboBoxIndex; - int deviceIndex; + GtkTreeModel* model; + GtkTreeIter iter; + int comboBoxIndex; + int deviceIndex; - comboBoxIndex = gtk_combo_box_get_active(comboBox); + comboBoxIndex = gtk_combo_box_get_active (comboBox); - if(comboBoxIndex >= 0) - { - model = gtk_combo_box_get_model(comboBox); - gtk_combo_box_get_active_iter(comboBox, &iter); - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); + if (comboBoxIndex >= 0) { + model = gtk_combo_box_get_model (comboBox); + gtk_combo_box_get_active_iter (comboBox, &iter); + gtk_tree_model_get (model, &iter, 1, &deviceIndex, -1); - dbus_set_audio_output_device(deviceIndex); - } + dbus_set_audio_output_device (deviceIndex); + } } /** * Set the audio input device on the server with its index */ - static void -select_audio_input_device(GtkComboBox* comboBox, gpointer data UNUSED) +static void +select_audio_input_device (GtkComboBox* comboBox, gpointer data UNUSED) { - GtkTreeModel* model; - GtkTreeIter iter; - int comboBoxIndex; - int deviceIndex; + GtkTreeModel* model; + GtkTreeIter iter; + int comboBoxIndex; + int deviceIndex; - comboBoxIndex = gtk_combo_box_get_active(comboBox); + comboBoxIndex = gtk_combo_box_get_active (comboBox); - if(comboBoxIndex >= 0) - { - model = gtk_combo_box_get_model(comboBox); - gtk_combo_box_get_active_iter(comboBox, &iter); - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); + if (comboBoxIndex >= 0) { + model = gtk_combo_box_get_model (comboBox); + gtk_combo_box_get_active_iter (comboBox, &iter); + gtk_tree_model_get (model, &iter, 1, &deviceIndex, -1); - dbus_set_audio_input_device(deviceIndex); - } + dbus_set_audio_input_device (deviceIndex); + } } /** * Set the audio ringtone device on the server with its index */ static void -select_audio_ringtone_device(GtkComboBox *comboBox, gpointer data UNUSED) +select_audio_ringtone_device (GtkComboBox *comboBox, gpointer data UNUSED) { GtkTreeModel *model; GtkTreeIter iter; int comboBoxIndex; int deviceIndex; - comboBoxIndex = gtk_combo_box_get_active(comboBox); + comboBoxIndex = gtk_combo_box_get_active (comboBox); - if(comboBoxIndex >= 0) { - model = gtk_combo_box_get_model(comboBox); - gtk_combo_box_get_active_iter(comboBox, &iter); + if (comboBoxIndex >= 0) { + model = gtk_combo_box_get_model (comboBox); + gtk_combo_box_get_active_iter (comboBox, &iter); - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); + gtk_tree_model_get (model, &iter, 1, &deviceIndex, -1); - dbus_set_audio_ringtone_device(deviceIndex); + dbus_set_audio_ringtone_device (deviceIndex); } } /** * Toggle move buttons on if a codec is selected, off elsewise */ - static void -select_codec(GtkTreeSelection *selection, GtkTreeModel *model) +static void +select_codec (GtkTreeSelection *selection, GtkTreeModel *model) { - GtkTreeIter iter; - - if(!gtk_tree_selection_get_selected(selection, &model, &iter)) - { - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), FALSE); - } - else - { - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), TRUE); - } + GtkTreeIter iter; + + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) { + gtk_widget_set_sensitive (GTK_WIDGET (codecMoveUpButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (codecMoveDownButton), FALSE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (codecMoveUpButton), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (codecMoveDownButton), TRUE); + } } /** * Toggle active value of codec on click and update changes to the deamon * and in configuration files */ - static void -codec_active_toggled (GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data ) +static void +codec_active_toggled (GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data) { - GtkTreeIter iter; - GtkTreePath *treePath; - GtkTreeModel *model; - gboolean active; - char* name; - char* srate; - codec_t* codec; - account_t *acc; - - // Get path of clicked codec active toggle box - treePath = gtk_tree_path_new_from_string(path); - model = gtk_tree_view_get_model (GTK_TREE_VIEW (codecTreeView)); - gtk_tree_model_get_iter(model, &iter, treePath); - - // Retrieve userdata - acc = (account_t*) data; - - if (!acc) - ERROR ("Aie, no account selected"); - - // Get active value and name at iteration - gtk_tree_model_get(model, &iter, - COLUMN_CODEC_ACTIVE, &active, - COLUMN_CODEC_NAME, &name, - COLUMN_CODEC_FREQUENCY, &srate, - -1); - - printf("%s, %s\n", name, srate); - printf("%i\n", g_queue_get_length (acc->codecs)); - - // codec_list_get_by_name(name); - if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"8 kHz")==0)) - codec = codec_list_get_by_payload((gconstpointer) 110, acc->codecs); - else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"16 kHz")==0)) - codec = codec_list_get_by_payload((gconstpointer) 111, acc->codecs); - else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"32 kHz")==0)) - codec = codec_list_get_by_payload((gconstpointer) 112, acc->codecs); - else - codec = codec_list_get_by_name ((gconstpointer) name, acc->codecs); - - // Toggle active value - active = !active; - - // Store value - gtk_list_store_set(GTK_LIST_STORE(model), &iter, - COLUMN_CODEC_ACTIVE, active, - -1); - - gtk_tree_path_free(treePath); - - // Modify codec queue to represent change - if (active) - codec_set_active (&codec); - else - codec_set_inactive (&codec); - - // Perpetuate changes to the deamon - // codec_list_update_to_daemon (acc); + GtkTreeIter iter; + GtkTreePath *treePath; + GtkTreeModel *model; + gboolean active; + char* name; + char* srate; + codec_t* codec; + account_t *acc; + + // Get path of clicked codec active toggle box + treePath = gtk_tree_path_new_from_string (path); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (codecTreeView)); + gtk_tree_model_get_iter (model, &iter, treePath); + + // Retrieve userdata + acc = (account_t*) data; + + if (!acc) + ERROR ("Aie, no account selected"); + + // Get active value and name at iteration + gtk_tree_model_get (model, &iter, + COLUMN_CODEC_ACTIVE, &active, + COLUMN_CODEC_NAME, &name, + COLUMN_CODEC_FREQUENCY, &srate, + -1); + + printf ("%s, %s\n", name, srate); + printf ("%i\n", g_queue_get_length (acc->codecs)); + + // codec_list_get_by_name(name); + if ( (g_strcasecmp (name,"speex") ==0) && (g_strcasecmp (srate,"8 kHz") ==0)) + codec = codec_list_get_by_payload ( (gconstpointer) 110, acc->codecs); + else if ( (g_strcasecmp (name,"speex") ==0) && (g_strcasecmp (srate,"16 kHz") ==0)) + codec = codec_list_get_by_payload ( (gconstpointer) 111, acc->codecs); + else if ( (g_strcasecmp (name,"speex") ==0) && (g_strcasecmp (srate,"32 kHz") ==0)) + codec = codec_list_get_by_payload ( (gconstpointer) 112, acc->codecs); + else + codec = codec_list_get_by_name ( (gconstpointer) name, acc->codecs); + + // Toggle active value + active = !active; + + // Store value + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COLUMN_CODEC_ACTIVE, active, + -1); + + gtk_tree_path_free (treePath); + + // Modify codec queue to represent change + if (active) + codec_set_active (&codec); + else + codec_set_inactive (&codec); + + // Perpetuate changes to the deamon + // codec_list_update_to_daemon (acc); } /** * Move codec in list depending on direction and selected codec and * update changes in the daemon list and the configuration files */ -static void codec_move (gboolean moveUp, gpointer data) { - - GtkTreeIter iter; - GtkTreeIter *iter2; - GtkTreeView *treeView; - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkTreePath *treePath; - gchar *path; - account_t *acc; - GQueue *acc_q; - - // Get view, model and selection of codec store - model = gtk_tree_view_get_model(GTK_TREE_VIEW(codecTreeView)); - selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(codecTreeView)); - - // Retrieve the user data - acc = (account_t*) data; - if (acc) - acc_q = acc->codecs; - - // Find selected iteration and create a copy - gtk_tree_selection_get_selected(GTK_TREE_SELECTION(selection), &model, &iter); - iter2 = gtk_tree_iter_copy(&iter); - - // Find path of iteration - path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter); - 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 - if(moveUp) - gtk_tree_path_prev(treePath); - else - gtk_tree_path_next(treePath); - gtk_tree_model_get_iter(model, &iter, treePath); - - // Swap iterations if valid - if(gtk_list_store_iter_is_valid(GTK_LIST_STORE(model), &iter)) - gtk_list_store_swap(GTK_LIST_STORE(model), &iter, iter2); - - // Scroll to new position - gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (codecTreeView), treePath, NULL, FALSE, 0, 0); - - // Free resources - gtk_tree_path_free(treePath); - gtk_tree_iter_free(iter2); - g_free(path); - - // Perpetuate changes in codec queue - if(moveUp) - codec_list_move_codec_up (indice, &acc_q); - else - codec_list_move_codec_down (indice, &acc_q); +static void codec_move (gboolean moveUp, gpointer data) +{ + + GtkTreeIter iter; + GtkTreeIter *iter2; + GtkTreeView *treeView; + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreePath *treePath; + gchar *path; + account_t *acc; + GQueue *acc_q; + + // Get view, model and selection of codec store + model = gtk_tree_view_get_model (GTK_TREE_VIEW (codecTreeView)); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (codecTreeView)); + + // Retrieve the user data + acc = (account_t*) data; + + if (acc) + acc_q = acc->codecs; + + // Find selected iteration and create a copy + gtk_tree_selection_get_selected (GTK_TREE_SELECTION (selection), &model, &iter); + iter2 = gtk_tree_iter_copy (&iter); + + // Find path of iteration + path = gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL (model), &iter); + 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 + if (moveUp) + gtk_tree_path_prev (treePath); + else + gtk_tree_path_next (treePath); + + gtk_tree_model_get_iter (model, &iter, treePath); + + // Swap iterations if valid + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE (model), &iter)) + gtk_list_store_swap (GTK_LIST_STORE (model), &iter, iter2); + + // Scroll to new position + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (codecTreeView), treePath, NULL, FALSE, 0, 0); + + // Free resources + gtk_tree_path_free (treePath); + gtk_tree_iter_free (iter2); + g_free (path); + + // Perpetuate changes in codec queue + if (moveUp) + codec_list_move_codec_up (indice, &acc_q); + else + codec_list_move_codec_down (indice, &acc_q); } /** * Called from move up codec button signal */ -static void codec_move_up (GtkButton *button UNUSED, gpointer data) { +static void codec_move_up (GtkButton *button UNUSED, gpointer data) +{ - // Change tree view ordering and get indice changed - codec_move (TRUE, data); + // Change tree view ordering and get indice changed + codec_move (TRUE, data); } /** * Called from move down codec button signal */ -static void codec_move_down(GtkButton *button UNUSED, gpointer data) { +static void codec_move_down (GtkButton *button UNUSED, gpointer data) +{ - // Change tree view ordering and get indice changed - codec_move (FALSE, data); + // Change tree view ordering and get indice changed + codec_move (FALSE, data); } - int -is_ringtone_enabled( void ) +int +is_ringtone_enabled (void) { - return dbus_is_ringtone_enabled(); + return dbus_is_ringtone_enabled(); } - void -ringtone_enabled( void ) +void +ringtone_enabled (void) { - dbus_ringtone_enabled(); + dbus_ringtone_enabled(); } - void -ringtone_changed( GtkFileChooser *chooser , GtkLabel *label UNUSED) +void +ringtone_changed (GtkFileChooser *chooser , GtkLabel *label UNUSED) { - gchar* tone = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( chooser )); - dbus_set_ringtone_choice( tone ); + gchar* tone = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); + dbus_set_ringtone_choice (tone); } - gchar* -get_ringtone_choice( void ) +gchar* +get_ringtone_choice (void) { - return dbus_get_ringtone_choice(); + return dbus_get_ringtone_choice(); } GtkWidget* codecs_box (account_t **a) { - GtkWidget *ret; - GtkWidget *scrolledWindow; - GtkWidget *buttonBox; - - GtkListStore *codecStore; - GtkCellRenderer *renderer; - GtkTreeSelection *treeSelection; - GtkTreeViewColumn *treeViewColumn; - - ret = gtk_hbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - scrolledWindow = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_SHADOW_IN); - - gtk_box_pack_start(GTK_BOX(ret), scrolledWindow, TRUE, TRUE, 0); - codecStore = gtk_list_store_new(CODEC_COLUMN_COUNT, - G_TYPE_BOOLEAN, // Active - G_TYPE_STRING, // Name - G_TYPE_STRING, // Frequency - G_TYPE_STRING, // Bit rate - G_TYPE_STRING // Bandwith - ); - - // Create codec tree view with list store - codecTreeView = gtk_tree_view_new_with_model(GTK_TREE_MODEL(codecStore)); - - // Get tree selection manager - treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW(codecTreeView)); - g_signal_connect(G_OBJECT(treeSelection), "changed", - G_CALLBACK (select_codec), - codecStore); - - // Active column - renderer = gtk_cell_renderer_toggle_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes("", renderer, "active", COLUMN_CODEC_ACTIVE, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Toggle codec active property on clicked - g_signal_connect(G_OBJECT(renderer), "toggled", G_CALLBACK (codec_active_toggled), (gpointer) *a); - - // Name column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Name"), renderer, "markup", COLUMN_CODEC_NAME, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Bit rate column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Frequency"), renderer, "text", COLUMN_CODEC_FREQUENCY, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Bandwith column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Bitrate"), renderer, "text", COLUMN_CODEC_BITRATE, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Frequency column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Bandwidth"), renderer, "text", COLUMN_CODEC_BANDWIDTH, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - g_object_unref(G_OBJECT(codecStore)); - gtk_container_add(GTK_CONTAINER(scrolledWindow), codecTreeView); - - // Create button box - buttonBox = gtk_vbox_new(FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(buttonBox), 10); - gtk_box_pack_start(GTK_BOX(ret), buttonBox, FALSE, FALSE, 0); - - codecMoveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveUpButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(codecMoveUpButton), "clicked", G_CALLBACK(codec_move_up), *a); - - codecMoveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveDownButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(codecMoveDownButton), "clicked", G_CALLBACK(codec_move_down), *a); - - preferences_dialog_fill_codec_list (a); - - return ret; + GtkWidget *ret; + GtkWidget *scrolledWindow; + GtkWidget *buttonBox; + + GtkListStore *codecStore; + GtkCellRenderer *renderer; + GtkTreeSelection *treeSelection; + GtkTreeViewColumn *treeViewColumn; + + ret = gtk_hbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); + + scrolledWindow = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledWindow), GTK_SHADOW_IN); + + gtk_box_pack_start (GTK_BOX (ret), scrolledWindow, TRUE, TRUE, 0); + codecStore = gtk_list_store_new (CODEC_COLUMN_COUNT, + G_TYPE_BOOLEAN, // Active + G_TYPE_STRING, // Name + G_TYPE_STRING, // Frequency + G_TYPE_STRING, // Bit rate + G_TYPE_STRING // Bandwith + ); + + // Create codec tree view with list store + codecTreeView = gtk_tree_view_new_with_model (GTK_TREE_MODEL (codecStore)); + + // Get tree selection manager + treeSelection = gtk_tree_view_get_selection (GTK_TREE_VIEW (codecTreeView)); + g_signal_connect (G_OBJECT (treeSelection), "changed", + G_CALLBACK (select_codec), + codecStore); + + // Active column + renderer = gtk_cell_renderer_toggle_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes ("", renderer, "active", COLUMN_CODEC_ACTIVE, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (codecTreeView), treeViewColumn); + + // Toggle codec active property on clicked + g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (codec_active_toggled), (gpointer) *a); + + // Name column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Name"), renderer, "markup", COLUMN_CODEC_NAME, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (codecTreeView), treeViewColumn); + + // Bit rate column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Frequency"), renderer, "text", COLUMN_CODEC_FREQUENCY, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (codecTreeView), treeViewColumn); + + // Bandwith column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Bitrate"), renderer, "text", COLUMN_CODEC_BITRATE, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (codecTreeView), treeViewColumn); + + // Frequency column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_ ("Bandwidth"), renderer, "text", COLUMN_CODEC_BANDWIDTH, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (codecTreeView), treeViewColumn); + + g_object_unref (G_OBJECT (codecStore)); + gtk_container_add (GTK_CONTAINER (scrolledWindow), codecTreeView); + + // Create button box + buttonBox = gtk_vbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (buttonBox), 10); + gtk_box_pack_start (GTK_BOX (ret), buttonBox, FALSE, FALSE, 0); + + codecMoveUpButton = gtk_button_new_from_stock (GTK_STOCK_GO_UP); + gtk_widget_set_sensitive (GTK_WIDGET (codecMoveUpButton), FALSE); + gtk_box_pack_start (GTK_BOX (buttonBox), codecMoveUpButton, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (codecMoveUpButton), "clicked", G_CALLBACK (codec_move_up), *a); + + codecMoveDownButton = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN); + gtk_widget_set_sensitive (GTK_WIDGET (codecMoveDownButton), FALSE); + gtk_box_pack_start (GTK_BOX (buttonBox), codecMoveDownButton, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (codecMoveDownButton), "clicked", G_CALLBACK (codec_move_down), *a); + + preferences_dialog_fill_codec_list (a); + + return ret; } - void -select_audio_manager( void ) +void +select_audio_manager (void) { - DEBUG("audio manager selected"); - - if( !SHOW_ALSA_CONF && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ) ) - { - dbus_set_audio_manager( ALSA ); - DEBUG(" display alsa conf panel"); - alsabox = alsa_box(); - gtk_container_add( GTK_CONTAINER(alsa_conf ) , alsabox); - gtk_widget_show( alsa_conf ); - gtk_widget_set_sensitive(GTK_WIDGET(alsa_conf), TRUE); - - gtk_action_set_sensitive (GTK_ACTION (volumeToggle), TRUE); - } - else if( SHOW_ALSA_CONF && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) )) - { - dbus_set_audio_manager( PULSEAUDIO ); - DEBUG(" remove alsa conf panel"); - gtk_container_remove( GTK_CONTAINER(alsa_conf) , alsabox ); - gtk_widget_hide( alsa_conf ); - if (gtk_toggle_action_get_active ( GTK_TOGGLE_ACTION (volumeToggle))) - { - main_window_volume_controls(FALSE); - eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, FALSE); - gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (volumeToggle), FALSE); - } - gtk_action_set_sensitive (GTK_ACTION (volumeToggle), FALSE); - } else { - DEBUG("alsa conf panel...nothing"); - } + DEBUG ("audio manager selected"); + + if (!SHOW_ALSA_CONF && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) { + dbus_set_audio_manager (ALSA); + DEBUG (" display alsa conf panel"); + alsabox = alsa_box(); + gtk_container_add (GTK_CONTAINER (alsa_conf) , alsabox); + gtk_widget_show (alsa_conf); + gtk_widget_set_sensitive (GTK_WIDGET (alsa_conf), TRUE); + + gtk_action_set_sensitive (GTK_ACTION (volumeToggle), TRUE); + } else if (SHOW_ALSA_CONF && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) { + dbus_set_audio_manager (PULSEAUDIO); + DEBUG (" remove alsa conf panel"); + gtk_container_remove (GTK_CONTAINER (alsa_conf) , alsabox); + gtk_widget_hide (alsa_conf); + + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (volumeToggle))) { + main_window_volume_controls (FALSE); + eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, FALSE); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), FALSE); + } + + gtk_action_set_sensitive (GTK_ACTION (volumeToggle), FALSE); + } else { + DEBUG ("alsa conf panel...nothing"); + } } void -active_echo_cancel(void) { +active_echo_cancel (void) +{ gchar* state; gchar* newstate; - DEBUG("Audio: Active echo cancel clicked"); + DEBUG ("Audio: Active echo cancel clicked"); state = dbus_get_echo_cancel_state(); - DEBUG("Audio: Get echo cancel state %s", state); + DEBUG ("Audio: Get echo cancel state %s", state); - if(strcmp(state, "enabled") == 0) - newstate = "disabled"; + if (strcmp (state, "enabled") == 0) + newstate = "disabled"; else - newstate = "enabled"; + newstate = "enabled"; + + dbus_set_echo_cancel_state (newstate); - dbus_set_echo_cancel_state(newstate); - } void -active_noise_suppress(void) { +active_noise_suppress (void) +{ gchar *state; gchar *newstate; - DEBUG("Audio: Active noise suppress clicked"); + DEBUG ("Audio: Active noise suppress clicked"); state = dbus_get_noise_suppress_state(); - DEBUG("Audio: Get echo cancel state %s", state); + DEBUG ("Audio: Get echo cancel state %s", state); - if(strcmp(state, "enabled") == 0) - newstate = "disabled"; + if (strcmp (state, "enabled") == 0) + newstate = "disabled"; else - newstate = "enabled"; + newstate = "enabled"; + + dbus_set_noise_suppress_state (newstate); - dbus_set_noise_suppress_state(newstate); - } GtkWidget* alsa_box() { - GtkWidget *ret; - GtkWidget *table; - GtkWidget *item; - GtkCellRenderer *renderer; - - ret = gtk_hbox_new(FALSE, 10); - gtk_widget_show( ret ); - - table = gtk_table_new(5, 3, FALSE); - gtk_table_set_col_spacing(GTK_TABLE(table), 0, 40); - gtk_box_pack_start( GTK_BOX(ret) , table , TRUE , TRUE , 1); - gtk_widget_show(table); - - DEBUG("Audio: Configuration plugin"); - item = gtk_label_new(_("ALSA plugin")); - gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), item, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show( item ); - // Set choices of audio managers - pluginlist = gtk_list_store_new(1, G_TYPE_STRING); - preferences_dialog_fill_audio_plugin_list(); - plugin = gtk_combo_box_new_with_model(GTK_TREE_MODEL(pluginlist)); - select_active_output_audio_plugin(); - gtk_label_set_mnemonic_widget(GTK_LABEL(item), plugin); - g_signal_connect(G_OBJECT(plugin), "changed", G_CALLBACK(select_output_audio_plugin), plugin); - - // Set rendering - renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(plugin), renderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(plugin), renderer, "text", 0, NULL); - gtk_table_attach(GTK_TABLE(table), plugin, 2, 3, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(plugin); - - // Device : Output device - // Create title label - DEBUG("Audio: Configuration output"); - item = gtk_label_new(_("Output")); - gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), item, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(item); - // Set choices of output devices - outputlist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); - preferences_dialog_fill_output_audio_device_list(); - output = gtk_combo_box_new_with_model(GTK_TREE_MODEL(outputlist)); - select_active_output_audio_device(); - gtk_label_set_mnemonic_widget(GTK_LABEL(item), output); - g_signal_connect(G_OBJECT(output), "changed", G_CALLBACK(select_audio_output_device), output); - - // Set rendering - renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(output), renderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(output), renderer, "text", 0, NULL); - gtk_table_attach(GTK_TABLE(table), output, 2, 3, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(output); - - // Device : Input device - // Create title label - DEBUG("Audio: Configuration input"); - item = gtk_label_new(_("Input")); - gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), item, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(item); - - // Set choices of output devices - inputlist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); - preferences_dialog_fill_input_audio_device_list(); - input = gtk_combo_box_new_with_model(GTK_TREE_MODEL(inputlist)); - select_active_input_audio_device(); - gtk_label_set_mnemonic_widget(GTK_LABEL(item), input); - g_signal_connect(G_OBJECT(input), "changed", G_CALLBACK(select_audio_input_device), input); - - // Set rendering - renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(input), renderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(input), renderer, "text", 0, NULL); - gtk_table_attach(GTK_TABLE(table), input, 2, 3, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(input); - - - DEBUG("Audio: Configuration rintgtone"); - item = gtk_label_new(_("Ringtone")); - gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), item, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(item); - // set choices of ringtone devices - ringtonelist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); - preferences_dialog_fill_ringtone_audio_device_list(); - ringtone = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ringtonelist)); - select_active_ringtone_audio_device(); - gtk_label_set_mnemonic_widget(GTK_LABEL(item), output); - g_signal_connect(G_OBJECT(ringtone), "changed", G_CALLBACK(select_audio_ringtone_device), output); - - // Set rendering - renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(ringtone), renderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(ringtone), renderer, "text", 0, NULL); - gtk_table_attach(GTK_TABLE(table), ringtone, 2, 3, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(ringtone); - - gtk_widget_show_all(ret); - - DEBUG("done"); - return ret; + GtkWidget *ret; + GtkWidget *table; + GtkWidget *item; + GtkCellRenderer *renderer; + + ret = gtk_hbox_new (FALSE, 10); + gtk_widget_show (ret); + + table = gtk_table_new (5, 3, FALSE); + gtk_table_set_col_spacing (GTK_TABLE (table), 0, 40); + gtk_box_pack_start (GTK_BOX (ret) , table , TRUE , TRUE , 1); + gtk_widget_show (table); + + DEBUG ("Audio: Configuration plugin"); + item = gtk_label_new (_ ("ALSA plugin")); + gtk_misc_set_alignment (GTK_MISC (item), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), item, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (item); + // Set choices of audio managers + pluginlist = gtk_list_store_new (1, G_TYPE_STRING); + preferences_dialog_fill_audio_plugin_list(); + plugin = gtk_combo_box_new_with_model (GTK_TREE_MODEL (pluginlist)); + select_active_output_audio_plugin(); + gtk_label_set_mnemonic_widget (GTK_LABEL (item), plugin); + g_signal_connect (G_OBJECT (plugin), "changed", G_CALLBACK (select_output_audio_plugin), plugin); + + // Set rendering + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (plugin), renderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (plugin), renderer, "text", 0, NULL); + gtk_table_attach (GTK_TABLE (table), plugin, 2, 3, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (plugin); + + // Device : Output device + // Create title label + DEBUG ("Audio: Configuration output"); + item = gtk_label_new (_ ("Output")); + gtk_misc_set_alignment (GTK_MISC (item), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), item, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (item); + // Set choices of output devices + outputlist = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); + preferences_dialog_fill_output_audio_device_list(); + output = gtk_combo_box_new_with_model (GTK_TREE_MODEL (outputlist)); + select_active_output_audio_device(); + gtk_label_set_mnemonic_widget (GTK_LABEL (item), output); + g_signal_connect (G_OBJECT (output), "changed", G_CALLBACK (select_audio_output_device), output); + + // Set rendering + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (output), renderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (output), renderer, "text", 0, NULL); + gtk_table_attach (GTK_TABLE (table), output, 2, 3, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (output); + + // Device : Input device + // Create title label + DEBUG ("Audio: Configuration input"); + item = gtk_label_new (_ ("Input")); + gtk_misc_set_alignment (GTK_MISC (item), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), item, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (item); + + // Set choices of output devices + inputlist = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); + preferences_dialog_fill_input_audio_device_list(); + input = gtk_combo_box_new_with_model (GTK_TREE_MODEL (inputlist)); + select_active_input_audio_device(); + gtk_label_set_mnemonic_widget (GTK_LABEL (item), input); + g_signal_connect (G_OBJECT (input), "changed", G_CALLBACK (select_audio_input_device), input); + + // Set rendering + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (input), renderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (input), renderer, "text", 0, NULL); + gtk_table_attach (GTK_TABLE (table), input, 2, 3, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (input); + + + DEBUG ("Audio: Configuration rintgtone"); + item = gtk_label_new (_ ("Ringtone")); + gtk_misc_set_alignment (GTK_MISC (item), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), item, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (item); + // set choices of ringtone devices + ringtonelist = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); + preferences_dialog_fill_ringtone_audio_device_list(); + ringtone = gtk_combo_box_new_with_model (GTK_TREE_MODEL (ringtonelist)); + select_active_ringtone_audio_device(); + gtk_label_set_mnemonic_widget (GTK_LABEL (item), output); + g_signal_connect (G_OBJECT (ringtone), "changed", G_CALLBACK (select_audio_ringtone_device), output); + + // Set rendering + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (ringtone), renderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (ringtone), renderer, "text", 0, NULL); + gtk_table_attach (GTK_TABLE (table), ringtone, 2, 3, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show (ringtone); + + gtk_widget_show_all (ret); + + DEBUG ("done"); + return ret; } GtkWidget* noise_box() { - GtkWidget *ret; - GtkWidget *enableEchoCancel; - GtkWidget *enableNoiseReduction; - gboolean echocancelActive, noisesuppressActive; - gchar *state; - - ret = gtk_hbox_new( TRUE , 1); - - enableEchoCancel = gtk_check_button_new_with_mnemonic( _("_Echo Suppression")); - state = dbus_get_echo_cancel_state(); - echocancelActive = FALSE; - if(strcmp(state, "enabled") == 0) - echocancelActive = TRUE; - else - echocancelActive = FALSE; - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableEchoCancel), echocancelActive); - g_signal_connect(G_OBJECT(enableEchoCancel), "clicked", active_echo_cancel, NULL); - - gtk_box_pack_start( GTK_BOX(ret), enableEchoCancel, TRUE , TRUE , 1); - - - enableNoiseReduction = gtk_check_button_new_with_mnemonic( _("_Noise Reduction")); - state = dbus_get_noise_suppress_state(); - noisesuppressActive = FALSE; - if(strcmp(state, "enabled") == 0) - noisesuppressActive = TRUE; - else - noisesuppressActive = FALSE; - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableNoiseReduction), noisesuppressActive); - gtk_box_pack_start( GTK_BOX(ret) , enableNoiseReduction , TRUE , TRUE , 1); - - g_signal_connect(G_OBJECT(enableNoiseReduction), "clicked", active_noise_suppress, NULL); + GtkWidget *ret; + GtkWidget *enableEchoCancel; + GtkWidget *enableNoiseReduction; + gboolean echocancelActive, noisesuppressActive; + gchar *state; - return ret; + ret = gtk_hbox_new (TRUE , 1); + + enableEchoCancel = gtk_check_button_new_with_mnemonic (_ ("_Echo Suppression")); + state = dbus_get_echo_cancel_state(); + echocancelActive = FALSE; + + if (strcmp (state, "enabled") == 0) + echocancelActive = TRUE; + else + echocancelActive = FALSE; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableEchoCancel), echocancelActive); + g_signal_connect (G_OBJECT (enableEchoCancel), "clicked", active_echo_cancel, NULL); + + gtk_box_pack_start (GTK_BOX (ret), enableEchoCancel, TRUE , TRUE , 1); + + + enableNoiseReduction = gtk_check_button_new_with_mnemonic (_ ("_Noise Reduction")); + state = dbus_get_noise_suppress_state(); + noisesuppressActive = FALSE; + + if (strcmp (state, "enabled") == 0) + noisesuppressActive = TRUE; + else + noisesuppressActive = FALSE; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableNoiseReduction), noisesuppressActive); + gtk_box_pack_start (GTK_BOX (ret) , enableNoiseReduction , TRUE , TRUE , 1); + + g_signal_connect (G_OBJECT (enableNoiseReduction), "clicked", active_noise_suppress, NULL); + + return ret; } -static void record_path_changed( GtkFileChooser *chooser , GtkLabel *label UNUSED) +static void record_path_changed (GtkFileChooser *chooser , GtkLabel *label UNUSED) { - DEBUG("record_path_changed"); + DEBUG ("record_path_changed"); - gchar* path; - path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER( chooser )); - DEBUG("path2 %s", path); - dbus_set_record_path( path ); + gchar* path; + path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); + DEBUG ("path2 %s", path); + dbus_set_record_path (path); } GtkWidget* create_audio_configuration() { - // Main widget - GtkWidget *ret; - // Sub boxes - GtkWidget *box; - GtkWidget *frame; + // Main widget + GtkWidget *ret; + // Sub boxes + GtkWidget *box; + GtkWidget *frame; - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); - GtkWidget *alsa; - GtkWidget *table; - - gnome_main_section_new_with_table (_("Sound Manager"), &frame, &table, 1, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - int audio_manager = dbus_get_audio_manager(); - gboolean pulse_audio = FALSE; - if (audio_manager == PULSEAUDIO) { - pulse_audio = TRUE; - } - - pulse = gtk_radio_button_new_with_mnemonic( NULL , _("_Pulseaudio")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(pulse), pulse_audio); - gtk_table_attach ( GTK_TABLE( table ), pulse, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - alsa = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(pulse), _("_ALSA")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(alsa), !pulse_audio); - g_signal_connect(G_OBJECT(alsa), "clicked", G_CALLBACK(select_audio_manager), NULL); - gtk_table_attach ( GTK_TABLE( table ), alsa, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // Box for the ALSA configuration - gnome_main_section_new (_("ALSA settings"), &alsa_conf); - gtk_box_pack_start(GTK_BOX(ret), alsa_conf, FALSE, FALSE, 0); - gtk_widget_show( alsa_conf ); - if( SHOW_ALSA_CONF ) - { - // Box for the ALSA configuration - printf("ALSA Created \n"); - alsabox = alsa_box(); - gtk_container_add( GTK_CONTAINER(alsa_conf) , alsabox ); - gtk_widget_hide( alsa_conf ); - } - - // Recorded file saving path - GtkWidget *label; - GtkWidget *folderChooser; - gchar *dftPath; - - /* Get the path where to save audio files */ - dftPath = dbus_get_record_path (); - DEBUG("load recording path %s\n", dftPath); - - gnome_main_section_new_with_table (_("Recordings"), &frame, &table, 1, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - // label - label = gtk_label_new(_("Destination folder")); - gtk_table_attach( GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // folder chooser button - folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( folderChooser), dftPath); - g_signal_connect( G_OBJECT( folderChooser ) , "selection_changed" , G_CALLBACK( record_path_changed ) , NULL ); - gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // Box for the ringtones - gnome_main_section_new_with_table (_("Ringtones"), &frame, &table, 1, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - GtkWidget *enableTone; - GtkWidget *fileChooser; - - enableTone = gtk_check_button_new_with_mnemonic( _("_Enable ringtones")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableTone), dbus_is_ringtone_enabled() ); - g_signal_connect(G_OBJECT( enableTone) , "clicked" , G_CALLBACK( ringtone_enabled ) , NULL); - gtk_table_attach ( GTK_TABLE( table ), enableTone, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // file chooser button - fileChooser = gtk_file_chooser_button_new(_("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( fileChooser) , g_get_home_dir()); - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER( fileChooser) , get_ringtone_choice()); - g_signal_connect( G_OBJECT( fileChooser ) , "selection_changed" , G_CALLBACK( ringtone_changed ) , NULL ); - - GtkFileFilter *filter = gtk_file_filter_new(); - gtk_file_filter_set_name( filter , _("Audio Files") ); - gtk_file_filter_add_pattern(filter , "*.wav" ); - gtk_file_filter_add_pattern(filter , "*.ul" ); - gtk_file_filter_add_pattern(filter , "*.au" ); - gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( fileChooser ) , filter); - gtk_table_attach ( GTK_TABLE( table ), fileChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - gnome_main_section_new (_("Voice enhancement settings"), &noise_conf); - gtk_box_pack_start(GTK_BOX(ret), noise_conf, FALSE, FALSE, 0); - gtk_widget_show( noise_conf ); - - // Box for the voice enhancement configuration - noisebox = noise_box(); - gtk_container_add( GTK_CONTAINER(noise_conf) , noisebox ); - + GtkWidget *alsa; + GtkWidget *table; - gtk_widget_show_all(ret); + gnome_main_section_new_with_table (_ ("Sound Manager"), &frame, &table, 1, 2); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - if(!pulse_audio) { - gtk_widget_show(alsa_conf); - } - else{ - gtk_widget_hide(alsa_conf); - } + int audio_manager = dbus_get_audio_manager(); + gboolean pulse_audio = FALSE; - return ret; + if (audio_manager == PULSEAUDIO) { + pulse_audio = TRUE; + } + + pulse = gtk_radio_button_new_with_mnemonic (NULL , _ ("_Pulseaudio")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pulse), pulse_audio); + gtk_table_attach (GTK_TABLE (table), pulse, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + alsa = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (pulse), _ ("_ALSA")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (alsa), !pulse_audio); + g_signal_connect (G_OBJECT (alsa), "clicked", G_CALLBACK (select_audio_manager), NULL); + gtk_table_attach (GTK_TABLE (table), alsa, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // Box for the ALSA configuration + gnome_main_section_new (_ ("ALSA settings"), &alsa_conf); + gtk_box_pack_start (GTK_BOX (ret), alsa_conf, FALSE, FALSE, 0); + gtk_widget_show (alsa_conf); + + if (SHOW_ALSA_CONF) { + // Box for the ALSA configuration + printf ("ALSA Created \n"); + alsabox = alsa_box(); + gtk_container_add (GTK_CONTAINER (alsa_conf) , alsabox); + gtk_widget_hide (alsa_conf); + } + + // Recorded file saving path + GtkWidget *label; + GtkWidget *folderChooser; + gchar *dftPath; + + /* Get the path where to save audio files */ + dftPath = dbus_get_record_path (); + DEBUG ("load recording path %s\n", dftPath); + + gnome_main_section_new_with_table (_ ("Recordings"), &frame, &table, 1, 2); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + // label + label = gtk_label_new (_ ("Destination folder")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // folder chooser button + folderChooser = gtk_file_chooser_button_new (_ ("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (folderChooser), dftPath); + g_signal_connect (G_OBJECT (folderChooser) , "selection_changed" , G_CALLBACK (record_path_changed) , NULL); + gtk_table_attach (GTK_TABLE (table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // Box for the ringtones + gnome_main_section_new_with_table (_ ("Ringtones"), &frame, &table, 1, 2); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + GtkWidget *enableTone; + GtkWidget *fileChooser; + + enableTone = gtk_check_button_new_with_mnemonic (_ ("_Enable ringtones")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableTone), dbus_is_ringtone_enabled()); + g_signal_connect (G_OBJECT (enableTone) , "clicked" , G_CALLBACK (ringtone_enabled) , NULL); + gtk_table_attach (GTK_TABLE (table), enableTone, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // file chooser button + fileChooser = gtk_file_chooser_button_new (_ ("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN); + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (fileChooser) , g_get_home_dir()); + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (fileChooser) , get_ringtone_choice()); + g_signal_connect (G_OBJECT (fileChooser) , "selection_changed" , G_CALLBACK (ringtone_changed) , NULL); + + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_file_filter_set_name (filter , _ ("Audio Files")); + gtk_file_filter_add_pattern (filter , "*.wav"); + gtk_file_filter_add_pattern (filter , "*.ul"); + gtk_file_filter_add_pattern (filter , "*.au"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (fileChooser) , filter); + gtk_table_attach (GTK_TABLE (table), fileChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + gnome_main_section_new (_ ("Voice enhancement settings"), &noise_conf); + gtk_box_pack_start (GTK_BOX (ret), noise_conf, FALSE, FALSE, 0); + gtk_widget_show (noise_conf); + + // Box for the voice enhancement configuration + noisebox = noise_box(); + gtk_container_add (GTK_CONTAINER (noise_conf) , noisebox); + + + gtk_widget_show_all (ret); + + if (!pulse_audio) { + gtk_widget_show (alsa_conf); + } else { + gtk_widget_hide (alsa_conf); + } + + return ret; } /* GtkWidget* create_codecs_configuration (account_t **a) { diff --git a/sflphone-client-gnome/src/config/audioconf.h b/sflphone-client-gnome/src/config/audioconf.h index b195b947d8ce1d0b6ff6f35ca0cb077469f56ce4..70fadb3dc3c06c1fc7af069d8e4e52bec6595b33 100644 --- a/sflphone-client-gnome/src/config/audioconf.h +++ b/sflphone-client-gnome/src/config/audioconf.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -42,6 +42,6 @@ GtkWidget* pulse_box(); GtkWidget* codecs_box(); GtkWidget* ringtone_box(); -gboolean get_api( ); +gboolean get_api(); #endif // __AUDIO_CONF_H diff --git a/sflphone-client-gnome/src/config/hooks-config.c b/sflphone-client-gnome/src/config/hooks-config.c index 7331cc88fc94e634f1097c7585ff12e71d66ee8c..df257d6eaa561cf777cadb03a55ada635b0ad325 100644 --- a/sflphone-client-gnome/src/config/hooks-config.c +++ b/sflphone-client-gnome/src/config/hooks-config.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -34,14 +34,15 @@ URLHook_Config *_urlhook_config; GtkWidget *field, *command, *prefix; -void hooks_load_parameters (URLHook_Config** settings){ +void hooks_load_parameters (URLHook_Config** settings) +{ GHashTable *_params = NULL; URLHook_Config *_settings; // Allocate a struct _settings = g_new0 (URLHook_Config, 1); - + // Fetch the settings from D-Bus _params = (GHashTable*) dbus_get_hook_settings (); @@ -52,38 +53,38 @@ void hooks_load_parameters (URLHook_Config** settings){ _settings->iax2_enabled = "0"; _settings->phone_number_enabled = "0"; _settings->phone_number_prefix = ""; + } else { + _settings->sip_field = (gchar*) (g_hash_table_lookup (_params, URLHOOK_SIP_FIELD)); + _settings->command = (gchar*) (g_hash_table_lookup (_params, URLHOOK_COMMAND)); + _settings->sip_enabled = (gchar*) (g_hash_table_lookup (_params, URLHOOK_SIP_ENABLED)); + _settings->iax2_enabled = (gchar*) (g_hash_table_lookup (_params, URLHOOK_IAX2_ENABLED)); + _settings->phone_number_enabled = (gchar*) (g_hash_table_lookup (_params, PHONE_NUMBER_HOOK_ENABLED)); + _settings->phone_number_prefix = (gchar*) (g_hash_table_lookup (_params, PHONE_NUMBER_HOOK_ADD_PREFIX)); } - else { - _settings->sip_field = (gchar*)(g_hash_table_lookup (_params, URLHOOK_SIP_FIELD)); - _settings->command = (gchar*)(g_hash_table_lookup (_params, URLHOOK_COMMAND)); - _settings->sip_enabled = (gchar*)(g_hash_table_lookup (_params, URLHOOK_SIP_ENABLED)); - _settings->iax2_enabled = (gchar*)(g_hash_table_lookup (_params, URLHOOK_IAX2_ENABLED)); - _settings->phone_number_enabled = (gchar*)(g_hash_table_lookup (_params, PHONE_NUMBER_HOOK_ENABLED )); - _settings->phone_number_prefix = (gchar*)(g_hash_table_lookup (_params, PHONE_NUMBER_HOOK_ADD_PREFIX )); - } - + *settings = _settings; } -void hooks_save_parameters (void){ +void hooks_save_parameters (void) +{ GHashTable *params = NULL; - + params = g_hash_table_new (NULL, g_str_equal); - g_hash_table_replace (params, (gpointer)URLHOOK_SIP_FIELD, - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(field)))); - g_hash_table_replace (params, (gpointer)URLHOOK_COMMAND, - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(command)))); - g_hash_table_replace (params, (gpointer)URLHOOK_SIP_ENABLED, - (gpointer)g_strdup(_urlhook_config->sip_enabled)); - g_hash_table_replace (params, (gpointer)URLHOOK_IAX2_ENABLED, - (gpointer)g_strdup(_urlhook_config->iax2_enabled)); - g_hash_table_replace (params, (gpointer)PHONE_NUMBER_HOOK_ENABLED, - (gpointer)g_strdup(_urlhook_config->phone_number_enabled)); - g_hash_table_replace (params, (gpointer)PHONE_NUMBER_HOOK_ADD_PREFIX, - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(prefix)))); - + g_hash_table_replace (params, (gpointer) URLHOOK_SIP_FIELD, + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (field)))); + g_hash_table_replace (params, (gpointer) URLHOOK_COMMAND, + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (command)))); + g_hash_table_replace (params, (gpointer) URLHOOK_SIP_ENABLED, + (gpointer) g_strdup (_urlhook_config->sip_enabled)); + g_hash_table_replace (params, (gpointer) URLHOOK_IAX2_ENABLED, + (gpointer) g_strdup (_urlhook_config->iax2_enabled)); + g_hash_table_replace (params, (gpointer) PHONE_NUMBER_HOOK_ENABLED, + (gpointer) g_strdup (_urlhook_config->phone_number_enabled)); + g_hash_table_replace (params, (gpointer) PHONE_NUMBER_HOOK_ADD_PREFIX, + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (prefix)))); + dbus_set_hook_settings (params); // Decrement the reference count @@ -91,104 +92,111 @@ void hooks_save_parameters (void){ } -static void sip_enabled_cb (GtkWidget *widget) { +static void sip_enabled_cb (GtkWidget *widget) +{ guint check; - check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); + check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + if (check) _urlhook_config->sip_enabled="1"; else _urlhook_config->sip_enabled="0"; } -static void iax2_enabled_cb (GtkWidget *widget) { +static void iax2_enabled_cb (GtkWidget *widget) +{ guint check; - check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); + check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + if (check) _urlhook_config->iax2_enabled="1"; else _urlhook_config->iax2_enabled="0"; } -static void phone_number_enabled_cb (GtkWidget *widget) { +static void phone_number_enabled_cb (GtkWidget *widget) +{ guint check; - check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); - if (check){ + check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if (check) { _urlhook_config->phone_number_enabled="1"; - gtk_widget_set_sensitive (GTK_WIDGET (prefix), TRUE); - }else{ + gtk_widget_set_sensitive (GTK_WIDGET (prefix), TRUE); + } else { _urlhook_config->phone_number_enabled="0"; - gtk_widget_set_sensitive (GTK_WIDGET (prefix), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (prefix), FALSE); } } -GtkWidget* create_hooks_settings (){ +GtkWidget* create_hooks_settings () +{ GtkWidget *ret, *frame, *table, *label, *widg; // Load the user value hooks_load_parameters (&_urlhook_config); - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); - gnome_main_section_new_with_table (_("URL Argument"), &frame, &table, 5, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + gnome_main_section_new_with_table (_ ("URL Argument"), &frame, &table, 5, 2); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - label = gtk_label_new(_("Custom commands on incoming calls with URL")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 2, 0, 1, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new (_ ("Custom commands on incoming calls with URL")); + gtk_table_attach (GTK_TABLE (table), label, 0, 2, 0, 1, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new (_ ("%s will be replaced with the passed URL.")); + gtk_table_attach (GTK_TABLE (table), label, 0, 2, 1, 2, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - label = gtk_label_new(_("%s will be replaced with the passed URL.")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 2, 1, 2, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + widg = gtk_check_button_new_with_mnemonic (_ ("Trigger on specific _SIP header")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widg), (g_strcasecmp (_urlhook_config->sip_enabled, "1") ==0) ?TRUE:FALSE); + g_signal_connect (G_OBJECT (widg) , "clicked" , G_CALLBACK (sip_enabled_cb), NULL); + gtk_table_attach (GTK_TABLE (table), widg, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - widg = gtk_check_button_new_with_mnemonic( _("Trigger on specific _SIP header")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->sip_enabled, "1")==0)?TRUE:FALSE); - g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (sip_enabled_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), widg, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - field = gtk_entry_new (); - gtk_entry_set_text(GTK_ENTRY(field), _urlhook_config->sip_field); - gtk_table_attach ( GTK_TABLE( table ), field, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_entry_set_text (GTK_ENTRY (field), _urlhook_config->sip_field); + gtk_table_attach (GTK_TABLE (table), field, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - widg = gtk_check_button_new_with_mnemonic( _("Trigger on _IAX2 URL")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->iax2_enabled, "1")==0)?TRUE:FALSE); - g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (iax2_enabled_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), widg, 0, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + widg = gtk_check_button_new_with_mnemonic (_ ("Trigger on _IAX2 URL")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widg), (g_strcasecmp (_urlhook_config->iax2_enabled, "1") ==0) ?TRUE:FALSE); + g_signal_connect (G_OBJECT (widg) , "clicked" , G_CALLBACK (iax2_enabled_cb), NULL); + gtk_table_attach (GTK_TABLE (table), widg, 0, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - label = gtk_label_new_with_mnemonic (_("Command to _run")); - gtk_misc_set_alignment(GTK_MISC(label), 0.05, 0.5); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new_with_mnemonic (_ ("Command to _run")); + gtk_misc_set_alignment (GTK_MISC (label), 0.05, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); command = gtk_entry_new (); gtk_label_set_mnemonic_widget (GTK_LABEL (label), command); - gtk_entry_set_text(GTK_ENTRY(command), _urlhook_config->command); - gtk_table_attach ( GTK_TABLE( table ), command, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + gtk_entry_set_text (GTK_ENTRY (command), _urlhook_config->command); + gtk_table_attach (GTK_TABLE (table), command, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); - gnome_main_section_new_with_table (_("Phone number rewriting"), &frame, &table, 4, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + gnome_main_section_new_with_table (_ ("Phone number rewriting"), &frame, &table, 4, 2); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - widg = gtk_check_button_new_with_mnemonic( _("_Prefix dialed numbers with")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->phone_number_enabled, "1")==0)?TRUE:FALSE); - g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (phone_number_enabled_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), widg, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + widg = gtk_check_button_new_with_mnemonic (_ ("_Prefix dialed numbers with")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widg), (g_strcasecmp (_urlhook_config->phone_number_enabled, "1") ==0) ?TRUE:FALSE); + g_signal_connect (G_OBJECT (widg) , "clicked" , G_CALLBACK (phone_number_enabled_cb), NULL); + gtk_table_attach (GTK_TABLE (table), widg, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + prefix = gtk_entry_new (); gtk_label_set_mnemonic_widget (GTK_LABEL (label), prefix); - gtk_entry_set_text(GTK_ENTRY(prefix), _urlhook_config->phone_number_prefix); - gtk_widget_set_sensitive (GTK_WIDGET (prefix), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widg))); - gtk_table_attach ( GTK_TABLE( table ), prefix, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + gtk_entry_set_text (GTK_ENTRY (prefix), _urlhook_config->phone_number_prefix); + gtk_widget_set_sensitive (GTK_WIDGET (prefix), gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widg))); + gtk_table_attach (GTK_TABLE (table), prefix, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); - gtk_widget_show_all(ret); + gtk_widget_show_all (ret); return ret; } diff --git a/sflphone-client-gnome/src/config/hooks-config.h b/sflphone-client-gnome/src/config/hooks-config.h index 5fcd951b21c4105b25842955b2b1cfd75e73a40a..f1b575517ae1206156ed3967a00f46fc9809f0bd 100644 --- a/sflphone-client-gnome/src/config/hooks-config.h +++ b/sflphone-client-gnome/src/config/hooks-config.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -55,8 +55,8 @@ typedef struct _URLHook_Config { gchar *sip_field; gchar *command; gchar *phone_number_enabled; - gchar *phone_number_prefix; -}URLHook_Config; + gchar *phone_number_prefix; +} URLHook_Config; /** * Save the parameters through D-BUS diff --git a/sflphone-client-gnome/src/config/preferencesdialog.c b/sflphone-client-gnome/src/config/preferencesdialog.c index ff68a31c7af95928bd411b15cbf9e38a2fd4da02..7aae7db058df4eeae98624b86cd838e4f1ff2ca3 100644 --- a/sflphone-client-gnome/src/config/preferencesdialog.c +++ b/sflphone-client-gnome/src/config/preferencesdialog.c @@ -75,71 +75,73 @@ static void set_md5_hash_cb (GtkWidget *widget UNUSED, gpointer data UNUSED) { - gboolean enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); - dbus_set_md5_credential_hashing (enabled); + gboolean enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + dbus_set_md5_credential_hashing (enabled); } static void start_hidden (void) { - gboolean currentstate = eel_gconf_get_integer (START_HIDDEN); - eel_gconf_set_integer (START_HIDDEN, !currentstate); + gboolean currentstate = eel_gconf_get_integer (START_HIDDEN); + eel_gconf_set_integer (START_HIDDEN, !currentstate); } static void set_popup_mode (GtkWidget *widget, gpointer *userdata) { - gboolean currentstate = eel_gconf_get_integer (POPUP_ON_CALL); - if (currentstate || gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { - eel_gconf_set_integer (POPUP_ON_CALL, !currentstate); - } + gboolean currentstate = eel_gconf_get_integer (POPUP_ON_CALL); + + if (currentstate || gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + eel_gconf_set_integer (POPUP_ON_CALL, !currentstate); + } } void set_notif_level () { - gboolean current_state = eel_gconf_get_integer (NOTIFY_ALL); - eel_gconf_set_integer (NOTIFY_ALL, !current_state); + gboolean current_state = eel_gconf_get_integer (NOTIFY_ALL); + eel_gconf_set_integer (NOTIFY_ALL, !current_state); } static void history_limit_cb (GtkSpinButton *button, void *ptr) { - history_limit = gtk_spin_button_get_value_as_int ((GtkSpinButton *) (ptr)); + history_limit = gtk_spin_button_get_value_as_int ( (GtkSpinButton *) (ptr)); } static void history_enabled_cb (GtkWidget *widget) { - history_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - gtk_widget_set_sensitive (GTK_WIDGET (history_value), history_enabled); + history_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + gtk_widget_set_sensitive (GTK_WIDGET (history_value), history_enabled); - // Toggle it through D-Bus - eel_gconf_set_integer (HISTORY_ENABLED, !eel_gconf_get_integer (HISTORY_ENABLED)); + // Toggle it through D-Bus + eel_gconf_set_integer (HISTORY_ENABLED, !eel_gconf_get_integer (HISTORY_ENABLED)); } void clean_history (void) { - calllist_clean_history (); + calllist_clean_history (); } -void showstatusicon_cb (GtkWidget *widget, gpointer data) { +void showstatusicon_cb (GtkWidget *widget, gpointer data) +{ - gboolean currentstatus = FALSE; + gboolean currentstatus = FALSE; - // data contains the previous value of dbus_is_status_icon_enabled () - ie before the click. - currentstatus = (gboolean) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + // data contains the previous value of dbus_is_status_icon_enabled () - ie before the click. + currentstatus = (gboolean) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - // Update the widget states - gtk_widget_set_sensitive (GTK_WIDGET (popupwindow), currentstatus); - gtk_widget_set_sensitive (GTK_WIDGET (neverpopupwindow), currentstatus); - gtk_widget_set_sensitive (GTK_WIDGET (starthidden), currentstatus); + // Update the widget states + gtk_widget_set_sensitive (GTK_WIDGET (popupwindow), currentstatus); + gtk_widget_set_sensitive (GTK_WIDGET (neverpopupwindow), currentstatus); + gtk_widget_set_sensitive (GTK_WIDGET (starthidden), currentstatus); - currentstatus ? show_status_icon () : hide_status_icon (); + currentstatus ? show_status_icon () : hide_status_icon (); - // Update through D-Bus - eel_gconf_set_integer (SHOW_STATUSICON, currentstatus); + // Update through D-Bus + eel_gconf_set_integer (SHOW_STATUSICON, currentstatus); } @@ -147,125 +149,125 @@ GtkWidget* create_general_settings () { - GtkWidget *ret, *notifAll, *trayItem, *frame, *checkBoxWidget, *label, *table; - gboolean statusicon; - - // Load history configuration - history_load_configuration (); - - // Main widget - ret = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER(ret), 10); - - // Notifications Frame - gnome_main_section_new_with_table (_("Desktop Notifications"), &frame, - &table, 2, 1); - gtk_box_pack_start (GTK_BOX(ret), frame, FALSE, FALSE, 0); - - // Notification All - notifAll = gtk_check_button_new_with_mnemonic (_("_Enable notifications")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(notifAll), eel_gconf_get_integer (NOTIFY_ALL)); - g_signal_connect(G_OBJECT( notifAll ) , "clicked" , G_CALLBACK( set_notif_level ) , NULL ); - gtk_table_attach (GTK_TABLE(table), notifAll, 0, 1, 0, 1, GTK_EXPAND - | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // System Tray option frame - gnome_main_section_new_with_table (_("System Tray Icon"), &frame, &table, 4, - 1); - gtk_box_pack_start (GTK_BOX(ret), frame, FALSE, FALSE, 0); - - // Whether or not displaying an icon in the system tray - statusicon = eel_gconf_get_integer (SHOW_STATUSICON); - - showstatusicon = gtk_check_button_new_with_mnemonic ( - _("Show SFLphone in the system tray")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(showstatusicon), statusicon); - g_signal_connect (G_OBJECT (showstatusicon) , "clicked" , G_CALLBACK (showstatusicon_cb), NULL); - gtk_table_attach (GTK_TABLE (table), showstatusicon, 0, 1, 0, 1, GTK_EXPAND - | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - popupwindow = gtk_radio_button_new_with_mnemonic (NULL, - _("_Popup main window on incoming call")); - g_signal_connect(G_OBJECT (popupwindow), "toggled", G_CALLBACK (set_popup_mode), NULL); - gtk_table_attach (GTK_TABLE(table), popupwindow, 0, 1, 1, 2, GTK_EXPAND - | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - neverpopupwindow = gtk_radio_button_new_with_mnemonic_from_widget ( - GTK_RADIO_BUTTON (popupwindow), _("Ne_ver popup main window")); - gtk_table_attach (GTK_TABLE(table), neverpopupwindow, 0, 1, 2, 3, GTK_EXPAND - | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // Toggle according to the user configuration - eel_gconf_get_integer (POPUP_ON_CALL) ? gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (popupwindow), - TRUE) : - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (neverpopupwindow), - TRUE); - - starthidden = gtk_check_button_new_with_mnemonic ( - _("Hide SFLphone window on _startup")); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(starthidden), - eel_gconf_get_integer (START_HIDDEN)); - g_signal_connect(G_OBJECT (starthidden) , "clicked" , G_CALLBACK( start_hidden ) , NULL); - gtk_table_attach (GTK_TABLE(table), starthidden, 0, 1, 3, 4, GTK_EXPAND - | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // Update the widget states - gtk_widget_set_sensitive (GTK_WIDGET (popupwindow),statusicon); - gtk_widget_set_sensitive (GTK_WIDGET (neverpopupwindow),statusicon); - gtk_widget_set_sensitive (GTK_WIDGET (starthidden),statusicon); - - // HISTORY CONFIGURATION - gnome_main_section_new_with_table (_("Calls History"), &frame, &table, 3, 1); - gtk_box_pack_start (GTK_BOX(ret), frame, FALSE, FALSE, 0); - - checkBoxWidget = gtk_check_button_new_with_mnemonic ( - _("_Keep my history for at least")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkBoxWidget), - history_enabled); - g_signal_connect (G_OBJECT (checkBoxWidget) , "clicked" , G_CALLBACK (history_enabled_cb) , NULL); - gtk_table_attach (GTK_TABLE(table), checkBoxWidget, 0, 1, 0, 1, GTK_EXPAND - | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - history_value = gtk_spin_button_new_with_range (1, 99, 1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(history_value), history_limit); - g_signal_connect( G_OBJECT (history_value) , "value-changed" , G_CALLBACK (history_limit_cb) , history_value); - gtk_widget_set_sensitive (GTK_WIDGET (history_value), - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkBoxWidget))); - gtk_table_attach (GTK_TABLE(table), history_value, 1, 2, 0, 1, GTK_EXPAND - | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - label = gtk_label_new (_("days")); - gtk_table_attach (GTK_TABLE(table), label, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0, 5); - - gtk_widget_show_all (ret); - - return ret; + GtkWidget *ret, *notifAll, *trayItem, *frame, *checkBoxWidget, *label, *table; + gboolean statusicon; + + // Load history configuration + history_load_configuration (); + + // Main widget + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); + + // Notifications Frame + gnome_main_section_new_with_table (_ ("Desktop Notifications"), &frame, + &table, 2, 1); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + // Notification All + notifAll = gtk_check_button_new_with_mnemonic (_ ("_Enable notifications")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (notifAll), eel_gconf_get_integer (NOTIFY_ALL)); + g_signal_connect (G_OBJECT (notifAll) , "clicked" , G_CALLBACK (set_notif_level) , NULL); + gtk_table_attach (GTK_TABLE (table), notifAll, 0, 1, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // System Tray option frame + gnome_main_section_new_with_table (_ ("System Tray Icon"), &frame, &table, 4, + 1); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + // Whether or not displaying an icon in the system tray + statusicon = eel_gconf_get_integer (SHOW_STATUSICON); + + showstatusicon = gtk_check_button_new_with_mnemonic ( + _ ("Show SFLphone in the system tray")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (showstatusicon), statusicon); + g_signal_connect (G_OBJECT (showstatusicon) , "clicked" , G_CALLBACK (showstatusicon_cb), NULL); + gtk_table_attach (GTK_TABLE (table), showstatusicon, 0, 1, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + popupwindow = gtk_radio_button_new_with_mnemonic (NULL, + _ ("_Popup main window on incoming call")); + g_signal_connect (G_OBJECT (popupwindow), "toggled", G_CALLBACK (set_popup_mode), NULL); + gtk_table_attach (GTK_TABLE (table), popupwindow, 0, 1, 1, 2, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + neverpopupwindow = gtk_radio_button_new_with_mnemonic_from_widget ( + GTK_RADIO_BUTTON (popupwindow), _ ("Ne_ver popup main window")); + gtk_table_attach (GTK_TABLE (table), neverpopupwindow, 0, 1, 2, 3, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // Toggle according to the user configuration + eel_gconf_get_integer (POPUP_ON_CALL) ? gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (popupwindow), + TRUE) : + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (neverpopupwindow), + TRUE); + + starthidden = gtk_check_button_new_with_mnemonic ( + _ ("Hide SFLphone window on _startup")); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (starthidden), + eel_gconf_get_integer (START_HIDDEN)); + g_signal_connect (G_OBJECT (starthidden) , "clicked" , G_CALLBACK (start_hidden) , NULL); + gtk_table_attach (GTK_TABLE (table), starthidden, 0, 1, 3, 4, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // Update the widget states + gtk_widget_set_sensitive (GTK_WIDGET (popupwindow),statusicon); + gtk_widget_set_sensitive (GTK_WIDGET (neverpopupwindow),statusicon); + gtk_widget_set_sensitive (GTK_WIDGET (starthidden),statusicon); + + // HISTORY CONFIGURATION + gnome_main_section_new_with_table (_ ("Calls History"), &frame, &table, 3, 1); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + checkBoxWidget = gtk_check_button_new_with_mnemonic ( + _ ("_Keep my history for at least")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkBoxWidget), + history_enabled); + g_signal_connect (G_OBJECT (checkBoxWidget) , "clicked" , G_CALLBACK (history_enabled_cb) , NULL); + gtk_table_attach (GTK_TABLE (table), checkBoxWidget, 0, 1, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + history_value = gtk_spin_button_new_with_range (1, 99, 1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (history_value), history_limit); + g_signal_connect (G_OBJECT (history_value) , "value-changed" , G_CALLBACK (history_limit_cb) , history_value); + gtk_widget_set_sensitive (GTK_WIDGET (history_value), + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkBoxWidget))); + gtk_table_attach (GTK_TABLE (table), history_value, 1, 2, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + label = gtk_label_new (_ ("days")); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, + GTK_EXPAND | GTK_FILL, 0, 5); + + gtk_widget_show_all (ret); + + return ret; } void save_configuration_parameters (void) { - // Address book config - addressbook_config_save_parameters (); - hooks_save_parameters (); + // Address book config + addressbook_config_save_parameters (); + hooks_save_parameters (); - // History config - dbus_set_history_limit (history_limit); + // History config + dbus_set_history_limit (history_limit); - // Direct IP calls config - // dbus_set_ip2ip_details (directIpCallsProperties); + // Direct IP calls config + // dbus_set_ip2ip_details (directIpCallsProperties); } void history_load_configuration () { - history_limit = dbus_get_history_limit (); - history_enabled = eel_gconf_get_integer (HISTORY_ENABLED); + history_limit = dbus_get_history_limit (); + history_enabled = eel_gconf_get_integer (HISTORY_ENABLED); } /** @@ -274,69 +276,69 @@ history_load_configuration () void show_preferences_dialog () { - GtkDialog * dialog; - GtkWidget * notebook; - GtkWidget * tab; - guint result; - - dialogOpen = TRUE; - - dialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Preferences"), - GTK_WINDOW(get_main_window()), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CLOSE, - GTK_RESPONSE_ACCEPT, - NULL)); - - // Set window properties - gtk_dialog_set_has_separator (dialog, FALSE); - gtk_window_set_default_size (GTK_WINDOW(dialog), 600, 400); - gtk_container_set_border_width (GTK_CONTAINER(dialog), 0); - - // Create tabs container - notebook = gtk_notebook_new (); - gtk_box_pack_start (GTK_BOX (dialog->vbox), notebook, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER(notebook), 10); - gtk_widget_show (notebook); - - // General settings tab - tab = create_general_settings (); - gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( - _("General"))); - gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); - - // Audio tab - tab = create_audio_configuration (); - gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( - _("Audio"))); - gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); - - // Addressbook tab - tab = create_addressbook_settings (); - gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( - _("Address Book"))); - gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); - - // Hooks tab - tab = create_hooks_settings (); - gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( - _("Hooks"))); - gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); - - // Shortcuts tab - tab = create_shortcuts_settings(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Shortcuts"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - - gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); - - result = gtk_dialog_run (dialog); - - save_configuration_parameters (); - update_actions (); - - dialogOpen = FALSE; - - gtk_widget_destroy (GTK_WIDGET(dialog)); + GtkDialog * dialog; + GtkWidget * notebook; + GtkWidget * tab; + guint result; + + dialogOpen = TRUE; + + dialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_ ("Preferences"), + GTK_WINDOW (get_main_window()), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, + GTK_RESPONSE_ACCEPT, + NULL)); + + // Set window properties + gtk_dialog_set_has_separator (dialog, FALSE); + gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 400); + gtk_container_set_border_width (GTK_CONTAINER (dialog), 0); + + // Create tabs container + notebook = gtk_notebook_new (); + gtk_box_pack_start (GTK_BOX (dialog->vbox), notebook, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (notebook), 10); + gtk_widget_show (notebook); + + // General settings tab + tab = create_general_settings (); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), tab, gtk_label_new ( + _ ("General"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), tab); + + // Audio tab + tab = create_audio_configuration (); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), tab, gtk_label_new ( + _ ("Audio"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), tab); + + // Addressbook tab + tab = create_addressbook_settings (); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), tab, gtk_label_new ( + _ ("Address Book"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), tab); + + // Hooks tab + tab = create_hooks_settings (); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), tab, gtk_label_new ( + _ ("Hooks"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), tab); + + // Shortcuts tab + tab = create_shortcuts_settings(); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), tab, gtk_label_new (_ ("Shortcuts"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), tab); + + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); + + result = gtk_dialog_run (dialog); + + save_configuration_parameters (); + update_actions (); + + dialogOpen = FALSE; + + gtk_widget_destroy (GTK_WIDGET (dialog)); } diff --git a/sflphone-client-gnome/src/config/preferencesdialog.h b/sflphone-client-gnome/src/config/preferencesdialog.h index e14a240111419084212a5e59f9bcde86b944adb8..fb5193bf70ac1bb8e7ad608eae116ebb92f4e097 100644 --- a/sflphone-client-gnome/src/config/preferencesdialog.h +++ b/sflphone-client-gnome/src/config/preferencesdialog.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -85,7 +85,7 @@ void select_active_output_audio_plugin(); * because the default plugin always use default audio device * @param plugin The description of the selected plugin */ -void update_combo_box( gchar* plugin ); +void update_combo_box (gchar* plugin); /** * Build the widget to display codec list @@ -97,7 +97,7 @@ GtkWidget * create_codec_table(); * Create the main account window in a new window * @return GtkWidget* The widget created */ -GtkWidget * create_accounts_tab(GtkDialog * dialog); +GtkWidget * create_accounts_tab (GtkDialog * dialog); /** * Create the audio configuration tab and add it to the main configuration window @@ -121,4 +121,4 @@ void save_configuration_parameters (void); void history_load_configuration (void); -#endif +#endif diff --git a/sflphone-client-gnome/src/config/shortcuts-config.c b/sflphone-client-gnome/src/config/shortcuts-config.c index 64bdfd0d434fe677c195bab07d7f1dffaf51cdf4..47fb054bd257f51bf9529654e7979980c04d2150 100644 --- a/sflphone-client-gnome/src/config/shortcuts-config.c +++ b/sflphone-client-gnome/src/config/shortcuts-config.c @@ -36,44 +36,43 @@ GtkWidget* create_shortcuts_settings() { - GtkWidget *vbox, *result_frame, *window, *treeview, *scrolled_window, *label; + GtkWidget *vbox, *result_frame, *window, *treeview, *scrolled_window, *label; - GtkTreeIter iter; - guint i = 0; + GtkTreeIter iter; + guint i = 0; - vbox = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 10); + vbox = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); - gnome_main_section_new(_("General"), &result_frame); + gnome_main_section_new (_ ("General"), &result_frame); - label = gtk_label_new(_("Be careful: these shortcuts might override system-wide shortcuts.")); + label = gtk_label_new (_ ("Be careful: these shortcuts might override system-wide shortcuts.")); - treeview = gtk_tree_view_new(); - setup_tree_view(treeview); + treeview = gtk_tree_view_new(); + setup_tree_view (treeview); - GtkListStore *store = gtk_list_store_new(COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT); + GtkListStore *store = gtk_list_store_new (COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT); - Accelerator* list = shortcuts_get_list(); + Accelerator* list = shortcuts_get_list(); - while (list[i].action != NULL) - { - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, ACTION, _(list[i].action), MASK, - (gint) list[i].mask, VALUE, XKeycodeToKeysym(GDK_DISPLAY(), - list[i].value, 0), -1); - i++; + while (list[i].action != NULL) { + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, ACTION, _ (list[i].action), MASK, + (gint) list[i].mask, VALUE, XKeycodeToKeysym (GDK_DISPLAY(), + list[i].value, 0), -1); + i++; } - gtk_tree_view_set_model(GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (store)); - g_object_unref(store); + gtk_tree_view_set_model (GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (store)); + g_object_unref (store); - gtk_container_add(GTK_CONTAINER (result_frame), treeview); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), result_frame, FALSE, FALSE, 0); + gtk_container_add (GTK_CONTAINER (result_frame), treeview); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), result_frame, FALSE, FALSE, 0); - gtk_widget_show_all(vbox); + gtk_widget_show_all (vbox); - return vbox; + return vbox; } /* @@ -81,76 +80,77 @@ create_shortcuts_settings() * second is a keyboard accelerator. */ static void -setup_tree_view(GtkWidget *treeview) +setup_tree_view (GtkWidget *treeview) { - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - - renderer = gtk_cell_renderer_text_new(); - column = gtk_tree_view_column_new_with_attributes("Action", renderer, "text", - ACTION, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW (treeview), column); - - renderer = gtk_cell_renderer_accel_new(); - g_object_set(renderer, "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_GTK, - "editable", TRUE, NULL); - column = gtk_tree_view_column_new_with_attributes("Shortcut", renderer, - "accel-mods", MASK, "accel-key", VALUE, NULL); - - gtk_tree_view_append_column(GTK_TREE_VIEW (treeview), column); - g_signal_connect (G_OBJECT (renderer), "accel_edited", G_CALLBACK (accel_edited), (gpointer) treeview); - g_signal_connect (G_OBJECT (renderer), "accel_cleared", G_CALLBACK (accel_cleared), (gpointer) treeview); + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + renderer = gtk_cell_renderer_text_new(); + column = gtk_tree_view_column_new_with_attributes ("Action", renderer, "text", + ACTION, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column); + + renderer = gtk_cell_renderer_accel_new(); + g_object_set (renderer, "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_GTK, + "editable", TRUE, NULL); + column = gtk_tree_view_column_new_with_attributes ("Shortcut", renderer, + "accel-mods", MASK, "accel-key", VALUE, NULL); + + gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column); + g_signal_connect (G_OBJECT (renderer), "accel_edited", G_CALLBACK (accel_edited), (gpointer) treeview); + g_signal_connect (G_OBJECT (renderer), "accel_cleared", G_CALLBACK (accel_cleared), (gpointer) treeview); } static void -accel_edited(GtkCellRendererAccel *renderer, gchar *path, guint accel_key, - GdkModifierType mask, guint hardware_keycode, GtkTreeView *treeview) +accel_edited (GtkCellRendererAccel *renderer, gchar *path, guint accel_key, + GdkModifierType mask, guint hardware_keycode, GtkTreeView *treeview) { - DEBUG("Accel edited"); - - GtkTreeModel *model; - GtkTreeIter iter; - - Accelerator* list = shortcuts_get_list(); - model = gtk_tree_view_get_model(treeview); - gint code = XKeysymToKeycode(GDK_DISPLAY(), accel_key); - - // Disable existing binding if key already used - int i = 0; - gtk_tree_model_get_iter_first(model, &iter); - while (list[i].action != NULL) - { - if(list[i].value == code) - { - gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, 0, VALUE, 0, -1); - WARN("This key was already affected"); - } - gtk_tree_model_iter_next(model, &iter); - i++; - } - - // Update treeview - if (gtk_tree_model_get_iter_from_string(model, &iter, path)) - gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, (gint) mask, VALUE, - accel_key, -1); - - // Update GDK bindings - shortcuts_update_bindings(atoi(path), code); + DEBUG ("Accel edited"); + + GtkTreeModel *model; + GtkTreeIter iter; + + Accelerator* list = shortcuts_get_list(); + model = gtk_tree_view_get_model (treeview); + gint code = XKeysymToKeycode (GDK_DISPLAY(), accel_key); + + // Disable existing binding if key already used + int i = 0; + gtk_tree_model_get_iter_first (model, &iter); + + while (list[i].action != NULL) { + if (list[i].value == code) { + gtk_list_store_set (GTK_LIST_STORE (model), &iter, MASK, 0, VALUE, 0, -1); + WARN ("This key was already affected"); + } + + gtk_tree_model_iter_next (model, &iter); + i++; + } + + // Update treeview + if (gtk_tree_model_get_iter_from_string (model, &iter, path)) + gtk_list_store_set (GTK_LIST_STORE (model), &iter, MASK, (gint) mask, VALUE, + accel_key, -1); + + // Update GDK bindings + shortcuts_update_bindings (atoi (path), code); } static void -accel_cleared(GtkCellRendererAccel *renderer, gchar *path, GtkTreeView *treeview) +accel_cleared (GtkCellRendererAccel *renderer, gchar *path, GtkTreeView *treeview) { - DEBUG("Accel cleared"); + DEBUG ("Accel cleared"); + + GtkTreeModel *model; + GtkTreeIter iter; - GtkTreeModel *model; - GtkTreeIter iter; + // Update treeview + model = gtk_tree_view_get_model (treeview); - // Update treeview - model = gtk_tree_view_get_model(treeview); - if (gtk_tree_model_get_iter_from_string(model, &iter, path)) - gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, 0, VALUE, 0, -1); + if (gtk_tree_model_get_iter_from_string (model, &iter, path)) + gtk_list_store_set (GTK_LIST_STORE (model), &iter, MASK, 0, VALUE, 0, -1); - // Update GDK bindings - shortcuts_update_bindings(atoi(path), 0); + // Update GDK bindings + shortcuts_update_bindings (atoi (path), 0); } diff --git a/sflphone-client-gnome/src/config/shortcuts-config.h b/sflphone-client-gnome/src/config/shortcuts-config.h index 02682ab0a1631384205a7ae4939c4ae25fa48610..10a4b85bfffb81c50dc50eb468bab733e0b8c09e 100644 --- a/sflphone-client-gnome/src/config/shortcuts-config.h +++ b/sflphone-client-gnome/src/config/shortcuts-config.h @@ -39,9 +39,8 @@ G_BEGIN_DECLS -enum -{ - ACTION = 0, MASK, VALUE, COLUMNS +enum { + ACTION = 0, MASK, VALUE, COLUMNS }; GtkWidget* @@ -52,11 +51,11 @@ setup_tree_view (GtkWidget *treeview); static void accel_edited (GtkCellRendererAccel *renderer, gchar *path, guint accel_key, - GdkModifierType mask, guint hardware_keycode, GtkTreeView *treeview); + GdkModifierType mask, guint hardware_keycode, GtkTreeView *treeview); static void accel_cleared (GtkCellRendererAccel *renderer, gchar *path, - GtkTreeView *treeview); + GtkTreeView *treeview); G_END_DECLS diff --git a/sflphone-client-gnome/src/config/tlsadvanceddialog.c b/sflphone-client-gnome/src/config/tlsadvanceddialog.c index 4050d0338f8ba1b2714ba083b29681444689afaf..530880d7957b23051f8c6deb910219a765f5eeab 100644 --- a/sflphone-client-gnome/src/config/tlsadvanceddialog.c +++ b/sflphone-client-gnome/src/config/tlsadvanceddialog.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -41,328 +41,326 @@ #include <libsexy/sexy-icon-entry.h> #endif -void show_advanced_tls_options(GHashTable * properties) +void show_advanced_tls_options (GHashTable * properties) { GtkDialog * tlsDialog; GtkWidget * ret; - - tlsDialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Advanced options for TLS"), - GTK_WINDOW(get_main_window()), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, - GTK_RESPONSE_ACCEPT, - NULL)); - - gtk_window_set_policy( GTK_WINDOW(tlsDialog), FALSE, FALSE, FALSE ); - gtk_dialog_set_has_separator(tlsDialog, TRUE); - gtk_container_set_border_width (GTK_CONTAINER(tlsDialog), 0); - - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - gtk_box_pack_start(GTK_BOX(tlsDialog->vbox), ret, FALSE, FALSE, 0); - - GtkWidget *frame, *table; - gnome_main_section_new_with_table (_("TLS transport"), &frame, &table, 3, 13); - gtk_container_set_border_width(GTK_CONTAINER (table), 10); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - gchar * description = g_markup_printf_escaped(_("TLS transport can be used along with UDP for those calls that would\n"\ - "require secure sip transactions (aka SIPS). You can configure a different\n"\ - "TLS transport for each account. However, each of them will run on a dedicated\n"\ - "port, different one from each other\n")); - GtkWidget * label; - label = gtk_label_new(NULL); - gtk_widget_set_size_request(label, 600, 70); - gtk_label_set_line_wrap (GTK_LABEL(label), TRUE); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_label_set_markup(GTK_LABEL(label), description); - gtk_table_attach(GTK_TABLE(table), label, 0, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + + tlsDialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_ ("Advanced options for TLS"), + GTK_WINDOW (get_main_window()), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, + GTK_RESPONSE_ACCEPT, + NULL)); + + gtk_window_set_policy (GTK_WINDOW (tlsDialog), FALSE, FALSE, FALSE); + gtk_dialog_set_has_separator (tlsDialog, TRUE); + gtk_container_set_border_width (GTK_CONTAINER (tlsDialog), 0); + + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (ret), 10); + gtk_box_pack_start (GTK_BOX (tlsDialog->vbox), ret, FALSE, FALSE, 0); + + GtkWidget *frame, *table; + gnome_main_section_new_with_table (_ ("TLS transport"), &frame, &table, 3, 13); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + gchar * description = g_markup_printf_escaped (_ ("TLS transport can be used along with UDP for those calls that would\n"\ + "require secure sip transactions (aka SIPS). You can configure a different\n"\ + "TLS transport for each account. However, each of them will run on a dedicated\n"\ + "port, different one from each other\n")); + GtkWidget * label; + label = gtk_label_new (NULL); + gtk_widget_set_size_request (label, 600, 70); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_label_set_markup (GTK_LABEL (label), description); + gtk_table_attach (GTK_TABLE (table), label, 0, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gchar * account_id; gchar * tls_listener_port; gchar * tls_ca_list_file; gchar * tls_certificate_file; gchar * tls_private_key_file; - gchar * tls_password; + gchar * tls_password; gchar * tls_method; gchar * tls_ciphers; gchar * tls_server_name; - gchar * verify_server; - gchar * verify_client; - gchar * require_client_certificate; + gchar * verify_server; + gchar * verify_client; + gchar * require_client_certificate; gchar * negotiation_timeout_sec; - gchar * negotiation_timeout_msec; + gchar * negotiation_timeout_msec; if (properties != NULL) { - account_id = g_hash_table_lookup(properties, ACCOUNT_ID); - tls_listener_port = g_hash_table_lookup(properties, TLS_LISTENER_PORT); - tls_ca_list_file = g_hash_table_lookup(properties, TLS_CA_LIST_FILE); - tls_certificate_file = g_hash_table_lookup(properties, TLS_CERTIFICATE_FILE); - tls_private_key_file = g_hash_table_lookup(properties, TLS_PRIVATE_KEY_FILE); - tls_password = g_hash_table_lookup(properties, TLS_PASSWORD); - tls_method = g_hash_table_lookup(properties, TLS_METHOD); - tls_ciphers = g_hash_table_lookup(properties, TLS_CIPHERS); - tls_server_name = g_hash_table_lookup(properties, TLS_SERVER_NAME); - verify_server = g_hash_table_lookup(properties, TLS_VERIFY_SERVER); - verify_client = g_hash_table_lookup(properties, TLS_VERIFY_CLIENT); - require_client_certificate = g_hash_table_lookup(properties, TLS_REQUIRE_CLIENT_CERTIFICATE); - negotiation_timeout_sec = g_hash_table_lookup(properties, TLS_NEGOTIATION_TIMEOUT_SEC); - negotiation_timeout_msec = g_hash_table_lookup(properties, TLS_NEGOTIATION_TIMEOUT_MSEC); + account_id = g_hash_table_lookup (properties, ACCOUNT_ID); + tls_listener_port = g_hash_table_lookup (properties, TLS_LISTENER_PORT); + tls_ca_list_file = g_hash_table_lookup (properties, TLS_CA_LIST_FILE); + tls_certificate_file = g_hash_table_lookup (properties, TLS_CERTIFICATE_FILE); + tls_private_key_file = g_hash_table_lookup (properties, TLS_PRIVATE_KEY_FILE); + tls_password = g_hash_table_lookup (properties, TLS_PASSWORD); + tls_method = g_hash_table_lookup (properties, TLS_METHOD); + tls_ciphers = g_hash_table_lookup (properties, TLS_CIPHERS); + tls_server_name = g_hash_table_lookup (properties, TLS_SERVER_NAME); + verify_server = g_hash_table_lookup (properties, TLS_VERIFY_SERVER); + verify_client = g_hash_table_lookup (properties, TLS_VERIFY_CLIENT); + require_client_certificate = g_hash_table_lookup (properties, TLS_REQUIRE_CLIENT_CERTIFICATE); + negotiation_timeout_sec = g_hash_table_lookup (properties, TLS_NEGOTIATION_TIMEOUT_SEC); + negotiation_timeout_msec = g_hash_table_lookup (properties, TLS_NEGOTIATION_TIMEOUT_MSEC); } - - label = gtk_label_new(_("Global TLS listener (all accounts)")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - GtkWidget * tlsListenerPort; - GtkWidget * hbox = gtk_hbox_new(FALSE, 10); - gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - tlsListenerPort = gtk_spin_button_new_with_range(0, 65535, 1); - gtk_label_set_mnemonic_widget(GTK_LABEL (label), tlsListenerPort); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(tlsListenerPort), g_ascii_strtod(tls_listener_port, NULL)); - gtk_box_pack_start_defaults(GTK_BOX(hbox), tlsListenerPort); - - if(g_strcmp0(account_id, IP2IP_PROFILE) != 0) { - gtk_widget_set_sensitive(tlsListenerPort, FALSE); + + label = gtk_label_new (_ ("Global TLS listener (all accounts)")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + GtkWidget * tlsListenerPort; + GtkWidget * hbox = gtk_hbox_new (FALSE, 10); + gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + tlsListenerPort = gtk_spin_button_new_with_range (0, 65535, 1); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), tlsListenerPort); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (tlsListenerPort), g_ascii_strtod (tls_listener_port, NULL)); + gtk_box_pack_start_defaults (GTK_BOX (hbox), tlsListenerPort); + + if (g_strcmp0 (account_id, IP2IP_PROFILE) != 0) { + gtk_widget_set_sensitive (tlsListenerPort, FALSE); } - - label = gtk_label_new( _("Certificate of Authority list")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new (_ ("Certificate of Authority list")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * caListFileChooser; - caListFileChooser = gtk_file_chooser_button_new(_("Choose a CA list file (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_table_attach (GTK_TABLE(table), caListFileChooser, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + caListFileChooser = gtk_file_chooser_button_new (_ ("Choose a CA list file (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); + gtk_table_attach (GTK_TABLE (table), caListFileChooser, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); if (tls_ca_list_file == NULL) { - gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); + gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (caListFileChooser)); - } - else { - if(g_strcmp0(tls_ca_list_file, "") == 0) { + } else { + if (g_strcmp0 (tls_ca_list_file, "") == 0) { - gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); - } - else{ + gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (caListFileChooser)); + } else { - GFile * file = g_file_new_for_path(tls_ca_list_file); - gtk_file_chooser_set_file (GTK_FILE_CHOOSER(caListFileChooser), file, NULL); - g_object_unref(file); - } + GFile * file = g_file_new_for_path (tls_ca_list_file); + gtk_file_chooser_set_file (GTK_FILE_CHOOSER (caListFileChooser), file, NULL); + g_object_unref (file); + } } - label = gtk_label_new( _("Public endpoint certificate file")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new (_ ("Public endpoint certificate file")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * certificateFileChooser; - certificateFileChooser = gtk_file_chooser_button_new(_("Choose a public endpoint certificate (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_table_attach (GTK_TABLE(table), certificateFileChooser, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + certificateFileChooser = gtk_file_chooser_button_new (_ ("Choose a public endpoint certificate (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); + gtk_table_attach (GTK_TABLE (table), certificateFileChooser, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); if (tls_certificate_file == NULL) { // gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(caListFileChooser), g_get_home_dir()); - gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); + gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (caListFileChooser)); } else { - if(g_strcmp0(tls_certificate_file, "") == 0){ + if (g_strcmp0 (tls_certificate_file, "") == 0) { - gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(certificateFileChooser)); - } - else { + gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (certificateFileChooser)); + } else { - GFile * file = g_file_new_for_path(tls_certificate_file); - gtk_file_chooser_set_file (GTK_FILE_CHOOSER(certificateFileChooser), file, NULL); - g_object_unref(file); - } + GFile * file = g_file_new_for_path (tls_certificate_file); + gtk_file_chooser_set_file (GTK_FILE_CHOOSER (certificateFileChooser), file, NULL); + g_object_unref (file); + } } - - label = gtk_label_new(("Private key file")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new ( ("Private key file")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * privateKeyFileChooser; - privateKeyFileChooser = gtk_file_chooser_button_new(_("Choose a private key file (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_table_attach (GTK_TABLE(table), privateKeyFileChooser, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + privateKeyFileChooser = gtk_file_chooser_button_new (_ ("Choose a private key file (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); + gtk_table_attach (GTK_TABLE (table), privateKeyFileChooser, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); if (tls_private_key_file == NULL) { - gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); + gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (caListFileChooser)); } else { - if(g_strcmp0(tls_private_key_file, "") == 0) { + if (g_strcmp0 (tls_private_key_file, "") == 0) { - gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(privateKeyFileChooser)); - } - else { + gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (privateKeyFileChooser)); + } else { - GFile * file = g_file_new_for_path(tls_private_key_file); - gtk_file_chooser_set_file (GTK_FILE_CHOOSER(privateKeyFileChooser), file, NULL); - g_object_unref(file); + GFile * file = g_file_new_for_path (tls_private_key_file); + gtk_file_chooser_set_file (GTK_FILE_CHOOSER (privateKeyFileChooser), file, NULL); + g_object_unref (file); - } + } } - - label = gtk_label_new_with_mnemonic (_("Password for the private key")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - GtkWidget * privateKeyPasswordEntry; + + label = gtk_label_new_with_mnemonic (_ ("Password for the private key")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + GtkWidget * privateKeyPasswordEntry; #if GTK_CHECK_VERSION(2,16,0) - privateKeyPasswordEntry = gtk_entry_new(); - gtk_entry_set_icon_from_stock (GTK_ENTRY (privateKeyPasswordEntry), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); + privateKeyPasswordEntry = gtk_entry_new(); + gtk_entry_set_icon_from_stock (GTK_ENTRY (privateKeyPasswordEntry), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); #else - privateKeyPasswordEntry = sexy_icon_entry_new(); - GtkWidget * image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); - sexy_icon_entry_set_icon(SEXY_ICON_ENTRY(privateKeyPasswordEntry), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + privateKeyPasswordEntry = sexy_icon_entry_new(); + GtkWidget * image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (privateKeyPasswordEntry), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); #endif - gtk_entry_set_visibility(GTK_ENTRY(privateKeyPasswordEntry), FALSE); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), privateKeyPasswordEntry); - gtk_entry_set_text(GTK_ENTRY(privateKeyPasswordEntry), tls_password); - gtk_table_attach (GTK_TABLE(table), privateKeyPasswordEntry, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - /* TLS protocol methods */ - GtkListStore * tlsProtocolMethodListStore; + gtk_entry_set_visibility (GTK_ENTRY (privateKeyPasswordEntry), FALSE); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), privateKeyPasswordEntry); + gtk_entry_set_text (GTK_ENTRY (privateKeyPasswordEntry), tls_password); + gtk_table_attach (GTK_TABLE (table), privateKeyPasswordEntry, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + /* TLS protocol methods */ + GtkListStore * tlsProtocolMethodListStore; GtkTreeIter iter; GtkWidget * tlsProtocolMethodCombo; - - tlsProtocolMethodListStore = gtk_list_store_new( 1, G_TYPE_STRING ); - label = gtk_label_new_with_mnemonic (_("TLS protocol method")); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - - gchar** supported_tls_method = NULL; + + tlsProtocolMethodListStore = gtk_list_store_new (1, G_TYPE_STRING); + label = gtk_label_new_with_mnemonic (_ ("TLS protocol method")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + gchar** supported_tls_method = NULL; supported_tls_method = dbus_get_supported_tls_method(); GtkTreeIter supported_tls_method_iter = iter; + if (supported_tls_method != NULL) { char **supported_tls_method_ptr; + for (supported_tls_method_ptr = supported_tls_method; *supported_tls_method_ptr; supported_tls_method_ptr++) { - DEBUG("Supported Method %s", *supported_tls_method_ptr); - gtk_list_store_append(tlsProtocolMethodListStore, &iter ); - gtk_list_store_set(tlsProtocolMethodListStore, &iter, 0, *supported_tls_method_ptr, -1 ); - - if (g_strcmp0(*supported_tls_method_ptr, tls_method) == 0) { - DEBUG("Setting active element in TLS protocol combo box"); + DEBUG ("Supported Method %s", *supported_tls_method_ptr); + gtk_list_store_append (tlsProtocolMethodListStore, &iter); + gtk_list_store_set (tlsProtocolMethodListStore, &iter, 0, *supported_tls_method_ptr, -1); + + if (g_strcmp0 (*supported_tls_method_ptr, tls_method) == 0) { + DEBUG ("Setting active element in TLS protocol combo box"); supported_tls_method_iter = iter; } } } - - tlsProtocolMethodCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(tlsProtocolMethodListStore)); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), tlsProtocolMethodCombo); - gtk_table_attach(GTK_TABLE(table), tlsProtocolMethodCombo, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - g_object_unref(G_OBJECT(tlsProtocolMethodListStore)); - + + tlsProtocolMethodCombo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (tlsProtocolMethodListStore)); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), tlsProtocolMethodCombo); + gtk_table_attach (GTK_TABLE (table), tlsProtocolMethodCombo, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + g_object_unref (G_OBJECT (tlsProtocolMethodListStore)); + GtkCellRenderer *tlsProtocolMethodCellRenderer; tlsProtocolMethodCellRenderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(tlsProtocolMethodCombo), tlsProtocolMethodCellRenderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(tlsProtocolMethodCombo), tlsProtocolMethodCellRenderer, "text", 0, NULL); - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(tlsProtocolMethodCombo), &supported_tls_method_iter); - + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (tlsProtocolMethodCombo), tlsProtocolMethodCellRenderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (tlsProtocolMethodCombo), tlsProtocolMethodCellRenderer, "text", 0, NULL); + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (tlsProtocolMethodCombo), &supported_tls_method_iter); + /* Cipher list */ GtkWidget * cipherListEntry; - label = gtk_label_new_with_mnemonic (_("TLS cipher list")); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + label = gtk_label_new_with_mnemonic (_ ("TLS cipher list")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); cipherListEntry = gtk_entry_new(); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), cipherListEntry); - gtk_entry_set_text(GTK_ENTRY(cipherListEntry), tls_ciphers); - gtk_table_attach (GTK_TABLE(table), cipherListEntry, 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + gtk_label_set_mnemonic_widget (GTK_LABEL (label), cipherListEntry); + gtk_entry_set_text (GTK_ENTRY (cipherListEntry), tls_ciphers); + gtk_table_attach (GTK_TABLE (table), cipherListEntry, 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + GtkWidget * serverNameInstance; - label = gtk_label_new_with_mnemonic (_("Server name instance for outgoing TLS connection")); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + label = gtk_label_new_with_mnemonic (_ ("Server name instance for outgoing TLS connection")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); serverNameInstance = gtk_entry_new(); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), serverNameInstance); - gtk_entry_set_text(GTK_ENTRY(serverNameInstance), tls_server_name); - gtk_table_attach (GTK_TABLE(table), serverNameInstance, 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - label = gtk_label_new(_("Negotiation timeout (sec:msec)")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - GtkWidget * tlsTimeOutSec; - hbox = gtk_hbox_new(FALSE, 10); - gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - tlsTimeOutSec = gtk_spin_button_new_with_range(0, pow(2,sizeof(long)), 1); - gtk_label_set_mnemonic_widget(GTK_LABEL (label), tlsTimeOutSec); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(tlsTimeOutSec), g_ascii_strtod(negotiation_timeout_sec, NULL)); - gtk_box_pack_start_defaults(GTK_BOX(hbox), tlsTimeOutSec); - GtkWidget * tlsTimeOutMSec; - tlsTimeOutMSec = gtk_spin_button_new_with_range(0, pow(2,sizeof(long)), 1); - gtk_label_set_mnemonic_widget(GTK_LABEL (label), tlsTimeOutMSec); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(tlsTimeOutMSec), g_ascii_strtod(negotiation_timeout_msec, NULL)); - gtk_box_pack_start_defaults(GTK_BOX(hbox), tlsTimeOutMSec); - + gtk_label_set_mnemonic_widget (GTK_LABEL (label), serverNameInstance); + gtk_entry_set_text (GTK_ENTRY (serverNameInstance), tls_server_name); + gtk_table_attach (GTK_TABLE (table), serverNameInstance, 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new (_ ("Negotiation timeout (sec:msec)")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + GtkWidget * tlsTimeOutSec; + hbox = gtk_hbox_new (FALSE, 10); + gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + tlsTimeOutSec = gtk_spin_button_new_with_range (0, pow (2,sizeof (long)), 1); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), tlsTimeOutSec); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (tlsTimeOutSec), g_ascii_strtod (negotiation_timeout_sec, NULL)); + gtk_box_pack_start_defaults (GTK_BOX (hbox), tlsTimeOutSec); + GtkWidget * tlsTimeOutMSec; + tlsTimeOutMSec = gtk_spin_button_new_with_range (0, pow (2,sizeof (long)), 1); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), tlsTimeOutMSec); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (tlsTimeOutMSec), g_ascii_strtod (negotiation_timeout_msec, NULL)); + gtk_box_pack_start_defaults (GTK_BOX (hbox), tlsTimeOutMSec); + GtkWidget * verifyCertificateServer; - verifyCertificateServer = gtk_check_button_new_with_mnemonic(_("Verify incoming certificates, as a server")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateServer), - g_strcasecmp(verify_server,"true") == 0 ? TRUE: FALSE); - gtk_table_attach (GTK_TABLE(table), verifyCertificateServer, 0, 1, 11, 12, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + verifyCertificateServer = gtk_check_button_new_with_mnemonic (_ ("Verify incoming certificates, as a server")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (verifyCertificateServer), + g_strcasecmp (verify_server,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (table), verifyCertificateServer, 0, 1, 11, 12, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * verifyCertificateClient; - verifyCertificateClient = gtk_check_button_new_with_mnemonic(_("Verify certificates from answer, as a client")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateClient), - g_strcasecmp(verify_client,"true") == 0 ? TRUE: FALSE); - gtk_table_attach (GTK_TABLE(table), verifyCertificateClient, 0, 1, 12, 13, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + verifyCertificateClient = gtk_check_button_new_with_mnemonic (_ ("Verify certificates from answer, as a client")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (verifyCertificateClient), + g_strcasecmp (verify_client,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (table), verifyCertificateClient, 0, 1, 12, 13, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * requireCertificate; - requireCertificate = gtk_check_button_new_with_mnemonic(_("Require certificate for incoming tls connections")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(requireCertificate), - g_strcasecmp(require_client_certificate,"true") == 0 ? TRUE: FALSE); - gtk_table_attach (GTK_TABLE(table), requireCertificate, 0, 1, 13, 14, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - gtk_widget_show_all(ret); - - if(gtk_dialog_run(GTK_DIALOG(tlsDialog)) == GTK_RESPONSE_ACCEPT) { - - g_hash_table_replace(properties, - g_strdup(TLS_LISTENER_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsListenerPort)))); - g_hash_table_replace(properties, - g_strdup(TLS_CA_LIST_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(caListFileChooser)))); - - g_hash_table_replace(properties, - g_strdup(TLS_CERTIFICATE_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(certificateFileChooser)))); - - g_hash_table_replace(properties, - g_strdup(TLS_PRIVATE_KEY_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(privateKeyFileChooser)))); - - g_hash_table_replace(properties, - g_strdup(TLS_PASSWORD), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(privateKeyPasswordEntry)))); - - g_hash_table_replace(properties, - g_strdup(TLS_METHOD), - g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(tlsProtocolMethodCombo)))); - - g_hash_table_replace(properties, - g_strdup(TLS_CIPHERS), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(cipherListEntry)))); - - g_hash_table_replace(properties, - g_strdup(TLS_SERVER_NAME), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(serverNameInstance)))); - - g_hash_table_replace(properties, - g_strdup(TLS_VERIFY_SERVER), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(verifyCertificateServer)) ? "true": "false")); - - g_hash_table_replace(properties, - g_strdup(TLS_VERIFY_CLIENT), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(verifyCertificateClient)) ? "true": "false")); - - g_hash_table_replace(properties, - g_strdup(TLS_REQUIRE_CLIENT_CERTIFICATE), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(requireCertificate)) ? "true": "false")); - - g_hash_table_replace(properties, - g_strdup(TLS_NEGOTIATION_TIMEOUT_SEC), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsTimeOutSec)))); - - g_hash_table_replace(properties, - g_strdup(TLS_NEGOTIATION_TIMEOUT_MSEC), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsTimeOutMSec)))); - } - - gtk_widget_destroy (GTK_WIDGET(tlsDialog)); + requireCertificate = gtk_check_button_new_with_mnemonic (_ ("Require certificate for incoming tls connections")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (requireCertificate), + g_strcasecmp (require_client_certificate,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (table), requireCertificate, 0, 1, 13, 14, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + gtk_widget_show_all (ret); + + if (gtk_dialog_run (GTK_DIALOG (tlsDialog)) == GTK_RESPONSE_ACCEPT) { + + g_hash_table_replace (properties, + g_strdup (TLS_LISTENER_PORT), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (tlsListenerPort)))); + g_hash_table_replace (properties, + g_strdup (TLS_CA_LIST_FILE), g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (caListFileChooser)))); + + g_hash_table_replace (properties, + g_strdup (TLS_CERTIFICATE_FILE), g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (certificateFileChooser)))); + + g_hash_table_replace (properties, + g_strdup (TLS_PRIVATE_KEY_FILE), g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (privateKeyFileChooser)))); + + g_hash_table_replace (properties, + g_strdup (TLS_PASSWORD), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (privateKeyPasswordEntry)))); + + g_hash_table_replace (properties, + g_strdup (TLS_METHOD), + g_strdup ( (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (tlsProtocolMethodCombo)))); + + g_hash_table_replace (properties, + g_strdup (TLS_CIPHERS), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (cipherListEntry)))); + + g_hash_table_replace (properties, + g_strdup (TLS_SERVER_NAME), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (serverNameInstance)))); + + g_hash_table_replace (properties, + g_strdup (TLS_VERIFY_SERVER), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (verifyCertificateServer)) ? "true": "false")); + + g_hash_table_replace (properties, + g_strdup (TLS_VERIFY_CLIENT), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (verifyCertificateClient)) ? "true": "false")); + + g_hash_table_replace (properties, + g_strdup (TLS_REQUIRE_CLIENT_CERTIFICATE), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (requireCertificate)) ? "true": "false")); + + g_hash_table_replace (properties, + g_strdup (TLS_NEGOTIATION_TIMEOUT_SEC), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (tlsTimeOutSec)))); + + g_hash_table_replace (properties, + g_strdup (TLS_NEGOTIATION_TIMEOUT_MSEC), + g_strdup ( (gchar *) gtk_entry_get_text (GTK_ENTRY (tlsTimeOutMSec)))); + } + + gtk_widget_destroy (GTK_WIDGET (tlsDialog)); } diff --git a/sflphone-client-gnome/src/config/tlsadvanceddialog.h b/sflphone-client-gnome/src/config/tlsadvanceddialog.h index 4c7ed3a37f04144264d4410b3d54c33d3209ca8b..d60fdf8e9a1c2f96339547e937699c9364c00fd8 100644 --- a/sflphone-client-gnome/src/config/tlsadvanceddialog.h +++ b/sflphone-client-gnome/src/config/tlsadvanceddialog.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __SFL_TLS_ADVANCED_DIALOG__ #define __SFL_TLS_ADVANCED_DIALOG__ /** @file tlsadvanceddialog.h @@ -37,10 +37,10 @@ #include <glib.h> #include <mainwindow.h> -/** +/** * Display the advanced options window for zrtp - */ + */ -void show_advanced_tls_options(GHashTable * properties); +void show_advanced_tls_options (GHashTable * properties); -#endif +#endif diff --git a/sflphone-client-gnome/src/config/utils.c b/sflphone-client-gnome/src/config/utils.c index 7049d796069507e169258f9e792f4c02ed8cb18a..ded55acc62272e06b2bd6192e5bc6bab29e18532 100644 --- a/sflphone-client-gnome/src/config/utils.c +++ b/sflphone-client-gnome/src/config/utils.c @@ -32,7 +32,7 @@ void gnome_main_section_new_with_table (gchar *title, GtkWidget **frame, GtkWidget **table, gint nb_col, gint nb_row) { - GtkWidget *_frame, *_table, *label, *align; + GtkWidget *_frame, *_table, *label, *align; PangoAttrList *attrs = NULL; PangoAttribute *attr = NULL; @@ -44,28 +44,28 @@ void gnome_main_section_new_with_table (gchar *title, GtkWidget **frame, GtkWidg _frame = gtk_frame_new (title); gtk_frame_set_shadow_type (GTK_FRAME (_frame), GTK_SHADOW_NONE); - gtk_container_set_border_width(GTK_CONTAINER(_frame), 2); - + gtk_container_set_border_width (GTK_CONTAINER (_frame), 2); + label = gtk_frame_get_label_widget (GTK_FRAME (_frame)); gtk_label_set_attributes (GTK_LABEL (label), attrs); pango_attr_list_unref (attrs); - align = gtk_alignment_new( 0.08, 0.2, 0.1, 0.1 ); - gtk_container_add( GTK_CONTAINER(_frame), align ); + align = gtk_alignment_new (0.08, 0.2, 0.1, 0.1); + gtk_container_add (GTK_CONTAINER (_frame), align); + + _table = gtk_table_new (nb_col, nb_row, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (_table), 2); + gtk_table_set_col_spacings (GTK_TABLE (_table), 2); + gtk_widget_show (_table); + gtk_container_add (GTK_CONTAINER (align), _table); - _table = gtk_table_new(nb_col, nb_row, FALSE); - gtk_table_set_row_spacings( GTK_TABLE(_table), 2); - gtk_table_set_col_spacings( GTK_TABLE(_table), 2); - gtk_widget_show(_table); - gtk_container_add( GTK_CONTAINER(align), _table ); - *table = _table; *frame = _frame; } void gnome_main_section_new_with_vbox (gchar *title, GtkWidget **frame, GtkWidget **vbox, gint nb_row) { - GtkWidget *_frame, *_vbox, *label, *align; + GtkWidget *_frame, *_vbox, *label, *align; PangoAttrList *attrs = NULL; PangoAttribute *attr = NULL; @@ -77,19 +77,19 @@ void gnome_main_section_new_with_vbox (gchar *title, GtkWidget **frame, GtkWidge _frame = gtk_frame_new (title); gtk_frame_set_shadow_type (GTK_FRAME (_frame), GTK_SHADOW_NONE); - gtk_container_set_border_width(GTK_CONTAINER(_frame), 2); - + gtk_container_set_border_width (GTK_CONTAINER (_frame), 2); + label = gtk_frame_get_label_widget (GTK_FRAME (_frame)); gtk_label_set_attributes (GTK_LABEL (label), attrs); pango_attr_list_unref (attrs); - align = gtk_alignment_new( 0.08, 0.2, 0.1, 0.1 ); - gtk_container_add( GTK_CONTAINER(_frame), align ); - - _vbox = gtk_vbox_new(FALSE, 10); - gtk_widget_show(_vbox); - gtk_container_add( GTK_CONTAINER(align), _vbox); - + align = gtk_alignment_new (0.08, 0.2, 0.1, 0.1); + gtk_container_add (GTK_CONTAINER (_frame), align); + + _vbox = gtk_vbox_new (FALSE, 10); + gtk_widget_show (_vbox); + gtk_container_add (GTK_CONTAINER (align), _vbox); + *vbox = _vbox; *frame = _frame; } @@ -99,7 +99,7 @@ void gnome_main_section_new (gchar *title, GtkWidget **frame) GtkWidget *_frame, *label; PangoAttrList *attrs = NULL; PangoAttribute *attr = NULL; - + attrs = pango_attr_list_new (); attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); attr->start_index = 0; @@ -108,8 +108,8 @@ void gnome_main_section_new (gchar *title, GtkWidget **frame) _frame = gtk_frame_new (title); gtk_frame_set_shadow_type (GTK_FRAME (_frame), GTK_SHADOW_NONE); - gtk_container_set_border_width(GTK_CONTAINER(_frame), 2); - + gtk_container_set_border_width (GTK_CONTAINER (_frame), 2); + label = gtk_frame_get_label_widget (GTK_FRAME (_frame)); gtk_label_set_attributes (GTK_LABEL (label), attrs); pango_attr_list_unref (attrs); diff --git a/sflphone-client-gnome/src/config/zrtpadvanceddialog.c b/sflphone-client-gnome/src/config/zrtpadvanceddialog.c index 469cf52a3c4230eef362788eab10485e329c3355..476565d2aead977d42cd642db65580961efd2f04 100644 --- a/sflphone-client-gnome/src/config/zrtpadvanceddialog.c +++ b/sflphone-client-gnome/src/config/zrtpadvanceddialog.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -34,7 +34,7 @@ #include <gtk/gtk.h> -void show_advanced_zrtp_options(GHashTable * properties) +void show_advanced_zrtp_options (GHashTable * properties) { GtkDialog * securityDialog; @@ -44,142 +44,143 @@ void show_advanced_zrtp_options(GHashTable * properties) GtkWidget * enableSASConfirm; GtkWidget * enableZrtpNotSuppOther; GtkWidget * displaySasOnce; - + gchar * curSasConfirm = "true"; gchar * curHelloEnabled = "true"; gchar * curZrtpNotSuppOther = "true"; gchar * curDisplaySasOnce = "false"; - - if(properties != NULL) { - curHelloEnabled = g_hash_table_lookup(properties, ACCOUNT_ZRTP_HELLO_HASH); - curSasConfirm = g_hash_table_lookup(properties, ACCOUNT_ZRTP_DISPLAY_SAS); - curZrtpNotSuppOther = g_hash_table_lookup(properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING); - curDisplaySasOnce = g_hash_table_lookup(properties, ACCOUNT_DISPLAY_SAS_ONCE); + + if (properties != NULL) { + curHelloEnabled = g_hash_table_lookup (properties, ACCOUNT_ZRTP_HELLO_HASH); + curSasConfirm = g_hash_table_lookup (properties, ACCOUNT_ZRTP_DISPLAY_SAS); + curZrtpNotSuppOther = g_hash_table_lookup (properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING); + curDisplaySasOnce = g_hash_table_lookup (properties, ACCOUNT_DISPLAY_SAS_ONCE); + } + + securityDialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_ ("ZRTP Options"), + GTK_WINDOW (get_main_window()), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, + GTK_RESPONSE_ACCEPT, + NULL) + ); + gtk_window_set_policy (GTK_WINDOW (securityDialog), FALSE, FALSE, FALSE); + gtk_dialog_set_has_separator (securityDialog, TRUE); + gtk_container_set_border_width (GTK_CONTAINER (securityDialog), 0); + + + tableZrtp = gtk_table_new (4, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings (GTK_TABLE (tableZrtp), 10); + gtk_table_set_col_spacings (GTK_TABLE (tableZrtp), 10); + gtk_box_pack_start (GTK_BOX (securityDialog->vbox), tableZrtp, FALSE, FALSE, 0); + gtk_widget_show (tableZrtp); + + enableHelloHash = gtk_check_button_new_with_mnemonic (_ ("Send Hello Hash in S_DP")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableHelloHash), + g_strcasecmp (curHelloEnabled,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (tableZrtp), enableHelloHash, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (enableHelloHash) , TRUE); + + enableSASConfirm = gtk_check_button_new_with_mnemonic (_ ("Ask User to Confirm SAS")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableSASConfirm), + g_strcasecmp (curSasConfirm,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (tableZrtp), enableSASConfirm, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (enableSASConfirm) , TRUE); + + enableZrtpNotSuppOther = gtk_check_button_new_with_mnemonic (_ ("_Warn if ZRTP not supported")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableZrtpNotSuppOther), + g_strcasecmp (curZrtpNotSuppOther,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (tableZrtp), enableZrtpNotSuppOther, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (enableZrtpNotSuppOther) , TRUE); + + displaySasOnce = gtk_check_button_new_with_mnemonic (_ ("Display SAS once for hold events")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (displaySasOnce), + g_strcasecmp (curDisplaySasOnce,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (tableZrtp), displaySasOnce, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (displaySasOnce) , TRUE); + + gtk_widget_show_all (tableZrtp); + + gtk_container_set_border_width (GTK_CONTAINER (tableZrtp), 10); + + if (gtk_dialog_run (GTK_DIALOG (securityDialog)) == GTK_RESPONSE_ACCEPT) { + g_hash_table_replace (properties, + g_strdup (ACCOUNT_ZRTP_DISPLAY_SAS), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (enableSASConfirm)) ? "true": "false")); + + g_hash_table_replace (properties, + g_strdup (ACCOUNT_DISPLAY_SAS_ONCE), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (displaySasOnce)) ? "true": "false")); + + g_hash_table_replace (properties, + g_strdup (ACCOUNT_ZRTP_HELLO_HASH), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (enableHelloHash)) ? "true": "false")); + + g_hash_table_replace (properties, + g_strdup (ACCOUNT_ZRTP_NOT_SUPP_WARNING), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (enableZrtpNotSuppOther)) ? "true": "false")); } - - securityDialog = GTK_DIALOG (gtk_dialog_new_with_buttons ( _("ZRTP Options"), - GTK_WINDOW (get_main_window()), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, - GTK_RESPONSE_ACCEPT, - NULL) - ); - gtk_window_set_policy( GTK_WINDOW(securityDialog), FALSE, FALSE, FALSE ); - gtk_dialog_set_has_separator(securityDialog, TRUE); - gtk_container_set_border_width (GTK_CONTAINER(securityDialog), 0); - - - tableZrtp = gtk_table_new (4, 2 , FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(tableZrtp), 10); - gtk_table_set_col_spacings( GTK_TABLE(tableZrtp), 10); - gtk_box_pack_start(GTK_BOX(securityDialog->vbox), tableZrtp, FALSE, FALSE, 0); - gtk_widget_show(tableZrtp); - - enableHelloHash = gtk_check_button_new_with_mnemonic(_("Send Hello Hash in S_DP")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableHelloHash), - g_strcasecmp(curHelloEnabled,"true") == 0 ? TRUE: FALSE); - gtk_table_attach ( GTK_TABLE(tableZrtp), enableHelloHash, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( enableHelloHash ) , TRUE ); - - enableSASConfirm = gtk_check_button_new_with_mnemonic(_("Ask User to Confirm SAS")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableSASConfirm), - g_strcasecmp(curSasConfirm,"true") == 0 ? TRUE: FALSE); - gtk_table_attach ( GTK_TABLE(tableZrtp), enableSASConfirm, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( enableSASConfirm ) , TRUE ); - - enableZrtpNotSuppOther = gtk_check_button_new_with_mnemonic(_("_Warn if ZRTP not supported")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableZrtpNotSuppOther), - g_strcasecmp(curZrtpNotSuppOther,"true") == 0 ? TRUE: FALSE); - gtk_table_attach ( GTK_TABLE(tableZrtp), enableZrtpNotSuppOther, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( enableZrtpNotSuppOther ) , TRUE ); - - displaySasOnce = gtk_check_button_new_with_mnemonic(_("Display SAS once for hold events")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(displaySasOnce), - g_strcasecmp(curDisplaySasOnce,"true") == 0 ? TRUE: FALSE); - gtk_table_attach ( GTK_TABLE(tableZrtp), displaySasOnce, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( displaySasOnce ) , TRUE ); - - gtk_widget_show_all(tableZrtp); - - gtk_container_set_border_width (GTK_CONTAINER(tableZrtp), 10); - - if(gtk_dialog_run(GTK_DIALOG(securityDialog)) == GTK_RESPONSE_ACCEPT) { - g_hash_table_replace(properties, - g_strdup(ACCOUNT_ZRTP_DISPLAY_SAS), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enableSASConfirm)) ? "true": "false")); - - g_hash_table_replace(properties, - g_strdup(ACCOUNT_DISPLAY_SAS_ONCE), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(displaySasOnce)) ? "true": "false")); - - g_hash_table_replace(properties, - g_strdup(ACCOUNT_ZRTP_HELLO_HASH), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enableHelloHash)) ? "true": "false")); - - g_hash_table_replace(properties, - g_strdup(ACCOUNT_ZRTP_NOT_SUPP_WARNING), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enableZrtpNotSuppOther)) ? "true": "false")); - } - - gtk_widget_destroy (GTK_WIDGET(securityDialog)); + + gtk_widget_destroy (GTK_WIDGET (securityDialog)); } -void show_advanced_sdes_options(GHashTable * properties) { +void show_advanced_sdes_options (GHashTable * properties) +{ GtkDialog * securityDialog; GtkWidget * sdesTable; GtkWidget * enableRtpFallback; gchar * rtpFallback = "false"; - - if(properties != NULL) { - rtpFallback = g_hash_table_lookup(properties, ACCOUNT_SRTP_RTP_FALLBACK); + + if (properties != NULL) { + rtpFallback = g_hash_table_lookup (properties, ACCOUNT_SRTP_RTP_FALLBACK); } - securityDialog = GTK_DIALOG (gtk_dialog_new_with_buttons ( _("SDES Options"), + securityDialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_ ("SDES Options"), + + GTK_WINDOW (get_main_window()), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_WINDOW (get_main_window()), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, - GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, - GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, - GTK_STOCK_SAVE, + GTK_RESPONSE_ACCEPT, - GTK_RESPONSE_ACCEPT, - - NULL)); + NULL)); - gtk_window_set_policy( GTK_WINDOW(securityDialog), FALSE, FALSE, FALSE ); - gtk_dialog_set_has_separator(securityDialog, TRUE); - gtk_container_set_border_width (GTK_CONTAINER(securityDialog), 0); + gtk_window_set_policy (GTK_WINDOW (securityDialog), FALSE, FALSE, FALSE); + gtk_dialog_set_has_separator (securityDialog, TRUE); + gtk_container_set_border_width (GTK_CONTAINER (securityDialog), 0); - sdesTable = gtk_table_new (1, 2 , FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(sdesTable), 10); - gtk_table_set_col_spacings( GTK_TABLE(sdesTable), 10); - gtk_box_pack_start(GTK_BOX(securityDialog->vbox), sdesTable, FALSE, FALSE, 0); - gtk_widget_show(sdesTable); + sdesTable = gtk_table_new (1, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings (GTK_TABLE (sdesTable), 10); + gtk_table_set_col_spacings (GTK_TABLE (sdesTable), 10); + gtk_box_pack_start (GTK_BOX (securityDialog->vbox), sdesTable, FALSE, FALSE, 0); + gtk_widget_show (sdesTable); - enableRtpFallback = gtk_check_button_new_with_mnemonic(_("Fallback on RTP on SDES failure")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableRtpFallback), - g_strcasecmp(rtpFallback,"true") == 0 ? TRUE: FALSE); - gtk_table_attach ( GTK_TABLE(sdesTable), enableRtpFallback, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive( GTK_WIDGET( enableRtpFallback ) , TRUE ); + enableRtpFallback = gtk_check_button_new_with_mnemonic (_ ("Fallback on RTP on SDES failure")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableRtpFallback), + g_strcasecmp (rtpFallback,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE (sdesTable), enableRtpFallback, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (enableRtpFallback) , TRUE); - gtk_widget_show_all(sdesTable); + gtk_widget_show_all (sdesTable); + + gtk_container_set_border_width (GTK_CONTAINER (sdesTable), 10); + + if (gtk_dialog_run (GTK_DIALOG (securityDialog)) == GTK_RESPONSE_ACCEPT) { + g_hash_table_replace (properties, + g_strdup (ACCOUNT_SRTP_RTP_FALLBACK), + g_strdup (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (enableRtpFallback)) ? "true": "false")); + } - gtk_container_set_border_width (GTK_CONTAINER(sdesTable), 10); - - if(gtk_dialog_run(GTK_DIALOG(securityDialog)) == GTK_RESPONSE_ACCEPT) { - g_hash_table_replace(properties, - g_strdup(ACCOUNT_SRTP_RTP_FALLBACK), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enableRtpFallback)) ? "true": "false")); - } - - gtk_widget_destroy (GTK_WIDGET(securityDialog)); + gtk_widget_destroy (GTK_WIDGET (securityDialog)); } diff --git a/sflphone-client-gnome/src/config/zrtpadvanceddialog.h b/sflphone-client-gnome/src/config/zrtpadvanceddialog.h index c561d6a1f15f8e10167149ae91aa39e3f07e4678..fc6f4ec839887c5b6c9b19b2f2b26a4473482328 100644 --- a/sflphone-client-gnome/src/config/zrtpadvanceddialog.h +++ b/sflphone-client-gnome/src/config/zrtpadvanceddialog.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __SFL_ZRTP_ADVANCED_DIALOG__ #define __SFL_ZRTP_ADVANCED_DIALOG__ /** @file zrtpadvanceddialog.h @@ -36,12 +36,12 @@ #include <glib.h> #include <mainwindow.h> -/** +/** * Display the advanced options window for zrtp - */ + */ -void show_advanced_zrtp_options(GHashTable * properties); +void show_advanced_zrtp_options (GHashTable * properties); -void show_advanced_sdes_options(GHashTable * properties); +void show_advanced_sdes_options (GHashTable * properties); -#endif +#endif diff --git a/sflphone-client-gnome/src/contacts/addressbook.c b/sflphone-client-gnome/src/contacts/addressbook.c index 9c7e8d38b449dcc762d00d66dc0d4d320e7b4d65..0b38124c1df3840437de6448c455771bafaa24dd 100644 --- a/sflphone-client-gnome/src/contacts/addressbook.c +++ b/sflphone-client-gnome/src/contacts/addressbook.c @@ -34,28 +34,29 @@ #include <addressbook-config.h> static void -handler_async_search(GList *, gpointer); +handler_async_search (GList *, gpointer); /** * Perform a search on address book */ void -addressbook_search(GtkEntry* entry) +addressbook_search (GtkEntry* entry) { - const gchar* query = gtk_entry_get_text(GTK_ENTRY (entry)); - if (strlen(query) >= 3) { + const gchar* query = gtk_entry_get_text (GTK_ENTRY (entry)); + + if (strlen (query) >= 3) { AddressBook_Config *addressbook_config; - - // Activate waiting layer - activateWaitingLayer(); - // Load the address book parameters - addressbook_config_load_parameters(&addressbook_config); - - // Start the asynchronous search as soon as we have an entry */ - search_async(gtk_entry_get_text(GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, addressbook_config); + // Activate waiting layer + activateWaitingLayer(); + + // Load the address book parameters + addressbook_config_load_parameters (&addressbook_config); + + // Start the asynchronous search as soon as we have an entry */ + search_async (gtk_entry_get_text (GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, addressbook_config); } } @@ -66,12 +67,12 @@ addressbook_search(GtkEntry* entry) gboolean addressbook_is_enabled() { - AddressBook_Config *addressbook_config; - - // Load the address book parameters - addressbook_config_load_parameters(&addressbook_config); + AddressBook_Config *addressbook_config; - return (guint)addressbook_config->enable; + // Load the address book parameters + addressbook_config_load_parameters (&addressbook_config); + + return (guint) addressbook_config->enable; } /** @@ -80,7 +81,7 @@ addressbook_is_enabled() gboolean addressbook_is_ready() { - return books_ready(); + return books_ready(); } /** @@ -89,7 +90,7 @@ addressbook_is_ready() gboolean addressbook_is_active() { - return books_active(); + return books_active(); } /** @@ -100,31 +101,32 @@ static void addressbook_config_books() { - gchar **config_book_uid; - book_data_t *book_data; - gchar **list; + gchar **config_book_uid; + book_data_t *book_data; + gchar **list; - // Retrieve list of books - list = (gchar **) dbus_get_addressbook_list(); + // Retrieve list of books + list = (gchar **) dbus_get_addressbook_list(); - if (list) { + if (list) { - for (config_book_uid = list; *config_book_uid; config_book_uid++) { + for (config_book_uid = list; *config_book_uid; config_book_uid++) { - // Get corresponding book data - book_data = books_get_book_data_by_uid(*config_book_uid); + // Get corresponding book data + book_data = books_get_book_data_by_uid (*config_book_uid); - // If book_data exists - if (book_data != NULL) { + // If book_data exists + if (book_data != NULL) { - book_data->active = TRUE; - } - } - g_strfreev(list); - } + book_data->active = TRUE; + } + } - // Update buttons - update_actions (); + g_strfreev (list); + } + + // Update buttons + update_actions (); } /** @@ -133,8 +135,8 @@ addressbook_config_books() GSList * addressbook_get_books_data() { - addressbook_config_books(); - return books_data; + addressbook_config_books(); + return books_data; } /** @@ -144,66 +146,69 @@ addressbook_get_books_data() void addressbook_init() { - // Call books initialization - init(&addressbook_config_books); + // Call books initialization + init (&addressbook_config_books); } /** * Callback called after all book have been processed */ static void -handler_async_search(GList *hits, gpointer user_data) +handler_async_search (GList *hits, gpointer user_data) { - GList *i; - GdkPixbuf *photo = NULL; - AddressBook_Config *addressbook_config; - callable_obj_t *j; + GList *i; + GdkPixbuf *photo = NULL; + AddressBook_Config *addressbook_config; + callable_obj_t *j; - // freeing calls - while ((j = (callable_obj_t *) g_queue_pop_tail(contacts->callQueue)) != NULL) - { - free_callable_obj_t(j); + // freeing calls + while ( (j = (callable_obj_t *) g_queue_pop_tail (contacts->callQueue)) != NULL) { + free_callable_obj_t (j); } - // Retrieve the address book parameters - addressbook_config = (AddressBook_Config*) user_data; - - // reset previous results - calltree_reset(contacts); - calllist_reset(contacts); - - for (i = hits; i != NULL; i = i->next) - { - Hit *entry; - entry = i->data; - if (entry) - { - // Get the photo - if (addressbook_display(addressbook_config, - ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)) - photo = entry->photo; - // Create entry for business phone information - if (addressbook_display(addressbook_config, - ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)) - calllist_add_contact(entry->name, entry->phone_business, - CONTACT_PHONE_BUSINESS, photo); - // Create entry for home phone information - if (addressbook_display(addressbook_config, - ADDRESSBOOK_DISPLAY_PHONE_HOME)) - calllist_add_contact(entry->name, entry->phone_home, - CONTACT_PHONE_HOME, photo); - // Create entry for mobile phone information - if (addressbook_display(addressbook_config, - ADDRESSBOOK_DISPLAY_PHONE_MOBILE)) - calllist_add_contact(entry->name, entry->phone_mobile, - CONTACT_PHONE_MOBILE, photo); + // Retrieve the address book parameters + addressbook_config = (AddressBook_Config*) user_data; + + // reset previous results + calltree_reset (contacts); + calllist_reset (contacts); + + for (i = hits; i != NULL; i = i->next) { + Hit *entry; + entry = i->data; + + if (entry) { + // Get the photo + if (addressbook_display (addressbook_config, + ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)) + photo = entry->photo; + + // Create entry for business phone information + if (addressbook_display (addressbook_config, + ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)) + calllist_add_contact (entry->name, entry->phone_business, + CONTACT_PHONE_BUSINESS, photo); + + // Create entry for home phone information + if (addressbook_display (addressbook_config, + ADDRESSBOOK_DISPLAY_PHONE_HOME)) + calllist_add_contact (entry->name, entry->phone_home, + CONTACT_PHONE_HOME, photo); + + // Create entry for mobile phone information + if (addressbook_display (addressbook_config, + ADDRESSBOOK_DISPLAY_PHONE_MOBILE)) + calllist_add_contact (entry->name, entry->phone_mobile, + CONTACT_PHONE_MOBILE, photo); } - free_hit(entry); + + free_hit (entry); } - g_list_free(hits); - // Deactivate waiting image - deactivateWaitingLayer(); + g_list_free (hits); + + // Deactivate waiting image + deactivateWaitingLayer(); } diff --git a/sflphone-client-gnome/src/contacts/addressbook.h b/sflphone-client-gnome/src/contacts/addressbook.h index f87f9dba19ec292e18783d5abf57650e4bf12aa3..cc2760f035e558b431c234dacb434cfcfc8936ed 100644 --- a/sflphone-client-gnome/src/contacts/addressbook.h +++ b/sflphone-client-gnome/src/contacts/addressbook.h @@ -63,7 +63,7 @@ addressbook_is_active(); * Perform a search in addressbook */ void -addressbook_search(GtkEntry*); +addressbook_search (GtkEntry*); /** * Initialize addressbook diff --git a/sflphone-client-gnome/src/contacts/addressbook/eds.c b/sflphone-client-gnome/src/contacts/addressbook/eds.c index 236235313ffeedc298d07a695b3e71f11f25f4e1..6cb165d34bf6e91acd141bceb1b676d33b316ce5 100644 --- a/sflphone-client-gnome/src/contacts/addressbook/eds.c +++ b/sflphone-client-gnome/src/contacts/addressbook/eds.c @@ -44,22 +44,20 @@ /** * Structure used to store search callback and data */ -typedef struct _Search_Handler_And_Data -{ - int search_id; - SearchAsyncHandler handler; - gpointer user_data; - GList *hits; - int max_results_remaining; - int book_views_remaining; +typedef struct _Search_Handler_And_Data { + int search_id; + SearchAsyncHandler handler; + gpointer user_data; + GList *hits; + int max_results_remaining; + int book_views_remaining; } Search_Handler_And_Data; /** * Structure used to store open callback and data */ -typedef struct _Open_Handler_And_Data -{ - OpenAsyncHandler handler; +typedef struct _Open_Handler_And_Data { + OpenAsyncHandler handler; } Open_Handler_And_Data; /** @@ -75,8 +73,7 @@ int remaining_books_to_open; /** * Fields on which search will be performed */ -static EContactField search_fields[] = - { E_CONTACT_FULL_NAME, E_CONTACT_PHONE_BUSINESS, E_CONTACT_NICKNAME, 0 }; +static EContactField search_fields[] = { E_CONTACT_FULL_NAME, E_CONTACT_PHONE_BUSINESS, E_CONTACT_NICKNAME, 0 }; static int n_search_fields = G_N_ELEMENTS (search_fields) - 1; @@ -84,13 +81,13 @@ static int n_search_fields = G_N_ELEMENTS (search_fields) - 1; * Freeing a hit instance */ void -free_hit(Hit *h) +free_hit (Hit *h) { - g_free(h->name); - g_free(h->phone_business); - g_free(h->phone_home); - g_free(h->phone_mobile); - g_free(h); + g_free (h->name); + g_free (h->phone_business); + g_free (h->phone_home); + g_free (h->phone_mobile); + g_free (h); } /** @@ -99,7 +96,7 @@ free_hit(Hit *h) gboolean books_ready() { - return (g_slist_length(books_data) > 0); + return (g_slist_length (books_data) > 0); } /** @@ -108,203 +105,199 @@ books_ready() gboolean books_active() { - GSList *book_list_iterator; - book_data_t *book_data; - - // Iterate throw the list - for (book_list_iterator = books_data; book_list_iterator != NULL; book_list_iterator - = book_list_iterator->next) - { - book_data = (book_data_t *) book_list_iterator->data; - if (book_data->active) - return TRUE; + GSList *book_list_iterator; + book_data_t *book_data; + + // Iterate throw the list + for (book_list_iterator = books_data; book_list_iterator != NULL; book_list_iterator + = book_list_iterator->next) { + book_data = (book_data_t *) book_list_iterator->data; + + if (book_data->active) + return TRUE; } - // If no result - return FALSE; + // If no result + return FALSE; } /** * Get a specific book data by UID */ book_data_t * -books_get_book_data_by_uid(gchar *uid) +books_get_book_data_by_uid (gchar *uid) { - GSList *book_list_iterator; - book_data_t *book_data; - - // Iterate throw the list - for (book_list_iterator = books_data; book_list_iterator != NULL; book_list_iterator - = book_list_iterator->next) - { - book_data = (book_data_t *) book_list_iterator->data; - if (strcmp(book_data->uid, uid) == 0) - return book_data; + GSList *book_list_iterator; + book_data_t *book_data; + + // Iterate throw the list + for (book_list_iterator = books_data; book_list_iterator != NULL; book_list_iterator + = book_list_iterator->next) { + book_data = (book_data_t *) book_list_iterator->data; + + if (strcmp (book_data->uid, uid) == 0) + return book_data; } - // If no result - return NULL; + // If no result + return NULL; } /** * Split a string of tokens separated by whitespace into an array of tokens. */ static GArray * -split_query_string(const gchar *str) +split_query_string (const gchar *str) { - GArray *parts = g_array_sized_new(FALSE, FALSE, sizeof (char *), 2); - PangoLogAttr *attrs; - guint str_len = strlen (str), word_start = 0, i; - - attrs = g_new0 (PangoLogAttr, str_len + 1); - /* TODO: do we need to specify a particular language or is NULL ok? */ - pango_get_log_attrs (str, -1, -1, NULL, attrs, str_len + 1); - - for (i = 0; i < str_len + 1; i++) - { - char *start_word, *end_word, *word; - if (attrs[i].is_word_end) - { - start_word = g_utf8_offset_to_pointer (str, word_start); - end_word = g_utf8_offset_to_pointer (str, i); - word = g_strndup (start_word, end_word - start_word); - g_array_append_val (parts, word); + GArray *parts = g_array_sized_new (FALSE, FALSE, sizeof (char *), 2); + PangoLogAttr *attrs; + guint str_len = strlen (str), word_start = 0, i; + + attrs = g_new0 (PangoLogAttr, str_len + 1); + /* TODO: do we need to specify a particular language or is NULL ok? */ + pango_get_log_attrs (str, -1, -1, NULL, attrs, str_len + 1); + + for (i = 0; i < str_len + 1; i++) { + char *start_word, *end_word, *word; + + if (attrs[i].is_word_end) { + start_word = g_utf8_offset_to_pointer (str, word_start); + end_word = g_utf8_offset_to_pointer (str, i); + word = g_strndup (start_word, end_word - start_word); + g_array_append_val (parts, word); } - if (attrs[i].is_word_start) - { - word_start = i; + + if (attrs[i].is_word_start) { + word_start = i; } } - g_free (attrs); - return parts; + + g_free (attrs); + return parts; } - /** - * Create a query which looks for the specified string in a contact's full name, email addresses and - * nick name. - */ +/** + * Create a query which looks for the specified string in a contact's full name, email addresses and + * nick name. + */ static EBookQuery* -create_query(const char* s) +create_query (const char* s) { - EBookQuery *query; - GArray *parts = split_query_string(s); - EBookQuery ***field_queries; - EBookQuery **q; - EBookQuery **phone; - guint j; - int i; - - q = g_new0 (EBookQuery *, n_search_fields); - field_queries = g_new0 (EBookQuery **, n_search_fields); - - for (i = 0; i < n_search_fields; i++) - { - field_queries[i] = g_new0 (EBookQuery *, parts->len); - for (j = 0; j < parts->len; j++) - { - field_queries[i][j] = e_book_query_field_test(search_fields[i], - E_BOOK_QUERY_CONTAINS, g_array_index (parts, gchar *, j)); + EBookQuery *query; + GArray *parts = split_query_string (s); + EBookQuery ***field_queries; + EBookQuery **q; + EBookQuery **phone; + guint j; + int i; + + q = g_new0 (EBookQuery *, n_search_fields); + field_queries = g_new0 (EBookQuery **, n_search_fields); + + for (i = 0; i < n_search_fields; i++) { + field_queries[i] = g_new0 (EBookQuery *, parts->len); + + for (j = 0; j < parts->len; j++) { + field_queries[i][j] = e_book_query_field_test (search_fields[i], + E_BOOK_QUERY_CONTAINS, g_array_index (parts, gchar *, j)); } - q[i] = e_book_query_and(parts->len, field_queries[i], TRUE); + + q[i] = e_book_query_and (parts->len, field_queries[i], TRUE); } - g_array_free(parts, TRUE); - phone = g_new0 (EBookQuery *, 3); - phone[0] = e_book_query_field_exists(E_CONTACT_PHONE_BUSINESS); - phone[1] = e_book_query_field_exists(E_CONTACT_PHONE_HOME); - phone[2] = e_book_query_field_exists(E_CONTACT_PHONE_MOBILE); + g_array_free (parts, TRUE); - query = e_book_query_andv(e_book_query_or(n_search_fields, q, FALSE), - e_book_query_or(3, phone, FALSE), NULL); + phone = g_new0 (EBookQuery *, 3); + phone[0] = e_book_query_field_exists (E_CONTACT_PHONE_BUSINESS); + phone[1] = e_book_query_field_exists (E_CONTACT_PHONE_HOME); + phone[2] = e_book_query_field_exists (E_CONTACT_PHONE_MOBILE); - for (i = 0; i < n_search_fields; i++) - { - g_free(field_queries[i]); + query = e_book_query_andv (e_book_query_or (n_search_fields, q, FALSE), + e_book_query_or (3, phone, FALSE), NULL); + + for (i = 0; i < n_search_fields; i++) { + g_free (field_queries[i]); } - g_free(field_queries); - g_free(q); - g_free(phone); - return query; + g_free (field_queries); + g_free (q); + g_free (phone); + + return query; } /** * Retrieve the contact's picture */ static GdkPixbuf* -pixbuf_from_contact(EContact *contact) +pixbuf_from_contact (EContact *contact) { - GdkPixbuf *pixbuf = NULL; - EContactPhoto *photo = e_contact_get(contact, E_CONTACT_PHOTO); - if (photo) - { - GdkPixbufLoader *loader; + GdkPixbuf *pixbuf = NULL; + EContactPhoto *photo = e_contact_get (contact, E_CONTACT_PHOTO); + + if (photo) { + GdkPixbufLoader *loader; - loader = gdk_pixbuf_loader_new(); + loader = gdk_pixbuf_loader_new(); - if (photo->type == E_CONTACT_PHOTO_TYPE_INLINED) - { - if (gdk_pixbuf_loader_write(loader, - (guchar *) photo->data.inlined.data, photo->data.inlined.length, - NULL)) - pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); + if (photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { + if (gdk_pixbuf_loader_write (loader, + (guchar *) photo->data.inlined.data, photo->data.inlined.length, + NULL)) + pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); } - // If pixbuf has been found, check size and resize if needed - if (pixbuf) - { - GdkPixbuf *tmp; - gint width = gdk_pixbuf_get_width(pixbuf); - gint height = gdk_pixbuf_get_height(pixbuf); - double scale = 1.0; - - if (height > width) - { - scale = pixbuf_size / (double) height; - } - else - { - scale = pixbuf_size / (double) width; + // If pixbuf has been found, check size and resize if needed + if (pixbuf) { + GdkPixbuf *tmp; + gint width = gdk_pixbuf_get_width (pixbuf); + gint height = gdk_pixbuf_get_height (pixbuf); + double scale = 1.0; + + if (height > width) { + scale = pixbuf_size / (double) height; + } else { + scale = pixbuf_size / (double) width; } - if (scale < 1.0) - { - tmp = gdk_pixbuf_scale_simple(pixbuf, width * scale, height - * scale, GDK_INTERP_BILINEAR); - g_object_unref(pixbuf); - pixbuf = tmp; + if (scale < 1.0) { + tmp = gdk_pixbuf_scale_simple (pixbuf, width * scale, height + * scale, GDK_INTERP_BILINEAR); + g_object_unref (pixbuf); + pixbuf = tmp; } } - e_contact_photo_free(photo); + + e_contact_photo_free (photo); } - return pixbuf; + + return pixbuf; } /** * Callback for asynchronous open of books */ static void -eds_async_open_callback(EBook *book, EBookStatus status, gpointer closure) +eds_async_open_callback (EBook *book, EBookStatus status, gpointer closure) { Open_Handler_And_Data *had = (Open_Handler_And_Data *) closure; remaining_books_to_open--; - DEBUG("eds_async_open_callback remaining book to open: %i", remaining_books_to_open); + DEBUG ("eds_async_open_callback remaining book to open: %i", remaining_books_to_open); if (status == E_BOOK_ERROR_OK) { - book_data_t *book_data = g_new(book_data_t, 1); - book_data->active = FALSE; - book_data->name = g_strdup(e_source_peek_name(e_book_get_source(book))); - book_data->uid = g_strdup(e_source_peek_uid(e_book_get_source(book))); - book_data->ebook = book; - books_data = g_slist_prepend(books_data, book_data); - had->handler(); - } - else { + book_data_t *book_data = g_new (book_data_t, 1); + book_data->active = FALSE; + book_data->name = g_strdup (e_source_peek_name (e_book_get_source (book))); + book_data->uid = g_strdup (e_source_peek_uid (e_book_get_source (book))); + book_data->ebook = book; + books_data = g_slist_prepend (books_data, book_data); + had->handler(); + } else { - WARN("Got error %d when opening book", status); + WARN ("Got error %d when opening book", status); } } @@ -312,88 +305,84 @@ eds_async_open_callback(EBook *book, EBookStatus status, gpointer closure) * Initialize address book */ void -init(OpenAsyncHandler callback) +init (OpenAsyncHandler callback) { - GSList *list, *l; - ESourceList *source_list = NULL; - remaining_books_to_open = 0; - books_data = NULL; - - source_list = e_source_list_new_for_gconf_default("/apps/evolution/addressbook/sources"); - - if (source_list == NULL) - { - DEBUG("Error could not initialize source list for addressbook"); - return; + GSList *list, *l; + ESourceList *source_list = NULL; + remaining_books_to_open = 0; + books_data = NULL; + + source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources"); + + if (source_list == NULL) { + DEBUG ("Error could not initialize source list for addressbook"); + return; } - list = e_source_list_peek_groups(source_list); - - Open_Handler_And_Data *had = g_new (Open_Handler_And_Data, 1); - had->handler = callback; - - for (l = list; l != NULL; l = l->next) - { - - ESourceGroup *group = l->data; - GSList *sources = NULL, *m; - sources = e_source_group_peek_sources(group); - for (m = sources; m != NULL; m = m->next) - { - ESource *source = m->data; - EBook *book = e_book_new(source, NULL); - if (book != NULL) - { - // Keep count of remaining books to open - - DEBUG("init addressbook %i", remaining_books_to_open); - remaining_books_to_open++; - - // Asynchronous open - e_book_async_open(book, FALSE, eds_async_open_callback, had); + list = e_source_list_peek_groups (source_list); + + Open_Handler_And_Data *had = g_new (Open_Handler_And_Data, 1); + had->handler = callback; + + for (l = list; l != NULL; l = l->next) { + + ESourceGroup *group = l->data; + GSList *sources = NULL, *m; + sources = e_source_group_peek_sources (group); + + for (m = sources; m != NULL; m = m->next) { + ESource *source = m->data; + EBook *book = e_book_new (source, NULL); + + if (book != NULL) { + // Keep count of remaining books to open + + DEBUG ("init addressbook %i", remaining_books_to_open); + remaining_books_to_open++; + + // Asynchronous open + e_book_async_open (book, FALSE, eds_async_open_callback, had); } } } - current_search_id = 0; - g_object_unref(source_list); + current_search_id = 0; + + g_object_unref (source_list); } /** * Final callback after all books have been processed. */ static void -view_finish(EBookView *book_view, Search_Handler_And_Data *had) +view_finish (EBookView *book_view, Search_Handler_And_Data *had) { - GList *i; - SearchAsyncHandler had_handler = had->handler; - GList *had_hits = had->hits; - gpointer had_user_data = had->user_data; - int search_id = had->search_id; - g_free(had); - - if (book_view != NULL) - g_object_unref(book_view); - - if (search_id == current_search_id) - { - // Reinitialize search id to prevent overflow - if (current_search_id > 5000) - current_search_id = 0; - - // Call display callback - had_handler(had_hits, had_user_data); - } - else - { - // Some hits could have been processed but will not be used - for (i = had_hits; i != NULL; i = i->next) - { - Hit *entry; - entry = i->data; - free_hit(entry); + GList *i; + SearchAsyncHandler had_handler = had->handler; + GList *had_hits = had->hits; + gpointer had_user_data = had->user_data; + int search_id = had->search_id; + g_free (had); + + if (book_view != NULL) + g_object_unref (book_view); + + if (search_id == current_search_id) { + // Reinitialize search id to prevent overflow + if (current_search_id > 5000) + current_search_id = 0; + + // Call display callback + had_handler (had_hits, had_user_data); + } else { + // Some hits could have been processed but will not be used + for (i = had_hits; i != NULL; i = i->next) { + Hit *entry; + entry = i->data; + free_hit (entry); } - g_list_free(had_hits); + + g_list_free (had_hits); } } @@ -402,79 +391,76 @@ view_finish(EBookView *book_view, Search_Handler_And_Data *had) * Used to store book search results. */ static void -view_contacts_added_cb(EBookView *book_view, GList *contacts, - gpointer user_data) +view_contacts_added_cb (EBookView *book_view, GList *contacts, + gpointer user_data) { - GdkPixbuf *photo; + GdkPixbuf *photo; - Search_Handler_And_Data *had = (Search_Handler_And_Data *) user_data; + Search_Handler_And_Data *had = (Search_Handler_And_Data *) user_data; - // If it's not the last search launched, stop it - if (had->search_id != current_search_id) - { - e_book_view_stop(book_view); - return; + // If it's not the last search launched, stop it + if (had->search_id != current_search_id) { + e_book_view_stop (book_view); + return; } - // If we reached max results - if (had->max_results_remaining <= 0) - { - e_book_view_stop(book_view); - had->book_views_remaining--; - - // All books have been computed - if (had->book_views_remaining == 0) - { - view_finish(book_view, had); - return; + // If we reached max results + if (had->max_results_remaining <= 0) { + e_book_view_stop (book_view); + had->book_views_remaining--; + + // All books have been computed + if (had->book_views_remaining == 0) { + view_finish (book_view, had); + return; } } - // For each contact - for (; contacts != NULL; contacts = g_list_next (contacts)) - { - EContact *contact; - Hit *hit; - gchar *number; - - contact = E_CONTACT (contacts->data); - hit = g_new (Hit, 1); - - // Get the photo contact - photo = pixbuf_from_contact(contact); - hit->photo = photo; - - // Get business phone information - fetch_information_from_contact(contact, E_CONTACT_PHONE_BUSINESS, &number); - hit->phone_business = g_strdup(number); - - // Get home phone information - fetch_information_from_contact(contact, E_CONTACT_PHONE_HOME, &number); - hit->phone_home = g_strdup(number); - - // Get mobile phone information - fetch_information_from_contact(contact, E_CONTACT_PHONE_MOBILE, &number); - hit->phone_mobile = g_strdup(number); - - hit->name = g_strdup((char*) e_contact_get_const(contact, - E_CONTACT_NAME_OR_ORG)); - if (!hit->name) - hit->name = ""; - - // Append list of contacts - had->hits = g_list_append(had->hits, hit); - had->max_results_remaining--; - - // If we reached max results - if (had->max_results_remaining <= 0) - { - e_book_view_stop(book_view); - had->book_views_remaining--; - if (had->book_views_remaining == 0) - { - view_finish(book_view, had); + // For each contact + for (; contacts != NULL; contacts = g_list_next (contacts)) { + EContact *contact; + Hit *hit; + gchar *number; + + contact = E_CONTACT (contacts->data); + hit = g_new (Hit, 1); + + // Get the photo contact + photo = pixbuf_from_contact (contact); + hit->photo = photo; + + // Get business phone information + fetch_information_from_contact (contact, E_CONTACT_PHONE_BUSINESS, &number); + hit->phone_business = g_strdup (number); + + // Get home phone information + fetch_information_from_contact (contact, E_CONTACT_PHONE_HOME, &number); + hit->phone_home = g_strdup (number); + + // Get mobile phone information + fetch_information_from_contact (contact, E_CONTACT_PHONE_MOBILE, &number); + hit->phone_mobile = g_strdup (number); + + hit->name = g_strdup ( (char*) e_contact_get_const (contact, + E_CONTACT_NAME_OR_ORG)); + + if (!hit->name) + hit->name = ""; + + // Append list of contacts + had->hits = g_list_append (had->hits, hit); + had->max_results_remaining--; + + // If we reached max results + if (had->max_results_remaining <= 0) { + e_book_view_stop (book_view); + had->book_views_remaining--; + + if (had->book_views_remaining == 0) { + view_finish (book_view, had); } - break; + + break; } } } @@ -484,17 +470,16 @@ view_contacts_added_cb(EBookView *book_view, GList *contacts, * Used to call final callback when all books have been read. */ static void -view_completed_cb(EBookView *book_view, EBookViewStatus status UNUSED, -gpointer user_data) +view_completed_cb (EBookView *book_view, EBookViewStatus status UNUSED, + gpointer user_data) { - Search_Handler_And_Data *had = (Search_Handler_And_Data *) user_data; - had->book_views_remaining--; - - // All books have been prcessed - if (had->book_views_remaining == 0) - { - // Call finish function - view_finish(book_view, had); + Search_Handler_And_Data *had = (Search_Handler_And_Data *) user_data; + had->book_views_remaining--; + + // All books have been prcessed + if (had->book_views_remaining == 0) { + // Call finish function + view_finish (book_view, had); } } @@ -502,66 +487,61 @@ gpointer user_data) * Perform an asynchronous search */ void -search_async(const char *query, int max_results, SearchAsyncHandler handler, - gpointer user_data) +search_async (const char *query, int max_results, SearchAsyncHandler handler, + gpointer user_data) { - // Increment search id - current_search_id++; + // Increment search id + current_search_id++; - // If query is null - if (strlen(query) < 1 || g_slist_length(books_data) == 0) - { - // If data displayed (from previous search), directly call callback - handler(NULL, user_data); + // If query is null + if (strlen (query) < 1 || g_slist_length (books_data) == 0) { + // If data displayed (from previous search), directly call callback + handler (NULL, user_data); - return; + return; } - GSList *iter; - EBookQuery* book_query = create_query(query); - Search_Handler_And_Data *had = g_new (Search_Handler_And_Data, 1); - int search_count = 0; - - // Initialize search data - had->search_id = current_search_id; - had->handler = handler; - had->user_data = user_data; - had->hits = NULL; - had->max_results_remaining = max_results; - had->book_views_remaining = 0; - - // Iterate throw books data - for (iter = books_data; iter != NULL; iter = iter->next) - { - book_data_t *book_data = (book_data_t *) iter->data; - - // If book is active - if (book_data->active) - { - EBookView *book_view = NULL; - e_book_get_book_view(book_data->ebook, book_query, NULL, max_results, - &book_view, NULL); - - // If book view exists - if (book_view != NULL) - { - // Perform search - had->book_views_remaining++; - g_signal_connect (book_view, "contacts_added", (GCallback) view_contacts_added_cb, had); - g_signal_connect (book_view, "sequence_complete", (GCallback) view_completed_cb, had); - e_book_view_start(book_view); - search_count++; + GSList *iter; + EBookQuery* book_query = create_query (query); + Search_Handler_And_Data *had = g_new (Search_Handler_And_Data, 1); + int search_count = 0; + + // Initialize search data + had->search_id = current_search_id; + had->handler = handler; + had->user_data = user_data; + had->hits = NULL; + had->max_results_remaining = max_results; + had->book_views_remaining = 0; + + // Iterate throw books data + for (iter = books_data; iter != NULL; iter = iter->next) { + book_data_t *book_data = (book_data_t *) iter->data; + + // If book is active + if (book_data->active) { + EBookView *book_view = NULL; + e_book_get_book_view (book_data->ebook, book_query, NULL, max_results, + &book_view, NULL); + + // If book view exists + if (book_view != NULL) { + // Perform search + had->book_views_remaining++; + g_signal_connect (book_view, "contacts_added", (GCallback) view_contacts_added_cb, had); + g_signal_connect (book_view, "sequence_complete", (GCallback) view_completed_cb, had); + e_book_view_start (book_view); + search_count++; } } } - e_book_query_unref(book_query); + e_book_query_unref (book_query); - // If no search has been executed (no book selected) - if (search_count == 0) - { - // Call last callback anyway - view_finish(NULL, had); + // If no search has been executed (no book selected) + if (search_count == 0) { + // Call last callback anyway + view_finish (NULL, had); } } @@ -569,17 +549,17 @@ search_async(const char *query, int max_results, SearchAsyncHandler handler, * Fetch information for a specific contact */ void -fetch_information_from_contact(EContact *contact, EContactField field, - gchar **info) +fetch_information_from_contact (EContact *contact, EContactField field, + gchar **info) { - gchar *to_fetch; + gchar *to_fetch; + + to_fetch = g_strdup ( (char*) e_contact_get_const (contact, field)); - to_fetch = g_strdup((char*) e_contact_get_const(contact, field)); - if (!to_fetch) - { - to_fetch = g_strdup(EMPTY_ENTRY); + if (!to_fetch) { + to_fetch = g_strdup (EMPTY_ENTRY); } - *info = g_strdup(to_fetch); + *info = g_strdup (to_fetch); } diff --git a/sflphone-client-gnome/src/contacts/addressbook/eds.h b/sflphone-client-gnome/src/contacts/addressbook/eds.h index 7ff8cbd025f27b28d19951a7b5f2411fcaf511cd..2e44756a9ae962aae343729882e200912838322a 100644 --- a/sflphone-client-gnome/src/contacts/addressbook/eds.h +++ b/sflphone-client-gnome/src/contacts/addressbook/eds.h @@ -56,24 +56,22 @@ int current_search_id; /** * Represent a contact entry */ -typedef struct _Hit -{ - gchar *name; - GdkPixbuf *photo; - gchar *phone_business; - gchar *phone_home; - gchar *phone_mobile; +typedef struct _Hit { + gchar *name; + GdkPixbuf *photo; + gchar *phone_business; + gchar *phone_home; + gchar *phone_mobile; } Hit; /** * Book structure for "outside world" */ -typedef struct -{ - gchar *uid; - gchar *name; - gboolean active; - EBook *ebook; +typedef struct { + gchar *uid; + gchar *name; + gboolean active; + EBook *ebook; } book_data_t; GSList *books_data; @@ -82,46 +80,46 @@ GSList *books_data; * Free a contact entry */ void -free_hit(Hit *h); +free_hit (Hit *h); /** * Template callback function for the asynchronous search */ typedef void -(* SearchAsyncHandler)(GList *hits, gpointer user_data); +(* SearchAsyncHandler) (GList *hits, gpointer user_data); /** * Template callback function for the asynchronous open */ typedef void -(* OpenAsyncHandler)(); +(* OpenAsyncHandler) (); /** * Initialize the address book. * Connection to evolution data server */ void -init(OpenAsyncHandler); +init (OpenAsyncHandler); /** * Asynchronous search function */ void -search_async(const char *query, int max_results, SearchAsyncHandler handler, - gpointer user_data); +search_async (const char *query, int max_results, SearchAsyncHandler handler, + gpointer user_data); /** * Retrieve the specified information from the contact */ void -fetch_information_from_contact(EContact *contact, EContactField field, - gchar **info); +fetch_information_from_contact (EContact *contact, EContactField field, + gchar **info); GSList* -get_books(void); +get_books (void); book_data_t * -books_get_book_data_by_uid(gchar *uid); +books_get_book_data_by_uid (gchar *uid); /** * Public way to know if we can perform a search diff --git a/sflphone-client-gnome/src/contacts/calllist.c b/sflphone-client-gnome/src/contacts/calllist.c index 10744e58ff0fb1c1548661fedceb5f4c9faef927..ead96bbc2eaec2955fdbad2646b054166ca97096 100644 --- a/sflphone-client-gnome/src/contacts/calllist.c +++ b/sflphone-client-gnome/src/contacts/calllist.c @@ -33,66 +33,66 @@ #include <contacts/searchbar.h> // TODO : sflphoneGTK : try to do this more generic -void calllist_add_contact (gchar *contact_name, gchar *contact_phone, contact_type_t type, GdkPixbuf *photo){ +void calllist_add_contact (gchar *contact_name, gchar *contact_phone, contact_type_t type, GdkPixbuf *photo) +{ callable_obj_t *new_call; GdkPixbuf *pixbuf; /* Check if the information is valid */ - if (g_strcasecmp (contact_phone, EMPTY_ENTRY) != 0){ + if (g_strcasecmp (contact_phone, EMPTY_ENTRY) != 0) { create_new_call (CONTACT, CALL_STATE_DIALING, "", "", contact_name, contact_phone, &new_call); // Attach a pixbuf to a contact if (photo) { - attach_thumbnail (new_call, gdk_pixbuf_copy(photo)); - } - else { + attach_thumbnail (new_call, gdk_pixbuf_copy (photo)); + } else { switch (type) { case CONTACT_PHONE_BUSINESS: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/users.svg", NULL); + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/users.svg", NULL); break; case CONTACT_PHONE_HOME: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/home.svg", NULL); + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/home.svg", NULL); break; case CONTACT_PHONE_MOBILE: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/phone.svg", NULL); + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/phone.svg", NULL); break; default: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/contact_default.svg", NULL); + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/contact_default.svg", NULL); break; } + attach_thumbnail (new_call, pixbuf); } calllist_add (contacts, new_call); - calltree_add_call(contacts, new_call, NULL); + calltree_add_call (contacts, new_call, NULL); } } void calllist_init (calltab_t* tab) { - tab->callQueue = g_queue_new (); - tab->selectedCall = NULL; + tab->callQueue = g_queue_new (); + tab->selectedCall = NULL; } void calllist_clean (calltab_t* tab) { - g_queue_free (tab->callQueue); + g_queue_free (tab->callQueue); } void calllist_reset (calltab_t* tab) { - g_queue_free (tab->callQueue); - tab->callQueue = g_queue_new(); + g_queue_free (tab->callQueue); + tab->callQueue = g_queue_new(); } void calllist_add_history_entry (callable_obj_t *obj) { - if (eel_gconf_get_integer (HISTORY_ENABLED)) - { + if (eel_gconf_get_integer (HISTORY_ENABLED)) { g_queue_push_tail (history->callQueue, (gpointer *) obj); calltree_add_call (history, obj, NULL); } @@ -101,89 +101,84 @@ void calllist_add_history_entry (callable_obj_t *obj) void calllist_add (calltab_t* tab, callable_obj_t * c) { - if( tab == history ) - { + if (tab == history) { calllist_add_history_entry (c); - } - else + } else g_queue_push_tail (tab->callQueue, (gpointer *) c); } // TODO : sflphoneGTK : try to do this more generic void -calllist_clean_history( void ) +calllist_clean_history (void) { - unsigned int i; - guint size = calllist_get_size( history ); - DEBUG("history list size = %i", calllist_get_size( history )); - for( i = 0 ; i < size ; i++ ) - { - DEBUG("Delete calls"); - callable_obj_t* c = calllist_get_nth( history , i ); - // Delete the call from the call tree - DEBUG("Delete calls"); - calltree_remove_call(history, c, NULL); - } - calllist_reset( history ); + unsigned int i; + guint size = calllist_get_size (history); + DEBUG ("history list size = %i", calllist_get_size (history)); + + for (i = 0 ; i < size ; i++) { + DEBUG ("Delete calls"); + callable_obj_t* c = calllist_get_nth (history , i); + // Delete the call from the call tree + DEBUG ("Delete calls"); + calltree_remove_call (history, c, NULL); + } + + calllist_reset (history); } // TODO : sflphoneGTK : try to do this more generic void -calllist_remove_from_history( callable_obj_t* c ) +calllist_remove_from_history (callable_obj_t* c) { - calllist_remove( history, c->_callID ); - calltree_remove_call(history, c, NULL); - DEBUG("Size of history = %i" , calllist_get_size( history )); + calllist_remove (history, c->_callID); + calltree_remove_call (history, c, NULL); + DEBUG ("Size of history = %i" , calllist_get_size (history)); } void calllist_remove (calltab_t* tab, const gchar * callID) { - callable_obj_t * c = calllist_get(tab, callID); - if (c) - { - g_queue_remove(tab->callQueue, c); - } + callable_obj_t * c = calllist_get (tab, callID); + + if (c) { + g_queue_remove (tab->callQueue, c); + } } callable_obj_t * -calllist_get_by_state (calltab_t* tab, call_state_t state ) +calllist_get_by_state (calltab_t* tab, call_state_t state) { - GList * c = g_queue_find_custom (tab->callQueue, &state, get_state_callstruct); - if (c) - { - return (callable_obj_t *)c->data; - } - else - { - return NULL; - } + GList * c = g_queue_find_custom (tab->callQueue, &state, get_state_callstruct); + + if (c) { + return (callable_obj_t *) c->data; + } else { + return NULL; + } } guint calllist_get_size (calltab_t* tab) { - return g_queue_get_length (tab->callQueue); + return g_queue_get_length (tab->callQueue); } callable_obj_t * -calllist_get_nth (calltab_t* tab, guint n ) +calllist_get_nth (calltab_t* tab, guint n) { - return g_queue_peek_nth (tab->callQueue, n); + return g_queue_peek_nth (tab->callQueue, n); } callable_obj_t * -calllist_get (calltab_t* tab, const gchar * callID ) +calllist_get (calltab_t* tab, const gchar * callID) { - GList * c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct); - if (c) - { - return (callable_obj_t *)c->data; - } - else - { - return NULL; - } + GList * c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct); + + if (c) { + return (callable_obj_t *) c->data; + } else { + return NULL; + } } diff --git a/sflphone-client-gnome/src/contacts/calllist.h b/sflphone-client-gnome/src/contacts/calllist.h index db3cee03dcb4df6adc6685db1a8ffe234532530d..7b6704600fb3cb0c6a4aa498d1b437d90351533c 100644 --- a/sflphone-client-gnome/src/contacts/calllist.h +++ b/sflphone-client-gnome/src/contacts/calllist.h @@ -40,17 +40,17 @@ */ typedef struct { - GtkTreeStore* store; - GtkWidget* view; - GtkWidget* tree; - GtkWidget* searchbar; - - // Calllist vars - GQueue* callQueue; - gint selectedType; - callable_obj_t* selectedCall; - conference_obj_t* selectedConf; - gchar *_name; + GtkTreeStore* store; + GtkWidget* view; + GtkWidget* tree; + GtkWidget* searchbar; + + // Calllist vars + GQueue* callQueue; + gint selectedType; + callable_obj_t* selectedCall; + conference_obj_t* selectedConf; + gchar *_name; } calltab_t; void @@ -64,7 +64,7 @@ calllist_init (calltab_t* tab); /** This function empty and free the call list. */ void -calllist_clean(calltab_t* tab); +calllist_clean (calltab_t* tab); /** This function empty, free the call list and allocate a new one. */ void @@ -72,11 +72,11 @@ calllist_reset (calltab_t* tab); /** Get the maximun number of calls in the history calltab */ gdouble -call_history_get_max_calls( void ); +call_history_get_max_calls (void); /** Set the maximun number of calls in the history calltab */ void -call_history_set_max_calls( const gdouble number ); +call_history_set_max_calls (const gdouble number); /** This function append a call to list. * @param c The call you want to add @@ -106,13 +106,13 @@ calllist_get_size (calltab_t* tab); * @param n The position of the call you want * @return A call or NULL */ callable_obj_t * -calllist_get_nth (calltab_t* tab, guint n ); +calllist_get_nth (calltab_t* tab, guint n); /** Return the call corresponding to the callID * @param n The callID of the call you want * @return A call or NULL */ callable_obj_t * -calllist_get (calltab_t* tab, const gchar * callID ); +calllist_get (calltab_t* tab, const gchar * callID); /** * Clean the history. Delete all calls @@ -125,7 +125,7 @@ calllist_clean_history(); * @param c The call to remove */ void -calllist_remove_from_history( callable_obj_t* c); +calllist_remove_from_history (callable_obj_t* c); /** * Initialize a non-empty call list diff --git a/sflphone-client-gnome/src/contacts/calltab.c b/sflphone-client-gnome/src/contacts/calltab.c index ac194bf8287fe4a233e827aae2d2c9acfc22afa8..fab48e76318b7810a5969b7edaeb47382af70125 100644 --- a/sflphone-client-gnome/src/contacts/calltab.c +++ b/sflphone-client-gnome/src/contacts/calltab.c @@ -36,28 +36,28 @@ calltab_t* calltab_init (gboolean searchbar_type, gchar *name) { - calltab_t* ret; + calltab_t* ret; - ret = malloc(sizeof(calltab_t)); + ret = malloc (sizeof (calltab_t)); - ret->store = NULL; - ret->view = NULL; - ret->tree = NULL; - ret->searchbar = NULL; - ret->callQueue = NULL; - ret->selectedCall = NULL; - ret->selectedConf = NULL; - ret->_name = g_strdup (name); + ret->store = NULL; + ret->view = NULL; + ret->tree = NULL; + ret->searchbar = NULL; + ret->callQueue = NULL; + ret->selectedCall = NULL; + ret->selectedConf = NULL; + ret->_name = g_strdup (name); - calltree_create (ret, searchbar_type); - calllist_init(ret); + calltree_create (ret, searchbar_type); + calllist_init (ret); - return ret; + return ret; } void -calltab_select_call (calltab_t* tab, callable_obj_t * c ) +calltab_select_call (calltab_t* tab, callable_obj_t * c) { tab->selectedType = A_CALL; tab->selectedCall = c; @@ -66,7 +66,7 @@ calltab_select_call (calltab_t* tab, callable_obj_t * c ) void -calltab_select_conf (conference_obj_t * c ) +calltab_select_conf (conference_obj_t * c) { current_calls->selectedType = A_CONFERENCE; current_calls->selectedConf = c; @@ -74,7 +74,7 @@ calltab_select_conf (conference_obj_t * c ) } gint -calltab_get_selected_type(calltab_t* tab) +calltab_get_selected_type (calltab_t* tab) { return tab->selectedType; } @@ -82,7 +82,7 @@ calltab_get_selected_type(calltab_t* tab) callable_obj_t * calltab_get_selected_call (calltab_t* tab) { - return tab->selectedCall; + return tab->selectedCall; } conference_obj_t* diff --git a/sflphone-client-gnome/src/contacts/calltab.h b/sflphone-client-gnome/src/contacts/calltab.h index db14867ac51839ec0c3eb85c2bea116576fe69d5..1d748620ba3f3e9e1dd908e0ae03b16332f78ec8 100644 --- a/sflphone-client-gnome/src/contacts/calltab.h +++ b/sflphone-client-gnome/src/contacts/calltab.h @@ -54,7 +54,7 @@ void calltab_select_conf (conference_obj_t *); gint -calltab_get_selected_type(calltab_t* tab); +calltab_get_selected_type (calltab_t* tab); /** Return the selected call. * @return The number of the caller */ diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index 6417d628fb4775731f2354fde2ac82ba910c61e6..5b90c5553f64aafc85de1446dfc1eda365fb080c 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -62,41 +62,41 @@ conference_obj_t *dragged_conf; conference_obj_t *selected_conf; -static void drag_begin_cb(GtkWidget *widget, GdkDragContext *dc, gpointer data); -static void drag_end_cb(GtkWidget * mblist, GdkDragContext * context, gpointer data); -void drag_data_received_cb(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, GtkSelectionData *selection_data, guint info, guint t, gpointer data); +static void drag_begin_cb (GtkWidget *widget, GdkDragContext *dc, gpointer data); +static void drag_end_cb (GtkWidget * mblist, GdkDragContext * context, gpointer data); +void drag_data_received_cb (GtkWidget *widget, GdkDragContext *dc, gint x, gint y, GtkSelectionData *selection_data, guint info, guint t, gpointer data); enum { - COLUMN_ACCOUNT_STATE = 0, - COLUMN_ACCOUNT_DESC, - COLUMN_ACCOUNT_SECURITY, - COLUMN_ACCOUNT_PTR, + COLUMN_ACCOUNT_STATE = 0, + COLUMN_ACCOUNT_DESC, + COLUMN_ACCOUNT_SECURITY, + COLUMN_ACCOUNT_PTR, }; /** * Show popup menu */ - static gboolean +static gboolean popup_menu (GtkWidget *widget, - gpointer user_data UNUSED) + gpointer user_data UNUSED) { - show_popup_menu(widget, NULL); - return TRUE; + show_popup_menu (widget, NULL); + return TRUE; } /* Call back when the user click on a call in the list */ - static void -call_selected_cb(GtkTreeSelection *sel, void* data UNUSED ) +static void +call_selected_cb (GtkTreeSelection *sel, void* data UNUSED) { - DEBUG("CallTree: Selection callback"); + DEBUG ("CallTree: Selection callback"); GtkTreeIter iter; GValue val; - GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; - + GtkTreeModel *model = (GtkTreeModel*) active_calltree->store; + GtkTreePath* path; gchar* string_path; @@ -106,163 +106,162 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED ) } // store info for dragndrop - path = gtk_tree_model_get_path(model, &iter); - string_path = gtk_tree_path_to_string(path); - selected_path_depth = gtk_tree_path_get_depth(path); + path = gtk_tree_model_get_path (model, &iter); + string_path = gtk_tree_path_to_string (path); + selected_path_depth = gtk_tree_path_get_depth (path); - if(gtk_tree_model_iter_has_child(GTK_TREE_MODEL(model), &iter)) { + if (gtk_tree_model_iter_has_child (GTK_TREE_MODEL (model), &iter)) { - DEBUG("CallTree: Selected a conference"); - selected_type = A_CONFERENCE; + DEBUG ("CallTree: Selected a conference"); + selected_type = A_CONFERENCE; - val.g_type = 0; - gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); + val.g_type = 0; + gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); - calltab_select_conf((conference_obj_t*) g_value_get_pointer(&val)); + calltab_select_conf ( (conference_obj_t*) g_value_get_pointer (&val)); - selected_conf = (conference_obj_t*)g_value_get_pointer(&val); + selected_conf = (conference_obj_t*) g_value_get_pointer (&val); - if(selected_conf) { + if (selected_conf) { - selected_call_id = selected_conf->_confID; - selected_path = string_path; - selected_call = NULL; + selected_call_id = selected_conf->_confID; + selected_path = string_path; + selected_call = NULL; - } + } - DEBUG("CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d", - selected_path, selected_call_id, selected_path_depth); + DEBUG ("CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d", + selected_path, selected_call_id, selected_path_depth); - } - else { - - DEBUG("CallTree: Selected a call"); - selected_type = A_CALL; - - val.g_type = 0; - gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); - - calltab_select_call(active_calltree, (callable_obj_t*) g_value_get_pointer(&val)); - - selected_call = (callable_obj_t*)g_value_get_pointer(&val); - - if(selected_call) { - - selected_call_id = selected_call->_callID; - selected_path = string_path; - selected_conf = NULL; - } - - DEBUG("CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d", - selected_path, selected_call_id, selected_path_depth); + } else { + + DEBUG ("CallTree: Selected a call"); + selected_type = A_CALL; + + val.g_type = 0; + gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); + + calltab_select_call (active_calltree, (callable_obj_t*) g_value_get_pointer (&val)); + + selected_call = (callable_obj_t*) g_value_get_pointer (&val); + + if (selected_call) { + + selected_call_id = selected_call->_callID; + selected_path = string_path; + selected_conf = NULL; + } + + DEBUG ("CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d", + selected_path, selected_call_id, selected_path_depth); } - g_value_unset(&val); + g_value_unset (&val); update_actions(); } /* A row is activated when it is double clicked */ - void -row_activated(GtkTreeView *tree_view UNUSED, - GtkTreePath *path UNUSED, - GtkTreeViewColumn *column UNUSED, - void * data UNUSED) { +void +row_activated (GtkTreeView *tree_view UNUSED, + GtkTreePath *path UNUSED, + GtkTreeViewColumn *column UNUSED, + void * data UNUSED) +{ callable_obj_t* selectedCall = NULL; callable_obj_t* new_call; conference_obj_t* selectedConf = NULL; gchar *account_id; - - DEBUG("CallTree: Double click action"); - - if(calltab_get_selected_type(active_calltree) == A_CALL) { - - selectedCall = calltab_get_selected_call(active_calltree); - - if (selectedCall) { - DEBUG("CallTree: Selected a call"); - - // Get the right event from the right calltree - if( active_calltree == current_calls ) { - - DEBUG("CallTree: Active tree is current calls"); - - switch(selectedCall->_state) { - case CALL_STATE_INCOMING: - dbus_accept(selectedCall); - stop_notification(); - break; - case CALL_STATE_HOLD: - dbus_unhold(selectedCall); - break; - case CALL_STATE_RINGING: - case CALL_STATE_CURRENT: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - break; - case CALL_STATE_DIALING: - sflphone_place_call (selectedCall); - break; - default: - WARN("Row activated - Should not happen!"); - break; - } - } - - // If history or contact: double click action places a new call - else { - - DEBUG("CallTree: Active tree is history or contact"); - - account_id = g_strdup (selectedCall->_accountID); - - // Create a new call - create_new_call (CALL, CALL_STATE_DIALING, "", account_id, selectedCall->_peer_name, selectedCall->_peer_number, &new_call); - - calllist_add(current_calls, new_call); - calltree_add_call(current_calls, new_call, NULL); - sflphone_place_call(new_call); - calltree_display(current_calls); - } - } - } - else if(calltab_get_selected_type(current_calls) == A_CONFERENCE) { - - DEBUG("CallTree: Selected a conference"); - - if( active_calltree == current_calls ) { - - selectedConf = calltab_get_selected_conf(current_calls); - - if(selectedConf) { - - switch(selectedConf->_state) { - case CONFERENCE_STATE_ACTIVE_ATACHED: - // sflphone_add_main_participant(selectedConf); - break; - case CONFERENCE_STATE_ACTIVE_DETACHED: - sflphone_add_main_participant(selectedConf); - break; - case CONFERENCE_STATE_HOLD: - sflphone_conference_off_hold(selectedConf); - break; - } - } - } + + DEBUG ("CallTree: Double click action"); + + if (calltab_get_selected_type (active_calltree) == A_CALL) { + + selectedCall = calltab_get_selected_call (active_calltree); + + if (selectedCall) { + DEBUG ("CallTree: Selected a call"); + + // Get the right event from the right calltree + if (active_calltree == current_calls) { + + DEBUG ("CallTree: Active tree is current calls"); + + switch (selectedCall->_state) { + case CALL_STATE_INCOMING: + dbus_accept (selectedCall); + stop_notification(); + break; + case CALL_STATE_HOLD: + dbus_unhold (selectedCall); + break; + case CALL_STATE_RINGING: + case CALL_STATE_CURRENT: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + break; + case CALL_STATE_DIALING: + sflphone_place_call (selectedCall); + break; + default: + WARN ("Row activated - Should not happen!"); + break; + } + } + + // If history or contact: double click action places a new call + else { + + DEBUG ("CallTree: Active tree is history or contact"); + + account_id = g_strdup (selectedCall->_accountID); + + // Create a new call + create_new_call (CALL, CALL_STATE_DIALING, "", account_id, selectedCall->_peer_name, selectedCall->_peer_number, &new_call); + + calllist_add (current_calls, new_call); + calltree_add_call (current_calls, new_call, NULL); + sflphone_place_call (new_call); + calltree_display (current_calls); + } + } + } else if (calltab_get_selected_type (current_calls) == A_CONFERENCE) { + + DEBUG ("CallTree: Selected a conference"); + + if (active_calltree == current_calls) { + + selectedConf = calltab_get_selected_conf (current_calls); + + if (selectedConf) { + + switch (selectedConf->_state) { + case CONFERENCE_STATE_ACTIVE_ATACHED: + // sflphone_add_main_participant(selectedConf); + break; + case CONFERENCE_STATE_ACTIVE_DETACHED: + sflphone_add_main_participant (selectedConf); + break; + case CONFERENCE_STATE_HOLD: + sflphone_conference_off_hold (selectedConf); + break; + } + } + } } } /* Catch cursor-activated signal. That is, when the entry is single clicked */ - void -row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) +void +row_single_click (GtkTreeView *tree_view UNUSED, void * data UNUSED) { callable_obj_t * selectedCall = NULL; account_t * account_details = NULL; gchar * displaySasOnce=""; - DEBUG("CallTree: Single click action"); + DEBUG ("CallTree: Single click action"); - selectedCall = calltab_get_selected_call( active_calltree ); + selectedCall = calltab_get_selected_call (active_calltree); /* if(!selected_call) { @@ -272,76 +271,79 @@ row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) if (selectedCall) { - account_details = account_list_get_by_id(selectedCall->_accountID); - DEBUG("AccountID %s", selectedCall->_accountID); - - if(account_details != NULL) { - displaySasOnce = g_hash_table_lookup(account_details->properties, ACCOUNT_DISPLAY_SAS_ONCE); - DEBUG("Display SAS once %s", displaySasOnce); - } - else { - GHashTable * properties = NULL; - sflphone_get_ip2ip_properties (&properties); - if(properties != NULL) - { displaySasOnce = g_hash_table_lookup(properties, ACCOUNT_DISPLAY_SAS_ONCE); DEBUG("IP2IP displaysasonce %s", displaySasOnce); } - } - - /* Make sure that we are not in the history tab since - * nothing is defined for it yet - */ - if( active_calltree == current_calls ) { - - // sflphone_selected_call_codec(selectedCall); - - // DEBUG("single click action: %s", dbus_get_current_codec_name(selectedCall)); - // sflphone_display_selected_codec(dbus_get_current_codec_name(selectedCall)); - - switch(selectedCall->_srtp_state) { - - case SRTP_STATE_ZRTP_SAS_UNCONFIRMED: - selectedCall->_srtp_state = SRTP_STATE_ZRTP_SAS_CONFIRMED; - if(g_strcasecmp(displaySasOnce,"true") == 0) { - selectedCall->_zrtp_confirmed = TRUE; - } - dbus_confirm_sas(selectedCall); - calltree_update_call(current_calls, selectedCall, NULL); - break; - case SRTP_STATE_ZRTP_SAS_CONFIRMED: - selectedCall->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED; - dbus_reset_sas(selectedCall); - calltree_update_call(current_calls, selectedCall, NULL); - break; - default: - DEBUG("Single click but no action"); - break; - } - } + account_details = account_list_get_by_id (selectedCall->_accountID); + DEBUG ("AccountID %s", selectedCall->_accountID); + + if (account_details != NULL) { + displaySasOnce = g_hash_table_lookup (account_details->properties, ACCOUNT_DISPLAY_SAS_ONCE); + DEBUG ("Display SAS once %s", displaySasOnce); + } else { + GHashTable * properties = NULL; + sflphone_get_ip2ip_properties (&properties); + + if (properties != NULL) { + displaySasOnce = g_hash_table_lookup (properties, ACCOUNT_DISPLAY_SAS_ONCE); + DEBUG ("IP2IP displaysasonce %s", displaySasOnce); + } + } + + /* Make sure that we are not in the history tab since + * nothing is defined for it yet + */ + if (active_calltree == current_calls) { + + // sflphone_selected_call_codec(selectedCall); + + // DEBUG("single click action: %s", dbus_get_current_codec_name(selectedCall)); + // sflphone_display_selected_codec(dbus_get_current_codec_name(selectedCall)); + + switch (selectedCall->_srtp_state) { + + case SRTP_STATE_ZRTP_SAS_UNCONFIRMED: + selectedCall->_srtp_state = SRTP_STATE_ZRTP_SAS_CONFIRMED; + + if (g_strcasecmp (displaySasOnce,"true") == 0) { + selectedCall->_zrtp_confirmed = TRUE; + } + + dbus_confirm_sas (selectedCall); + calltree_update_call (current_calls, selectedCall, NULL); + break; + case SRTP_STATE_ZRTP_SAS_CONFIRMED: + selectedCall->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED; + dbus_reset_sas (selectedCall); + calltree_update_call (current_calls, selectedCall, NULL); + break; + default: + DEBUG ("Single click but no action"); + break; + } + } } } - static gboolean -button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUSED) +static gboolean +button_pressed (GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUSED) { - if (event->button == 3 && event->type == GDK_BUTTON_PRESS){ - if( active_calltree == current_calls ) { - show_popup_menu(widget, event); - return TRUE; - } - else if (active_calltree == history) { - show_popup_menu_history (widget, event); - return TRUE; - } - else { - show_popup_menu_contacts (widget, event); - return TRUE; - } + if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { + if (active_calltree == current_calls) { + show_popup_menu (widget, event); + return TRUE; + } else if (active_calltree == history) { + show_popup_menu_history (widget, event); + return TRUE; + } else { + show_popup_menu_contacts (widget, event); + return TRUE; + } } + return FALSE; } -gchar* -calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gchar *audio_codec, gchar** display_info) +gchar* +calltree_display_call_info (callable_obj_t * c, CallDisplayType display_type, gchar *audio_codec, gchar** display_info) { gchar * description; @@ -349,150 +351,147 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch gchar * peer_number = c->_peer_number; gchar * hostname = NULL; - gchar * display_number = ""; + gchar * display_number = ""; - DEBUG("CallTree: Display call info"); + DEBUG ("CallTree: Display call info"); // If call is outgoing, keep the hostname, strip it elsewhere - if(c->_type == CALL && c->_history_state == OUTGOING) { + if (c->_type == CALL && c->_history_state == OUTGOING) { - display_number = peer_number; - } - else { + display_number = peer_number; + } else { // Get the hostname for this call (NULL if not existent) - hostname = g_strrstr(peer_number, "@"); - - // Test if we are dialing a new number - if(g_strcmp0("", c->_peer_number) != 0) { - - // Strip the hostname if existent - if(hostname) { - display_number = g_strndup(peer_number, hostname - peer_number); - } - else { - display_number = peer_number; - } - } - else { - - display_number = peer_number; - } + hostname = g_strrstr (peer_number, "@"); + + // Test if we are dialing a new number + if (g_strcmp0 ("", c->_peer_number) != 0) { + + // Strip the hostname if existent + if (hostname) { + display_number = g_strndup (peer_number, hostname - peer_number); + } else { + display_number = peer_number; + } + } else { + + display_number = peer_number; + } } + // Different display depending on type - switch(display_type) { - - case DISPLAY_TYPE_CALL: - - DEBUG("CallTree: Display a normal call"); - if(c->_state_code == 0) { - - if(g_strcmp0("", c->_peer_name) == 0) { - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>", - display_number, c->_peer_name); - } - else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - c->_peer_name, display_number); - } - - } - else { - if(g_strcmp0("", c->_peer_name) == 0) { - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>%s (%d)</i>", - display_number, c->_peer_name, - c->_state_code_description, c->_state_code); - } - else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i>", - c->_peer_name, display_number, - c->_state_code_description, c->_state_code); - } - } - break; - - - case DISPLAY_TYPE_CALL_TRANSFER: - - DEBUG("CallTree: Display a call transfer") - - if(g_strcmp0("",c->_peer_name) == 0){ - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>Transfert to:%s</i> ", - display_number, c->_peer_name, c->_trsft_to); - } - else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:%s</i> ", - c->_peer_name, display_number, c->_trsft_to); - } - break; - - - case DISPLAY_TYPE_STATE_CODE : - - DEBUG("CallTree: Display a state code"); - - if(g_strcmp0("",c->_peer_name) == 0){ - - if (c->_state_code) { - - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>%s (%d)</i> <i>%s</i>", - display_number, c->_peer_name, - c->_state_code_description, c->_state_code, - audio_codec); - } else { - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>%s</i>", - display_number, c->_peer_name, audio_codec); - } - } - else { - if (c->_state_code) { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i> <i>%s</i>", - c->_peer_name, display_number, - c->_state_code_description, c->_state_code, - audio_codec); - } else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s</i>", - c->_peer_name, display_number, audio_codec); - } - } - break; - - case DISPLAY_TYPE_SAS: - - DEBUG("CallTree: Display a call with sas"); - - if(g_strcmp0("", c->_peer_name) == 0){ - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>Confirm SAS <b>%s</b> ?</i> ", - display_number, c->_peer_name, c->_sas); - } - else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Confirm SAS <b>%s</b> ?</i> ", - c->_peer_name, display_number, c->_sas); - } - break; - - case DISPLAY_TYPE_HISTORY : - - DEBUG("CallTree: Display history entry"); - - if(g_strcmp0("", c->_peer_name) == 0) { - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>", - display_number, c->_peer_name); - } - else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - c->_peer_name, display_number); - } - break; - - default : - DEBUG("CallTree: Not an allowable type of display"); - break; + switch (display_type) { + + case DISPLAY_TYPE_CALL: + + DEBUG ("CallTree: Display a normal call"); + + if (c->_state_code == 0) { + + if (g_strcmp0 ("", c->_peer_name) == 0) { + description = g_markup_printf_escaped ("<b>%s</b><i>%s</i>", + display_number, c->_peer_name); + } else { + description = g_markup_printf_escaped ("<b>%s</b> <i>%s</i>", + c->_peer_name, display_number); + } + + } else { + if (g_strcmp0 ("", c->_peer_name) == 0) { + description = g_markup_printf_escaped ("<b>%s</b><i>%s</i>\n<i>%s (%d)</i>", + display_number, c->_peer_name, + c->_state_code_description, c->_state_code); + } else { + description = g_markup_printf_escaped ("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i>", + c->_peer_name, display_number, + c->_state_code_description, c->_state_code); + } + } + + break; + + + case DISPLAY_TYPE_CALL_TRANSFER: + + DEBUG ("CallTree: Display a call transfer") + + if (g_strcmp0 ("",c->_peer_name) == 0) { + description = g_markup_printf_escaped ("<b>%s</b><i>%s</i>\n<i>Transfert to:%s</i> ", + display_number, c->_peer_name, c->_trsft_to); + } else { + description = g_markup_printf_escaped ("<b>%s</b> <i>%s</i>\n<i>Transfert to:%s</i> ", + c->_peer_name, display_number, c->_trsft_to); + } + + break; + + + case DISPLAY_TYPE_STATE_CODE : + + DEBUG ("CallTree: Display a state code"); + + if (g_strcmp0 ("",c->_peer_name) == 0) { + + if (c->_state_code) { + + description = g_markup_printf_escaped ("<b>%s</b><i>%s</i>\n<i>%s (%d)</i> <i>%s</i>", + display_number, c->_peer_name, + c->_state_code_description, c->_state_code, + audio_codec); + } else { + description = g_markup_printf_escaped ("<b>%s</b><i>%s</i>\n<i>%s</i>", + display_number, c->_peer_name, audio_codec); + } + } else { + if (c->_state_code) { + description = g_markup_printf_escaped ("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i> <i>%s</i>", + c->_peer_name, display_number, + c->_state_code_description, c->_state_code, + audio_codec); + } else { + description = g_markup_printf_escaped ("<b>%s</b> <i>%s</i>\n<i>%s</i>", + c->_peer_name, display_number, audio_codec); + } + } + + break; + + case DISPLAY_TYPE_SAS: + + DEBUG ("CallTree: Display a call with sas"); + + if (g_strcmp0 ("", c->_peer_name) == 0) { + description = g_markup_printf_escaped ("<b>%s</b><i>%s</i>\n<i>Confirm SAS <b>%s</b> ?</i> ", + display_number, c->_peer_name, c->_sas); + } else { + description = g_markup_printf_escaped ("<b>%s</b> <i>%s</i>\n<i>Confirm SAS <b>%s</b> ?</i> ", + c->_peer_name, display_number, c->_sas); + } + + break; + + case DISPLAY_TYPE_HISTORY : + + DEBUG ("CallTree: Display history entry"); + + if (g_strcmp0 ("", c->_peer_name) == 0) { + description = g_markup_printf_escaped ("<b>%s</b><i>%s</i>", + display_number, c->_peer_name); + } else { + description = g_markup_printf_escaped ("<b>%s</b> <i>%s</i>", + c->_peer_name, display_number); + } + + break; + + default : + DEBUG ("CallTree: Not an allowable type of display"); + break; } // return description; - tmp_info = g_strdup(description); + tmp_info = g_strdup (description); *display_info = tmp_info; } @@ -501,191 +500,193 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch /** * Reset call tree */ - void +void calltree_reset (calltab_t* tab) { - gtk_tree_store_clear (tab->store); + gtk_tree_store_clear (tab->store); } void -focus_on_calltree_out(){ - //DEBUG("set_focus_on_calltree_out"); - // gtk_widget_grab_focus(GTK_WIDGET(sw)); - focus_is_on_calltree = FALSE; +focus_on_calltree_out() +{ + //DEBUG("set_focus_on_calltree_out"); + // gtk_widget_grab_focus(GTK_WIDGET(sw)); + focus_is_on_calltree = FALSE; } void -focus_on_calltree_in(){ - //DEBUG("set_focus_on_calltree_in"); - // gtk_widget_grab_focus(GTK_WIDGET(sw)); - focus_is_on_calltree = TRUE; +focus_on_calltree_in() +{ + //DEBUG("set_focus_on_calltree_in"); + // gtk_widget_grab_focus(GTK_WIDGET(sw)); + focus_is_on_calltree = TRUE; } - void +void calltree_create (calltab_t* tab, gboolean searchbar_type) { - tab->tree = gtk_vbox_new(FALSE, 10); + tab->tree = gtk_vbox_new (FALSE, 10); - // Fix bug #708 (resize) - gtk_widget_set_size_request(tab->tree,100,80); + // Fix bug #708 (resize) + gtk_widget_set_size_request (tab->tree,100,80); - gtk_container_set_border_width (GTK_CONTAINER (tab->tree), 0); + gtk_container_set_border_width (GTK_CONTAINER (tab->tree), 0); - sw = gtk_scrolled_window_new( NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); - tab->store = gtk_tree_store_new (4, - GDK_TYPE_PIXBUF,// Icon - G_TYPE_STRING, // Description - GDK_TYPE_PIXBUF, // Security Icon - G_TYPE_POINTER // Pointer to the Object - ); + tab->store = gtk_tree_store_new (4, + GDK_TYPE_PIXBUF,// Icon + G_TYPE_STRING, // Description + GDK_TYPE_PIXBUF, // Security Icon + G_TYPE_POINTER // Pointer to the Object + ); - tab->view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(tab->store)); - gtk_tree_view_set_enable_search( GTK_TREE_VIEW(tab->view), FALSE); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(tab->view), FALSE); - g_signal_connect (G_OBJECT (tab->view), "row-activated", - G_CALLBACK (row_activated), - NULL); + tab->view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tab->store)); + gtk_tree_view_set_enable_search (GTK_TREE_VIEW (tab->view), FALSE); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tab->view), FALSE); + g_signal_connect (G_OBJECT (tab->view), "row-activated", + G_CALLBACK (row_activated), + NULL); - GTK_WIDGET_SET_FLAGS (GTK_WIDGET(sw),GTK_CAN_FOCUS); - gtk_widget_grab_focus (GTK_WIDGET(sw)); + GTK_WIDGET_SET_FLAGS (GTK_WIDGET (sw),GTK_CAN_FOCUS); + gtk_widget_grab_focus (GTK_WIDGET (sw)); - g_signal_connect (G_OBJECT (tab->view), "cursor-changed", - G_CALLBACK (row_single_click), - NULL); + g_signal_connect (G_OBJECT (tab->view), "cursor-changed", + G_CALLBACK (row_single_click), + NULL); - // Connect the popup menu - g_signal_connect (G_OBJECT (tab->view), "popup-menu", - G_CALLBACK (popup_menu), - NULL); - g_signal_connect (G_OBJECT (tab->view), "button-press-event", - G_CALLBACK (button_pressed), - NULL); + // Connect the popup menu + g_signal_connect (G_OBJECT (tab->view), "popup-menu", + G_CALLBACK (popup_menu), + NULL); + g_signal_connect (G_OBJECT (tab->view), "button-press-event", + G_CALLBACK (button_pressed), + NULL); - // g_signal_connect (G_OBJECT (sw), "key-release-event", - // G_CALLBACK (on_key_released), NULL); + // g_signal_connect (G_OBJECT (sw), "key-release-event", + // G_CALLBACK (on_key_released), NULL); - g_signal_connect_after (G_OBJECT (tab->view), "focus-in-event", - G_CALLBACK (focus_on_calltree_in), NULL); - g_signal_connect_after (G_OBJECT (tab->view), "focus-out-event", - G_CALLBACK (focus_on_calltree_out), NULL); + g_signal_connect_after (G_OBJECT (tab->view), "focus-in-event", + G_CALLBACK (focus_on_calltree_in), NULL); + g_signal_connect_after (G_OBJECT (tab->view), "focus-out-event", + G_CALLBACK (focus_on_calltree_out), NULL); - if(tab != history && tab!=contacts) { + if (tab != history && tab!=contacts) { - DEBUG("SET TREE VIEW REORDABLE"); - // Make calltree reordable for drag n drop - gtk_tree_view_set_reorderable(GTK_TREE_VIEW(tab->view), TRUE); + DEBUG ("SET TREE VIEW REORDABLE"); + // Make calltree reordable for drag n drop + gtk_tree_view_set_reorderable (GTK_TREE_VIEW (tab->view), TRUE); - // source widget drag n drop signals - g_signal_connect (G_OBJECT (tab->view), "drag_begin", G_CALLBACK (drag_begin_cb), NULL); - g_signal_connect (G_OBJECT (tab->view), "drag_end", G_CALLBACK (drag_end_cb), NULL); + // source widget drag n drop signals + g_signal_connect (G_OBJECT (tab->view), "drag_begin", G_CALLBACK (drag_begin_cb), NULL); + g_signal_connect (G_OBJECT (tab->view), "drag_end", G_CALLBACK (drag_end_cb), NULL); - // destination widget drag n drop signals - g_signal_connect (G_OBJECT (tab->view), "drag_data_received", G_CALLBACK (drag_data_received_cb), NULL); + // destination widget drag n drop signals + g_signal_connect (G_OBJECT (tab->view), "drag_data_received", G_CALLBACK (drag_data_received_cb), NULL); - } + } - gtk_widget_grab_focus(GTK_WIDGET(tab->view)); + gtk_widget_grab_focus (GTK_WIDGET (tab->view)); + + rend = gtk_cell_renderer_pixbuf_new(); + col = gtk_tree_view_column_new_with_attributes ("Icon", + rend, + "pixbuf", 0, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tab->view), col); + + rend = gtk_cell_renderer_text_new(); + col = gtk_tree_view_column_new_with_attributes ("Description", + rend, + "markup", COLUMN_ACCOUNT_DESC, + NULL); + g_object_set (rend, "wrap-mode", (PangoWrapMode) PANGO_WRAP_WORD_CHAR, NULL); + g_object_set (rend, "wrap-width", (gint) CALLTREE_TEXT_WIDTH, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tab->view), col); + + /* Security icon */ + rend = gtk_cell_renderer_pixbuf_new(); + col = gtk_tree_view_column_new_with_attributes ("Icon", + rend, + "pixbuf", COLUMN_ACCOUNT_SECURITY, + NULL); + g_object_set (rend, "xalign", (gfloat) 1.0, NULL); + g_object_set (rend, "yalign", (gfloat) 0.0, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tab->view), col); + + + g_object_unref (G_OBJECT (tab->store)); + gtk_container_add (GTK_CONTAINER (sw), tab->view); + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tab->view)); + g_signal_connect (G_OBJECT (sel), "changed", + G_CALLBACK (call_selected_cb), + NULL); + + gtk_box_pack_start (GTK_BOX (tab->tree), sw, TRUE, TRUE, 0); + + // search bar if tab is either "history" or "addressbook" + if (searchbar_type) { + calltab_create_searchbar (tab); + gtk_box_pack_start (GTK_BOX (tab->tree), tab->searchbar, FALSE, TRUE, 0); + } - rend = gtk_cell_renderer_pixbuf_new(); - col = gtk_tree_view_column_new_with_attributes ("Icon", - rend, - "pixbuf", 0, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); + gtk_widget_show (tab->tree); +} - rend = gtk_cell_renderer_text_new(); - col = gtk_tree_view_column_new_with_attributes ("Description", - rend, - "markup", COLUMN_ACCOUNT_DESC, - NULL); - g_object_set(rend, "wrap-mode", (PangoWrapMode) PANGO_WRAP_WORD_CHAR, NULL); - g_object_set(rend, "wrap-width", (gint) CALLTREE_TEXT_WIDTH, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); - /* Security icon */ - rend = gtk_cell_renderer_pixbuf_new(); - col = gtk_tree_view_column_new_with_attributes ("Icon", - rend, - "pixbuf", COLUMN_ACCOUNT_SECURITY, - NULL); - g_object_set(rend, "xalign", (gfloat) 1.0, NULL); - g_object_set(rend, "yalign", (gfloat) 0.0, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); +void +calltree_remove_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) +{ + GtkTreeIter iter; + GValue val; + callable_obj_t * iterCall; + GtkTreeStore* store = tab->store; - g_object_unref(G_OBJECT(tab->store)); - gtk_container_add(GTK_CONTAINER(sw), tab->view); + if (!c) + ERROR ("CallTree: Error: Not a valid call"); - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tab->view)); - g_signal_connect (G_OBJECT (sel), "changed", - G_CALLBACK (call_selected_cb), - NULL); + DEBUG ("CallTree: Remove call %s", c->_callID); - gtk_box_pack_start(GTK_BOX(tab->tree), sw, TRUE, TRUE, 0); + int nbChild = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), parent); + int i; - // search bar if tab is either "history" or "addressbook" - if(searchbar_type){ - calltab_create_searchbar (tab); - gtk_box_pack_start(GTK_BOX(tab->tree), tab->searchbar, FALSE, TRUE, 0); - } + for (i = 0; i < nbChild; i++) { + if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &iter, parent, i)) { + if (gtk_tree_model_iter_has_child (GTK_TREE_MODEL (store), &iter)) { + calltree_remove_call (tab, c, &iter); + } - gtk_widget_show(tab->tree); -} + val.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL (store), &iter, COLUMN_ACCOUNT_PTR, &val); + iterCall = (callable_obj_t*) g_value_get_pointer (&val); + g_value_unset (&val); - void -calltree_remove_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) -{ + if (iterCall == c) { + gtk_tree_store_remove (store, &iter); + } + } + } - GtkTreeIter iter; - GValue val; - callable_obj_t * iterCall; - GtkTreeStore* store = tab->store; - - if(!c) - ERROR("CallTree: Error: Not a valid call"); - - DEBUG("CallTree: Remove call %s", c->_callID); - - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); - int i; - for( i = 0; i < nbChild; i++) - { - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, parent, i)) - { - if(gtk_tree_model_iter_has_child(GTK_TREE_MODEL(store), &iter)) - { - calltree_remove_call (tab, c, &iter); - } - - val.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, COLUMN_ACCOUNT_PTR, &val); - - iterCall = (callable_obj_t*) g_value_get_pointer(&val); - g_value_unset(&val); - - if(iterCall == c) - { - gtk_tree_store_remove(store, &iter); - } - } - } - callable_obj_t * selectedCall = calltab_get_selected_call(tab); - if(selectedCall == c) - calltab_select_call(tab, NULL); - update_actions(); - - DEBUG("Calltre remove call ended"); + callable_obj_t * selectedCall = calltab_get_selected_call (tab); + + if (selectedCall == c) + calltab_select_call (tab, NULL); + + update_actions(); + + DEBUG ("Calltre remove call ended"); } - void +void calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) { GdkPixbuf *pixbuf=NULL; @@ -701,165 +702,177 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) account_t* account_details=NULL; gchar *audio_codec = ""; - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); + int nbChild = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), parent); int i; - if(c != NULL) { - account_details = account_list_get_by_id(c->_accountID); - if(account_details != NULL) { - srtp_enabled = g_hash_table_lookup(account_details->properties, ACCOUNT_SRTP_ENABLED); - if(g_strcasecmp(g_hash_table_lookup(account_details->properties, ACCOUNT_ZRTP_DISPLAY_SAS),"false") == 0) - { display_sas = FALSE; } - } else { - GHashTable * properties = NULL; - sflphone_get_ip2ip_properties (&properties); - if(properties != NULL) { - srtp_enabled = g_hash_table_lookup(properties, ACCOUNT_SRTP_ENABLED); - if(g_strcasecmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_DISPLAY_SAS),"false") == 0) - { display_sas = FALSE; } - } - } - } - - for( i = 0; i < nbChild; i++) { - - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, parent, i)) { - - if(gtk_tree_model_iter_has_child(GTK_TREE_MODEL(store), &iter)) { - calltree_update_call (tab, c, &iter); - } - - val.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, COLUMN_ACCOUNT_PTR, &val); - - - iterCall = (callable_obj_t*) g_value_get_pointer(&val); - g_value_unset(&val); - - if(iterCall != c) { - continue; - } - - /* Update text */ - gchar * description; - gchar * date=""; - gchar * duration=""; - audio_codec = call_get_audio_codec (c); - - if(c->_state == CALL_STATE_TRANSFERT) { - - calltree_display_call_info(c, DISPLAY_TYPE_CALL_TRANSFER, NULL, &description); - - } - else { - - if((c->_sas != NULL) && (display_sas == TRUE) && (c->_srtp_state == SRTP_STATE_ZRTP_SAS_UNCONFIRMED) && (c->_zrtp_confirmed == FALSE)) { - calltree_display_call_info(c, DISPLAY_TYPE_SAS, NULL, &description); - } else { - calltree_display_call_info(c, DISPLAY_TYPE_STATE_CODE, audio_codec, &description); - } - } - - /* Update icons */ - if( tab == current_calls ) { - DEBUG("Receiving in state %d", c->_state); - switch(c->_state) { - case CALL_STATE_HOLD: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); - break; - case CALL_STATE_INCOMING: - case CALL_STATE_RINGING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - case CALL_STATE_CURRENT: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); - break; - case CALL_STATE_DIALING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); - break; - case CALL_STATE_FAILURE: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); - break; - case CALL_STATE_BUSY: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/busy.svg", NULL); - break; - case CALL_STATE_TRANSFERT: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/transfert.svg", NULL); - break; - case CALL_STATE_RECORD: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL); - break; - default: - WARN("Update calltree - Should not happen!"); - } - - switch(c->_srtp_state) { - case SRTP_STATE_SDES_SUCCESS: - DEBUG("SDES negotiation succes"); - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_confirmed.svg", NULL); - break; - case SRTP_STATE_ZRTP_SAS_UNCONFIRMED: - DEBUG("Secure is ON"); - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_unconfirmed.svg", NULL); - if(c->_sas != NULL) { DEBUG("SAS is ready with value %s", c->_sas); } - break; - case SRTP_STATE_ZRTP_SAS_CONFIRMED: - DEBUG("SAS is confirmed"); - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_confirmed.svg", NULL); - break; - case SRTP_STATE_ZRTP_SAS_SIGNED: - DEBUG("Secure is ON with SAS signed and verified"); - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_certified.svg", NULL); - break; - case SRTP_STATE_UNLOCKED: - DEBUG("Secure is off calltree %d", c->_state); - if(g_strcasecmp(srtp_enabled,"true") == 0) { - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_off.svg", NULL); - } - break; - default: - WARN("Update calltree srtp state #%d- Should not happen!", c->_srtp_state); - if(g_strcasecmp(srtp_enabled,"true") == 0) { - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_off.svg", NULL); - } - - } - - } - else if(tab == history) { - switch(c->_history_state) { - case INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); - break; - case OUTGOING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); - break; - case MISSED: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); - break; - default: - WARN("History - Should not happen!"); - } - - calltree_display_call_info(c, DISPLAY_TYPE_HISTORY, NULL, &description); - - date = get_formatted_start_timestamp (c); - duration = get_call_duration (c); - duration = g_strconcat( date , duration , NULL); - description = g_strconcat( description , duration, NULL); - } - - gtk_tree_store_set(store, &iter, - 0, pixbuf, // Icon - 1, description, // Description - 2, pixbuf_security, - 3, c, - -1); - - if (pixbuf != NULL) - g_object_unref(G_OBJECT(pixbuf)); - } - + if (c != NULL) { + account_details = account_list_get_by_id (c->_accountID); + + if (account_details != NULL) { + srtp_enabled = g_hash_table_lookup (account_details->properties, ACCOUNT_SRTP_ENABLED); + + if (g_strcasecmp (g_hash_table_lookup (account_details->properties, ACCOUNT_ZRTP_DISPLAY_SAS),"false") == 0) { + display_sas = FALSE; + } + } else { + GHashTable * properties = NULL; + sflphone_get_ip2ip_properties (&properties); + + if (properties != NULL) { + srtp_enabled = g_hash_table_lookup (properties, ACCOUNT_SRTP_ENABLED); + + if (g_strcasecmp (g_hash_table_lookup (properties, ACCOUNT_ZRTP_DISPLAY_SAS),"false") == 0) { + display_sas = FALSE; + } + } + } + } + + for (i = 0; i < nbChild; i++) { + + if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &iter, parent, i)) { + + if (gtk_tree_model_iter_has_child (GTK_TREE_MODEL (store), &iter)) { + calltree_update_call (tab, c, &iter); + } + + val.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL (store), &iter, COLUMN_ACCOUNT_PTR, &val); + + + iterCall = (callable_obj_t*) g_value_get_pointer (&val); + g_value_unset (&val); + + if (iterCall != c) { + continue; + } + + /* Update text */ + gchar * description; + gchar * date=""; + gchar * duration=""; + audio_codec = call_get_audio_codec (c); + + if (c->_state == CALL_STATE_TRANSFERT) { + + calltree_display_call_info (c, DISPLAY_TYPE_CALL_TRANSFER, NULL, &description); + + } else { + + if ( (c->_sas != NULL) && (display_sas == TRUE) && (c->_srtp_state == SRTP_STATE_ZRTP_SAS_UNCONFIRMED) && (c->_zrtp_confirmed == FALSE)) { + calltree_display_call_info (c, DISPLAY_TYPE_SAS, NULL, &description); + } else { + calltree_display_call_info (c, DISPLAY_TYPE_STATE_CODE, audio_codec, &description); + } + } + + /* Update icons */ + if (tab == current_calls) { + DEBUG ("Receiving in state %d", c->_state); + + switch (c->_state) { + case CALL_STATE_HOLD: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/hold.svg", NULL); + break; + case CALL_STATE_INCOMING: + case CALL_STATE_RINGING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/ring.svg", NULL); + break; + case CALL_STATE_CURRENT: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/current.svg", NULL); + break; + case CALL_STATE_DIALING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/dial.svg", NULL); + break; + case CALL_STATE_FAILURE: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/fail.svg", NULL); + break; + case CALL_STATE_BUSY: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/busy.svg", NULL); + break; + case CALL_STATE_TRANSFERT: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/transfert.svg", NULL); + break; + case CALL_STATE_RECORD: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/icon_rec.svg", NULL); + break; + default: + WARN ("Update calltree - Should not happen!"); + } + + switch (c->_srtp_state) { + case SRTP_STATE_SDES_SUCCESS: + DEBUG ("SDES negotiation succes"); + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_confirmed.svg", NULL); + break; + case SRTP_STATE_ZRTP_SAS_UNCONFIRMED: + DEBUG ("Secure is ON"); + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_unconfirmed.svg", NULL); + + if (c->_sas != NULL) { + DEBUG ("SAS is ready with value %s", c->_sas); + } + + break; + case SRTP_STATE_ZRTP_SAS_CONFIRMED: + DEBUG ("SAS is confirmed"); + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_confirmed.svg", NULL); + break; + case SRTP_STATE_ZRTP_SAS_SIGNED: + DEBUG ("Secure is ON with SAS signed and verified"); + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_certified.svg", NULL); + break; + case SRTP_STATE_UNLOCKED: + DEBUG ("Secure is off calltree %d", c->_state); + + if (g_strcasecmp (srtp_enabled,"true") == 0) { + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_off.svg", NULL); + } + + break; + default: + WARN ("Update calltree srtp state #%d- Should not happen!", c->_srtp_state); + + if (g_strcasecmp (srtp_enabled,"true") == 0) { + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_off.svg", NULL); + } + + } + + } else if (tab == history) { + switch (c->_history_state) { + case INCOMING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/incoming.svg", NULL); + break; + case OUTGOING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/outgoing.svg", NULL); + break; + case MISSED: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/missed.svg", NULL); + break; + default: + WARN ("History - Should not happen!"); + } + + calltree_display_call_info (c, DISPLAY_TYPE_HISTORY, NULL, &description); + + date = get_formatted_start_timestamp (c); + duration = get_call_duration (c); + duration = g_strconcat (date , duration , NULL); + description = g_strconcat (description , duration, NULL); + } + + gtk_tree_store_set (store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + 2, pixbuf_security, + 3, c, + -1); + + if (pixbuf != NULL) + g_object_unref (G_OBJECT (pixbuf)); + } + } update_actions(); @@ -869,191 +882,186 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) void calltree_add_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) { - DEBUG("CallTree: Add call to calltree id: %s, peer name: %s", c->_callID, c->_peer_name); - - if (tab == history) - { - calltree_add_history_entry (c); - return; - } - - account_t* account_details=NULL; - - GdkPixbuf *pixbuf=NULL; - GdkPixbuf *pixbuf_security=NULL; - GtkTreeIter iter; - gchar* key_exchange=""; - gchar* srtp_enabled=""; - - // New call in the list - gchar * description; - gchar * date=""; - gchar *duration=""; - - calltree_display_call_info(c, DISPLAY_TYPE_CALL, NULL, &description); - - gtk_tree_store_prepend (tab->store, &iter, parent); - - if(c != NULL) { - account_details = account_list_get_by_id(c->_callID); - if(account_details != NULL) { - srtp_enabled = g_hash_table_lookup(account_details->properties, ACCOUNT_SRTP_ENABLED); - key_exchange = g_hash_table_lookup(account_details->properties, ACCOUNT_KEY_EXCHANGE); - } - } - - DEBUG("Added call key exchange is %s", key_exchange) - - if( tab == current_calls ) - { - switch(c->_state) - { - case CALL_STATE_INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - case CALL_STATE_DIALING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); - break; - case CALL_STATE_RINGING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - case CALL_STATE_CURRENT: - // If the call has been initiated by a another client and, when we start, it is already current - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); - break; - case CALL_STATE_HOLD: - // If the call has been initiated by a another client and, when we start, it is already current - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); - break; - case CALL_STATE_FAILURE: - // If the call has been initiated by a another client and, when we start, it is already current - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); - break; - default: - WARN("Update calltree add - Should not happen!"); - } - - if(g_strcasecmp(srtp_enabled,"true") == 0) { - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/secure_off.svg", NULL); - } - } - - else if (tab == contacts) { - pixbuf = c->_contact_thumbnail; - description = g_strconcat( description , NULL); - } - - else { - WARN ("This widget doesn't exist - This is a bug in the application."); - } - - - //Resize it - if(pixbuf) - { - if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) - { - pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); - } - } - - if(pixbuf_security) - { - if(gdk_pixbuf_get_width(pixbuf_security) > 32 || gdk_pixbuf_get_height(pixbuf_security) > 32) - { - pixbuf_security = gdk_pixbuf_scale_simple(pixbuf_security, 32, 32, GDK_INTERP_BILINEAR); - } - } - - gtk_tree_store_set(tab->store, &iter, - 0, pixbuf, // Icon - 1, description, // Description - 2, pixbuf_security, // Informs user about the state of security - 3, c, // Pointer - -1); - - if (pixbuf != NULL) - { g_object_unref(G_OBJECT(pixbuf)); } - if (pixbuf_security != NULL) - { g_object_unref(G_OBJECT(pixbuf)); } - - gtk_tree_view_set_model (GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(history->store)); - - gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(tab->view)), &iter); - - history_reinit(history); + DEBUG ("CallTree: Add call to calltree id: %s, peer name: %s", c->_callID, c->_peer_name); + + if (tab == history) { + calltree_add_history_entry (c); + return; + } + + account_t* account_details=NULL; + + GdkPixbuf *pixbuf=NULL; + GdkPixbuf *pixbuf_security=NULL; + GtkTreeIter iter; + gchar* key_exchange=""; + gchar* srtp_enabled=""; + + // New call in the list + gchar * description; + gchar * date=""; + gchar *duration=""; + + calltree_display_call_info (c, DISPLAY_TYPE_CALL, NULL, &description); + + gtk_tree_store_prepend (tab->store, &iter, parent); + + if (c != NULL) { + account_details = account_list_get_by_id (c->_callID); + + if (account_details != NULL) { + srtp_enabled = g_hash_table_lookup (account_details->properties, ACCOUNT_SRTP_ENABLED); + key_exchange = g_hash_table_lookup (account_details->properties, ACCOUNT_KEY_EXCHANGE); + } + } + + DEBUG ("Added call key exchange is %s", key_exchange) + + if (tab == current_calls) { + switch (c->_state) { + case CALL_STATE_INCOMING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/ring.svg", NULL); + break; + case CALL_STATE_DIALING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/dial.svg", NULL); + break; + case CALL_STATE_RINGING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/ring.svg", NULL); + break; + case CALL_STATE_CURRENT: + // If the call has been initiated by a another client and, when we start, it is already current + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/current.svg", NULL); + break; + case CALL_STATE_HOLD: + // If the call has been initiated by a another client and, when we start, it is already current + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/hold.svg", NULL); + break; + case CALL_STATE_FAILURE: + // If the call has been initiated by a another client and, when we start, it is already current + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/fail.svg", NULL); + break; + default: + WARN ("Update calltree add - Should not happen!"); + } + + if (g_strcasecmp (srtp_enabled,"true") == 0) { + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/secure_off.svg", NULL); + } + } + + else if (tab == contacts) { + pixbuf = c->_contact_thumbnail; + description = g_strconcat (description , NULL); + } + + else { + WARN ("This widget doesn't exist - This is a bug in the application."); + } + + + //Resize it + if (pixbuf) { + if (gdk_pixbuf_get_width (pixbuf) > 32 || gdk_pixbuf_get_height (pixbuf) > 32) { + pixbuf = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } + } + + if (pixbuf_security) { + if (gdk_pixbuf_get_width (pixbuf_security) > 32 || gdk_pixbuf_get_height (pixbuf_security) > 32) { + pixbuf_security = gdk_pixbuf_scale_simple (pixbuf_security, 32, 32, GDK_INTERP_BILINEAR); + } + } + + gtk_tree_store_set (tab->store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + 2, pixbuf_security, // Informs user about the state of security + 3, c, // Pointer + -1); + + if (pixbuf != NULL) { + g_object_unref (G_OBJECT (pixbuf)); + } + + if (pixbuf_security != NULL) { + g_object_unref (G_OBJECT (pixbuf)); + } + + gtk_tree_view_set_model (GTK_TREE_VIEW (history->view), GTK_TREE_MODEL (history->store)); + + gtk_tree_selection_select_iter (gtk_tree_view_get_selection (GTK_TREE_VIEW (tab->view)), &iter); + + history_reinit (history); } void calltree_add_history_entry (callable_obj_t * c) { - DEBUG("calltree_add_history_entry %s", c->_callID); - - if (!eel_gconf_get_integer (HISTORY_ENABLED)) - return; - - GdkPixbuf *pixbuf=NULL; - GdkPixbuf *pixbuf_security=NULL; - GtkTreeIter iter; - - // New call in the list - gchar * description, *date="", *duration=""; - - calltree_display_call_info(c, DISPLAY_TYPE_HISTORY, NULL, &description); - - gtk_tree_store_prepend (history->store, &iter, NULL); - - switch(c->_history_state) - { - case INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); - break; - case OUTGOING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); - break; - case MISSED: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); - break; - default: - WARN("History - Should not happen!"); - } - - date = get_formatted_start_timestamp (c); - duration = get_call_duration (c); - duration = g_strconcat( date , duration , NULL); - description = g_strconcat( description , duration, NULL); - - //Resize it - if(pixbuf) - { - if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) - { - pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); - } - } - - if(pixbuf_security != NULL) - { - if(gdk_pixbuf_get_width(pixbuf_security) > 32 || gdk_pixbuf_get_height(pixbuf_security) > 32) - { - pixbuf_security = gdk_pixbuf_scale_simple(pixbuf_security, 32, 32, GDK_INTERP_BILINEAR); - } - } - gtk_tree_store_set(history->store, &iter, - 0, pixbuf, // Icon - 1, description, // Description - 2, pixbuf_security, // Icon - 3, c, // Pointer - -1); - - if (pixbuf != NULL) - g_object_unref(G_OBJECT(pixbuf)); - if (pixbuf_security != NULL) - { g_object_unref(G_OBJECT(pixbuf_security)); } - - gtk_tree_view_set_model (GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(history->store)); - - history_reinit(history); + DEBUG ("calltree_add_history_entry %s", c->_callID); + + if (!eel_gconf_get_integer (HISTORY_ENABLED)) + return; + + GdkPixbuf *pixbuf=NULL; + GdkPixbuf *pixbuf_security=NULL; + GtkTreeIter iter; + + // New call in the list + gchar * description, *date="", *duration=""; + + calltree_display_call_info (c, DISPLAY_TYPE_HISTORY, NULL, &description); + + gtk_tree_store_prepend (history->store, &iter, NULL); + + switch (c->_history_state) { + case INCOMING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/incoming.svg", NULL); + break; + case OUTGOING: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/outgoing.svg", NULL); + break; + case MISSED: + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/missed.svg", NULL); + break; + default: + WARN ("History - Should not happen!"); + } + + date = get_formatted_start_timestamp (c); + duration = get_call_duration (c); + duration = g_strconcat (date , duration , NULL); + description = g_strconcat (description , duration, NULL); + + //Resize it + if (pixbuf) { + if (gdk_pixbuf_get_width (pixbuf) > 32 || gdk_pixbuf_get_height (pixbuf) > 32) { + pixbuf = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } + } + + if (pixbuf_security != NULL) { + if (gdk_pixbuf_get_width (pixbuf_security) > 32 || gdk_pixbuf_get_height (pixbuf_security) > 32) { + pixbuf_security = gdk_pixbuf_scale_simple (pixbuf_security, 32, 32, GDK_INTERP_BILINEAR); + } + } + + gtk_tree_store_set (history->store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + 2, pixbuf_security, // Icon + 3, c, // Pointer + -1); + + if (pixbuf != NULL) + g_object_unref (G_OBJECT (pixbuf)); + + if (pixbuf_security != NULL) { + g_object_unref (G_OBJECT (pixbuf_security)); + } + + gtk_tree_view_set_model (GTK_TREE_VIEW (history->view), GTK_TREE_MODEL (history->store)); + + history_reinit (history); } @@ -1064,7 +1072,7 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf) GdkPixbuf *pixbuf_security=NULL; GtkTreeIter iter; GtkTreePath *path; - GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; + GtkTreeModel *model = (GtkTreeModel*) active_calltree->store; // gchar** participant = dbus_get_participant_list(conf->_confID); // gchar** pl; @@ -1077,191 +1085,188 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf) gchar* srtp_enabled=""; // New call in the list - + gchar * description; - if(!conf) { - ERROR("Calltree: Error: Conference is null!!"); - return; + if (!conf) { + ERROR ("Calltree: Error: Conference is null!!"); + return; } - DEBUG("Calltree: Add conference %s", conf->_confID); + DEBUG ("Calltree: Add conference %s", conf->_confID); // description = g_markup_printf_escaped("<b>%s</b>", conf->_confID); - description = g_markup_printf_escaped("<b>%s</b>", ""); + description = g_markup_printf_escaped ("<b>%s</b>", ""); gtk_tree_store_append (tab->store, &iter, NULL); - if( tab == current_calls ) - { - - switch(conf->_state) - { - case CONFERENCE_STATE_ACTIVE_ATACHED: - { - - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/usersActive.svg", NULL); - break; - } - case CONFERENCE_STATE_ACTIVE_DETACHED: - case CONFERENCE_STATE_HOLD: - { - - - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/users.svg", NULL); - break; - } - default: - WARN("Update conference add - Should not happen!"); - } - } - else - { - DEBUG("Error Conference State NULL for conferece %s!!!!!", conf->_confID); + if (tab == current_calls) { + + switch (conf->_state) { + case CONFERENCE_STATE_ACTIVE_ATACHED: { + + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/usersActive.svg", NULL); + break; + } + case CONFERENCE_STATE_ACTIVE_DETACHED: + case CONFERENCE_STATE_HOLD: { + + + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/users.svg", NULL); + break; + } + default: + WARN ("Update conference add - Should not happen!"); + } + } else { + DEBUG ("Error Conference State NULL for conferece %s!!!!!", conf->_confID); } //Resize it - if(pixbuf) { - if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) { - pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); - } + if (pixbuf) { + if (gdk_pixbuf_get_width (pixbuf) > 32 || gdk_pixbuf_get_height (pixbuf) > 32) { + pixbuf = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } + } else { + DEBUG ("Error no pixbuff for conference from %s", ICONS_DIR); } - else { - DEBUG("Error no pixbuff for conference from %s", ICONS_DIR); - } - + // Used to determine if at least one participant use a security feature - // If true (at least on call use a security feature) we need to display security icons + // If true (at least on call use a security feature) we need to display security icons conf->_conf_srtp_enabled = FALSE; - + // Used to determine if the conference is secured // Every participant to a conference must be secured, the conference is not secured elsewhere conf->_conference_secured = TRUE; - DEBUG("Calltree: Determine if conference is secured"); - + DEBUG ("Calltree: Determine if conference is secured"); + // participant = conf->participant; // participant = dbus_get_participant_list(conf->_confID); conference_participant = conf->participant_list; - if(conference_participant) { - - DEBUG("Calltree: Determine if at least one participant uses SRTP"); - - // participant = conf->participant; - // participant = dbus_get_participant_list(conf->_confID); - // for (pl = participant; *pl; pl++) - while(conference_participant) { - - // call_id = (gchar*)(*pl); - call_id = (gchar*)(conference_participant->data); - call = calllist_get (tab, call_id); - - if(call != NULL) { - - account_details = account_list_get_by_id(call->_callID); - if(account_details != NULL) { - srtp_enabled = g_hash_table_lookup(account_details->properties, ACCOUNT_SRTP_ENABLED); - } - - if(g_strcasecmp(srtp_enabled,"true") == 0) { - DEBUG("Calltree: SRTP enabled for participant %s", call_id); - conf->_conf_srtp_enabled = TRUE; - break; - } - else { - DEBUG("Calltree: SRTP is not enabled for participant %s", call_id); - } - - } - - conference_participant = conference_next_participant(conference_participant); - - } - - DEBUG("Calltree: Determine if all conference participant are secured"); - - if(conf->_conf_srtp_enabled) { - // participant = conf->participant; - conference_participant = conf->participant_list; - // for (pl = participant; *pl; pl++) - while(conference_participant) { - // call_id = (gchar*)(*pl); - call_id = (gchar*)(conference_participant->data); - call = calllist_get (tab, call_id); - - if(call != NULL) { - - if(call->_srtp_state == 0) { - DEBUG("Calltree: Participant %s is not secured", call_id); - conf->_conference_secured = FALSE; - break; - } - else { - DEBUG("Calltree: Participant %s is secured", call_id); - } - } - conference_participant = conference_next_participant(conference_participant); - } - } + + if (conference_participant) { + + DEBUG ("Calltree: Determine if at least one participant uses SRTP"); + + // participant = conf->participant; + // participant = dbus_get_participant_list(conf->_confID); + // for (pl = participant; *pl; pl++) + while (conference_participant) { + + // call_id = (gchar*)(*pl); + call_id = (gchar*) (conference_participant->data); + call = calllist_get (tab, call_id); + + if (call != NULL) { + + account_details = account_list_get_by_id (call->_callID); + + if (account_details != NULL) { + srtp_enabled = g_hash_table_lookup (account_details->properties, ACCOUNT_SRTP_ENABLED); + } + + if (g_strcasecmp (srtp_enabled,"true") == 0) { + DEBUG ("Calltree: SRTP enabled for participant %s", call_id); + conf->_conf_srtp_enabled = TRUE; + break; + } else { + DEBUG ("Calltree: SRTP is not enabled for participant %s", call_id); + } + + } + + conference_participant = conference_next_participant (conference_participant); + + } + + DEBUG ("Calltree: Determine if all conference participant are secured"); + + if (conf->_conf_srtp_enabled) { + // participant = conf->participant; + conference_participant = conf->participant_list; + + // for (pl = participant; *pl; pl++) + while (conference_participant) { + // call_id = (gchar*)(*pl); + call_id = (gchar*) (conference_participant->data); + call = calllist_get (tab, call_id); + + if (call != NULL) { + + if (call->_srtp_state == 0) { + DEBUG ("Calltree: Participant %s is not secured", call_id); + conf->_conference_secured = FALSE; + break; + } else { + DEBUG ("Calltree: Participant %s is secured", call_id); + } + } + + conference_participant = conference_next_participant (conference_participant); + } + } } - if(conf->_conf_srtp_enabled) { - if(conf->_conference_secured) { - DEBUG("Calltree: Conference is secured"); - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_confirmed.svg", NULL); - } - else { - DEBUG("Calltree: Conference is not secured"); - pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_off.svg", NULL); - } + if (conf->_conf_srtp_enabled) { + if (conf->_conference_secured) { + DEBUG ("Calltree: Conference is secured"); + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_confirmed.svg", NULL); + } else { + DEBUG ("Calltree: Conference is not secured"); + pixbuf_security = gdk_pixbuf_new_from_file (ICONS_DIR "/lock_off.svg", NULL); + } } - - DEBUG("Calltree: Add conference to tree store"); - - gtk_tree_store_set(tab->store, &iter, - 0, pixbuf, // Icon - 1, description, // Description - 2, pixbuf_security, - 3, conf, // Pointer - -1); + + DEBUG ("Calltree: Add conference to tree store"); + + gtk_tree_store_set (tab->store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + 2, pixbuf_security, + 3, conf, // Pointer + -1); if (pixbuf != NULL) - g_object_unref(G_OBJECT(pixbuf)); - + g_object_unref (G_OBJECT (pixbuf)); + // participant = conf->participant; // participant = dbus_get_participant_list(conf->_confID); conference_participant = conf->participant_list; - if(conference_participant) { - - DEBUG("Calltre: Adding conference participant"); - // for (pl = participant; *pl; pl++) - while(conference_participant) { - - DEBUG("OK"); - call_id = (gchar*)(conference_participant->data); - call = calllist_get (tab, call_id); - // create_new_call_from_details (conf_id, conference_details, &c); - - calltree_remove_call(tab, call, NULL); - calltree_add_call (tab, call, &iter); - - conference_participant = conference_next_participant(conference_participant); - } + + if (conference_participant) { + + DEBUG ("Calltre: Adding conference participant"); + + // for (pl = participant; *pl; pl++) + while (conference_participant) { + + DEBUG ("OK"); + call_id = (gchar*) (conference_participant->data); + call = calllist_get (tab, call_id); + // create_new_call_from_details (conf_id, conference_details, &c); + + calltree_remove_call (tab, call, NULL); + calltree_add_call (tab, call, &iter); + + conference_participant = conference_next_participant (conference_participant); + } } + /* - else - { - WARN ("Conferences cannot be added in this widget - This is a bug in the application."); - } + else + { + WARN ("Conferences cannot be added in this widget - This is a bug in the application."); + } */ - gtk_tree_view_set_model(GTK_TREE_VIEW(tab->view), GTK_TREE_MODEL(tab->store)); + gtk_tree_view_set_model (GTK_TREE_VIEW (tab->view), GTK_TREE_MODEL (tab->store)); - path = gtk_tree_model_get_path(model, &iter); + path = gtk_tree_model_get_path (model, &iter); - gtk_tree_view_expand_row(GTK_TREE_VIEW(tab->view), path, FALSE); + gtk_tree_view_expand_row (GTK_TREE_VIEW (tab->view), path, FALSE); update_actions(); @@ -1271,7 +1276,7 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf) void calltree_update_conference (calltab_t* tab, const gchar* confID) { - DEBUG("calltree_update_conference"); + DEBUG ("calltree_update_conference"); } @@ -1280,8 +1285,8 @@ void calltree_update_conference (calltab_t* tab, const gchar* confID) void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, GtkTreeIter *parent) { - DEBUG("calltree_remove_conference %s\n", conf->_confID); - + DEBUG ("calltree_remove_conference %s\n", conf->_confID); + GtkTreeIter iter_parent; GtkTreeIter iter_child; GValue confval; @@ -1290,50 +1295,53 @@ void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, G callable_obj_t * call; GtkTreeStore* store = tab->store; - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); + int nbChild = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), parent); int nbParticipant; int i, j; - for( i = 0; i < nbChild; i++) { - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter_parent, parent, i)) { + for (i = 0; i < nbChild; i++) { + + if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &iter_parent, parent, i)) { + + if (gtk_tree_model_iter_has_child (GTK_TREE_MODEL (store), &iter_parent)) { + + calltree_remove_conference (tab, conf, &iter_parent); - if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(store), &iter_parent)) { + confval.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL (store), &iter_parent, COLUMN_ACCOUNT_PTR, &confval); - calltree_remove_conference (tab, conf, &iter_parent); + tempconf = (conference_obj_t*) g_value_get_pointer (&confval); + g_value_unset (&confval); - confval.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter_parent, COLUMN_ACCOUNT_PTR, &confval); + if (tempconf == conf) { - tempconf = (conference_obj_t*) g_value_get_pointer(&confval); - g_value_unset(&confval); + nbParticipant = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), &iter_parent); + DEBUG ("nbParticipant: %i", nbParticipant); - if(tempconf == conf) { - - nbParticipant = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), &iter_parent); - DEBUG("nbParticipant: %i", nbParticipant); - for( j = 0; j < nbParticipant; j++) { - call = NULL; - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter_child, &iter_parent, j)){ + for (j = 0; j < nbParticipant; j++) { + call = NULL; - callval.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter_child, COLUMN_ACCOUNT_PTR, &callval); + if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &iter_child, &iter_parent, j)) { - call = (callable_obj_t*)g_value_get_pointer(&callval); - g_value_unset(&callval); - - if(call) { - calltree_add_call (tab, call, NULL); - } - } - - } + callval.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL (store), &iter_child, COLUMN_ACCOUNT_PTR, &callval); - gtk_tree_store_remove(store, &iter_parent); - } - } - } + call = (callable_obj_t*) g_value_get_pointer (&callval); + g_value_unset (&callval); + + if (call) { + calltree_add_call (tab, call, NULL); + } + } + + } + + gtk_tree_store_remove (store, &iter_parent); + } + } + } } // callable_obj_t * selectedCall = calltab_get_selected_call(tab); @@ -1341,13 +1349,14 @@ void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, G // calltab_select_call(tab, NULL); update_actions(); - + } -void calltree_display (calltab_t *tab) { +void calltree_display (calltab_t *tab) +{ + - GtkTreeSelection *sel; /* If we already are displaying the specified calltree */ @@ -1360,12 +1369,13 @@ void calltree_display (calltab_t *tab) { DEBUG ("display main tab"); - if (active_calltree==contacts) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); - } else { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); - } - // gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)currentCallsButton, TRUE); + if (active_calltree==contacts) { + gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, FALSE); + } else { + gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton, FALSE); + } + + // gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)currentCallsButton, TRUE); } @@ -1374,417 +1384,409 @@ void calltree_display (calltab_t *tab) { DEBUG ("display history tab"); - if (active_calltree==contacts) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); - } + if (active_calltree==contacts) { + gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, FALSE); + } - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, TRUE); + gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton, TRUE); } else if (tab==contacts) { DEBUG ("display contact tab"); - if (active_calltree==history) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); - } + if (active_calltree==history) { + gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton, FALSE); + } - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, TRUE); + gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, TRUE); } else ERROR ("calltree.c line %d . This is probably a bug in the application", __LINE__); - + gtk_widget_hide (active_calltree->tree); active_calltree = tab; gtk_widget_show (active_calltree->tree); - + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); - DEBUG("Emit signal changed from calltree_display"); - g_signal_emit_by_name(sel, "changed"); + DEBUG ("Emit signal changed from calltree_display"); + g_signal_emit_by_name (sel, "changed"); update_actions(); } -static void drag_begin_cb(GtkWidget *widget, GdkDragContext *dc, gpointer data) +static void drag_begin_cb (GtkWidget *widget, GdkDragContext *dc, gpointer data) { GtkTargetList* target_list; } -static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer data) +static void drag_end_cb (GtkWidget * widget, GdkDragContext * context, gpointer data) { - DEBUG("CallTree: Drag end callback"); - DEBUG("CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d", - selected_path, selected_call_id, selected_path_depth); - DEBUG("CallTree: dragged path %s, dragged_call_id %s, dragged_path_depth %d", - dragged_path, dragged_call_id, dragged_path_depth); - - GtkTreeModel *model = (GtkTreeModel*)current_calls->store; - GtkTreePath *path = gtk_tree_path_new_from_string(dragged_path); - GtkTreePath *dpath = gtk_tree_path_new_from_string(dragged_path); - GtkTreePath *spath = gtk_tree_path_new_from_string(selected_path); - + DEBUG ("CallTree: Drag end callback"); + DEBUG ("CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d", + selected_path, selected_call_id, selected_path_depth); + DEBUG ("CallTree: dragged path %s, dragged_call_id %s, dragged_path_depth %d", + dragged_path, dragged_call_id, dragged_path_depth); + + GtkTreeModel *model = (GtkTreeModel*) current_calls->store; + GtkTreePath *path = gtk_tree_path_new_from_string (dragged_path); + GtkTreePath *dpath = gtk_tree_path_new_from_string (dragged_path); + GtkTreePath *spath = gtk_tree_path_new_from_string (selected_path); + GtkTreeIter iter; GtkTreeIter iter_parent; GtkTreeIter iter_children; GtkTreeIter parent_conference; // conference for which this call is attached GValue val; - + callable_obj_t* call; conference_obj_t* conf; // Make sure drag n drop does not imply a dialing call for either selected and dragged call - if(selected_call && (selected_type == A_CALL)) { - - DEBUG("CallTree: Selected a call"); - if(selected_call->_state == CALL_STATE_DIALING || - selected_call->_state == CALL_STATE_INVALID || - selected_call->_state == CALL_STATE_FAILURE || - selected_call->_state == CALL_STATE_BUSY || - selected_call->_state == CALL_STATE_TRANSFERT) { - - DEBUG("CallTree: Selected an invalid call"); - - calltree_remove_call(current_calls, selected_call, NULL); - calltree_add_call(current_calls, selected_call, NULL); - - dragged_call = NULL; - return; - } - - - if(dragged_call && (dragged_type == A_CALL)) { - - DEBUG("CallTree: Dragged on a call"); - if(dragged_call->_state == CALL_STATE_DIALING || - dragged_call->_state == CALL_STATE_INVALID || - dragged_call->_state == CALL_STATE_FAILURE || - dragged_call->_state == CALL_STATE_BUSY || - dragged_call->_state == CALL_STATE_TRANSFERT) { - - DEBUG("CallTree: Dragged on an invalid call"); - - calltree_remove_call(current_calls, selected_call, NULL); - - if(selected_call->_confID) { - - gtk_tree_path_up(spath); - gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &parent_conference, spath); - - calltree_add_call(current_calls, selected_call, &parent_conference); - } - else { - - calltree_add_call(current_calls, selected_call, NULL); - } - - dragged_call = NULL; - return; - } - } + if (selected_call && (selected_type == A_CALL)) { + + DEBUG ("CallTree: Selected a call"); + + if (selected_call->_state == CALL_STATE_DIALING || + selected_call->_state == CALL_STATE_INVALID || + selected_call->_state == CALL_STATE_FAILURE || + selected_call->_state == CALL_STATE_BUSY || + selected_call->_state == CALL_STATE_TRANSFERT) { + + DEBUG ("CallTree: Selected an invalid call"); + + calltree_remove_call (current_calls, selected_call, NULL); + calltree_add_call (current_calls, selected_call, NULL); + + dragged_call = NULL; + return; + } + + + if (dragged_call && (dragged_type == A_CALL)) { + + DEBUG ("CallTree: Dragged on a call"); + + if (dragged_call->_state == CALL_STATE_DIALING || + dragged_call->_state == CALL_STATE_INVALID || + dragged_call->_state == CALL_STATE_FAILURE || + dragged_call->_state == CALL_STATE_BUSY || + dragged_call->_state == CALL_STATE_TRANSFERT) { + + DEBUG ("CallTree: Dragged on an invalid call"); + + calltree_remove_call (current_calls, selected_call, NULL); + + if (selected_call->_confID) { + + gtk_tree_path_up (spath); + gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &parent_conference, spath); + + calltree_add_call (current_calls, selected_call, &parent_conference); + } else { + + calltree_add_call (current_calls, selected_call, NULL); + } + + dragged_call = NULL; + return; + } + } } // Make sure a conference is only dragged on another conference - if(selected_conf && (selected_type == A_CONFERENCE)) { + if (selected_conf && (selected_type == A_CONFERENCE)) { - DEBUG("CallTree: Selected a conference"); + DEBUG ("CallTree: Selected a conference"); - if(!dragged_conf && (dragged_type == A_CALL)) { + if (!dragged_conf && (dragged_type == A_CALL)) { - DEBUG("CallTree: Dragged on a call"); + DEBUG ("CallTree: Dragged on a call"); - conf = selected_conf; + conf = selected_conf; - calltree_remove_conference(current_calls, conf, NULL); - calltree_add_conference(current_calls, conf); + calltree_remove_conference (current_calls, conf, NULL); + calltree_add_conference (current_calls, conf); - dragged_call = NULL; - return; - } + dragged_call = NULL; + return; + } } - if(selected_path_depth == 1) { + if (selected_path_depth == 1) { - if(dragged_path_depth == 1) { + if (dragged_path_depth == 1) { - if (selected_type == A_CALL && dragged_type == A_CALL) { + if (selected_type == A_CALL && dragged_type == A_CALL) { - if(gtk_tree_path_compare (dpath, spath) == 0) { - // draged a call on itself - } - else { - // dragged a single call on a single call - if(selected_call != NULL && dragged_call != NULL) - sflphone_join_participant(selected_call->_callID, dragged_call->_callID); - } - } - else if(selected_type == A_CALL && dragged_type == A_CONFERENCE) { + if (gtk_tree_path_compare (dpath, spath) == 0) { + // draged a call on itself + } else { + // dragged a single call on a single call + if (selected_call != NULL && dragged_call != NULL) + sflphone_join_participant (selected_call->_callID, dragged_call->_callID); + } + } else if (selected_type == A_CALL && dragged_type == A_CONFERENCE) { - // dragged a single call on a conference - if(!selected_call) { - DEBUG("Error: call dragged on a conference is null"); - return; - } + // dragged a single call on a conference + if (!selected_call) { + DEBUG ("Error: call dragged on a conference is null"); + return; + } - selected_call->_confID = g_strdup(dragged_call_id); - sflphone_add_participant(selected_call_id, dragged_call_id); - } - else if(selected_type == A_CONFERENCE && dragged_type == A_CALL) { + selected_call->_confID = g_strdup (dragged_call_id); + sflphone_add_participant (selected_call_id, dragged_call_id); + } else if (selected_type == A_CONFERENCE && dragged_type == A_CALL) { - // dragged a conference on a single call - conf = selected_conf; - - calltree_remove_conference(current_calls, conf, NULL); - calltree_add_conference(current_calls, conf); + // dragged a conference on a single call + conf = selected_conf; + calltree_remove_conference (current_calls, conf, NULL); + calltree_add_conference (current_calls, conf); - } - else if(selected_type == A_CONFERENCE && dragged_type == A_CONFERENCE){ - // dragged a conference on a conference - if(gtk_tree_path_compare (dpath, spath) == 0) { + } else if (selected_type == A_CONFERENCE && dragged_type == A_CONFERENCE) { - if(!current_calls) { - DEBUG("Error while joining the same conference\n"); - return; - } + // dragged a conference on a conference + if (gtk_tree_path_compare (dpath, spath) == 0) { - DEBUG("Joined the same conference!\n"); - gtk_tree_view_expand_row(GTK_TREE_VIEW(current_calls->view), path, FALSE); - } - else { + if (!current_calls) { + DEBUG ("Error while joining the same conference\n"); + return; + } - if(!selected_conf) { - DEBUG("Error: selected conference is null while joining 2 conference"); - } + DEBUG ("Joined the same conference!\n"); + gtk_tree_view_expand_row (GTK_TREE_VIEW (current_calls->view), path, FALSE); + } else { - if(!dragged_conf) { - DEBUG("Error: dragged conference is null while joining 2 conference"); - } + if (!selected_conf) { + DEBUG ("Error: selected conference is null while joining 2 conference"); + } - DEBUG("Joined two conference %s, %s!\n", dragged_path, selected_path); - sflphone_join_conference(selected_conf->_confID, dragged_conf->_confID); - } - } + if (!dragged_conf) { + DEBUG ("Error: dragged conference is null while joining 2 conference"); + } - // TODO: dragged a single call on a NULL element (should do nothing) - // TODO: dragged a conference on a NULL element (should do nothing) + DEBUG ("Joined two conference %s, %s!\n", dragged_path, selected_path); + sflphone_join_conference (selected_conf->_confID, dragged_conf->_confID); + } + } - } - else { - - // dragged_path_depth == 2 - if (selected_type == A_CALL && dragged_type == A_CALL) { + // TODO: dragged a single call on a NULL element (should do nothing) + // TODO: dragged a conference on a NULL element (should do nothing) - // TODO: dragged a call on a conference call - calltree_remove_call(current_calls, selected_call, NULL); - calltree_add_call(current_calls, selected_call, NULL); - } + } else { - else if(selected_type == A_CONFERENCE && dragged_type == A_CALL) { + // dragged_path_depth == 2 + if (selected_type == A_CALL && dragged_type == A_CALL) { - // TODO: dragged a conference on a conference call - calltree_remove_conference(current_calls, selected_conf, NULL); - calltree_add_conference(current_calls, selected_conf); - } + // TODO: dragged a call on a conference call + calltree_remove_call (current_calls, selected_call, NULL); + calltree_add_call (current_calls, selected_call, NULL); + } - // TODO: dragged a single call on a NULL element - // TODO: dragged a conference on a NULL element - } - } - else { + else if (selected_type == A_CONFERENCE && dragged_type == A_CALL) { + + // TODO: dragged a conference on a conference call + calltree_remove_conference (current_calls, selected_conf, NULL); + calltree_add_conference (current_calls, selected_conf); + } + + // TODO: dragged a single call on a NULL element + // TODO: dragged a conference on a NULL element + } + } else { // selected_path_depth == 2 - - if(dragged_path_depth == 1) { - - if(selected_type == A_CALL && dragged_type == A_CALL) { - - // dragged a conference call on a call - sflphone_detach_participant(selected_call_id); - - if(selected_call != NULL && dragged_call != NULL) - sflphone_join_participant(selected_call->_callID, dragged_call->_callID); - - } - else if(selected_type == A_CALL && dragged_type == A_CONFERENCE) { - - // dragged a conference call on a conference - sflphone_detach_participant(selected_call_id); - - if(selected_call != NULL && dragged_conf != NULL) { - - DEBUG("Adding a participant, since dragged call on a conference"); - - sflphone_add_participant(selected_call_id, dragged_call_id); - } - } - else { - - // dragged a conference call on a NULL element - sflphone_detach_participant(selected_call_id); - } - - } - else { - - // dragged_path_depth == 2 - // dragged a conference call on another conference call (same conference) - // TODO: dragged a conference call on another conference call (different conference) - - gtk_tree_path_up(path); - - gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &parent_conference, path); - - gtk_tree_path_up(dpath); - gtk_tree_path_up(spath); - - if(gtk_tree_path_compare (dpath, spath) == 0) { - - DEBUG("Dragged a call in the same conference"); - calltree_remove_call (current_calls, selected_call, NULL); - calltree_add_call (current_calls, selected_call, &parent_conference); - } - else { - - - DEBUG("Dragged a conference call onto another conference call %s, %s", gtk_tree_path_to_string(dpath), gtk_tree_path_to_string(spath)); - - conf = NULL; - - val.g_type = 0; - if(gtk_tree_model_get_iter (model, &iter, dpath)) { - - DEBUG("we got an iter!"); - gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); - - conf = (conference_obj_t*)g_value_get_pointer(&val); - } - g_value_unset(&val); - - sflphone_detach_participant(selected_call_id); - - if(conf) { - - DEBUG("we got a conf!"); - sflphone_add_participant(selected_call_id, conf->_confID); - } - else { - - DEBUG("didn't find a conf!"); - } - } - - // TODO: dragged a conference call on another conference call (different conference) - // TODO: dragged a conference call on a NULL element (same conference) - // TODO: dragged a conference call on a NULL element (different conference) - } - - } + + if (dragged_path_depth == 1) { + + if (selected_type == A_CALL && dragged_type == A_CALL) { + + // dragged a conference call on a call + sflphone_detach_participant (selected_call_id); + + if (selected_call != NULL && dragged_call != NULL) + sflphone_join_participant (selected_call->_callID, dragged_call->_callID); + + } else if (selected_type == A_CALL && dragged_type == A_CONFERENCE) { + + // dragged a conference call on a conference + sflphone_detach_participant (selected_call_id); + + if (selected_call != NULL && dragged_conf != NULL) { + + DEBUG ("Adding a participant, since dragged call on a conference"); + + sflphone_add_participant (selected_call_id, dragged_call_id); + } + } else { + + // dragged a conference call on a NULL element + sflphone_detach_participant (selected_call_id); + } + + } else { + + // dragged_path_depth == 2 + // dragged a conference call on another conference call (same conference) + // TODO: dragged a conference call on another conference call (different conference) + + gtk_tree_path_up (path); + + gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &parent_conference, path); + + gtk_tree_path_up (dpath); + gtk_tree_path_up (spath); + + if (gtk_tree_path_compare (dpath, spath) == 0) { + + DEBUG ("Dragged a call in the same conference"); + calltree_remove_call (current_calls, selected_call, NULL); + calltree_add_call (current_calls, selected_call, &parent_conference); + } else { + + + DEBUG ("Dragged a conference call onto another conference call %s, %s", gtk_tree_path_to_string (dpath), gtk_tree_path_to_string (spath)); + + conf = NULL; + + val.g_type = 0; + + if (gtk_tree_model_get_iter (model, &iter, dpath)) { + + DEBUG ("we got an iter!"); + gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); + + conf = (conference_obj_t*) g_value_get_pointer (&val); + } + + g_value_unset (&val); + + sflphone_detach_participant (selected_call_id); + + if (conf) { + + DEBUG ("we got a conf!"); + sflphone_add_participant (selected_call_id, conf->_confID); + } else { + + DEBUG ("didn't find a conf!"); + } + } + + // TODO: dragged a conference call on another conference call (different conference) + // TODO: dragged a conference call on a NULL element (same conference) + // TODO: dragged a conference call on a NULL element (different conference) + } + + } } -void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint t, gpointer data) +void drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint t, gpointer data) { // DEBUG("drag_data_received_cb\n"); - GtkTreeView *tree_view = GTK_TREE_VIEW(widget); + GtkTreeView *tree_view = GTK_TREE_VIEW (widget); GtkTreePath *drop_path; GtkTreeViewDropPosition position; GValue val; - GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; - GtkTreeModel* tree_model = gtk_tree_view_get_model(tree_view); + GtkTreeModel *model = (GtkTreeModel*) active_calltree->store; + GtkTreeModel* tree_model = gtk_tree_view_get_model (tree_view); GtkTreeIter iter; gchar value; val.g_type = 0; - gtk_tree_view_get_drag_dest_row(tree_view, &drop_path, &position); - - if(drop_path) { - - gtk_tree_model_get_iter(tree_model, &iter, drop_path); - gtk_tree_model_get_value(tree_model, &iter, COLUMN_ACCOUNT_PTR, &val); - - - if(gtk_tree_model_iter_has_child(tree_model, &iter)) { - - DEBUG("CallTree: Dragging on a conference"); - dragged_type = A_CONFERENCE; - dragged_call = NULL; - } - else { - - DEBUG("CallTree: Dragging on a call"); - dragged_type = A_CALL; - dragged_conf = NULL; - } - - switch (position) { - - case GTK_TREE_VIEW_DROP_AFTER: - DEBUG("CallTree: GTK_TREE_VIEW_DROP_AFTER"); - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - dragged_call_id = "NULL"; - dragged_call = NULL; - dragged_conf = NULL; - break; - - case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - DEBUG("CallTree: GTK_TREE_VIEW_DROP_INTO_OR_AFTER"); - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - if (dragged_type == A_CALL) { - - dragged_call_id = ((callable_obj_t*)g_value_get_pointer(&val))->_callID; - dragged_call = (callable_obj_t*)g_value_get_pointer(&val); - } - else { - - dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID; - dragged_conf = (conference_obj_t*)g_value_get_pointer(&val); - } - break; - - case GTK_TREE_VIEW_DROP_BEFORE: - DEBUG("CallTree: GTK_TREE_VIEW_DROP_BEFORE"); - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - dragged_call_id = "NULL"; - dragged_call = NULL; - dragged_conf = NULL; - break; - - case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - DEBUG("CallTree: GTK_TREE_VIEW_DROP_INTO_OR_BEFORE"); - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - if (dragged_type == A_CALL) { - dragged_call_id = ((callable_obj_t*)g_value_get_pointer(&val))->_callID; - dragged_call = (callable_obj_t*)g_value_get_pointer(&val); - } - else { - dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID; - dragged_conf = (conference_obj_t*)g_value_get_pointer(&val); - } - break; - - default: - return; - } + gtk_tree_view_get_drag_dest_row (tree_view, &drop_path, &position); + + if (drop_path) { + + gtk_tree_model_get_iter (tree_model, &iter, drop_path); + gtk_tree_model_get_value (tree_model, &iter, COLUMN_ACCOUNT_PTR, &val); + + + if (gtk_tree_model_iter_has_child (tree_model, &iter)) { + + DEBUG ("CallTree: Dragging on a conference"); + dragged_type = A_CONFERENCE; + dragged_call = NULL; + } else { + + DEBUG ("CallTree: Dragging on a call"); + dragged_type = A_CALL; + dragged_conf = NULL; + } + + switch (position) { + + case GTK_TREE_VIEW_DROP_AFTER: + DEBUG ("CallTree: GTK_TREE_VIEW_DROP_AFTER"); + dragged_path = gtk_tree_path_to_string (drop_path); + dragged_path_depth = gtk_tree_path_get_depth (drop_path); + dragged_call_id = "NULL"; + dragged_call = NULL; + dragged_conf = NULL; + break; + + case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + DEBUG ("CallTree: GTK_TREE_VIEW_DROP_INTO_OR_AFTER"); + dragged_path = gtk_tree_path_to_string (drop_path); + dragged_path_depth = gtk_tree_path_get_depth (drop_path); + + if (dragged_type == A_CALL) { + + dragged_call_id = ( (callable_obj_t*) g_value_get_pointer (&val))->_callID; + dragged_call = (callable_obj_t*) g_value_get_pointer (&val); + } else { + + dragged_call_id = ( (conference_obj_t*) g_value_get_pointer (&val))->_confID; + dragged_conf = (conference_obj_t*) g_value_get_pointer (&val); + } + + break; + + case GTK_TREE_VIEW_DROP_BEFORE: + DEBUG ("CallTree: GTK_TREE_VIEW_DROP_BEFORE"); + dragged_path = gtk_tree_path_to_string (drop_path); + dragged_path_depth = gtk_tree_path_get_depth (drop_path); + dragged_call_id = "NULL"; + dragged_call = NULL; + dragged_conf = NULL; + break; + + case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + DEBUG ("CallTree: GTK_TREE_VIEW_DROP_INTO_OR_BEFORE"); + dragged_path = gtk_tree_path_to_string (drop_path); + dragged_path_depth = gtk_tree_path_get_depth (drop_path); + + if (dragged_type == A_CALL) { + dragged_call_id = ( (callable_obj_t*) g_value_get_pointer (&val))->_callID; + dragged_call = (callable_obj_t*) g_value_get_pointer (&val); + } else { + dragged_call_id = ( (conference_obj_t*) g_value_get_pointer (&val))->_confID; + dragged_conf = (conference_obj_t*) g_value_get_pointer (&val); + } + + break; + + default: + return; + } } } diff --git a/sflphone-client-gnome/src/contacts/calltree.h b/sflphone-client-gnome/src/contacts/calltree.h index c383caa9ed9ee6ee6abaaf305584fdc8c2a060b7..d94d741bbb70a7be7c65fdbf34a3d18442f8eadf 100644 --- a/sflphone-client-gnome/src/contacts/calltree.h +++ b/sflphone-client-gnome/src/contacts/calltree.h @@ -67,7 +67,7 @@ typedef enum { * @return GtkWidget* A new widget */ void -calltree_create(calltab_t* tab, gboolean searchbar_type); +calltree_create (calltab_t* tab, gboolean searchbar_type); /** * Add a call in the calltree @@ -90,7 +90,7 @@ calltree_update_call (calltab_t* ct, callable_obj_t * c, GtkTreeIter *parent); void calltree_remove_call (calltab_t* ct, callable_obj_t * c, GtkTreeIter *parent); -void +void calltree_add_history_entry (callable_obj_t * c); void @@ -109,6 +109,6 @@ void calltree_display (calltab_t *tab); void -row_activated(GtkTreeView *, GtkTreePath *, GtkTreeViewColumn *, void *); +row_activated (GtkTreeView *, GtkTreePath *, GtkTreeViewColumn *, void *); #endif diff --git a/sflphone-client-gnome/src/contacts/conferencelist.c b/sflphone-client-gnome/src/contacts/conferencelist.c index 42216fdcd0c6427457b1b34f7d22df3603829702..155b82d240820d8c261a6de7482858b59a2d1e38 100644 --- a/sflphone-client-gnome/src/contacts/conferencelist.c +++ b/sflphone-client-gnome/src/contacts/conferencelist.c @@ -31,13 +31,13 @@ #include <conferencelist.h> -gchar* +gchar* generate_conf_id (void) { gchar *conf_id; - conf_id = g_new0(gchar, 30); - g_sprintf(conf_id, "%d", rand()); + conf_id = g_new0 (gchar, 30); + g_sprintf (conf_id, "%d", rand()); return conf_id; } @@ -65,12 +65,12 @@ conferencelist_reset() void -conferencelist_add(const conference_obj_t* conf) +conferencelist_add (const conference_obj_t* conf) { - gchar* c = (gchar*)conferencelist_get(conf->_confID); - if(!c) - { - g_queue_push_tail (conferenceQueue, (gpointer)conf); + gchar* c = (gchar*) conferencelist_get (conf->_confID); + + if (!c) { + g_queue_push_tail (conferenceQueue, (gpointer) conf); } } @@ -78,40 +78,36 @@ conferencelist_add(const conference_obj_t* conf) void conferencelist_remove (const gchar* conf) { - gchar* c = (gchar*)conferencelist_get(conf); - if (c) - { - g_queue_remove(conferenceQueue, c); + gchar* c = (gchar*) conferencelist_get (conf); + + if (c) { + g_queue_remove (conferenceQueue, c); } } -conference_obj_t* +conference_obj_t* conferencelist_get (const gchar* conf_id) { - GList* c = g_queue_find_custom(conferenceQueue, conf_id, is_confID_confstruct); - if (c) - { - return (conference_obj_t*)c->data; - } - else - { - return NULL; + GList* c = g_queue_find_custom (conferenceQueue, conf_id, is_confID_confstruct); + + if (c) { + return (conference_obj_t*) c->data; + } else { + return NULL; } } -conference_obj_t* -conferencelist_get_nth ( guint n ) +conference_obj_t* +conferencelist_get_nth (guint n) { - GList* c = g_queue_peek_nth(conferenceQueue, n); - if (c) - { - return (conference_obj_t*)c->data; - } - else - { - return NULL; + GList* c = g_queue_peek_nth (conferenceQueue, n); + + if (c) { + return (conference_obj_t*) c->data; + } else { + return NULL; } } diff --git a/sflphone-client-gnome/src/contacts/conferencelist.h b/sflphone-client-gnome/src/contacts/conferencelist.h index 2652b892b7aba376bd1692224a8eafa3741f0bdc..afde7f2e0878d86035305ba27c19ec0580000fbf 100644 --- a/sflphone-client-gnome/src/contacts/conferencelist.h +++ b/sflphone-client-gnome/src/contacts/conferencelist.h @@ -74,7 +74,7 @@ conferencelist_get_size (); * @param n The position of the call you want * @return A call or NULL */ conference_obj_t* -conferencelist_get_nth (guint n ); +conferencelist_get_nth (guint n); /** Return the call corresponding to the callID * @param n The callID of the call you want diff --git a/sflphone-client-gnome/src/contacts/history.c b/sflphone-client-gnome/src/contacts/history.c index f354e73ceef65f5946a4b8386f4f68373d41c907..3a11a70f0f2e2b2f0bf8f219ea123726fac046bd 100644 --- a/sflphone-client-gnome/src/contacts/history.c +++ b/sflphone-client-gnome/src/contacts/history.c @@ -41,7 +41,7 @@ static gboolean history_is_visible (GtkTreeModel*, GtkTreeIter*, gpointer); void history_search (SearchType search_type) { - if(history_filter != NULL) { + if (history_filter != NULL) { gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (history_filter)); } } @@ -64,58 +64,57 @@ void history_set_searchbar_widget (GtkWidget *searchbar) history_searchbar_widget = searchbar; } -static GtkTreeModel* history_create_filter (GtkTreeModel* child) +static GtkTreeModel* history_create_filter (GtkTreeModel* child) { GtkTreeModel* ret; - DEBUG("Create Filter"); + DEBUG ("Create Filter"); ret = gtk_tree_model_filter_new (child, NULL); gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (ret), history_is_visible, NULL, NULL); return GTK_TREE_MODEL (ret); } -static gboolean history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) +static gboolean history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) { GValue val, obj; callable_obj_t *history_entry = NULL; gchar* text = NULL; - gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(history_searchbar_widget)); + gchar* search = (gchar*) gtk_entry_get_text (GTK_ENTRY (history_searchbar_widget)); + + memset (&val, 0, sizeof (val)); + memset (&obj, 0, sizeof (obj)); - memset (&val, 0, sizeof(val)); - memset (&obj, 0, sizeof(obj)); - // Fetch the call description - gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 1, &val); - if(G_VALUE_HOLDS_STRING(&val)){ - text = (gchar *)g_value_get_string(&val); + gtk_tree_model_get_value (GTK_TREE_MODEL (model), iter, 1, &val); + + if (G_VALUE_HOLDS_STRING (&val)) { + text = (gchar *) g_value_get_string (&val); } - + // Fetch the call type - gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 3, &obj); - if (G_VALUE_HOLDS_POINTER (&obj)){ + gtk_tree_model_get_value (GTK_TREE_MODEL (model), iter, 3, &obj); + + if (G_VALUE_HOLDS_POINTER (&obj)) { history_entry = (gpointer) g_value_get_pointer (&obj); } - if(text != NULL) - { - if (history_entry) - { + if (text != NULL) { + if (history_entry) { // Filter according to the type of call // MISSED, INCOMING, OUTGOING, ALL - if ((int)get_current_history_search_type () == SEARCH_ALL) - return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); - else - { + if ( (int) get_current_history_search_type () == SEARCH_ALL) + return g_regex_match_simple (search, text, G_REGEX_CASELESS, 0); + else { // We need a match on the history_state_t and the current search type - return (history_entry->_history_state + 1) == (int)get_current_history_search_type () && - g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); + return (history_entry->_history_state + 1) == (int) get_current_history_search_type () && + g_regex_match_simple (search, text, G_REGEX_CASELESS, 0); } } } - // Clean up + // Clean up g_value_unset (&val); g_value_unset (&obj); diff --git a/sflphone-client-gnome/src/contacts/history.h b/sflphone-client-gnome/src/contacts/history.h index f91393ccb1316d1da74bb171b7e8d7c2d5595ee8..a02e4857832d7f8c345beb7f7d4cba8d63bd0262 100644 --- a/sflphone-client-gnome/src/contacts/history.h +++ b/sflphone-client-gnome/src/contacts/history.h @@ -63,6 +63,6 @@ void history_reinit (calltab_t* history); * Set history search bar widget (needed for is_visible) */ void -history_set_searchbar_widget(GtkWidget *); +history_set_searchbar_widget (GtkWidget *); #endif diff --git a/sflphone-client-gnome/src/contacts/searchbar.c b/sflphone-client-gnome/src/contacts/searchbar.c index 09e2da62e4f79badf94d55b9010b7aeed909b3cf..eec22e53011b822c0af323d84c72efcf99e4f20b 100644 --- a/sflphone-client-gnome/src/contacts/searchbar.c +++ b/sflphone-client-gnome/src/contacts/searchbar.c @@ -47,12 +47,11 @@ GdkPixbuf *missed_pixbuf = NULL; void searchbar_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED) { - DEBUG("searchbar_entry_changed"); + DEBUG ("searchbar_entry_changed"); if (active_calltree == contacts) { addressbook_search (entry); - } - else if (active_calltree == history) { + } else if (active_calltree == history) { history_search (HistorySearchType); } } @@ -65,12 +64,12 @@ static void search_all (GtkWidget *item, GtkEntry *entry) gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND); gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, - g_markup_printf_escaped("%s\n%s", - _("Search all"), - _("Click here to change the search type"))); + g_markup_printf_escaped ("%s\n%s", + _ ("Search all"), + _ ("Click here to change the search type"))); history_search (HistorySearchType); -} +} static void search_by_missed (GtkWidget *item, GtkEntry *entry) { @@ -78,11 +77,11 @@ static void search_by_missed (GtkWidget *item, GtkEntry *entry) gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, missed_pixbuf); gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, - g_markup_printf_escaped("%s\n%s", - _("Search by missed call"), - _("Click here to change the search type"))); + g_markup_printf_escaped ("%s\n%s", + _ ("Search by missed call"), + _ ("Click here to change the search type"))); history_search (HistorySearchType); -} +} static void search_by_incoming (GtkWidget *item, GtkEntry *entry) { @@ -90,11 +89,11 @@ static void search_by_incoming (GtkWidget *item, GtkEntry *entry) gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, incoming_pixbuf); gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, - g_markup_printf_escaped("%s\n%s", - _("Search by incoming call"), - _("Click here to change the search type"))); + g_markup_printf_escaped ("%s\n%s", + _ ("Search by incoming call"), + _ ("Click here to change the search type"))); history_search (HistorySearchType); -} +} static void search_by_outgoing (GtkWidget *item, GtkEntry *entry) { @@ -102,18 +101,18 @@ static void search_by_outgoing (GtkWidget *item, GtkEntry *entry) gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, outgoing_pixbuf); gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, - g_markup_printf_escaped("%s\n%s", - _("Search by outgoing call"), - _("Click here to change the search type"))); + g_markup_printf_escaped ("%s\n%s", + _ ("Search by outgoing call"), + _ ("Click here to change the search type"))); history_search (HistorySearchType); -} +} static void icon_press_cb (GtkEntry *entry, gint position, GdkEventButton *event, gpointer data) { if (position == GTK_ENTRY_ICON_PRIMARY && active_calltree == history) - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - event->button, event->time); - else + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, + event->button, event->time); + else gtk_entry_set_text (entry, ""); } @@ -128,30 +127,28 @@ static void text_changed_cb (GtkEntry *entry, GParamSpec *pspec) #endif void -focus_on_searchbar_out(){ - DEBUG("set_focus_on_searchbar_out"); +focus_on_searchbar_out() +{ + DEBUG ("set_focus_on_searchbar_out"); // gtk_widget_grab_focus(GTK_WIDGET(sw)); focus_is_on_searchbar = FALSE; } void -focus_on_searchbar_in(){ - DEBUG("set_focus_on_searchbar_in"); +focus_on_searchbar_in() +{ + DEBUG ("set_focus_on_searchbar_in"); // gtk_widget_grab_focus(GTK_WIDGET(sw)); focus_is_on_searchbar = TRUE; } -void searchbar_init(calltab_t *tab) +void searchbar_init (calltab_t *tab) { - if (g_strcasecmp (tab->_name, CONTACTS) == 0) - { + if (g_strcasecmp (tab->_name, CONTACTS) == 0) { addressbook_init(); - } - else if (g_strcasecmp (tab->_name, HISTORY) == 0) - { + } else if (g_strcasecmp (tab->_name, HISTORY) == 0) { history_init(); - } - else + } else ERROR ("searchbar.c - searchbar_init should not happen within this widget\n"); } @@ -160,7 +157,7 @@ GtkWidget* history_searchbar_new (void) GtkWidget *ret, *item, *image; - ret = gtk_hbox_new(FALSE, 0); + ret = gtk_hbox_new (FALSE, 0); #if GTK_CHECK_VERSION(2,16,0) @@ -213,40 +210,41 @@ GtkWidget* history_searchbar_new (void) #else searchbox = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); - sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(searchbox) ); + image = gtk_image_new_from_stock (GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); + sexy_icon_entry_add_clear_button (SEXY_ICON_ENTRY (searchbox)); #endif - g_signal_connect_after(GTK_ENTRY(searchbox), "changed", G_CALLBACK(searchbar_entry_changed), NULL); + g_signal_connect_after (GTK_ENTRY (searchbox), "changed", G_CALLBACK (searchbar_entry_changed), NULL); g_signal_connect_after (G_OBJECT (searchbox), "focus-in-event", - G_CALLBACK (focus_on_searchbar_in), NULL); + G_CALLBACK (focus_on_searchbar_in), NULL); g_signal_connect_after (G_OBJECT (searchbox), "focus-out-event", - G_CALLBACK (focus_on_searchbar_out), NULL); + G_CALLBACK (focus_on_searchbar_out), NULL); - gtk_box_pack_start(GTK_BOX(ret), searchbox, TRUE, TRUE, 0); - history_set_searchbar_widget(searchbox); + gtk_box_pack_start (GTK_BOX (ret), searchbox, TRUE, TRUE, 0); + history_set_searchbar_widget (searchbox); return ret; } -GtkWidget* contacts_searchbar_new () { +GtkWidget* contacts_searchbar_new () +{ GtkWidget *ret; - ret = gtk_hbox_new(FALSE, 0); + ret = gtk_hbox_new (FALSE, 0); #if GTK_CHECK_VERSION(2,16,0) - GdkPixbuf *pixbuf; + GdkPixbuf *pixbuf; searchbox = gtk_entry_new(); gtk_entry_set_icon_from_stock (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR); pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/stock_person.svg", NULL); gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_PRIMARY, pixbuf); gtk_entry_set_icon_tooltip_text (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_PRIMARY, - "Search contacts\n" - "GNOME evolution backend"); + "Search contacts\n" + "GNOME evolution backend"); // Set the clean insensitive @@ -260,29 +258,31 @@ GtkWidget* contacts_searchbar_new () { GtkWidget *image; searchbox = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); - sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(searchbox) ); + image = gtk_image_new_from_stock (GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon (SEXY_ICON_ENTRY (searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE (image)); + sexy_icon_entry_add_clear_button (SEXY_ICON_ENTRY (searchbox)); #endif - g_signal_connect_after(GTK_ENTRY(searchbox), "changed", G_CALLBACK(searchbar_entry_changed), NULL); + g_signal_connect_after (GTK_ENTRY (searchbox), "changed", G_CALLBACK (searchbar_entry_changed), NULL); g_signal_connect_after (G_OBJECT (searchbox), "focus-in-event", - G_CALLBACK (focus_on_searchbar_in), NULL); + G_CALLBACK (focus_on_searchbar_in), NULL); g_signal_connect_after (G_OBJECT (searchbox), "focus-out-event", - G_CALLBACK (focus_on_searchbar_out), NULL); + G_CALLBACK (focus_on_searchbar_out), NULL); - gtk_box_pack_start(GTK_BOX(ret), searchbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (ret), searchbox, TRUE, TRUE, 0); return ret; } -void activateWaitingLayer() { - gtk_widget_show(waitingLayer); +void activateWaitingLayer() +{ + gtk_widget_show (waitingLayer); } -void deactivateWaitingLayer() { - gtk_widget_hide(waitingLayer); +void deactivateWaitingLayer() +{ + gtk_widget_hide (waitingLayer); } SearchType get_current_history_search_type (void) diff --git a/sflphone-client-gnome/src/contacts/searchbar.h b/sflphone-client-gnome/src/contacts/searchbar.h index f1464cd554a2d1385fa5bcfafab0d3faf1d5cfd9..0fa107cce7fd48f3b82d74b9f97c45fa3ca8cb4d 100644 --- a/sflphone-client-gnome/src/contacts/searchbar.h +++ b/sflphone-client-gnome/src/contacts/searchbar.h @@ -69,7 +69,7 @@ SearchType get_current_history_search_type (void); /** * Initialize a specific search bar */ -void searchbar_init(calltab_t *); +void searchbar_init (calltab_t *); /** * Activate a waiting layer during search diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index 6e6659d8006ccf9deba223b87860b5a3e1aa713e..f1284db9450fbe237daebb26672dfeccb6602938 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -54,1880 +54,1824 @@ DBusGProxy * callManagerProxy; DBusGProxy * configurationManagerProxy; DBusGProxy * instanceProxy; - static void -incoming_call_cb(DBusGProxy *proxy UNUSED, const gchar* accountID, - const gchar* callID, const gchar* from, void * foo UNUSED ) +static void +incoming_call_cb (DBusGProxy *proxy UNUSED, const gchar* accountID, + const gchar* callID, const gchar* from, void * foo UNUSED) { - DEBUG("Incoming call (%s) from %s", callID, from); + DEBUG ("Incoming call (%s) from %s", callID, from); - callable_obj_t * c; - gchar *peer_name, *peer_number; - // We receive the from field under a formatted way. We want to extract the number and the name of the caller - peer_name = call_get_peer_name(from); - peer_number = call_get_peer_number(from); + callable_obj_t * c; + gchar *peer_name, *peer_number; + // We receive the from field under a formatted way. We want to extract the number and the name of the caller + peer_name = call_get_peer_name (from); + peer_number = call_get_peer_number (from); - DEBUG(" peer name: %s", peer_name); - DEBUG(" peer number: %s", peer_number); + DEBUG (" peer name: %s", peer_name); + DEBUG (" peer number: %s", peer_number); - create_new_call(CALL, CALL_STATE_INCOMING, g_strdup(callID), g_strdup( - accountID), peer_name, peer_number, &c); + create_new_call (CALL, CALL_STATE_INCOMING, g_strdup (callID), g_strdup ( + accountID), peer_name, peer_number, &c); #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink(TRUE); - popup_main_window(); + status_tray_icon_blink (TRUE); + popup_main_window(); #endif - set_timestamp(&c->_time_start); - notify_incoming_call(c); - sflphone_incoming_call(c); -} - - static void -zrtp_negotiation_failed_cb(DBusGProxy *proxy UNUSED, const gchar* callID, - const gchar* reason, const gchar* severity, void * foo UNUSED ) -{ - DEBUG ("Zrtp negotiation failed."); - main_window_zrtp_negotiation_failed(callID, reason, severity); - callable_obj_t * c = NULL; - c = calllist_get(current_calls, callID); - if (c) - { - notify_zrtp_negotiation_failed(c); - } -} - - static void -curent_selected_codec(DBusGProxy *proxy UNUSED, const gchar* callID, - const gchar* codecName, void * foo UNUSED ) -{ - // DEBUG ("%s codec decided for call %s",codecName,callID); - // sflphone_display_selected_codec (codecName); -} - - static void -volume_changed_cb(DBusGProxy *proxy UNUSED, const gchar* device, const gdouble value, - void * foo UNUSED ) -{ - DEBUG ("Volume of %s changed to %f.",device, value); - set_slider(device, value); -} - - static void -voice_mail_cb(DBusGProxy *proxy UNUSED, const gchar* accountID, const guint nb, - void * foo UNUSED ) -{ - DEBUG ("%d Voice mail waiting!",nb); - sflphone_notify_voice_mail(accountID, nb); -} - - static void -incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar* callID UNUSED, const gchar *from, const gchar* msg, void * foo UNUSED ) -{ - DEBUG ("Message %s!",msg); - - // Get the call information. Does this call exist? - callable_obj_t * c = calllist_get (current_calls, callID); - - /* First check if the call is valid */ - if (c) { - - /* Make the instant messaging main window pops */ - im_widget_display (&c); - - /* Display the message */ - im_widget_add_message (c->_im_widget, get_peer_information (c), msg, 0); - - } else { - ERROR ("Message received, but no recipient found"); - } -} - - static void -call_state_cb(DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* state, - void * foo UNUSED ) -{ - DEBUG ("Call %s state %s",callID, state); - callable_obj_t * c = calllist_get(current_calls, callID); - if (c) - { - if (strcmp(state, "HUNGUP") == 0) - { - if (c->_state == CALL_STATE_CURRENT) - { - // peer hung up, the conversation was established, so _stop has been initialized with the current time value - DEBUG("call state current"); - set_timestamp(&c->_time_stop); - calltree_update_call(history, c, NULL); - } - stop_notification(); - sflphone_hung_up(c); - calltree_update_call(history, c, NULL ); - status_bar_display_account(); - } - else if (strcmp(state, "UNHOLD_CURRENT") == 0) - { - sflphone_current(c); - } - else if (strcmp(state, "UNHOLD_RECORD") == 0) - { - sflphone_record(c); - } - else if (strcmp(state, "HOLD") == 0) - { - sflphone_hold(c); - } - else if (strcmp(state, "RINGING") == 0) - { - sflphone_ringing(c); - } - else if (strcmp(state, "CURRENT") == 0) - { - sflphone_current(c); - } - else if (strcmp(state, "FAILURE") == 0) - { - sflphone_fail(c); - } - else if (strcmp(state, "BUSY") == 0) - { - sflphone_busy(c); - } - } - else - { - // The callID is unknow, threat it like a new call - // If it were an incoming call, we won't be here - // It means that a new call has been initiated with an other client (cli for instance) - if (strcmp(state, "RINGING") == 0 || strcmp(state, "CURRENT") == 0) - { - callable_obj_t *new_call; - GHashTable *call_details; - gchar *type; - - DEBUG ("New ringing call! accountID: %s", callID); - - // We fetch the details associated to the specified call - call_details = dbus_get_call_details(callID); - create_new_call_from_details(callID, call_details, &new_call); - - // Restore the callID to be synchronous with the daemon - new_call->_callID = g_strdup(callID); - type = g_hash_table_lookup(call_details, "CALL_TYPE"); - - if (g_strcasecmp(type, "0") == 0) - { - // DEBUG("incoming\n"); - new_call->_history_state = INCOMING; - } - else - { - // DEBUG("outgoing\n"); - new_call->_history_state = OUTGOING; - } - - calllist_add(current_calls, new_call); - calllist_add(history, new_call); - calltree_add_call(current_calls, new_call, NULL); - update_actions(); - calltree_display(current_calls); - - //sflphone_incoming_call (new_call); - } - } -} - - static void -conference_changed_cb(DBusGProxy *proxy UNUSED, const gchar* confID, - const gchar* state, void * foo UNUSED ) -{ - - // sflphone_display_transfer_status("Transfer successfull"); - conference_obj_t* changed_conf = conferencelist_get(confID); - gchar** participants; - gchar** part; - - DEBUG("conference new state %s\n", state); - - if (changed_conf) - { - // remove old conference from calltree - calltree_remove_conference(current_calls, changed_conf, NULL); - - // update conference state - if (strcmp(state, "ACTIVE_ATACHED") == 0) - { - changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; - } - else if (strcmp(state, "ACTIVE_DETACHED") == 0) - { - changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED; - } - else if (strcmp(state, "HOLD") == 0) - { - changed_conf->_state = CONFERENCE_STATE_HOLD; - } - else - { - DEBUG("Error: conference state not recognized"); - } - - participants = (gchar**) dbus_get_participant_list(changed_conf->_confID); - - // update conferece participants - conference_participant_list_update(participants, changed_conf); - - // add new conference to calltree - calltree_add_conference(current_calls, changed_conf); - } -} - - static void -conference_created_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED ) + set_timestamp (&c->_time_start); + notify_incoming_call (c); + sflphone_incoming_call (c); +} + +static void +zrtp_negotiation_failed_cb (DBusGProxy *proxy UNUSED, const gchar* callID, + const gchar* reason, const gchar* severity, void * foo UNUSED) +{ + DEBUG ("Zrtp negotiation failed."); + main_window_zrtp_negotiation_failed (callID, reason, severity); + callable_obj_t * c = NULL; + c = calllist_get (current_calls, callID); + + if (c) { + notify_zrtp_negotiation_failed (c); + } +} + +static void +curent_selected_codec (DBusGProxy *proxy UNUSED, const gchar* callID, + const gchar* codecName, void * foo UNUSED) +{ + // DEBUG ("%s codec decided for call %s",codecName,callID); + // sflphone_display_selected_codec (codecName); +} + +static void +volume_changed_cb (DBusGProxy *proxy UNUSED, const gchar* device, const gdouble value, + void * foo UNUSED) +{ + DEBUG ("Volume of %s changed to %f.",device, value); + set_slider (device, value); +} + +static void +voice_mail_cb (DBusGProxy *proxy UNUSED, const gchar* accountID, const guint nb, + void * foo UNUSED) { - DEBUG ("DBUS: Conference %s added", confID); + DEBUG ("%d Voice mail waiting!",nb); + sflphone_notify_voice_mail (accountID, nb); +} - conference_obj_t* new_conf; - callable_obj_t* call; - gchar* call_id; - gchar** participants; - gchar** part; +static void +incoming_message_cb (DBusGProxy *proxy UNUSED, const gchar* callID UNUSED, const gchar *from, const gchar* msg, void * foo UNUSED) +{ + DEBUG ("Message %s!",msg); + + // Get the call information. Does this call exist? + callable_obj_t * c = calllist_get (current_calls, callID); - create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, confID, &new_conf); + /* First check if the call is valid */ + if (c) { - participants = (gchar**) dbus_get_participant_list(new_conf->_confID); + /* Make the instant messaging main window pops */ + im_widget_display (&c); - // Update conference list - conference_participant_list_update(participants, new_conf); + /* Display the message */ + im_widget_add_message (c->_im_widget, get_peer_information (c), msg, 0); - // Add conference ID in in each calls - for (part = participants; *part; part++) { - call_id = (gchar*) (*part); - call = calllist_get(current_calls, call_id); - call->_confID = g_strdup(confID); - } + } else { + ERROR ("Message received, but no recipient found"); + } +} - conferencelist_add(new_conf); - calltree_add_conference(current_calls, new_conf); +static void +call_state_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* state, + void * foo UNUSED) +{ + DEBUG ("Call %s state %s",callID, state); + callable_obj_t * c = calllist_get (current_calls, callID); + + if (c) { + if (strcmp (state, "HUNGUP") == 0) { + if (c->_state == CALL_STATE_CURRENT) { + // peer hung up, the conversation was established, so _stop has been initialized with the current time value + DEBUG ("call state current"); + set_timestamp (&c->_time_stop); + calltree_update_call (history, c, NULL); + } + + stop_notification(); + sflphone_hung_up (c); + calltree_update_call (history, c, NULL); + status_bar_display_account(); + } else if (strcmp (state, "UNHOLD_CURRENT") == 0) { + sflphone_current (c); + } else if (strcmp (state, "UNHOLD_RECORD") == 0) { + sflphone_record (c); + } else if (strcmp (state, "HOLD") == 0) { + sflphone_hold (c); + } else if (strcmp (state, "RINGING") == 0) { + sflphone_ringing (c); + } else if (strcmp (state, "CURRENT") == 0) { + sflphone_current (c); + } else if (strcmp (state, "FAILURE") == 0) { + sflphone_fail (c); + } else if (strcmp (state, "BUSY") == 0) { + sflphone_busy (c); + } + } else { + // The callID is unknow, threat it like a new call + // If it were an incoming call, we won't be here + // It means that a new call has been initiated with an other client (cli for instance) + if (strcmp (state, "RINGING") == 0 || strcmp (state, "CURRENT") == 0) { + callable_obj_t *new_call; + GHashTable *call_details; + gchar *type; + + DEBUG ("New ringing call! accountID: %s", callID); + + // We fetch the details associated to the specified call + call_details = dbus_get_call_details (callID); + create_new_call_from_details (callID, call_details, &new_call); + + // Restore the callID to be synchronous with the daemon + new_call->_callID = g_strdup (callID); + type = g_hash_table_lookup (call_details, "CALL_TYPE"); + + if (g_strcasecmp (type, "0") == 0) { + // DEBUG("incoming\n"); + new_call->_history_state = INCOMING; + } else { + // DEBUG("outgoing\n"); + new_call->_history_state = OUTGOING; + } + + calllist_add (current_calls, new_call); + calllist_add (history, new_call); + calltree_add_call (current_calls, new_call, NULL); + update_actions(); + calltree_display (current_calls); + + //sflphone_incoming_call (new_call); + } + } } - static void -conference_removed_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED ) +static void +conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, + const gchar* state, void * foo UNUSED) { - DEBUG ("DBUS: Conference removed %s", confID); - conference_obj_t * c = conferencelist_get(confID); - calltree_remove_conference(current_calls, c, NULL); + // sflphone_display_transfer_status("Transfer successfull"); + conference_obj_t* changed_conf = conferencelist_get (confID); + gchar** participants; + gchar** part; + + DEBUG ("conference new state %s\n", state); + + if (changed_conf) { + // remove old conference from calltree + calltree_remove_conference (current_calls, changed_conf, NULL); - GSList *participant = c->participant_list; - callable_obj_t *call; - while(participant) { + // update conference state + if (strcmp (state, "ACTIVE_ATACHED") == 0) { + changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; + } else if (strcmp (state, "ACTIVE_DETACHED") == 0) { + changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED; + } else if (strcmp (state, "HOLD") == 0) { + changed_conf->_state = CONFERENCE_STATE_HOLD; + } else { + DEBUG ("Error: conference state not recognized"); + } - call = calllist_get(current_calls, (const gchar *)(participant->data)); - if(call) { - DEBUG("DBUS: Remove participant %s", call->_callID); - if(call->_confID){ - g_free(call->_confID); - call->_confID = NULL; - } - } - participant = conference_next_participant(participant); - } + participants = (gchar**) dbus_get_participant_list (changed_conf->_confID); - conferencelist_remove(c->_confID); + // update conferece participants + conference_participant_list_update (participants, changed_conf); + + // add new conference to calltree + calltree_add_conference (current_calls, changed_conf); + } } - static void -accounts_changed_cb(DBusGProxy *proxy UNUSED, void * foo UNUSED ) +static void +conference_created_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED) { - DEBUG ("Accounts changed"); - sflphone_fill_account_list(); - sflphone_fill_ip2ip_profile(); - account_list_config_dialog_fill(); + DEBUG ("DBUS: Conference %s added", confID); + + conference_obj_t* new_conf; + callable_obj_t* call; + gchar* call_id; + gchar** participants; + gchar** part; + + create_new_conference (CONFERENCE_STATE_ACTIVE_ATACHED, confID, &new_conf); - // Update the status bar in case something happened - // Should fix ticket #1215 - status_bar_display_account(); + participants = (gchar**) dbus_get_participant_list (new_conf->_confID); - // Update the tooltip on the status icon - statusicon_set_tooltip (); + // Update conference list + conference_participant_list_update (participants, new_conf); + + // Add conference ID in in each calls + for (part = participants; *part; part++) { + call_id = (gchar*) (*part); + call = calllist_get (current_calls, call_id); + call->_confID = g_strdup (confID); + } + + conferencelist_add (new_conf); + calltree_add_conference (current_calls, new_conf); +} + +static void +conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED) +{ + DEBUG ("DBUS: Conference removed %s", confID); + + conference_obj_t * c = conferencelist_get (confID); + calltree_remove_conference (current_calls, c, NULL); + + GSList *participant = c->participant_list; + callable_obj_t *call; + + while (participant) { + + call = calllist_get (current_calls, (const gchar *) (participant->data)); + + if (call) { + DEBUG ("DBUS: Remove participant %s", call->_callID); + + if (call->_confID) { + g_free (call->_confID); + call->_confID = NULL; + } + } + + participant = conference_next_participant (participant); + } + + conferencelist_remove (c->_confID); } - static void -transfer_succeded_cb(DBusGProxy *proxy UNUSED, void * foo UNUSED ) +static void +accounts_changed_cb (DBusGProxy *proxy UNUSED, void * foo UNUSED) { - DEBUG ("Transfer succeded\n"); - sflphone_display_transfer_status("Transfer successfull"); + DEBUG ("Accounts changed"); + sflphone_fill_account_list(); + sflphone_fill_ip2ip_profile(); + account_list_config_dialog_fill(); + + // Update the status bar in case something happened + // Should fix ticket #1215 + status_bar_display_account(); + + // Update the tooltip on the status icon + statusicon_set_tooltip (); } - static void -transfer_failed_cb(DBusGProxy *proxy UNUSED, void * foo UNUSED ) +static void +transfer_succeded_cb (DBusGProxy *proxy UNUSED, void * foo UNUSED) { - DEBUG ("Transfer failed\n"); - sflphone_display_transfer_status("Transfer failed"); + DEBUG ("Transfer succeded\n"); + sflphone_display_transfer_status ("Transfer successfull"); } - static void -secure_sdes_on_cb(DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED) +static void +transfer_failed_cb (DBusGProxy *proxy UNUSED, void * foo UNUSED) { - DEBUG("SRTP using SDES is on"); - callable_obj_t *c = calllist_get(current_calls, callID); - if (c) - { - sflphone_srtp_sdes_on(c); - notify_secure_on(c); - } + DEBUG ("Transfer failed\n"); + sflphone_display_transfer_status ("Transfer failed"); +} + +static void +secure_sdes_on_cb (DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED) +{ + DEBUG ("SRTP using SDES is on"); + callable_obj_t *c = calllist_get (current_calls, callID); + + if (c) { + sflphone_srtp_sdes_on (c); + notify_secure_on (c); + } } - static void -secure_sdes_off_cb(DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED) +static void +secure_sdes_off_cb (DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED) { - DEBUG("SRTP using SDES is off"); - callable_obj_t *c = calllist_get(current_calls, callID); - if (c) - { - sflphone_srtp_sdes_off(c); - notify_secure_off(c); - } + DEBUG ("SRTP using SDES is off"); + callable_obj_t *c = calllist_get (current_calls, callID); + + if (c) { + sflphone_srtp_sdes_off (c); + notify_secure_off (c); + } } - static void -secure_zrtp_on_cb(DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* cipher, - void * foo UNUSED ) +static void +secure_zrtp_on_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* cipher, + void * foo UNUSED) { - DEBUG ("SRTP using ZRTP is ON secure_on_cb"); - callable_obj_t * c = calllist_get(current_calls, callID); - if (c) - { - c->_srtp_cipher = g_strdup(cipher); + DEBUG ("SRTP using ZRTP is ON secure_on_cb"); + callable_obj_t * c = calllist_get (current_calls, callID); - sflphone_srtp_zrtp_on(c); - notify_secure_on(c); - } + if (c) { + c->_srtp_cipher = g_strdup (cipher); + + sflphone_srtp_zrtp_on (c); + notify_secure_on (c); + } } - static void -secure_zrtp_off_cb(DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED ) +static void +secure_zrtp_off_cb (DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED) { - DEBUG ("SRTP using ZRTP is OFF"); - callable_obj_t * c = calllist_get(current_calls, callID); - if (c) - { - sflphone_srtp_zrtp_off(c); - notify_secure_off(c); - } + DEBUG ("SRTP using ZRTP is OFF"); + callable_obj_t * c = calllist_get (current_calls, callID); + + if (c) { + sflphone_srtp_zrtp_off (c); + notify_secure_off (c); + } } - static void -show_zrtp_sas_cb(DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* sas, - const gboolean verified, void * foo UNUSED ) +static void +show_zrtp_sas_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* sas, + const gboolean verified, void * foo UNUSED) { - DEBUG ("Showing SAS"); - callable_obj_t * c = calllist_get(current_calls, callID); - if (c) - { - sflphone_srtp_zrtp_show_sas(c, sas, verified); - } + DEBUG ("Showing SAS"); + callable_obj_t * c = calllist_get (current_calls, callID); + + if (c) { + sflphone_srtp_zrtp_show_sas (c, sas, verified); + } } - static void -confirm_go_clear_cb(DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED ) +static void +confirm_go_clear_cb (DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED) { - DEBUG ("Confirm Go Clear request"); - callable_obj_t * c = calllist_get(current_calls, callID); - if (c) - { - sflphone_confirm_go_clear(c); - } + DEBUG ("Confirm Go Clear request"); + callable_obj_t * c = calllist_get (current_calls, callID); + + if (c) { + sflphone_confirm_go_clear (c); + } } - static void -zrtp_not_supported_cb(DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED ) +static void +zrtp_not_supported_cb (DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED) { - DEBUG ("ZRTP not supported on the other end"); - callable_obj_t * c = calllist_get(current_calls, callID); - if (c) - { - sflphone_srtp_zrtp_not_supported(c); - notify_zrtp_not_supported(c); - } + DEBUG ("ZRTP not supported on the other end"); + callable_obj_t * c = calllist_get (current_calls, callID); + + if (c) { + sflphone_srtp_zrtp_not_supported (c); + notify_zrtp_not_supported (c); + } } - static void -sip_call_state_cb(DBusGProxy *proxy UNUSED, const gchar* callID, - const gchar* description, const guint code, void * foo UNUSED ) +static void +sip_call_state_cb (DBusGProxy *proxy UNUSED, const gchar* callID, + const gchar* description, const guint code, void * foo UNUSED) { - callable_obj_t * c = NULL; - c = calllist_get(current_calls, callID); + callable_obj_t * c = NULL; + c = calllist_get (current_calls, callID); - if (c != NULL) - { - DEBUG("sip_call_state_cb received code %d", code); - sflphone_call_state_changed(c, description, code); - } + if (c != NULL) { + DEBUG ("sip_call_state_cb received code %d", code); + sflphone_call_state_changed (c, description, code); + } } - static void -error_alert(DBusGProxy *proxy UNUSED, int errCode, void * foo UNUSED ) +static void +error_alert (DBusGProxy *proxy UNUSED, int errCode, void * foo UNUSED) { - ERROR ("Error notifying : (%i)", errCode); - sflphone_throw_exception(errCode); + ERROR ("Error notifying : (%i)", errCode); + sflphone_throw_exception (errCode); } - gboolean +gboolean dbus_connect() { - GError *error = NULL; - connection = NULL; - instanceProxy = NULL; - - g_type_init(); - - connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); - - if (error) - { - ERROR ("Failed to open connection to bus: %s", - error->message); - g_error_free(error); - return FALSE; - } - - /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ - - instanceProxy = dbus_g_proxy_new_for_name(connection, - "org.sflphone.SFLphone", "/org/sflphone/SFLphone/Instance", - "org.sflphone.SFLphone.Instance"); - /* - instanceProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/Instance", - "org.sflphone.SFLphone.Instance", - &error); - */ - - if (instanceProxy == NULL) - { - ERROR ("Failed to get proxy to Instance"); - return FALSE; - } - - DEBUG ("DBus connected to Instance"); - - callManagerProxy = dbus_g_proxy_new_for_name(connection, - "org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", - "org.sflphone.SFLphone.CallManager"); - - /* - callManagerProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/CallManager", - "org.sflphone.SFLphone.CallManager", - &error); - */ - if (callManagerProxy == NULL) - { - ERROR ("Failed to get proxy to CallManagers"); - return FALSE; - } - - DEBUG ("DBus connected to CallManager"); - /* STRING STRING STRING Marshaller */ - /* Incoming call */ - dbus_g_object_register_marshaller( - g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "incomingCall", G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "incomingCall", - G_CALLBACK(incoming_call_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "zrtpNegotiationFailed", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "zrtpNegotiationFailed", - G_CALLBACK(zrtp_negotiation_failed_cb), NULL, NULL); - - /* Current codec */ - dbus_g_object_register_marshaller( - g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "currentSelectedCodec", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "currentSelectedCodec", - G_CALLBACK(curent_selected_codec), NULL, NULL); - - /* Register a marshaller for STRING,STRING */ - dbus_g_object_register_marshaller( - g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "callStateChanged", G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "callStateChanged", - G_CALLBACK(call_state_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "voiceMailNotify", G_TYPE_STRING, - G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "voiceMailNotify", - G_CALLBACK(voice_mail_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "incomingMessage", G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "incomingMessage", - G_CALLBACK(incoming_message_cb), NULL, NULL); - - dbus_g_object_register_marshaller( - g_cclosure_user_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, G_TYPE_STRING, - G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "volumeChanged", G_TYPE_STRING, - G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "volumeChanged", - G_CALLBACK(volume_changed_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "transferSucceded", G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "transferSucceded", - G_CALLBACK(transfer_succeded_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "transferFailed", G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "transferFailed", - G_CALLBACK(transfer_failed_cb), NULL, NULL); - - /* Conference related callback */ - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "conferenceChanged", G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "conferenceChanged", - G_CALLBACK(conference_changed_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "conferenceCreated", G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "conferenceCreated", - G_CALLBACK(conference_created_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "conferenceRemoved", G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "conferenceRemoved", - G_CALLBACK(conference_removed_cb), NULL, NULL); - - /* Security related callbacks */ - - dbus_g_proxy_add_signal(callManagerProxy, "secureSdesOn", G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureSdesOn", - G_CALLBACK(secure_sdes_on_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "secureSdesOff", G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureSdesOff", - G_CALLBACK(secure_sdes_off_cb), NULL, NULL); - - /* Register a marshaller for STRING,STRING,BOOL */ - dbus_g_object_register_marshaller( - g_cclosure_user_marshal_VOID__STRING_STRING_BOOL, G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "showSAS", G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "showSAS", - G_CALLBACK(show_zrtp_sas_cb), NULL, NULL); - - dbus_g_proxy_add_signal(callManagerProxy, "secureZrtpOn", G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureZrtpOn", - G_CALLBACK(secure_zrtp_on_cb), NULL, NULL); - - /* Register a marshaller for STRING*/ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "secureZrtpOff", G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureZrtpOff", - G_CALLBACK(secure_zrtp_off_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "zrtpNotSuppOther", G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "zrtpNotSuppOther", - G_CALLBACK(zrtp_not_supported_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "confirmGoClear", G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "confirmGoClear", - G_CALLBACK(confirm_go_clear_cb), NULL, NULL); - - /* VOID STRING STRING INT */ - dbus_g_object_register_marshaller( - g_cclosure_user_marshal_VOID__STRING_STRING_INT, G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - - dbus_g_proxy_add_signal(callManagerProxy, "sipCallStateChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "sipCallStateChanged", - G_CALLBACK(sip_call_state_cb), NULL, NULL); - - configurationManagerProxy = dbus_g_proxy_new_for_name(connection, - "org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", - "org.sflphone.SFLphone.ConfigurationManager"); - - /* - configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/ConfigurationManager", - "org.sflphone.SFLphone.ConfigurationManager", - &error); - */ - if (!configurationManagerProxy) - { - ERROR ("Failed to get proxy to ConfigurationManager"); - return FALSE; - } - DEBUG ("DBus connected to ConfigurationManager"); - dbus_g_proxy_add_signal(configurationManagerProxy, "accountsChanged", - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(configurationManagerProxy, "accountsChanged", - G_CALLBACK(accounts_changed_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__INT, - G_TYPE_NONE, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal(configurationManagerProxy, "errorAlert", G_TYPE_INT, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(configurationManagerProxy, "errorAlert", - G_CALLBACK(error_alert), NULL, NULL); - - /* Defines a default timeout for the proxies */ + GError *error = NULL; + connection = NULL; + instanceProxy = NULL; + + g_type_init(); + + connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + + if (error) { + ERROR ("Failed to open connection to bus: %s", + error->message); + g_error_free (error); + return FALSE; + } + + /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ + + instanceProxy = dbus_g_proxy_new_for_name (connection, + "org.sflphone.SFLphone", "/org/sflphone/SFLphone/Instance", + "org.sflphone.SFLphone.Instance"); + /* + instanceProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/Instance", + "org.sflphone.SFLphone.Instance", + &error); + */ + + if (instanceProxy == NULL) { + ERROR ("Failed to get proxy to Instance"); + return FALSE; + } + + DEBUG ("DBus connected to Instance"); + + callManagerProxy = dbus_g_proxy_new_for_name (connection, + "org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", + "org.sflphone.SFLphone.CallManager"); + + /* + callManagerProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/CallManager", + "org.sflphone.SFLphone.CallManager", + &error); + */ + if (callManagerProxy == NULL) { + ERROR ("Failed to get proxy to CallManagers"); + return FALSE; + } + + DEBUG ("DBus connected to CallManager"); + /* STRING STRING STRING Marshaller */ + /* Incoming call */ + dbus_g_object_register_marshaller ( + g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "incomingCall", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "incomingCall", + G_CALLBACK (incoming_call_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "zrtpNegotiationFailed", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "zrtpNegotiationFailed", + G_CALLBACK (zrtp_negotiation_failed_cb), NULL, NULL); + + /* Current codec */ + dbus_g_object_register_marshaller ( + g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "currentSelectedCodec", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "currentSelectedCodec", + G_CALLBACK (curent_selected_codec), NULL, NULL); + + /* Register a marshaller for STRING,STRING */ + dbus_g_object_register_marshaller ( + g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "callStateChanged", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "callStateChanged", + G_CALLBACK (call_state_cb), NULL, NULL); + + dbus_g_object_register_marshaller (g_cclosure_user_marshal_VOID__STRING_INT, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "voiceMailNotify", G_TYPE_STRING, + G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "voiceMailNotify", + G_CALLBACK (voice_mail_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "incomingMessage", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "incomingMessage", + G_CALLBACK (incoming_message_cb), NULL, NULL); + + dbus_g_object_register_marshaller ( + g_cclosure_user_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, G_TYPE_STRING, + G_TYPE_DOUBLE, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "volumeChanged", G_TYPE_STRING, + G_TYPE_DOUBLE, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "volumeChanged", + G_CALLBACK (volume_changed_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "transferSucceded", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "transferSucceded", + G_CALLBACK (transfer_succeded_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "transferFailed", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "transferFailed", + G_CALLBACK (transfer_failed_cb), NULL, NULL); + + /* Conference related callback */ + + dbus_g_object_register_marshaller (g_cclosure_user_marshal_VOID__STRING, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "conferenceChanged", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "conferenceChanged", + G_CALLBACK (conference_changed_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "conferenceCreated", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "conferenceCreated", + G_CALLBACK (conference_created_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "conferenceRemoved", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "conferenceRemoved", + G_CALLBACK (conference_removed_cb), NULL, NULL); + + /* Security related callbacks */ + + dbus_g_proxy_add_signal (callManagerProxy, "secureSdesOn", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "secureSdesOn", + G_CALLBACK (secure_sdes_on_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "secureSdesOff", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "secureSdesOff", + G_CALLBACK (secure_sdes_off_cb), NULL, NULL); + + /* Register a marshaller for STRING,STRING,BOOL */ + dbus_g_object_register_marshaller ( + g_cclosure_user_marshal_VOID__STRING_STRING_BOOL, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "showSAS", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "showSAS", + G_CALLBACK (show_zrtp_sas_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, "secureZrtpOn", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "secureZrtpOn", + G_CALLBACK (secure_zrtp_on_cb), NULL, NULL); + + /* Register a marshaller for STRING*/ + dbus_g_object_register_marshaller (g_cclosure_user_marshal_VOID__STRING, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, "secureZrtpOff", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "secureZrtpOff", + G_CALLBACK (secure_zrtp_off_cb), NULL, NULL); + dbus_g_proxy_add_signal (callManagerProxy, "zrtpNotSuppOther", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "zrtpNotSuppOther", + G_CALLBACK (zrtp_not_supported_cb), NULL, NULL); + dbus_g_proxy_add_signal (callManagerProxy, "confirmGoClear", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "confirmGoClear", + G_CALLBACK (confirm_go_clear_cb), NULL, NULL); + + /* VOID STRING STRING INT */ + dbus_g_object_register_marshaller ( + g_cclosure_user_marshal_VOID__STRING_STRING_INT, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + + dbus_g_proxy_add_signal (callManagerProxy, "sipCallStateChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, "sipCallStateChanged", + G_CALLBACK (sip_call_state_cb), NULL, NULL); + + configurationManagerProxy = dbus_g_proxy_new_for_name (connection, + "org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", + "org.sflphone.SFLphone.ConfigurationManager"); + + /* + configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/ConfigurationManager", + "org.sflphone.SFLphone.ConfigurationManager", + &error); + */ + if (!configurationManagerProxy) { + ERROR ("Failed to get proxy to ConfigurationManager"); + return FALSE; + } + + DEBUG ("DBus connected to ConfigurationManager"); + dbus_g_proxy_add_signal (configurationManagerProxy, "accountsChanged", + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (configurationManagerProxy, "accountsChanged", + G_CALLBACK (accounts_changed_cb), NULL, NULL); + + dbus_g_object_register_marshaller (g_cclosure_user_marshal_VOID__INT, + G_TYPE_NONE, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_add_signal (configurationManagerProxy, "errorAlert", G_TYPE_INT, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (configurationManagerProxy, "errorAlert", + G_CALLBACK (error_alert), NULL, NULL); + + /* Defines a default timeout for the proxies */ #if HAVE_DBUS_G_PROXY_SET_DEFAULT_TIMEOUT - dbus_g_proxy_set_default_timeout(callManagerProxy, DEFAULT_DBUS_TIMEOUT); - dbus_g_proxy_set_default_timeout(instanceProxy, DEFAULT_DBUS_TIMEOUT); - dbus_g_proxy_set_default_timeout(configurationManagerProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout (callManagerProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout (instanceProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout (configurationManagerProxy, DEFAULT_DBUS_TIMEOUT); #endif - return TRUE; + return TRUE; } - void +void dbus_clean() { - g_object_unref(callManagerProxy); - g_object_unref(configurationManagerProxy); - g_object_unref(instanceProxy); + g_object_unref (callManagerProxy); + g_object_unref (configurationManagerProxy); + g_object_unref (instanceProxy); } - void -dbus_hold(const callable_obj_t * c) +void +dbus_hold (const callable_obj_t * c) { - DEBUG("dbus_hold %s\n", c->_callID); + DEBUG ("dbus_hold %s\n", c->_callID); + + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hold (callManagerProxy, c->_callID, &error); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hold(callManagerProxy, c->_callID, &error); - if (error) - { - ERROR ("Failed to call hold() on CallManager: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call hold() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_unhold(const callable_obj_t * c) +void +dbus_unhold (const callable_obj_t * c) { - DEBUG("dbus_unhold %s\n", c->_callID); + DEBUG ("dbus_unhold %s\n", c->_callID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_unhold(callManagerProxy, c->_callID, &error); - if (error) - { - ERROR ("Failed to call unhold() on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_unhold (callManagerProxy, c->_callID, &error); + + if (error) { + ERROR ("Failed to call unhold() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_hold_conference(const conference_obj_t * c) +void +dbus_hold_conference (const conference_obj_t * c) { - DEBUG("dbus_hold_conference %s\n", c->_confID); + DEBUG ("dbus_hold_conference %s\n", c->_confID); + + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hold_conference (callManagerProxy, + c->_confID, &error); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hold_conference(callManagerProxy, - c->_confID, &error); - if (error) - { - ERROR ("Failed to call hold() on CallManager: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call hold() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_unhold_conference(const conference_obj_t * c) +void +dbus_unhold_conference (const conference_obj_t * c) { - DEBUG("dbus_unhold_conference %s\n", c->_confID); + DEBUG ("dbus_unhold_conference %s\n", c->_confID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_unhold_conference(callManagerProxy, - c->_confID, &error); - if (error) - { - ERROR ("Failed to call unhold() on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_unhold_conference (callManagerProxy, + c->_confID, &error); + + if (error) { + ERROR ("Failed to call unhold() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_hang_up(const callable_obj_t * c) +void +dbus_hang_up (const callable_obj_t * c) { - DEBUG("dbus_hang_up %s\n", c->_callID); + DEBUG ("dbus_hang_up %s\n", c->_callID); + + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hang_up (callManagerProxy, c->_callID, + &error); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hang_up(callManagerProxy, c->_callID, - &error); - if (error) - { - ERROR ("Failed to call hang_up() on CallManager: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call hang_up() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_hang_up_conference(const conference_obj_t * c) +void +dbus_hang_up_conference (const conference_obj_t * c) { - DEBUG("dbus_hang_up_conference %s\n", c->_confID); + DEBUG ("dbus_hang_up_conference %s\n", c->_confID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hang_up_conference(callManagerProxy, - c->_confID, &error); - if (error) - { - ERROR ("Failed to call hang_up() on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hang_up_conference (callManagerProxy, + c->_confID, &error); + + if (error) { + ERROR ("Failed to call hang_up() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_transfert(const callable_obj_t * c) +void +dbus_transfert (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_transfert(callManagerProxy, c->_callID, - c->_trsft_to, &error); - if (error) - { - ERROR ("Failed to call transfert() on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_transfert (callManagerProxy, c->_callID, + c->_trsft_to, &error); + + if (error) { + ERROR ("Failed to call transfert() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_accept(const callable_obj_t * c) +void +dbus_accept (const callable_obj_t * c) { #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink(FALSE); + status_tray_icon_blink (FALSE); #endif - DEBUG("dbus_accept %s\n", c->_callID); + DEBUG ("dbus_accept %s\n", c->_callID); + + GError *error = NULL; + org_sflphone_SFLphone_CallManager_accept (callManagerProxy, c->_callID, &error); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_accept(callManagerProxy, c->_callID, &error); - if (error) - { - ERROR ("Failed to call accept(%s) on CallManager: %s", c->_callID, - (error->message == NULL ? g_quark_to_string(error->domain): error->message)); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call accept(%s) on CallManager: %s", c->_callID, + (error->message == NULL ? g_quark_to_string (error->domain) : error->message)); + g_error_free (error); + } } - void -dbus_refuse(const callable_obj_t * c) +void +dbus_refuse (const callable_obj_t * c) { #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink(FALSE); + status_tray_icon_blink (FALSE); #endif - DEBUG("dbus_refuse %s\n", c->_callID); + DEBUG ("dbus_refuse %s\n", c->_callID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_refuse(callManagerProxy, c->_callID, &error); - if (error) - { - ERROR ("Failed to call refuse() on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_refuse (callManagerProxy, c->_callID, &error); + + if (error) { + ERROR ("Failed to call refuse() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_place_call(const callable_obj_t * c) +void +dbus_place_call (const callable_obj_t * c) { - DEBUG("dbus_place_call %s\n", c->_callID); + DEBUG ("dbus_place_call %s\n", c->_callID); + + GError *error = NULL; + org_sflphone_SFLphone_CallManager_place_call (callManagerProxy, c->_accountID, + c->_callID, c->_peer_number, &error); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_place_call(callManagerProxy, c->_accountID, - c->_callID, c->_peer_number, &error); - if (error) - { - ERROR ("Failed to call placeCall() on CallManager: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call placeCall() on CallManager: %s", + error->message); + g_error_free (error); + } } - gchar** +gchar** dbus_account_list() { - GError *error = NULL; - char ** array; - - if (!org_sflphone_SFLphone_ConfigurationManager_get_account_list( - configurationManagerProxy, &array, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_account_list) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_account_list: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - DEBUG ("DBus called get_account_list() on ConfigurationManager"); - return array; - } -} - - GHashTable* -dbus_account_details(gchar * accountID) -{ - GError *error = NULL; - GHashTable * details; - - if (!org_sflphone_SFLphone_ConfigurationManager_get_account_details( - configurationManagerProxy, accountID, &details, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_account_details: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - return details; - } -} - - void -dbus_set_credential(account_t *a, int index) -{ - DEBUG("Sending credential %d to server", index); - GError *error = NULL; - GHashTable * credential = g_ptr_array_index(a->credential_information, index); - - if (credential == NULL) - { - DEBUG("Credential %d was deleted", index); - } - else - { - org_sflphone_SFLphone_ConfigurationManager_set_credential( - configurationManagerProxy, a->accountID, index, credential, &error); - } - - if (error) - { - ERROR ("Failed to call set_credential() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } -} - void -dbus_set_number_of_credential(account_t *a, int number) -{ - DEBUG("Sending number of credential %d to server", number); - GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_set_number_of_credential( - configurationManagerProxy, a->accountID, number, &error); - - if (error) - { - ERROR ("Failed to call set_number_of_credential() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } -} - void -dbus_delete_all_credential(account_t *a) -{ - DEBUG("Deleting all credentials\n"); - GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_delete_all_credential( - configurationManagerProxy, a->accountID, &error); - - if (error) - { - ERROR ("Failed to call deleteAllCredential on ConfigurationManager: %s", - error->message); - g_error_free(error); - } -} - - int -dbus_get_number_of_credential(gchar * accountID) -{ - GError *error = NULL; - int number = 0; - - DEBUG("Getting number of credential for account %s", accountID); - - if (!org_sflphone_SFLphone_ConfigurationManager_get_number_of_credential( - configurationManagerProxy, accountID, &number, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_account_details: %s", error->message); - } - g_error_free(error); - return 0; - } - else - { - DEBUG("%d credential(s) found for account %s", number, accountID); - return number; - } -} - - GHashTable* -dbus_get_credential(gchar * accountID, int index) -{ - GError *error = NULL; - GHashTable * details; - - if (!org_sflphone_SFLphone_ConfigurationManager_get_credential( - configurationManagerProxy, accountID, index, &details, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_account_details: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - return details; - } -} - - GHashTable* -dbus_get_ip2_ip_details(void) -{ - GError *error = NULL; - GHashTable * details; - if (!org_sflphone_SFLphone_ConfigurationManager_get_ip2_ip_details( - configurationManagerProxy, &details, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_ip2_ip_details) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_ip2_ip_details: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - return details; - } -} - - void -dbus_set_ip2ip_details(GHashTable * properties) -{ - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_ip2_ip_details( - configurationManagerProxy, properties, &error); - if (error) - { - ERROR ("Failed to call set_ip_2ip_details() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } -} - - void -dbus_send_register(gchar* accountID, const guint enable) -{ - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_send_register( - configurationManagerProxy, accountID, enable, &error); - if (error) - { - ERROR ("Failed to call send_register() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } -} - - void -dbus_remove_account(gchar * accountID) -{ - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_remove_account( - configurationManagerProxy, accountID, &error); - if (error) - { - ERROR ("Failed to call remove_account() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } -} - - void -dbus_set_account_details(account_t *a) -{ - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_account_details( - configurationManagerProxy, a->accountID, a->properties, &error); - if (error) - { - ERROR ("Failed to call set_account_details() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } -} - gchar* -dbus_add_account(account_t *a) -{ - gchar* accountId; - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_add_account( - configurationManagerProxy, a->properties, &accountId, &error); - if (error) - { - ERROR ("Failed to call add_account() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return accountId; -} - - void -dbus_set_volume(const gchar * device, gdouble value) -{ - GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_volume(callManagerProxy, device, value, - &error); - - if (error) - { - ERROR ("Failed to call set_volume() on callManagerProxy: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + char ** array; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_account_list ( + configurationManagerProxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_account_list) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_account_list: %s", error->message); + } + + g_error_free (error); + return NULL; + } else { + DEBUG ("DBus called get_account_list() on ConfigurationManager"); + return array; + } +} + +GHashTable* +dbus_account_details (gchar * accountID) +{ + GError *error = NULL; + GHashTable * details; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_account_details ( + configurationManagerProxy, accountID, &details, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_account_details: %s", error->message); + } + + g_error_free (error); + return NULL; + } else { + return details; + } +} + +void +dbus_set_credential (account_t *a, int index) +{ + DEBUG ("Sending credential %d to server", index); + GError *error = NULL; + GHashTable * credential = g_ptr_array_index (a->credential_information, index); + + if (credential == NULL) { + DEBUG ("Credential %d was deleted", index); + } else { + org_sflphone_SFLphone_ConfigurationManager_set_credential ( + configurationManagerProxy, a->accountID, index, credential, &error); + } + + if (error) { + ERROR ("Failed to call set_credential() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} +void +dbus_set_number_of_credential (account_t *a, int number) +{ + DEBUG ("Sending number of credential %d to server", number); + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_number_of_credential ( + configurationManagerProxy, a->accountID, number, &error); + + if (error) { + ERROR ("Failed to call set_number_of_credential() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} +void +dbus_delete_all_credential (account_t *a) +{ + DEBUG ("Deleting all credentials\n"); + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_delete_all_credential ( + configurationManagerProxy, a->accountID, &error); + + if (error) { + ERROR ("Failed to call deleteAllCredential on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} + +int +dbus_get_number_of_credential (gchar * accountID) +{ + GError *error = NULL; + int number = 0; + + DEBUG ("Getting number of credential for account %s", accountID); + + if (!org_sflphone_SFLphone_ConfigurationManager_get_number_of_credential ( + configurationManagerProxy, accountID, &number, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_account_details: %s", error->message); + } + + g_error_free (error); + return 0; + } else { + DEBUG ("%d credential(s) found for account %s", number, accountID); + return number; + } +} + +GHashTable* +dbus_get_credential (gchar * accountID, int index) +{ + GError *error = NULL; + GHashTable * details; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_credential ( + configurationManagerProxy, accountID, index, &details, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_account_details: %s", error->message); + } + + g_error_free (error); + return NULL; + } else { + return details; + } +} + +GHashTable* +dbus_get_ip2_ip_details (void) +{ + GError *error = NULL; + GHashTable * details; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_ip2_ip_details ( + configurationManagerProxy, &details, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_ip2_ip_details) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_ip2_ip_details: %s", error->message); + } + + g_error_free (error); + return NULL; + } else { + return details; + } +} + +void +dbus_set_ip2ip_details (GHashTable * properties) +{ + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_ip2_ip_details ( + configurationManagerProxy, properties, &error); + + if (error) { + ERROR ("Failed to call set_ip_2ip_details() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} + +void +dbus_send_register (gchar* accountID, const guint enable) +{ + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_send_register ( + configurationManagerProxy, accountID, enable, &error); + + if (error) { + ERROR ("Failed to call send_register() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} + +void +dbus_remove_account (gchar * accountID) +{ + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_remove_account ( + configurationManagerProxy, accountID, &error); + + if (error) { + ERROR ("Failed to call remove_account() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} + +void +dbus_set_account_details (account_t *a) +{ + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_account_details ( + configurationManagerProxy, a->accountID, a->properties, &error); + + if (error) { + ERROR ("Failed to call set_account_details() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} +gchar* +dbus_add_account (account_t *a) +{ + gchar* accountId; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_add_account ( + configurationManagerProxy, a->properties, &accountId, &error); + + if (error) { + ERROR ("Failed to call add_account() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } + + return accountId; +} + +void +dbus_set_volume (const gchar * device, gdouble value) +{ + GError *error = NULL; + org_sflphone_SFLphone_CallManager_set_volume (callManagerProxy, device, value, + &error); + + if (error) { + ERROR ("Failed to call set_volume() on callManagerProxy: %s", + error->message); + g_error_free (error); + } } - gdouble -dbus_get_volume(const gchar * device) +gdouble +dbus_get_volume (const gchar * device) { - gdouble value; - GError *error = NULL; + gdouble value; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_get_volume(callManagerProxy, device, - &value, &error); + org_sflphone_SFLphone_CallManager_get_volume (callManagerProxy, device, + &value, &error); - if (error) - { - ERROR ("Failed to call get_volume() on callManagerProxy: %s", - error->message); - g_error_free(error); - } - return value; + if (error) { + ERROR ("Failed to call get_volume() on callManagerProxy: %s", + error->message); + g_error_free (error); + } + + return value; } - void -dbus_play_dtmf(const gchar * key) +void +dbus_play_dtmf (const gchar * key) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_play_dt_mf(callManagerProxy, key, &error); + org_sflphone_SFLphone_CallManager_play_dt_mf (callManagerProxy, key, &error); - if (error) - { - ERROR ("Failed to call playDTMF() on callManagerProxy: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call playDTMF() on callManagerProxy: %s", + error->message); + g_error_free (error); + } } - void -dbus_start_tone(const int start, const guint type) +void +dbus_start_tone (const int start, const guint type) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_start_tone(callManagerProxy, start, type, - &error); + org_sflphone_SFLphone_CallManager_start_tone (callManagerProxy, start, type, + &error); - if (error) - { - ERROR ("Failed to call startTone() on callManagerProxy: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call startTone() on callManagerProxy: %s", + error->message); + g_error_free (error); + } } - void -dbus_register(int pid, gchar * name) +void +dbus_register (int pid, gchar * name) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_Instance_register(instanceProxy, pid, name, &error); + org_sflphone_SFLphone_Instance_register (instanceProxy, pid, name, &error); - if (error) - { - ERROR ("Failed to call register() on instanceProxy: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call register() on instanceProxy: %s", + error->message); + g_error_free (error); + } } - void -dbus_unregister(int pid) +void +dbus_unregister (int pid) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_Instance_unregister(instanceProxy, pid, &error); + org_sflphone_SFLphone_Instance_unregister (instanceProxy, pid, &error); - if (error) - { - ERROR ("Failed to call unregister() on instanceProxy: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call unregister() on instanceProxy: %s", + error->message); + g_error_free (error); + } } - gchar** +gchar** dbus_codec_list() { - GError *error = NULL; - gchar** array = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_codec_list( - configurationManagerProxy, &array, &error); + GError *error = NULL; + gchar** array = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_codec_list ( + configurationManagerProxy, &array, &error); + + if (error) { + ERROR ("Failed to call get_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } - if (error) - { - ERROR ("Failed to call get_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return array; + return array; } - gchar** -dbus_codec_details(int payload) +gchar** +dbus_codec_details (int payload) { - GError *error = NULL; - gchar ** array; - org_sflphone_SFLphone_ConfigurationManager_get_codec_details( - configurationManagerProxy, payload, &array, &error); + GError *error = NULL; + gchar ** array; + org_sflphone_SFLphone_ConfigurationManager_get_codec_details ( + configurationManagerProxy, payload, &array, &error); + + if (error) { + ERROR ("Failed to call get_codec_details() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } - if (error) - { - ERROR ("Failed to call get_codec_details() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return array; + return array; } - gchar* -dbus_get_current_codec_name(const callable_obj_t * c) +gchar* +dbus_get_current_codec_name (const callable_obj_t * c) { - gchar* codecName = ""; - GError* error = NULL; + gchar* codecName = ""; + GError* error = NULL; - org_sflphone_SFLphone_CallManager_get_current_codec_name(callManagerProxy, - c->_callID, &codecName, &error); - if (error) - { - g_error_free(error); - } + org_sflphone_SFLphone_CallManager_get_current_codec_name (callManagerProxy, + c->_callID, &codecName, &error); - DEBUG("dbus_get_current_codec_name : codecName : %s", codecName); + if (error) { + g_error_free (error); + } - return codecName; + DEBUG ("dbus_get_current_codec_name : codecName : %s", codecName); + + return codecName; } - gchar** -dbus_get_active_codec_list(gchar *accountID) +gchar** +dbus_get_active_codec_list (gchar *accountID) { - gchar ** array; - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list( - configurationManagerProxy, accountID, &array, &error); + gchar ** array; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list ( + configurationManagerProxy, accountID, &array, &error); + + if (error) { + ERROR ("Failed to call get_active_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } - if (error) - { - ERROR ("Failed to call get_active_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return array; + return array; } - void -dbus_set_active_codec_list(const gchar** list, const gchar *accountID) +void +dbus_set_active_codec_list (const gchar** list, const gchar *accountID) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list( - configurationManagerProxy, list, accountID, &error); + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list ( + configurationManagerProxy, list, accountID, &error); - if (error) - { - ERROR ("Failed to call set_active_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } + if (error) { + ERROR ("Failed to call set_active_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } /** * Get a list of output supported audio plugins */ - gchar** +gchar** dbus_get_audio_plugin_list() { - gchar** array; - GError* error = NULL; - - if (!org_sflphone_SFLphone_ConfigurationManager_get_audio_plugin_list( - configurationManagerProxy, &array, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_output_plugin_list) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_out_plugin_list: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - return array; - } -} - - void -dbus_set_input_audio_plugin(gchar* audioPlugin) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_input_audio_plugin( - configurationManagerProxy, audioPlugin, &error); - if (error) - { - ERROR("Failed to call set_input_audio_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); - } -} - - void -dbus_set_output_audio_plugin(gchar* audioPlugin) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_output_audio_plugin( - configurationManagerProxy, audioPlugin, &error); - if (error) - { - ERROR("Failed to call set_output_audio_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + gchar** array; + GError* error = NULL; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_audio_plugin_list ( + configurationManagerProxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_output_plugin_list) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_out_plugin_list: %s", error->message); + } + + g_error_free (error); + return NULL; + } else { + return array; + } +} + +void +dbus_set_input_audio_plugin (gchar* audioPlugin) +{ + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_input_audio_plugin ( + configurationManagerProxy, audioPlugin, &error); + + if (error) { + ERROR ("Failed to call set_input_audio_plugin() on ConfigurationManager: %s", error->message); + g_error_free (error); + } +} + +void +dbus_set_output_audio_plugin (gchar* audioPlugin) +{ + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_output_audio_plugin ( + configurationManagerProxy, audioPlugin, &error); + + if (error) { + ERROR ("Failed to call set_output_audio_plugin() on ConfigurationManager: %s", error->message); + g_error_free (error); + } } /** * Get all output devices index supported by current audio manager */ - gchar** +gchar** dbus_get_audio_output_device_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list( - configurationManagerProxy, &array, &error); - if (error) - { - ERROR("Failed to call get_audio_output_device_list() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return array; + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list ( + configurationManagerProxy, &array, &error); + + if (error) { + ERROR ("Failed to call get_audio_output_device_list() on ConfigurationManager: %s", error->message); + g_error_free (error); + } + + return array; } /** * Set audio output device from its index */ - void -dbus_set_audio_output_device(const int index) +void +dbus_set_audio_output_device (const int index) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device( - configurationManagerProxy, index, &error); - if (error) - { - ERROR("Failed to call set_audio_output_device() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device ( + configurationManagerProxy, index, &error); + + if (error) { + ERROR ("Failed to call set_audio_output_device() on ConfigurationManager: %s", error->message); + g_error_free (error); + } } /** * Set audio input device from its index */ - void -dbus_set_audio_input_device(const int index) +void +dbus_set_audio_input_device (const int index) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device( - configurationManagerProxy, index, &error); - if (error) - { - ERROR("Failed to call set_audio_input_device() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device ( + configurationManagerProxy, index, &error); + + if (error) { + ERROR ("Failed to call set_audio_input_device() on ConfigurationManager: %s", error->message); + g_error_free (error); + } } /** * Set adio ringtone device from its index */ - void -dbus_set_audio_ringtone_device(const int index) +void +dbus_set_audio_ringtone_device (const int index) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_ringtone_device( - configurationManagerProxy, index, &error); - if(error) - { - ERROR("Failed to call set_audio_ringtone_device() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_ringtone_device ( + configurationManagerProxy, index, &error); + + if (error) { + ERROR ("Failed to call set_audio_ringtone_device() on ConfigurationManager: %s", error->message); + g_error_free (error); + } } /** * Get all input devices index supported by current audio manager */ - gchar** +gchar** dbus_get_audio_input_device_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list( - configurationManagerProxy, &array, &error); - if (error) - { - ERROR("Failed to call get_audio_input_device_list() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return array; + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list ( + configurationManagerProxy, &array, &error); + + if (error) { + ERROR ("Failed to call get_audio_input_device_list() on ConfigurationManager: %s", error->message); + g_error_free (error); + } + + return array; } /** * Get output device index and input device index */ - gchar** +gchar** dbus_get_current_audio_devices_index() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index( - configurationManagerProxy, &array, &error); - if (error) - { - ERROR("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return array; + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index ( + configurationManagerProxy, &array, &error); + + if (error) { + ERROR ("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s", error->message); + g_error_free (error); + } + + return array; } /** * Get index */ - int -dbus_get_audio_device_index(const gchar *name) +int +dbus_get_audio_device_index (const gchar *name) { - int index; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index( - configurationManagerProxy, name, &index, &error); - if (error) - { - ERROR("Failed to call get_audio_device_index() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return index; + int index; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index ( + configurationManagerProxy, name, &index, &error); + + if (error) { + ERROR ("Failed to call get_audio_device_index() on ConfigurationManager: %s", error->message); + g_error_free (error); + } + + return index; } /** * Get audio plugin */ - gchar* +gchar* dbus_get_current_audio_output_plugin() { - gchar* plugin = ""; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin( - configurationManagerProxy, &plugin, &error); - if (error) - { - ERROR("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return plugin; + gchar* plugin = ""; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin ( + configurationManagerProxy, &plugin, &error); + + if (error) { + ERROR ("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); + g_error_free (error); + } + + return plugin; } /** - * Get echo canceller state + * Get echo canceller state */ - gchar* +gchar* dbus_get_echo_cancel_state() { - gchar* state = ""; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_state(configurationManagerProxy, &state, &error); - if(error) { - ERROR("DBus: Failed to call get_echo_cancel_state() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return state; + gchar* state = ""; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_state (configurationManagerProxy, &state, &error); + + if (error) { + ERROR ("DBus: Failed to call get_echo_cancel_state() on ConfigurationManager: %s", error->message); + g_error_free (error); + } + + return state; } /** * Set echo canceller state */ - void -dbus_set_echo_cancel_state(gchar* state) +void +dbus_set_echo_cancel_state (gchar* state) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_state( - configurationManagerProxy, state, &error); - if (error) - { - ERROR("Failed to call set_echo_cancel_state() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_state ( + configurationManagerProxy, state, &error); + + if (error) { + ERROR ("Failed to call set_echo_cancel_state() on ConfigurationManager: %s", error->message); + g_error_free (error); + } } /** * Get noise reduction state */ - gchar* +gchar* dbus_get_noise_suppress_state() { - gchar* state = ""; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_noise_suppress_state(configurationManagerProxy, &state, &error); - if(error) { - ERROR("DBus: Failed to call get_noise_suppress_state() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return state; + gchar* state = ""; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_noise_suppress_state (configurationManagerProxy, &state, &error); + + if (error) { + ERROR ("DBus: Failed to call get_noise_suppress_state() on ConfigurationManager: %s", error->message); + g_error_free (error); + } + + return state; } /** * Set echo canceller state */ - void -dbus_set_noise_suppress_state(gchar* state) +void +dbus_set_noise_suppress_state (gchar* state) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_noise_suppress_state( - configurationManagerProxy, state, &error); - if (error) - { - ERROR("Failed to call set_noise_suppress_state() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_noise_suppress_state ( + configurationManagerProxy, state, &error); + + if (error) { + ERROR ("Failed to call set_noise_suppress_state() on ConfigurationManager: %s", error->message); + g_error_free (error); + } } - gchar* +gchar* dbus_get_ringtone_choice() { - gchar* tone; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_ringtone_choice( - configurationManagerProxy, &tone, &error); - if (error) - { - g_error_free(error); - } - return tone; + gchar* tone; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_ringtone_choice ( + configurationManagerProxy, &tone, &error); + + if (error) { + g_error_free (error); + } + + return tone; } - void -dbus_set_ringtone_choice(const gchar* tone) +void +dbus_set_ringtone_choice (const gchar* tone) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_ringtone_choice( - configurationManagerProxy, tone, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_ringtone_choice ( + configurationManagerProxy, tone, &error); + + if (error) { + g_error_free (error); + } } - int +int dbus_is_ringtone_enabled() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_ringtone_enabled( - configurationManagerProxy, &res, &error); - if (error) - { - g_error_free(error); - } - return res; + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_ringtone_enabled ( + configurationManagerProxy, &res, &error); + + if (error) { + g_error_free (error); + } + + return res; } - void +void dbus_ringtone_enabled() { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_ringtone_enabled( - configurationManagerProxy, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_ringtone_enabled ( + configurationManagerProxy, &error); + + if (error) { + g_error_free (error); + } } - gboolean +gboolean dbus_is_md5_credential_hashing() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_md5_credential_hashing( - configurationManagerProxy, &res, &error); - if (error) - { - g_error_free(error); - } - return res; + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_md5_credential_hashing ( + configurationManagerProxy, &res, &error); + + if (error) { + g_error_free (error); + } + + return res; } - void -dbus_set_md5_credential_hashing(gboolean enabled) +void +dbus_set_md5_credential_hashing (gboolean enabled) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_md5_credential_hashing( - configurationManagerProxy, enabled, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_md5_credential_hashing ( + configurationManagerProxy, enabled, &error); + + if (error) { + g_error_free (error); + } } - int +int dbus_is_iax2_enabled() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled( - configurationManagerProxy, &res, &error); - if (error) - { - g_error_free(error); - } - return res; + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled ( + configurationManagerProxy, &res, &error); + + if (error) { + g_error_free (error); + } + + return res; } - int +int dbus_get_dialpad() { - int state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_dialpad( - configurationManagerProxy, &state, &error); - if (error) - { - g_error_free(error); - } - return state; + int state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_dialpad ( + configurationManagerProxy, &state, &error); + + if (error) { + g_error_free (error); + } + + return state; } - void -dbus_set_dialpad(gboolean display) +void +dbus_set_dialpad (gboolean display) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_dialpad( - configurationManagerProxy, display, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_dialpad ( + configurationManagerProxy, display, &error); + + if (error) { + g_error_free (error); + } } - int +int dbus_get_searchbar() { - int state; - GError* error = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_searchbar( - configurationManagerProxy, &state, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_searchbar) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_searchbar: %s", error->message); - } - g_error_free(error); - return -1; - } - else - { - return state; - } -} - - void + int state; + GError* error = NULL; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_searchbar ( + configurationManagerProxy, &state, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_searchbar) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_searchbar: %s", error->message); + } + + g_error_free (error); + return -1; + } else { + return state; + } +} + +void dbus_set_searchbar() { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_searchbar( - configurationManagerProxy, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_searchbar ( + configurationManagerProxy, &error); + + if (error) { + g_error_free (error); + } } - void -dbus_join_participant(const gchar* sel_callID, const gchar* drag_callID) +void +dbus_join_participant (const gchar* sel_callID, const gchar* drag_callID) { - DEBUG("dbus_join_participant %s and %s\n", sel_callID, drag_callID); + DEBUG ("dbus_join_participant %s and %s\n", sel_callID, drag_callID); - GError* error = NULL; + GError* error = NULL; - org_sflphone_SFLphone_CallManager_join_participant(callManagerProxy, - sel_callID, drag_callID, &error); - if (error) - { - g_error_free(error); - } + org_sflphone_SFLphone_CallManager_join_participant (callManagerProxy, + sel_callID, drag_callID, &error); + + if (error) { + g_error_free (error); + } } - void -dbus_add_participant(const gchar* callID, const gchar* confID) +void +dbus_add_participant (const gchar* callID, const gchar* confID) { - DEBUG("dbus_add_participant %s and %s\n", callID, confID); + DEBUG ("dbus_add_participant %s and %s\n", callID, confID); + + GError* error = NULL; - GError* error = NULL; + org_sflphone_SFLphone_CallManager_add_participant (callManagerProxy, callID, + confID, &error); - org_sflphone_SFLphone_CallManager_add_participant(callManagerProxy, callID, - confID, &error); - if (error) - { - g_error_free(error); - } + if (error) { + g_error_free (error); + } } - void -dbus_add_main_participant(const gchar* confID) +void +dbus_add_main_participant (const gchar* confID) { - DEBUG("dbus_add_participant %s\n", confID); + DEBUG ("dbus_add_participant %s\n", confID); + + GError* error = NULL; - GError* error = NULL; + org_sflphone_SFLphone_CallManager_add_main_participant (callManagerProxy, + confID, &error); - org_sflphone_SFLphone_CallManager_add_main_participant(callManagerProxy, - confID, &error); - if (error) - { - g_error_free(error); - } + if (error) { + g_error_free (error); + } } - void -dbus_detach_participant(const gchar* callID) +void +dbus_detach_participant (const gchar* callID) { - DEBUG("dbus_detach_participant %s\n", callID); + DEBUG ("dbus_detach_participant %s\n", callID); - GError* error = NULL; - org_sflphone_SFLphone_CallManager_detach_participant(callManagerProxy, - callID, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_CallManager_detach_participant (callManagerProxy, + callID, &error); + + if (error) { + g_error_free (error); + } } -dbus_join_conference(const gchar* sel_confID, const gchar* drag_confID) +dbus_join_conference (const gchar* sel_confID, const gchar* drag_confID) { - DEBUG("dbus_join_conference %s and %s\n", sel_confID, drag_confID); + DEBUG ("dbus_join_conference %s and %s\n", sel_confID, drag_confID); + + GError* error = NULL; - GError* error = NULL; + org_sflphone_SFLphone_CallManager_join_conference (callManagerProxy, + sel_confID, drag_confID, &error); - org_sflphone_SFLphone_CallManager_join_conference(callManagerProxy, - sel_confID, drag_confID, &error); - if (error) - { - g_error_free(error); - } + if (error) { + g_error_free (error); + } } - void -dbus_set_record(const gchar* id) +void +dbus_set_record (const gchar* id) { - DEBUG("dbus_set_record %s\n", id); + DEBUG ("dbus_set_record %s\n", id); + + GError* error = NULL; + org_sflphone_SFLphone_CallManager_set_recording (callManagerProxy, id, &error); - GError* error = NULL; - org_sflphone_SFLphone_CallManager_set_recording(callManagerProxy, id, &error); - if (error) - { - g_error_free(error); - } + if (error) { + g_error_free (error); + } } - gboolean -dbus_get_is_recording(const callable_obj_t * c) +gboolean +dbus_get_is_recording (const callable_obj_t * c) { - DEBUG("dbus_get_is_recording %s\n", c->_callID); - GError* error = NULL; - gboolean isRecording; - org_sflphone_SFLphone_CallManager_get_is_recording(callManagerProxy, - c->_callID, &isRecording, &error); - if (error) - { - g_error_free(error); - } - //DEBUG("RECORDING: %i",isRecording); - return isRecording; + DEBUG ("dbus_get_is_recording %s\n", c->_callID); + GError* error = NULL; + gboolean isRecording; + org_sflphone_SFLphone_CallManager_get_is_recording (callManagerProxy, + c->_callID, &isRecording, &error); + + if (error) { + g_error_free (error); + } + + //DEBUG("RECORDING: %i",isRecording); + return isRecording; } - void -dbus_set_record_path(const gchar* path) +void +dbus_set_record_path (const gchar* path) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_record_path( - configurationManagerProxy, path, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_record_path ( + configurationManagerProxy, path, &error); + + if (error) { + g_error_free (error); + } } - gchar* -dbus_get_record_path(void) +gchar* +dbus_get_record_path (void) { - GError* error = NULL; - gchar *path; - org_sflphone_SFLphone_ConfigurationManager_get_record_path( - configurationManagerProxy, &path, &error); - if (error) - { - g_error_free(error); - } - return path; + GError* error = NULL; + gchar *path; + org_sflphone_SFLphone_ConfigurationManager_get_record_path ( + configurationManagerProxy, &path, &error); + + if (error) { + g_error_free (error); + } + + return path; } - void -dbus_set_history_limit(const guint days) +void +dbus_set_history_limit (const guint days) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_history_limit( - configurationManagerProxy, days, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_history_limit ( + configurationManagerProxy, days, &error); + + if (error) { + g_error_free (error); + } } - guint -dbus_get_history_limit(void) +guint +dbus_get_history_limit (void) { - GError* error = NULL; - gint days = 30; - org_sflphone_SFLphone_ConfigurationManager_get_history_limit( - configurationManagerProxy, &days, &error); - if (error) - { - g_error_free(error); - } - return (guint) days; + GError* error = NULL; + gint days = 30; + org_sflphone_SFLphone_ConfigurationManager_get_history_limit ( + configurationManagerProxy, &days, &error); + + if (error) { + g_error_free (error); + } + + return (guint) days; } - void -dbus_set_audio_manager(int api) +void +dbus_set_audio_manager (int api) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_manager( - configurationManagerProxy, api, &error); - if (error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_manager ( + configurationManagerProxy, api, &error); + + if (error) { + g_error_free (error); + } } - int -dbus_get_audio_manager(void) +int +dbus_get_audio_manager (void) { - int api; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_manager( - configurationManagerProxy, &api, &error); - if (error) - { - ERROR("Error calling dbus_get_audio_manager"); - g_error_free(error); - } - - return api; + int api; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_manager ( + configurationManagerProxy, &api, &error); + + if (error) { + ERROR ("Error calling dbus_get_audio_manager"); + g_error_free (error); + } + + return api; } /* @@ -1965,602 +1909,584 @@ dbus_get_audio_manager(void) } */ - GHashTable* -dbus_get_addressbook_settings(void) +GHashTable* +dbus_get_addressbook_settings (void) { - GError *error = NULL; - GHashTable *results = NULL; + GError *error = NULL; + GHashTable *results = NULL; + + //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); - //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings ( + configurationManagerProxy, &results, &error); - org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings( - configurationManagerProxy, &results, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + g_error_free (error); + } - return results; + return results; } - void -dbus_set_addressbook_settings(GHashTable * settings) +void +dbus_set_addressbook_settings (GHashTable * settings) { - GError *error = NULL; + GError *error = NULL; + + DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); - DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings ( + configurationManagerProxy, settings, &error); - org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings( - configurationManagerProxy, settings, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); + g_error_free (error); + } } - gchar** -dbus_get_addressbook_list(void) +gchar** +dbus_get_addressbook_list (void) { - GError *error = NULL; - gchar** array; + GError *error = NULL; + gchar** array; - org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list( - configurationManagerProxy, &array, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list"); - g_error_free(error); - } + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list ( + configurationManagerProxy, &array, &error); - return array; + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list"); + g_error_free (error); + } + + return array; } - void -dbus_set_addressbook_list(const gchar** list) +void +dbus_set_addressbook_list (const gchar** list) { - GError *error = NULL; + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list ( + configurationManagerProxy, list, &error); - org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list( - configurationManagerProxy, list, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list"); + g_error_free (error); + } } - GHashTable* -dbus_get_hook_settings(void) +GHashTable* +dbus_get_hook_settings (void) { - GError *error = NULL; - GHashTable *results = NULL; + GError *error = NULL; + GHashTable *results = NULL; - //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); - org_sflphone_SFLphone_ConfigurationManager_get_hook_settings( - configurationManagerProxy, &results, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_hook_settings"); - g_error_free(error); - } + org_sflphone_SFLphone_ConfigurationManager_get_hook_settings ( + configurationManagerProxy, &results, &error); - return results; + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_hook_settings"); + g_error_free (error); + } + + return results; } - void -dbus_set_hook_settings(GHashTable * settings) +void +dbus_set_hook_settings (GHashTable * settings) { - GError *error = NULL; + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_hook_settings ( + configurationManagerProxy, settings, &error); - org_sflphone_SFLphone_ConfigurationManager_set_hook_settings( - configurationManagerProxy, settings, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_hook_settings"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_hook_settings"); + g_error_free (error); + } } - GHashTable* -dbus_get_call_details(const gchar *callID) +GHashTable* +dbus_get_call_details (const gchar *callID) { - GError *error = NULL; - GHashTable *details = NULL; + GError *error = NULL; + GHashTable *details = NULL; - org_sflphone_SFLphone_CallManager_get_call_details(callManagerProxy, callID, - &details, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_details"); - g_error_free(error); - } + org_sflphone_SFLphone_CallManager_get_call_details (callManagerProxy, callID, + &details, &error); - return details; + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_details"); + g_error_free (error); + } + + return details; } - gchar** -dbus_get_call_list(void) +gchar** +dbus_get_call_list (void) { - GError *error = NULL; - gchar **list = NULL; + GError *error = NULL; + gchar **list = NULL; + + org_sflphone_SFLphone_CallManager_get_call_list (callManagerProxy, &list, + &error); - org_sflphone_SFLphone_CallManager_get_call_list(callManagerProxy, &list, - &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_list"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_list"); + g_error_free (error); + } - return list; + return list; } - gchar** -dbus_get_conference_list(void) +gchar** +dbus_get_conference_list (void) { - GError *error = NULL; - gchar **list = NULL; + GError *error = NULL; + gchar **list = NULL; + + org_sflphone_SFLphone_CallManager_get_conference_list (callManagerProxy, + &list, &error); - org_sflphone_SFLphone_CallManager_get_conference_list(callManagerProxy, - &list, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_list"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_list"); + g_error_free (error); + } - return list; + return list; } - gchar** -dbus_get_participant_list(const char *confID) +gchar** +dbus_get_participant_list (const char *confID) { - GError *error = NULL; - gchar **list = NULL; + GError *error = NULL; + gchar **list = NULL; - DEBUG("DBUS: Get conference %s participant list", confID); + DEBUG ("DBUS: Get conference %s participant list", confID); - org_sflphone_SFLphone_CallManager_get_participant_list(callManagerProxy, - confID, &list, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_participant_list"); - g_error_free(error); - } + org_sflphone_SFLphone_CallManager_get_participant_list (callManagerProxy, + confID, &list, &error); - return list; + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_participant_list"); + g_error_free (error); + } + + return list; } - GHashTable* -dbus_get_conference_details(const gchar *confID) +GHashTable* +dbus_get_conference_details (const gchar *confID) { - GError *error = NULL; - GHashTable *details = NULL; + GError *error = NULL; + GHashTable *details = NULL; + + org_sflphone_SFLphone_CallManager_get_conference_details (callManagerProxy, + confID, &details, &error); - org_sflphone_SFLphone_CallManager_get_conference_details(callManagerProxy, - confID, &details, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_details"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_details"); + g_error_free (error); + } - return details; + return details; } - void -dbus_set_accounts_order(const gchar* order) +void +dbus_set_accounts_order (const gchar* order) { - GError *error = NULL; + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_accounts_order ( + configurationManagerProxy, order, &error); - org_sflphone_SFLphone_ConfigurationManager_set_accounts_order( - configurationManagerProxy, order, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_accounts_order"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_accounts_order"); + g_error_free (error); + } } - GHashTable* -dbus_get_history(void) +GHashTable* +dbus_get_history (void) { - GError *error = NULL; - GHashTable *entries = NULL; + GError *error = NULL; + GHashTable *entries = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_history( - configurationManagerProxy, &entries, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_history"); - g_error_free(error); - } + org_sflphone_SFLphone_ConfigurationManager_get_history ( + configurationManagerProxy, &entries, &error); - return entries; + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_history"); + g_error_free (error); + } + + return entries; } - void -dbus_set_history(GHashTable* entries) +void +dbus_set_history (GHashTable* entries) { - GError *error = NULL; + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_history ( + configurationManagerProxy, entries, &error); - org_sflphone_SFLphone_ConfigurationManager_set_history( - configurationManagerProxy, entries, &error); - if (error) - { - ERROR ("Error calling org_sflphone_SFLphone_CallManager_set_history"); - g_error_free(error); - } + if (error) { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_set_history"); + g_error_free (error); + } } - void -dbus_confirm_sas(const callable_obj_t * c) +void +dbus_confirm_sas (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_sa_sverified(callManagerProxy, - c->_callID, &error); - if (error) - { - ERROR ("Failed to call setSASVerified() on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_set_sa_sverified (callManagerProxy, + c->_callID, &error); + + if (error) { + ERROR ("Failed to call setSASVerified() on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_reset_sas(const callable_obj_t * c) +void +dbus_reset_sas (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_reset_sa_sverified(callManagerProxy, - c->_callID, &error); - if (error) - { - ERROR ("Failed to call resetSASVerified on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_reset_sa_sverified (callManagerProxy, + c->_callID, &error); + + if (error) { + ERROR ("Failed to call resetSASVerified on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_set_confirm_go_clear(const callable_obj_t * c) +void +dbus_set_confirm_go_clear (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_confirm_go_clear(callManagerProxy, - c->_callID, &error); - if (error) - { - ERROR ("Failed to call set_confirm_go_clear on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_set_confirm_go_clear (callManagerProxy, + c->_callID, &error); + + if (error) { + ERROR ("Failed to call set_confirm_go_clear on CallManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_request_go_clear(const callable_obj_t * c) +void +dbus_request_go_clear (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_request_go_clear(callManagerProxy, - c->_callID, &error); - if (error) - { - ERROR ("Failed to call request_go_clear on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_request_go_clear (callManagerProxy, + c->_callID, &error); + + if (error) { + ERROR ("Failed to call request_go_clear on CallManager: %s", + error->message); + g_error_free (error); + } } - gchar** +gchar** dbus_get_supported_tls_method() { - GError *error = NULL; - gchar** array = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_supported_tls_method( - configurationManagerProxy, &array, &error); - - if (error != NULL) - { - ERROR ("Failed to call get_supported_tls_method() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return array; -} - - GHashTable* -dbus_get_tls_settings_default(void) -{ - GError *error = NULL; - GHashTable *results = NULL; - - org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default( - configurationManagerProxy, &results, &error); - if (error != NULL) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default"); - g_error_free(error); - } - - return results; -} - - gchar * -dbus_get_address_from_interface_name(gchar* interface) + GError *error = NULL; + gchar** array = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_supported_tls_method ( + configurationManagerProxy, &array, &error); + + if (error != NULL) { + ERROR ("Failed to call get_supported_tls_method() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } + + return array; +} + +GHashTable* +dbus_get_tls_settings_default (void) +{ + GError *error = NULL; + GHashTable *results = NULL; + + org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default ( + configurationManagerProxy, &results, &error); + + if (error != NULL) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default"); + g_error_free (error); + } + + return results; +} + +gchar * +dbus_get_address_from_interface_name (gchar* interface) { - GError *error = NULL; - gchar * address; - - org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name( - configurationManagerProxy, interface, &address, &error); - if (error != NULL) - { - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name\n"); - g_error_free(error); - } - - return address; + GError *error = NULL; + gchar * address; + + org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name ( + configurationManagerProxy, interface, &address, &error); + + if (error != NULL) { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name\n"); + g_error_free (error); + } + + return address; } - gchar ** -dbus_get_all_ip_interface(void) +gchar ** +dbus_get_all_ip_interface (void) { - GError *error = NULL; - gchar ** array; + GError *error = NULL; + gchar ** array; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface ( + configurationManagerProxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_all_ip_interface: %s", error->message); + } - if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface( - configurationManagerProxy, &array, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_all_ip_interface: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); - return array; - } + g_error_free (error); + return NULL; + } else { + DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); + return array; + } } - gchar ** -dbus_get_all_ip_interface_by_name(void) +gchar ** +dbus_get_all_ip_interface_by_name (void) { - GError *error = NULL; - gchar ** array; + GError *error = NULL; + gchar ** array; - if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface_by_name( - configurationManagerProxy, &array, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_all_ip_interface: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); - return array; - } + if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface_by_name ( + configurationManagerProxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_all_ip_interface: %s", error->message); + } + + g_error_free (error); + return NULL; + } else { + DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); + return array; + } } - guint -dbus_get_window_width(void) +guint +dbus_get_window_width (void) { - GError *error = NULL; - guint value; + GError *error = NULL; + guint value; + + org_sflphone_SFLphone_ConfigurationManager_get_window_width ( + configurationManagerProxy, &value, &error); - org_sflphone_SFLphone_ConfigurationManager_get_window_width( - configurationManagerProxy, &value, &error); + if (error != NULL) { + ERROR ("Failed to call get_window_width() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } - if (error != NULL) - { - ERROR ("Failed to call get_window_width() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return value; + return value; } - guint -dbus_get_window_height(void) +guint +dbus_get_window_height (void) { - GError *error = NULL; - guint value; + GError *error = NULL; + guint value; + + org_sflphone_SFLphone_ConfigurationManager_get_window_height ( + configurationManagerProxy, &value, &error); - org_sflphone_SFLphone_ConfigurationManager_get_window_height( - configurationManagerProxy, &value, &error); + if (error != NULL) { + ERROR ("Failed to call get_window_height() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } - if (error != NULL) - { - ERROR ("Failed to call get_window_height() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return value; + return value; } - void -dbus_set_window_width(const guint width) +void +dbus_set_window_width (const guint width) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_window_width( - configurationManagerProxy, width, &error); + org_sflphone_SFLphone_ConfigurationManager_set_window_width ( + configurationManagerProxy, width, &error); - if (error != NULL) - { - ERROR ("Failed to call set_window_width() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } + if (error != NULL) { + ERROR ("Failed to call set_window_width() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_set_window_height(const guint height) +void +dbus_set_window_height (const guint height) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_window_height( - configurationManagerProxy, height, &error); + org_sflphone_SFLphone_ConfigurationManager_set_window_height ( + configurationManagerProxy, height, &error); - if (error != NULL) - { - ERROR ("Failed to call set_window_height() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } + if (error != NULL) { + ERROR ("Failed to call set_window_height() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } - guint -dbus_get_window_position_x(void) +guint +dbus_get_window_position_x (void) { - GError *error = NULL; - guint value; + GError *error = NULL; + guint value; - org_sflphone_SFLphone_ConfigurationManager_get_window_position_x( - configurationManagerProxy, &value, &error); + org_sflphone_SFLphone_ConfigurationManager_get_window_position_x ( + configurationManagerProxy, &value, &error); - if (error != NULL) - { - ERROR ("Failed to call get_window_position_x() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return value; + if (error != NULL) { + ERROR ("Failed to call get_window_position_x() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } + + return value; } - guint -dbus_get_window_position_y(void) +guint +dbus_get_window_position_y (void) { - GError *error = NULL; - guint value; + GError *error = NULL; + guint value; + + org_sflphone_SFLphone_ConfigurationManager_get_window_position_y ( + configurationManagerProxy, &value, &error); - org_sflphone_SFLphone_ConfigurationManager_get_window_position_y( - configurationManagerProxy, &value, &error); + if (error != NULL) { + ERROR ("Failed to call get_window_position_y() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } - if (error != NULL) - { - ERROR ("Failed to call get_window_position_y() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } - return value; + return value; } - void -dbus_set_window_position_x(const guint posx) +void +dbus_set_window_position_x (const guint posx) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_window_position_x( - configurationManagerProxy, posx, &error); + org_sflphone_SFLphone_ConfigurationManager_set_window_position_x ( + configurationManagerProxy, posx, &error); - if (error != NULL) - { - ERROR ("Failed to call set_window_position_x() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } + if (error != NULL) { + ERROR ("Failed to call set_window_position_x() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } - void -dbus_set_window_position_y(const guint posy) +void +dbus_set_window_position_y (const guint posy) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_window_position_y( - configurationManagerProxy, posy, &error); + org_sflphone_SFLphone_ConfigurationManager_set_window_position_y ( + configurationManagerProxy, posy, &error); - if (error != NULL) - { - ERROR ("Failed to call set_window_position_y() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } + if (error != NULL) { + ERROR ("Failed to call set_window_position_y() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } - GHashTable* -dbus_get_shortcuts(void) +GHashTable* +dbus_get_shortcuts (void) { - GError *error = NULL; - GHashTable * shortcuts; - if (!org_sflphone_SFLphone_ConfigurationManager_get_shortcuts( - configurationManagerProxy, &shortcuts, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_shortcuts) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_shortcuts: %s", error->message); - } - g_error_free(error); - return NULL; - } - else - { - return shortcuts; - } + GError *error = NULL; + GHashTable * shortcuts; + + if (!org_sflphone_SFLphone_ConfigurationManager_get_shortcuts ( + configurationManagerProxy, &shortcuts, &error)) { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { + ERROR ("Caught remote method (get_shortcuts) exception %s: %s", dbus_g_error_get_name (error), error->message); + } else { + ERROR ("Error while calling get_shortcuts: %s", error->message); + } + + g_error_free (error); + return NULL; + } else { + return shortcuts; + } } - void -dbus_set_shortcuts(GHashTable * shortcuts) +void +dbus_set_shortcuts (GHashTable * shortcuts) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_shortcuts( - configurationManagerProxy, shortcuts, &error); - if (error) - { - ERROR ("Failed to call set_shortcuts() on ConfigurationManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_shortcuts ( + configurationManagerProxy, shortcuts, &error); + + if (error) { + ERROR ("Failed to call set_shortcuts() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } - void +void dbus_send_text_message (const gchar* callID, const gchar *message) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_send_text_message( - callManagerProxy, callID, message, &error); - if (error) - { - ERROR ("Failed to call send_text_message() on CallManager: %s", - error->message); - g_error_free(error); - } + GError *error = NULL; + org_sflphone_SFLphone_CallManager_send_text_message ( + callManagerProxy, callID, message, &error); + + if (error) { + ERROR ("Failed to call send_text_message() on CallManager: %s", + error->message); + g_error_free (error); + } } diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index 87b0871d4870a48b7d835a36316faa48c04e3997..f9c6516009751c02f29d6ae364938aa88398dc49 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -60,19 +60,19 @@ void dbus_clean (); * CallManager - Hold a call * @param c The call to hold */ -void dbus_hold (const callable_obj_t * c ); +void dbus_hold (const callable_obj_t * c); /** * CallManager - Unhold a call * @param c The call to unhold */ -void dbus_unhold (const callable_obj_t * c ); +void dbus_unhold (const callable_obj_t * c); /** * CallManager - Hang up a call * @param c The call to hang up */ -void dbus_hang_up (const callable_obj_t * c ); +void dbus_hang_up (const callable_obj_t * c); /** * CallManager - Transfer a call @@ -110,50 +110,50 @@ gchar ** dbus_account_list(); * @param accountID The unique of the account * @return GHashTable* The details of the account */ -GHashTable * dbus_account_details(gchar * accountID); +GHashTable * dbus_account_details (gchar * accountID); /** * ConfigurationManager - Set the details of a specific account * @param a The account to update */ -void dbus_set_account_details(account_t *a); +void dbus_set_account_details (account_t *a); /** - * ConfigurationManager - Set the additional credential information + * ConfigurationManager - Set the additional credential information * of a specific account, for a specific credential index. * This function will add the new section on the server side * if it cannot be found. * @param a The account to update * @param index The index for the credential to update */ -void dbus_set_credential(account_t *a, int index); +void dbus_set_credential (account_t *a, int index); /** - * ConfigurationManager - Set the additional credential information + * ConfigurationManager - Set the additional credential information * of a specific account, for a specific credential index. * This function will add the new section on the server side * if it cannot be found. * @param a The account to update * @return int The number of credentials specified */ -int dbus_get_number_of_credential(gchar * accountID); +int dbus_get_number_of_credential (gchar * accountID); /** * ConfigurationManager - Delete all credentials defined for * a given account. * @param a The account id */ -void dbus_delete_all_credential(account_t *a); +void dbus_delete_all_credential (account_t *a); /** * ConfigurationManager - Set the number of credential that * is being used. * @param a The account id */ -void dbus_set_number_of_credential(account_t *a, int number); +void dbus_set_number_of_credential (account_t *a, int number); /** - * ConfigurationManager - Set the additional credential information + * ConfigurationManager - Set the additional credential information * of a specific account, for a specific credential index. * This function will add the new section on the server side * if it cannot be found. @@ -161,17 +161,17 @@ void dbus_set_number_of_credential(account_t *a, int number); * @param index The credential index * @return GHashTable* The credential at index "index" for the given account */ -GHashTable* dbus_get_credential(gchar * accountID, int index); +GHashTable* dbus_get_credential (gchar * accountID, int index); /** - * ConfigurationManager - Get the details for the ip2ip profile + * ConfigurationManager - Get the details for the ip2ip profile */ -GHashTable * dbus_get_ip2_ip_details(void); +GHashTable * dbus_get_ip2_ip_details (void); /** - * ConfigurationManager - Set the details for the ip2ip profile + * ConfigurationManager - Set the details for the ip2ip profile */ -void dbus_set_ip2ip_details(GHashTable * properties); +void dbus_set_ip2ip_details (GHashTable * properties); /** * ConfigurationManager - Send registration request @@ -180,38 +180,38 @@ void dbus_set_ip2ip_details(GHashTable * properties); * 0 for unregistration request * 1 for registration request */ -void dbus_send_register( gchar* accountID , const guint enable ); +void dbus_send_register (gchar* accountID , const guint enable); /** * ConfigurationManager - Add an account to the list * @param a The account to add */ -gchar* dbus_add_account(account_t *a); +gchar* dbus_add_account (account_t *a); /** * ConfigurationManager - Remove an account from the list * @param accountID The account to remove */ -void dbus_remove_account(gchar * accountID); +void dbus_remove_account (gchar * accountID); /** * ConfigurationManager - Set volume for speaker/mic * @param device The speaker or the mic * @param value The new value */ -void dbus_set_volume(const gchar * device, gdouble value); +void dbus_set_volume (const gchar * device, gdouble value); /** * ConfigurationManager - Get the volume of a device * @param device The speaker or the mic */ -gdouble dbus_get_volume(const gchar * device); +gdouble dbus_get_volume (const gchar * device); /** * ConfigurationManager - Play DTMF * @param key The DTMF to send */ -void dbus_play_dtmf(const gchar * key); +void dbus_play_dtmf (const gchar * key); /** * ConfigurationManager - Get the codecs list @@ -224,7 +224,7 @@ gchar** dbus_codec_list(); * @param payload The payload of the codec * @return gchar** The codec details */ -gchar** dbus_codec_details(int payload); +gchar** dbus_codec_details (int payload); /** * ConfigurationManager - Get the default codec list @@ -249,7 +249,7 @@ void dbus_set_active_codec_list (const gchar** list, const gchar*); * CallManager - return the codec name * @param callable_obj_t* current call */ -gchar* dbus_get_current_codec_name(const callable_obj_t * c); +gchar* dbus_get_current_codec_name (const callable_obj_t * c); /** * ConfigurationManager - Get the list of available output audio plugins @@ -261,13 +261,13 @@ gchar** dbus_get_audio_plugin_list(); * ConfigurationManager - Select an input audio plugin * @param audioPlugin The string description of the plugin */ -void dbus_set_input_audio_plugin(gchar* audioPlugin); +void dbus_set_input_audio_plugin (gchar* audioPlugin); /** * ConfigurationManager - Select an output audio plugin * @param audioPlugin The string description of the plugin */ -void dbus_set_output_audio_plugin(gchar* audioPlugin); +void dbus_set_output_audio_plugin (gchar* audioPlugin); /** * ConfigurationManager - Get the list of available output audio devices @@ -279,7 +279,7 @@ gchar** dbus_get_audio_output_device_list(); * ConfigurationManager - Select an output audio device * @param index The index of the soundcard */ -void dbus_set_audio_output_device(const int index); +void dbus_set_audio_output_device (const int index); /** * ConfigurationManager - Get the list of available input audio devices @@ -291,7 +291,7 @@ gchar** dbus_get_audio_input_device_list(); * ConfigurationManager - Select an input audio device * @param index The index of the soundcard */ -void dbus_set_audio_input_device(const int index); +void dbus_set_audio_input_device (const int index); /** * ConfigurationManager - Get the current audio devices @@ -304,7 +304,7 @@ gchar** dbus_get_current_audio_devices_index(); * @param name The string description of the audio device * @return int The index of the device */ -int dbus_get_audio_device_index(const gchar* name); +int dbus_get_audio_device_index (const gchar* name); /** * ConfigurationManager - Get the current output audio plugin @@ -320,29 +320,29 @@ gchar* dbus_get_current_audio_output_plugin(); * ConfigurationManager - Get the current state of echo canceller * @return gchar* The state (enabled/disabled) */ -gchar *dbus_get_echo_cancel_state(void); +gchar *dbus_get_echo_cancel_state (void); /** * ConfigurationManager - Set the crrent state of echo canceller * @param gchar* The state (enabled/disabled) */ -void dbus_set_echo_cancel_state(gchar *state); +void dbus_set_echo_cancel_state (gchar *state); /** * ConfigurationManager - Get the current noise suppressor state * @return gchar* The state (enabled/disabled) */ -gchar *dbus_get_noise_suppress_state(void); +gchar *dbus_get_noise_suppress_state (void); /** * ConfigurationManager - Set the current noise suppressor state * @param gchar* The state (enabled/disabled) */ -void dbus_set_noise_suppress_state(gchar *state); +void dbus_set_noise_suppress_state (gchar *state); /** - * ConfigurationManager - Query to server to + * ConfigurationManager - Query to server to * know if MD5 credential hashing is enabled. * @return True if enabled, false otherwise * @@ -353,16 +353,16 @@ gboolean dbus_is_md5_credential_hashing(); * ConfigurationManager - Set whether or not * the server should store credential as * a md5 hash. - * @param enabled + * @param enabled */ -void dbus_set_md5_credential_hashing(gboolean enabled); +void dbus_set_md5_credential_hashing (gboolean enabled); /** * ConfigurationManager - Tells the GUI if IAX2 support is enabled * @return int 1 if IAX2 is enabled * 0 otherwise */ -int dbus_is_iax2_enabled( void ); +int dbus_is_iax2_enabled (void); /** * ConfigurationManager - Query the server about the ringtone option. @@ -370,25 +370,25 @@ int dbus_is_iax2_enabled( void ); * @return int 1 if enabled * 0 otherwise */ -int dbus_is_ringtone_enabled( void ); +int dbus_is_ringtone_enabled (void); /** * ConfigurationManager - Set the ringtone option * Inverse current value */ -void dbus_ringtone_enabled( void ); +void dbus_ringtone_enabled (void); /** * ConfigurationManager - Get the ringtone * @return gchar* The file name selected as a ringtone */ -gchar* dbus_get_ringtone_choice( void ); +gchar* dbus_get_ringtone_choice (void); /** * ConfigurationManager - Set a ringtone * @param tone The file name of the ringtone */ -void dbus_set_ringtone_choice( const gchar* tone ); +void dbus_set_ringtone_choice (const gchar* tone); /** * ConfigurationManager - Set the dialpad visible or not @@ -400,25 +400,25 @@ void dbus_set_dialpad (gboolean display); * @return int 1 if dialpad has to be displayed * 0 otherwise */ -int dbus_get_dialpad( void ); +int dbus_get_dialpad (void); /** * ConfigurationManager - Set the searchbar visible or not */ -void dbus_set_searchbar( ); +void dbus_set_searchbar(); /** * ConfigurationManager - Tells if the user wants to display the search bar or not * @return int 1 if the search bar has to be displayed * 0 otherwise */ -int dbus_get_searchbar( void ); +int dbus_get_searchbar (void); /** * ConfigurationManager - Gives the maximum number of days the user wants to have in the history * @return double The maximum number of days */ -guint dbus_get_history_limit( void ); +guint dbus_get_history_limit (void); /** * ConfigurationManager - Gives the maximum number of days the user wants to have in the history @@ -430,14 +430,14 @@ void dbus_set_history_limit (const guint days); * @return int 0 ALSA * 1 PULSEAUDIO */ -int dbus_get_audio_manager( void ); +int dbus_get_audio_manager (void); /** * ConfigurationManager - Set the audio manager * @param api 0 ALSA * 1 PULSEAUDIO */ -void dbus_set_audio_manager( int api ); +void dbus_set_audio_manager (int api); /** * ConfigurationManager - Start a tone when a new call is open and no numbers have been dialed @@ -446,7 +446,7 @@ void dbus_set_audio_manager( int api ); * @param type TONE_WITH_MESSAGE * TONE_WITHOUT_MESSAGE */ -void dbus_start_tone(const int start , const guint type); +void dbus_start_tone (const int start , const guint type); /** * Instance - Send registration request to dbus service. @@ -454,19 +454,19 @@ void dbus_start_tone(const int start , const guint type); * @param pid The pid of the processus client * @param name The string description of the client. Here : GTK+ Client */ -void dbus_register( int pid, gchar * name); +void dbus_register (int pid, gchar * name); /** * Instance - Send unregistration request to dbus services * @param pid The pid of the processus */ -void dbus_unregister(int pid); +void dbus_unregister (int pid); -void dbus_set_sip_address(const gchar* address); +void dbus_set_sip_address (const gchar* address); -gint dbus_get_sip_address(void); +gint dbus_get_sip_address (void); -void dbus_add_participant(const gchar* callID, const gchar* confID); +void dbus_add_participant (const gchar* callID, const gchar* confID); void dbus_set_record (const gchar * id); @@ -492,17 +492,17 @@ void dbus_set_addressbook_list (const gchar** list); /** * Resolve the local address given an interface name */ -gchar * dbus_get_address_from_interface_name(gchar* interface); +gchar * dbus_get_address_from_interface_name (gchar* interface); /** * Query the daemon to return a list of network interface (described as there IP address) */ -gchar** dbus_get_all_ip_interface(void); +gchar** dbus_get_all_ip_interface (void); /** * Query the daemon to return a list of network interface (described as there name) */ -gchar** dbus_get_all_ip_interface_by_name(void); +gchar** dbus_get_all_ip_interface_by_name (void); /** * Encapsulate all the url hook-related configuration @@ -517,7 +517,7 @@ GHashTable* dbus_get_hook_settings (void); void dbus_set_hook_settings (GHashTable *); -gboolean dbus_get_is_recording(const callable_obj_t *); +gboolean dbus_get_is_recording (const callable_obj_t *); GHashTable* dbus_get_call_details (const gchar* callID); @@ -536,21 +536,21 @@ void dbus_set_history (GHashTable* entries); void sflphone_display_transfer_status (const gchar* message); /** - * CallManager - Confirm Short Authentication String + * CallManager - Confirm Short Authentication String * for a given callId * @param c The call to confirm SAS */ void dbus_confirm_sas (const callable_obj_t * c); /** - * CallManager - Reset Short Authentication String + * CallManager - Reset Short Authentication String * for a given callId * @param c The call to reset SAS */ void dbus_reset_sas (const callable_obj_t * c); /** - * CallManager - Request Go Clear in the ZRTP Protocol + * CallManager - Request Go Clear in the ZRTP Protocol * for a given callId * @param c The call that we want to go clear */ @@ -565,7 +565,7 @@ void dbus_set_confirm_go_clear (const callable_obj_t * c); /** * CallManager - Get the list of supported TLS methods from - * the server in textual form. + * the server in textual form. * @return an array of string representing supported methods */ gchar** dbus_get_supported_tls_method(); @@ -581,8 +581,8 @@ guint dbus_get_window_position_y (void); void dbus_set_window_position_x (const guint posx); void dbus_set_window_position_y (const guint posy); -GHashTable* dbus_get_shortcuts(void); -void dbus_set_shortcuts(GHashTable * shortcuts); +GHashTable* dbus_get_shortcuts (void); +void dbus_set_shortcuts (GHashTable * shortcuts); /* Instant messaging */ void dbus_send_text_message (const gchar* callID, const gchar *message); diff --git a/sflphone-client-gnome/src/dialpad.c b/sflphone-client-gnome/src/dialpad.c index 31ed1374132a772d02195a4d732c7f30ca195f8b..04009dc0450c9fb1e57f407f528965269251b900 100644 --- a/sflphone-client-gnome/src/dialpad.c +++ b/sflphone-client-gnome/src/dialpad.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #include <dialpad.h> #include <actions.h> @@ -37,80 +37,80 @@ static void dialpad_pressed (GtkWidget * widget UNUSED, gpointer data) { - gtk_widget_grab_focus(GTK_WIDGET(current_calls->view)); - sflphone_keypad(0, (gchar*) data); + gtk_widget_grab_focus (GTK_WIDGET (current_calls->view)); + sflphone_keypad (0, (gchar*) data); } -GtkWidget * +GtkWidget * get_numpad_button (const gchar* number, gboolean twolines, const gchar * letters) { - GtkWidget * button; - GtkWidget * label; - gchar * markup; - - button = gtk_button_new (); - label = gtk_label_new ( "1" ); - gtk_label_set_single_line_mode ( GTK_LABEL(label), FALSE ); - gtk_label_set_justify( GTK_LABEL(label), GTK_JUSTIFY_CENTER ); - markup = g_markup_printf_escaped("<big><b>%s</b></big>%s%s", number, (twolines == TRUE ? "\n": ""), letters); - gtk_label_set_markup ( GTK_LABEL(label), markup); - gtk_container_add (GTK_CONTAINER (button), label); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (dialpad_pressed), (gchar*)number); - - return button; + GtkWidget * button; + GtkWidget * label; + gchar * markup; + + button = gtk_button_new (); + label = gtk_label_new ("1"); + gtk_label_set_single_line_mode (GTK_LABEL (label), FALSE); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER); + markup = g_markup_printf_escaped ("<big><b>%s</b></big>%s%s", number, (twolines == TRUE ? "\n": ""), letters); + gtk_label_set_markup (GTK_LABEL (label), markup); + gtk_container_add (GTK_CONTAINER (button), label); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (dialpad_pressed), (gchar*) number); + + return button; } -GtkWidget * +GtkWidget * create_dialpad() { - GtkWidget * button; - GtkWidget * table; - - table = gtk_table_new ( 4, 3, TRUE /* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 5); - gtk_table_set_col_spacings( GTK_TABLE(table), 5); - gtk_container_set_border_width (GTK_CONTAINER(table), 5); - - button = get_numpad_button("1", TRUE, ""); - gtk_table_attach ( GTK_TABLE( table ), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("2", TRUE, "a b c"); - gtk_table_attach ( GTK_TABLE( table ), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("3", TRUE, "d e f"); - gtk_table_attach ( GTK_TABLE( table ), button, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - - button = get_numpad_button("4", TRUE, "g h i"); - gtk_table_attach ( GTK_TABLE( table ), button, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("5", TRUE, "j k l"); - gtk_table_attach ( GTK_TABLE( table ), button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("6", TRUE, "m n o"); - gtk_table_attach ( GTK_TABLE( table ), button, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - - button = get_numpad_button("7", TRUE, "p q r s"); - gtk_table_attach ( GTK_TABLE( table ), button, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("8", TRUE, "t u v"); - gtk_table_attach ( GTK_TABLE( table ), button, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("9", TRUE, "w x y z"); - gtk_table_attach ( GTK_TABLE( table ), button, 2, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - - button = get_numpad_button("*", FALSE, ""); - gtk_table_attach ( GTK_TABLE( table ), button, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("0", FALSE, ""); - gtk_table_attach ( GTK_TABLE( table ), button, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - button = get_numpad_button("#", FALSE, ""); - gtk_table_attach ( GTK_TABLE( table ), button, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - return table; - + GtkWidget * button; + GtkWidget * table; + + table = gtk_table_new (4, 3, TRUE /* homogeneous */); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + gtk_container_set_border_width (GTK_CONTAINER (table), 5); + + button = get_numpad_button ("1", TRUE, ""); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("2", TRUE, "a b c"); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("3", TRUE, "d e f"); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + + button = get_numpad_button ("4", TRUE, "g h i"); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("5", TRUE, "j k l"); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("6", TRUE, "m n o"); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + + button = get_numpad_button ("7", TRUE, "p q r s"); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("8", TRUE, "t u v"); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("9", TRUE, "w x y z"); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + + button = get_numpad_button ("*", FALSE, ""); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("0", FALSE, ""); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + button = get_numpad_button ("#", FALSE, ""); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + return table; + } diff --git a/sflphone-client-gnome/src/dialpad.h b/sflphone-client-gnome/src/dialpad.h index c95f5caf55541fd8db6fe6e4152c35db652fc945..c25f2ebff216bdfa52b1a98fc3313c84ec6676d1 100644 --- a/sflphone-client-gnome/src/dialpad.h +++ b/sflphone-client-gnome/src/dialpad.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __DIALPAD_H__ #define __DIALPAD_H__ @@ -42,4 +42,4 @@ */ GtkWidget * create_dialpad(); -#endif +#endif diff --git a/sflphone-client-gnome/src/eel-gconf-extensions.c b/sflphone-client-gnome/src/eel-gconf-extensions.c index 2bc4ab804f5d6d16e3bf586a9de8b189cba02fb0..1d912000683672b91ca43f58bc7ecbd893dc3e4c 100644 --- a/sflphone-client-gnome/src/eel-gconf-extensions.c +++ b/sflphone-client-gnome/src/eel-gconf-extensions.c @@ -37,280 +37,279 @@ static GConfClient *global_gconf_client = NULL; static void global_client_free (void) { - if (global_gconf_client == NULL) { - return; - } + if (global_gconf_client == NULL) { + return; + } - g_object_unref (G_OBJECT (global_gconf_client)); - global_gconf_client = NULL; + g_object_unref (G_OBJECT (global_gconf_client)); + global_gconf_client = NULL; } /* Public */ GConfClient * eel_gconf_client_get_global (void) { - /* Initialize gconf if needed */ - if (!gconf_is_initialized ()) { - char *argv[] = { "eel-preferences", NULL }; - GError *error = NULL; - char *teststr; - - if (!gconf_init (1, argv, &error)) { - if (eel_gconf_handle_error (&error)) { - return NULL; - } - } - - /* check if gconf schemas are working */ - teststr = gconf_client_get_string (eel_gconf_client_get_global(), - "/apps/gpdf/gconf_test", NULL); - if (!teststr) - { - GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Cannot find a schema for gpdf preferences. \n" - "Check your gconf setup, look at gpdf FAQ for \n" - "more info")); - gtk_dialog_run (GTK_DIALOG (dialog)); - exit (0); - } - else - { - g_free (teststr); - } + /* Initialize gconf if needed */ + if (!gconf_is_initialized ()) { + char *argv[] = { "eel-preferences", NULL }; + GError *error = NULL; + char *teststr; + if (!gconf_init (1, argv, &error)) { + if (eel_gconf_handle_error (&error)) { + return NULL; + } } - if (global_gconf_client == NULL) { - global_gconf_client = gconf_client_get_default (); - g_atexit (global_client_free); + /* check if gconf schemas are working */ + teststr = gconf_client_get_string (eel_gconf_client_get_global(), + "/apps/gpdf/gconf_test", NULL); + + if (!teststr) { + GtkWidget *dialog; + dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _ ("Cannot find a schema for gpdf preferences. \n" + "Check your gconf setup, look at gpdf FAQ for \n" + "more info")); + gtk_dialog_run (GTK_DIALOG (dialog)); + exit (0); + } else { + g_free (teststr); } - return global_gconf_client; + } + + if (global_gconf_client == NULL) { + global_gconf_client = gconf_client_get_default (); + g_atexit (global_client_free); + } + + return global_gconf_client; } gboolean eel_gconf_handle_error (GError **error) { - g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); - if (*error != NULL) { - g_warning (_("GConf error:\n %s"), (*error)->message); - g_error_free (*error); - *error = NULL; + if (*error != NULL) { + g_warning (_ ("GConf error:\n %s"), (*error)->message); + g_error_free (*error); + *error = NULL; - return TRUE; - } + return TRUE; + } - return FALSE; + return FALSE; } void eel_gconf_set_boolean (const char *key, - gboolean boolean_value) + gboolean boolean_value) { - GConfClient *client; - GError *error = NULL; + GConfClient *client; + GError *error = NULL; - g_return_if_fail (key != NULL); + g_return_if_fail (key != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_set_bool (client, key, boolean_value, &error); - eel_gconf_handle_error (&error); + gconf_client_set_bool (client, key, boolean_value, &error); + eel_gconf_handle_error (&error); } gboolean eel_gconf_get_boolean (const char *key) { - gboolean result; - GConfClient *client; - GError *error = NULL; + gboolean result; + GConfClient *client; + GError *error = NULL; - g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, FALSE); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, FALSE); - result = gconf_client_get_bool (client, key, &error); + result = gconf_client_get_bool (client, key, &error); - if (eel_gconf_handle_error (&error)) { - result = FALSE; - } + if (eel_gconf_handle_error (&error)) { + result = FALSE; + } - return result; + return result; } void eel_gconf_set_integer (const char *key, - int int_value) + int int_value) { - GConfClient *client; - GError *error = NULL; + GConfClient *client; + GError *error = NULL; - g_return_if_fail (key != NULL); + g_return_if_fail (key != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_set_int (client, key, int_value, &error); - eel_gconf_handle_error (&error); + gconf_client_set_int (client, key, int_value, &error); + eel_gconf_handle_error (&error); } int eel_gconf_get_integer (const char *key) { - int result; - GConfClient *client; - GError *error = NULL; + int result; + GConfClient *client; + GError *error = NULL; - g_return_val_if_fail (key != NULL, 0); + g_return_val_if_fail (key != NULL, 0); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, 0); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, 0); - result = gconf_client_get_int (client, key, &error); + result = gconf_client_get_int (client, key, &error); - if (eel_gconf_handle_error (&error)) { - result = 0; - } + if (eel_gconf_handle_error (&error)) { + result = 0; + } - return result; + return result; } void eel_gconf_set_float (const char *key, - gfloat float_value) + gfloat float_value) { - GConfClient *client; - GError *error = NULL; + GConfClient *client; + GError *error = NULL; - g_return_if_fail (key != NULL); + g_return_if_fail (key != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_set_float (client, key, float_value, &error); - eel_gconf_handle_error (&error); + gconf_client_set_float (client, key, float_value, &error); + eel_gconf_handle_error (&error); } gfloat eel_gconf_get_float (const char *key) { - gfloat result; - GConfClient *client; - GError *error = NULL; + gfloat result; + GConfClient *client; + GError *error = NULL; - g_return_val_if_fail (key != NULL, 0); + g_return_val_if_fail (key != NULL, 0); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, 0); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, 0); - result = gconf_client_get_float (client, key, &error); + result = gconf_client_get_float (client, key, &error); - if (eel_gconf_handle_error (&error)) { - result = 0; - } + if (eel_gconf_handle_error (&error)) { + result = 0; + } - return result; + return result; } void eel_gconf_set_string (const char *key, const char *string_value) { - GConfClient *client; - GError *error = NULL; + GConfClient *client; + GError *error = NULL; - g_return_if_fail (key != NULL); - g_return_if_fail (string_value != NULL); + g_return_if_fail (key != NULL); + g_return_if_fail (string_value != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_set_string (client, key, string_value, &error); - eel_gconf_handle_error (&error); + gconf_client_set_string (client, key, string_value, &error); + eel_gconf_handle_error (&error); } void eel_gconf_unset (const char *key) { - GConfClient *client; - GError *error = NULL; + GConfClient *client; + GError *error = NULL; - g_return_if_fail (key != NULL); + g_return_if_fail (key != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_unset (client, key, &error); - eel_gconf_handle_error (&error); + gconf_client_unset (client, key, &error); + eel_gconf_handle_error (&error); } char * eel_gconf_get_string (const char *key) { - char *result; - GConfClient *client; - GError *error = NULL; + char *result; + GConfClient *client; + GError *error = NULL; - g_return_val_if_fail (key != NULL, NULL); + g_return_val_if_fail (key != NULL, NULL); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, NULL); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, NULL); - result = gconf_client_get_string (client, key, &error); + result = gconf_client_get_string (client, key, &error); - if (eel_gconf_handle_error (&error)) { - result = g_strdup (""); - } + if (eel_gconf_handle_error (&error)) { + result = g_strdup (""); + } - return result; + return result; } void eel_gconf_set_string_list (const char *key, - const GSList *slist) + const GSList *slist) { - GConfClient *client; - GError *error; + GConfClient *client; + GError *error; - g_return_if_fail (key != NULL); + g_return_if_fail (key != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - error = NULL; - gconf_client_set_list (client, key, GCONF_VALUE_STRING, - /* Need cast cause of GConf api bug */ - (GSList *) slist, - &error); - eel_gconf_handle_error (&error); + error = NULL; + gconf_client_set_list (client, key, GCONF_VALUE_STRING, + /* Need cast cause of GConf api bug */ + (GSList *) slist, + &error); + eel_gconf_handle_error (&error); } GSList * eel_gconf_get_string_list (const char *key) { - GSList *slist; - GConfClient *client; - GError *error; + GSList *slist; + GConfClient *client; + GError *error; - g_return_val_if_fail (key != NULL, NULL); + g_return_val_if_fail (key != NULL, NULL); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, NULL); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, NULL); - error = NULL; - slist = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error); - if (eel_gconf_handle_error (&error)) { - slist = NULL; - } + error = NULL; + slist = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error); - return slist; + if (eel_gconf_handle_error (&error)) { + slist = NULL; + } + + return slist; } /* This code wasn't part of the original eel-gconf-extensions.c */ @@ -318,209 +317,212 @@ void eel_gconf_set_integer_list (const char *key, const GSList *slist) { - GConfClient *client; - GError *error; + GConfClient *client; + GError *error; - g_return_if_fail (key != NULL); + g_return_if_fail (key != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - error = NULL; - gconf_client_set_list (client, key, GCONF_VALUE_INT, - /* Need cast cause of GConf api bug */ - (GSList *) slist, - &error); - eel_gconf_handle_error (&error); + error = NULL; + gconf_client_set_list (client, key, GCONF_VALUE_INT, + /* Need cast cause of GConf api bug */ + (GSList *) slist, + &error); + eel_gconf_handle_error (&error); } GSList * eel_gconf_get_integer_list (const char *key) { - GSList *slist; - GConfClient *client; - GError *error; + GSList *slist; + GConfClient *client; + GError *error; - g_return_val_if_fail (key != NULL, NULL); + g_return_val_if_fail (key != NULL, NULL); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, NULL); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, NULL); - error = NULL; - slist = gconf_client_get_list (client, key, GCONF_VALUE_INT, &error); - if (eel_gconf_handle_error (&error)) { - slist = NULL; - } + error = NULL; + slist = gconf_client_get_list (client, key, GCONF_VALUE_INT, &error); - return slist; + if (eel_gconf_handle_error (&error)) { + slist = NULL; + } + + return slist; } /* End of added code */ gboolean eel_gconf_is_default (const char *key) { - gboolean result; - GConfValue *value; - GError *error = NULL; + gboolean result; + GConfValue *value; + GError *error = NULL; - g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); - value = gconf_client_get_without_default (eel_gconf_client_get_global (), key, &error); + value = gconf_client_get_without_default (eel_gconf_client_get_global (), key, &error); - if (eel_gconf_handle_error (&error)) { - if (value != NULL) { - gconf_value_free (value); - } - return FALSE; + if (eel_gconf_handle_error (&error)) { + if (value != NULL) { + gconf_value_free (value); } - result = (value == NULL); + return FALSE; + } - if (value != NULL) { - gconf_value_free (value); - } + result = (value == NULL); + + if (value != NULL) { + gconf_value_free (value); + } - return result; + return result; } gboolean eel_gconf_monitor_add (const char *directory) { - GError *error = NULL; - GConfClient *client; + GError *error = NULL; + GConfClient *client; - g_return_val_if_fail (directory != NULL, FALSE); + g_return_val_if_fail (directory != NULL, FALSE); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, FALSE); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, FALSE); - gconf_client_add_dir (client, - directory, - GCONF_CLIENT_PRELOAD_NONE, - &error); + gconf_client_add_dir (client, + directory, + GCONF_CLIENT_PRELOAD_NONE, + &error); - if (eel_gconf_handle_error (&error)) { - return FALSE; - } + if (eel_gconf_handle_error (&error)) { + return FALSE; + } - return TRUE; + return TRUE; } gboolean eel_gconf_monitor_remove (const char *directory) { - GError *error = NULL; - GConfClient *client; + GError *error = NULL; + GConfClient *client; - if (directory == NULL) { - return FALSE; - } + if (directory == NULL) { + return FALSE; + } - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, FALSE); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, FALSE); - gconf_client_remove_dir (client, - directory, - &error); + gconf_client_remove_dir (client, + directory, + &error); - if (eel_gconf_handle_error (&error)) { - return FALSE; - } + if (eel_gconf_handle_error (&error)) { + return FALSE; + } - return TRUE; + return TRUE; } void eel_gconf_suggest_sync (void) { - GConfClient *client; - GError *error = NULL; + GConfClient *client; + GError *error = NULL; - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_suggest_sync (client, &error); - eel_gconf_handle_error (&error); + gconf_client_suggest_sync (client, &error); + eel_gconf_handle_error (&error); } GConfValue* eel_gconf_get_value (const char *key) { - GConfValue *value = NULL; - GConfClient *client; - GError *error = NULL; + GConfValue *value = NULL; + GConfClient *client; + GError *error = NULL; - g_return_val_if_fail (key != NULL, NULL); + g_return_val_if_fail (key != NULL, NULL); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, NULL); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, NULL); - value = gconf_client_get (client, key, &error); + value = gconf_client_get (client, key, &error); - if (eel_gconf_handle_error (&error)) { - if (value != NULL) { - gconf_value_free (value); - value = NULL; - } + if (eel_gconf_handle_error (&error)) { + if (value != NULL) { + gconf_value_free (value); + value = NULL; } + } - return value; + return value; } void eel_gconf_set_value (const char *key, const GConfValue *value) { - GConfClient *client; - GError *error = NULL; + GConfClient *client; + GError *error = NULL; - g_return_if_fail (key != NULL); + g_return_if_fail (key != NULL); - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_set (client, key, value, &error); + gconf_client_set (client, key, value, &error); - if (eel_gconf_handle_error (&error)) { - return; - } + if (eel_gconf_handle_error (&error)) { + return; + } } gboolean eel_gconf_key_exists (const char *key) { - GConfValue *value = NULL; - GConfClient *client; - GError *error = NULL; - gboolean error_occurred; - gboolean value_found; + GConfValue *value = NULL; + GConfClient *client; + GError *error = NULL; + gboolean error_occurred; + gboolean value_found; - g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, FALSE); + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, FALSE); - value = gconf_client_get (client, key, &error); + value = gconf_client_get (client, key, &error); - value_found = (value != NULL); - error_occurred = (error != NULL); + value_found = (value != NULL); + error_occurred = (error != NULL); - eel_gconf_value_free (value); - if (error != NULL) { - g_error_free (error); - } + eel_gconf_value_free (value); + + if (error != NULL) { + g_error_free (error); + } - return (!error_occurred && value_found); + return (!error_occurred && value_found); } void eel_gconf_value_free (GConfValue *value) { - if (value == NULL) { - return; - } + if (value == NULL) { + return; + } - gconf_value_free (value); + gconf_value_free (value); } guint @@ -528,46 +530,46 @@ eel_gconf_notification_add (const char *key, GConfClientNotifyFunc notification_callback, gpointer callback_data) { - guint notification_id; - GConfClient *client; - GError *error = NULL; - - g_return_val_if_fail (key != NULL, EEL_GCONF_UNDEFINED_CONNECTION); - g_return_val_if_fail (notification_callback != NULL, EEL_GCONF_UNDEFINED_CONNECTION); - - client = eel_gconf_client_get_global (); - g_return_val_if_fail (client != NULL, EEL_GCONF_UNDEFINED_CONNECTION); - - notification_id = gconf_client_notify_add (client, - key, - notification_callback, - callback_data, - NULL, - &error); - - if (eel_gconf_handle_error (&error)) { - if (notification_id != EEL_GCONF_UNDEFINED_CONNECTION) { - gconf_client_notify_remove (client, notification_id); - notification_id = EEL_GCONF_UNDEFINED_CONNECTION; - } + guint notification_id; + GConfClient *client; + GError *error = NULL; + + g_return_val_if_fail (key != NULL, EEL_GCONF_UNDEFINED_CONNECTION); + g_return_val_if_fail (notification_callback != NULL, EEL_GCONF_UNDEFINED_CONNECTION); + + client = eel_gconf_client_get_global (); + g_return_val_if_fail (client != NULL, EEL_GCONF_UNDEFINED_CONNECTION); + + notification_id = gconf_client_notify_add (client, + key, + notification_callback, + callback_data, + NULL, + &error); + + if (eel_gconf_handle_error (&error)) { + if (notification_id != EEL_GCONF_UNDEFINED_CONNECTION) { + gconf_client_notify_remove (client, notification_id); + notification_id = EEL_GCONF_UNDEFINED_CONNECTION; } + } - return notification_id; + return notification_id; } void eel_gconf_notification_remove (guint notification_id) { - GConfClient *client; + GConfClient *client; - if (notification_id == EEL_GCONF_UNDEFINED_CONNECTION) { - return; - } + if (notification_id == EEL_GCONF_UNDEFINED_CONNECTION) { + return; + } - client = eel_gconf_client_get_global (); - g_return_if_fail (client != NULL); + client = eel_gconf_client_get_global (); + g_return_if_fail (client != NULL); - gconf_client_notify_remove (client, notification_id); + gconf_client_notify_remove (client, notification_id); } /* Simple wrapper for eel_gconf_notifier_add which @@ -580,15 +582,16 @@ gpdf_notification_add (const char *key, gpointer callback_data, GList **notifiers) { - guint id = 0; - - id = eel_gconf_notification_add(key, - notification_callback, - callback_data); - if (notifiers != NULL) { - *notifiers = g_list_append(*notifiers, - (gpointer)id); - } + guint id = 0; + + id = eel_gconf_notification_add (key, + notification_callback, + callback_data); + + if (notifiers != NULL) { + *notifiers = g_list_append (*notifiers, + (gpointer) id); + } } /* Removes all the notifiers listed in notifiers */ @@ -596,11 +599,11 @@ gpdf_notification_add (const char *key, void gpdf_notification_remove (GList **notifiers) { - g_list_foreach(*notifiers, - (GFunc)eel_gconf_notification_remove, - NULL); - g_list_free(*notifiers); - *notifiers = NULL; + g_list_foreach (*notifiers, + (GFunc) eel_gconf_notification_remove, + NULL); + g_list_free (*notifiers); + *notifiers = NULL; } diff --git a/sflphone-client-gnome/src/eel-gconf-extensions.h b/sflphone-client-gnome/src/eel-gconf-extensions.h index f4afab26067c4f0c2116dc2964f0cf6d3844ea19..f9e4f5c381159e79d732e5c55a687a009d7814c4 100644 --- a/sflphone-client-gnome/src/eel-gconf-extensions.h +++ b/sflphone-client-gnome/src/eel-gconf-extensions.h @@ -35,50 +35,50 @@ BEGIN_EXTERN_C #define EEL_GCONF_UNDEFINED_CONNECTION 0 -GConfClient *eel_gconf_client_get_global (void); -gboolean eel_gconf_handle_error (GError **error); -void eel_gconf_set_boolean (const char *key, - gboolean boolean_value); -gboolean eel_gconf_get_boolean (const char *key); -int eel_gconf_get_integer (const char *key); -void eel_gconf_set_integer (const char *key, - int int_value); -gfloat eel_gconf_get_float (const char *key); -void eel_gconf_set_float (const char *key, - gfloat float_value); -char * eel_gconf_get_string (const char *key); -void eel_gconf_set_string (const char *key, - const char *string_value); -GSList * eel_gconf_get_string_list (const char *key); -void eel_gconf_set_string_list (const char *key, - const GSList *string_list_value); -gboolean eel_gconf_is_default (const char *key); -gboolean eel_gconf_monitor_add (const char *directory); -gboolean eel_gconf_monitor_remove (const char *directory); -void eel_gconf_suggest_sync (void); -GConfValue* eel_gconf_get_value (const char *key); -gboolean eel_gconf_value_is_equal (const GConfValue *a, - const GConfValue *b); -void eel_gconf_set_value (const char *key, - const GConfValue *value); -gboolean eel_gconf_key_exists (const char *key); - -void eel_gconf_value_free (GConfValue *value); -void eel_gconf_unset (const char *key); +GConfClient *eel_gconf_client_get_global (void); +gboolean eel_gconf_handle_error (GError **error); +void eel_gconf_set_boolean (const char *key, + gboolean boolean_value); +gboolean eel_gconf_get_boolean (const char *key); +int eel_gconf_get_integer (const char *key); +void eel_gconf_set_integer (const char *key, + int int_value); +gfloat eel_gconf_get_float (const char *key); +void eel_gconf_set_float (const char *key, + gfloat float_value); +char * eel_gconf_get_string (const char *key); +void eel_gconf_set_string (const char *key, + const char *string_value); +GSList * eel_gconf_get_string_list (const char *key); +void eel_gconf_set_string_list (const char *key, + const GSList *string_list_value); +gboolean eel_gconf_is_default (const char *key); +gboolean eel_gconf_monitor_add (const char *directory); +gboolean eel_gconf_monitor_remove (const char *directory); +void eel_gconf_suggest_sync (void); +GConfValue* eel_gconf_get_value (const char *key); +gboolean eel_gconf_value_is_equal (const GConfValue *a, + const GConfValue *b); +void eel_gconf_set_value (const char *key, + const GConfValue *value); +gboolean eel_gconf_key_exists (const char *key); + +void eel_gconf_value_free (GConfValue *value); +void eel_gconf_unset (const char *key); /* Functions which weren't part of the eel-gconf-extensions.h file from eel */ -GSList *eel_gconf_get_integer_list (const char *key); -void eel_gconf_set_integer_list (const char *key, - const GSList *slist); -void gpdf_notification_add (const char *key, - GConfClientNotifyFunc notification_callback, - gpointer callback_data, - GList **notifiers); -void gpdf_notification_remove (GList **notifiers); -guint eel_gconf_notification_add (const char *key, - GConfClientNotifyFunc notification_callback, - gpointer callback_data); -void eel_gconf_notification_remove (guint notification_id); +GSList *eel_gconf_get_integer_list (const char *key); +void eel_gconf_set_integer_list (const char *key, + const GSList *slist); +void gpdf_notification_add (const char *key, + GConfClientNotifyFunc notification_callback, + gpointer callback_data, + GList **notifiers); +void gpdf_notification_remove (GList **notifiers); +guint eel_gconf_notification_add (const char *key, + GConfClientNotifyFunc notification_callback, + gpointer callback_data); +void eel_gconf_notification_remove (guint notification_id); #ifdef __cplusplus END_EXTERN_C diff --git a/sflphone-client-gnome/src/errors.c b/sflphone-client-gnome/src/errors.c index 0dbd1240014d8d810155b4484213bb4f06cfc989..87e05c83dcd48c8538c3da74092790e65feeb010 100644 --- a/sflphone-client-gnome/src/errors.c +++ b/sflphone-client-gnome/src/errors.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -31,21 +31,23 @@ #include <errors.h> #include <sflphone_const.h> - void -sflphone_throw_exception( int err ) +void +sflphone_throw_exception (int err) { - gchar* markup=""; - switch( err ){ - case ALSA_PLAYBACK_DEVICE: - markup = g_markup_printf_escaped(_("ALSA notification\n\nError while opening playback device")); - break; - case ALSA_CAPTURE_DEVICE: - markup = g_markup_printf_escaped(_("ALSA notification\n\nError while opening capture device")); - break; - case PULSEAUDIO_NOT_RUNNING: - markup = g_markup_printf_escaped(_("Pulseaudio notification\n\nPulseaudio is not running")); - break; - } - main_window_error_message( markup ); - free( markup ); + gchar* markup=""; + + switch (err) { + case ALSA_PLAYBACK_DEVICE: + markup = g_markup_printf_escaped (_ ("ALSA notification\n\nError while opening playback device")); + break; + case ALSA_CAPTURE_DEVICE: + markup = g_markup_printf_escaped (_ ("ALSA notification\n\nError while opening capture device")); + break; + case PULSEAUDIO_NOT_RUNNING: + markup = g_markup_printf_escaped (_ ("Pulseaudio notification\n\nPulseaudio is not running")); + break; + } + + main_window_error_message (markup); + free (markup); } diff --git a/sflphone-client-gnome/src/errors.h b/sflphone-client-gnome/src/errors.h index 2c87178ff3c020408fa40a1f9ab524c1167e5a86..80d1e08da2e13d1c1fbb3a8a435434813f41d610 100644 --- a/sflphone-client-gnome/src/errors.h +++ b/sflphone-client-gnome/src/errors.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __ERRORS_H #define __ERRORS_H @@ -45,6 +45,6 @@ * ALSA_PLAYBACK_ERROR * ALSA_CAPTURE_ERROR */ -void sflphone_throw_exception( int err ); +void sflphone_throw_exception (int err); #endif diff --git a/sflphone-client-gnome/src/icons/icon_factory.c b/sflphone-client-gnome/src/icons/icon_factory.c index 6380aeb6792b5dde879a633d0abe0e2e15951a1a..b81365874aa4fc8e6210672c288b2dcdaa4686c5 100644 --- a/sflphone-client-gnome/src/icons/icon_factory.c +++ b/sflphone-client-gnome/src/icons/icon_factory.c @@ -34,58 +34,57 @@ static GtkIconFactory *icon_factory = NULL; void add_icon (GtkIconFactory *factory, const gchar *stock_id, const guint8 *icon_data, GtkIconSize size) { - GtkIconSet *icons; - GtkIconSource *source; - GdkPixbuf *pixbuf; + GtkIconSet *icons; + GtkIconSource *source; + GdkPixbuf *pixbuf; - icons = gtk_icon_factory_lookup (factory, stock_id); - if (!icons) - { - pixbuf = gdk_pixbuf_new_from_inline (-1, icon_data, FALSE, NULL); - source = gtk_icon_source_new (); - gtk_icon_source_set_pixbuf (source, pixbuf); - gtk_icon_source_set_size (source, size); + icons = gtk_icon_factory_lookup (factory, stock_id); - icons = gtk_icon_set_new (); - gtk_icon_set_add_source (icons, source); + if (!icons) { + pixbuf = gdk_pixbuf_new_from_inline (-1, icon_data, FALSE, NULL); + source = gtk_icon_source_new (); + gtk_icon_source_set_pixbuf (source, pixbuf); + gtk_icon_source_set_size (source, size); - gtk_icon_factory_add (factory, stock_id, icons); + icons = gtk_icon_set_new (); + gtk_icon_set_add_source (icons, source); - g_object_unref (G_OBJECT (pixbuf)); - gtk_icon_source_free (source); - gtk_icon_set_unref (icons); - } - else - DEBUG ("Icon %s already exists in factory\n", stock_id); + gtk_icon_factory_add (factory, stock_id, icons); + + g_object_unref (G_OBJECT (pixbuf)); + gtk_icon_source_free (source); + gtk_icon_set_unref (icons); + } else + DEBUG ("Icon %s already exists in factory\n", stock_id); } void register_sflphone_stock_icons (GtkIconFactory *factory) { - add_icon (factory, GTK_STOCK_PICKUP, gnome_stock_pickup, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_HANGUP, gnome_stock_hangup, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_DIAL, gnome_stock_dial, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_TRANSFER, gnome_stock_transfer, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_ONHOLD, gnome_stock_onhold, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_OFFHOLD, gnome_stock_offhold, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_IM, gnome_stock_im, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_CALL_CURRENT, gnome_stock_call_current, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_ADDRESSBOOK, gnome_stock_addressbook, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_CALLS, gnome_stock_calls, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_SFLPHONE, gnome_stock_sflphone, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_FAIL, gnome_stock_fail, GTK_ICON_SIZE_SMALL_TOOLBAR); - add_icon (factory, GTK_STOCK_USER, gnome_stock_user, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_PICKUP, gnome_stock_pickup, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_HANGUP, gnome_stock_hangup, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_DIAL, gnome_stock_dial, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_TRANSFER, gnome_stock_transfer, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_ONHOLD, gnome_stock_onhold, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_OFFHOLD, gnome_stock_offhold, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_IM, gnome_stock_im, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_CALL_CURRENT, gnome_stock_call_current, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_ADDRESSBOOK, gnome_stock_addressbook, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_CALLS, gnome_stock_calls, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_SFLPHONE, gnome_stock_sflphone, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_FAIL, gnome_stock_fail, GTK_ICON_SIZE_SMALL_TOOLBAR); + add_icon (factory, GTK_STOCK_USER, gnome_stock_user, GTK_ICON_SIZE_SMALL_TOOLBAR); } void init_icon_factory (void) { - // Init the factory - icon_factory = gtk_icon_factory_new (); + // Init the factory + icon_factory = gtk_icon_factory_new (); - // Load icons - register_sflphone_stock_icons (icon_factory); + // Load icons + register_sflphone_stock_icons (icon_factory); - // Specify a default icon set - gtk_icon_factory_add_default (icon_factory); + // Specify a default icon set + gtk_icon_factory_add_default (icon_factory); } diff --git a/sflphone-client-gnome/src/icons/pixmap_data.h b/sflphone-client-gnome/src/icons/pixmap_data.h index a8e70490cdaafe10fda5e8dfe5382438a1ec712a..b38046be4d852eb15cb47ea0cc0844da244febe0 100644 --- a/sflphone-client-gnome/src/icons/pixmap_data.h +++ b/sflphone-client-gnome/src/icons/pixmap_data.h @@ -39,100 +39,101 @@ G_BEGIN_DECLS #pragma align 4 (gnome_stock_pickup) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_pickup[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_pickup[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_pickup[] = +static const guint8 gnome_stock_pickup[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0'\260\0\204&\260\0\222\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0'\261\0b&\260\0\357&\260\0\357'\262\0p\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\257\0F" - "&\260\0\342&\260\0\345&\260\0\345&\260\0\344%\256\0R\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\263\0/'\260\0\322" - "&\260\0\333&\260\0\333&\260\0\333&\260\0\333&\257\0\326(\256\0""9\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0#\260\0\35%\260\0\277" - "&\261\0\320&\261\0\320&\261\0\320&\261\0\320&\261\0\320&\261\0\320&\261" - "\0\304\"\254\0%\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40\257\0\20'\261\0" - "\252'\260\0\306'\260\0\306'\260\0\306'\260\0\306'\260\0\306'\260\0\306" - "'\260\0\306'\260\0\306'\261\0\260#\256\0\26\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\266\0" - "\7&\261\0\223&\260\0\274&\260\0\274&\260\0\274&\260\0\274&\260\0\274" - "&\260\0\274&\260\0\274&\260\0\274&\260\0\274&\260\0\274&\260\0\233.\271" - "\0\13\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\200\0\2'\257\0|'\260\0\262'\260\0\262'\260\0\262'\260\0\262" - "'\260\0\262'\260\0\262'\260\0\262'\260\0\262'\260\0\262'\260\0\262'\260" - "\0\262'\260\0\262'\260\0\204@\277\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'\257\0c&\260\0\250&\260\0\250&\260\0" - "\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250" - "&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\261\0l\0\0\0" - "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\260\0J'\260\0\236" - "'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260" - "\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0" - "\236'\260\0\236'\260\0\236'\260\0T\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0&\255\0""5&\261\0\223&\260\0\224&\260\0\224&\260\0\224&\260\0\224" - "&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260" - "\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0" - "\224&\260\0=\0\0\0\0\0\0\0\0\0\0\0\0#\261\0$(\260\0\207'\260\0\212'\260" - "\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0" - "\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212" - "'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\210$\260\0*\0\0\0" - "\0!\261\0\27&\260\0x&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257" - "\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0" - "\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200" - "&\257\0\200&\257\0\200&\257\0\200%\260\0{$\255\0\34""3\231\0\5\40\237" - "\0\10\40\237\0\10\40\237\0\10\40\237\0\10&\256\0/'\257\0v'\257\0v'\257" - "\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'" - "\257\0v&\262\0""5\40\237\0\10\40\237\0\10\40\237\0\10\40\237\0\10""3" - "\231\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(\256\0&&\260\0k&\260" - "\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&" - "\260\0k&\260\0k)\256\0,\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\264\0\"%\260\0a%\260\0a%\260\0a%" - "\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260" - "\0a&\263\0(\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0)\255\0\37&\260\0W&\260\0W&\260\0W&\260\0W&\260" - "\0W&\260\0W&\260\0W&\260\0W&\260\0W&\260\0W&\260\0W&\260\0W#\261\0$\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0&\263\0\33$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M" - "$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M(\257\0\40\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0+\252\0\30&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C" - "&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C$\255\0\34\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\263\0" - "\24$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256" - "\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9!\261\0\27\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\36\245\0\21&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/" - "&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/(\256\0\23\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0'\261\0\15)\263\0%)\263\0%)\263\0%)\263\0%)\263\0%)\263\0%)\263\0%" - ")\263\0%)\263\0%)\263\0%)\263\0%)\263\0%\"\273\0\17\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32\263" - "\0\12&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263" - "\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33.\271\0\13\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0+\252\0\6-\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21-" - "\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21" - "$\266\0\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0'\260\0\204&\260\0\222\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0'\261\0b&\260\0\357&\260\0\357'\262\0p\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\257\0F" + "&\260\0\342&\260\0\345&\260\0\345&\260\0\344%\256\0R\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\263\0/'\260\0\322" + "&\260\0\333&\260\0\333&\260\0\333&\260\0\333&\257\0\326(\256\0""9\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0#\260\0\35%\260\0\277" + "&\261\0\320&\261\0\320&\261\0\320&\261\0\320&\261\0\320&\261\0\320&\261" + "\0\304\"\254\0%\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40\257\0\20'\261\0" + "\252'\260\0\306'\260\0\306'\260\0\306'\260\0\306'\260\0\306'\260\0\306" + "'\260\0\306'\260\0\306'\261\0\260#\256\0\26\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\266\0" + "\7&\261\0\223&\260\0\274&\260\0\274&\260\0\274&\260\0\274&\260\0\274" + "&\260\0\274&\260\0\274&\260\0\274&\260\0\274&\260\0\274&\260\0\233.\271" + "\0\13\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\200\0\2'\257\0|'\260\0\262'\260\0\262'\260\0\262'\260\0\262" + "'\260\0\262'\260\0\262'\260\0\262'\260\0\262'\260\0\262'\260\0\262'\260" + "\0\262'\260\0\262'\260\0\204@\277\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'\257\0c&\260\0\250&\260\0\250&\260\0" + "\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250" + "&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\260\0\250&\261\0l\0\0\0" + "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\260\0J'\260\0\236" + "'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260" + "\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0\236'\260\0" + "\236'\260\0\236'\260\0\236'\260\0T\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0&\255\0""5&\261\0\223&\260\0\224&\260\0\224&\260\0\224&\260\0\224" + "&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260" + "\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0\224&\260\0" + "\224&\260\0=\0\0\0\0\0\0\0\0\0\0\0\0#\261\0$(\260\0\207'\260\0\212'\260" + "\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0" + "\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\212" + "'\260\0\212'\260\0\212'\260\0\212'\260\0\212'\260\0\210$\260\0*\0\0\0" + "\0!\261\0\27&\260\0x&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257" + "\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0" + "\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200&\257\0\200" + "&\257\0\200&\257\0\200&\257\0\200%\260\0{$\255\0\34""3\231\0\5\40\237" + "\0\10\40\237\0\10\40\237\0\10\40\237\0\10&\256\0/'\257\0v'\257\0v'\257" + "\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'\257\0v'" + "\257\0v&\262\0""5\40\237\0\10\40\237\0\10\40\237\0\10\40\237\0\10""3" + "\231\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(\256\0&&\260\0k&\260" + "\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&\260\0k&" + "\260\0k&\260\0k)\256\0,\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\264\0\"%\260\0a%\260\0a%\260\0a%" + "\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260\0a%\260" + "\0a&\263\0(\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0)\255\0\37&\260\0W&\260\0W&\260\0W&\260\0W&\260" + "\0W&\260\0W&\260\0W&\260\0W&\260\0W&\260\0W&\260\0W&\260\0W#\261\0$\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0&\263\0\33$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M" + "$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M$\260\0M(\257\0\40\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0+\252\0\30&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C" + "&\257\0C&\257\0C&\257\0C&\257\0C&\257\0C$\255\0\34\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\263\0" + "\24$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256" + "\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9$\256\0""9!\261\0\27\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\36\245\0\21&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/" + "&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/&\256\0/(\256\0\23\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0'\261\0\15)\263\0%)\263\0%)\263\0%)\263\0%)\263\0%)\263\0%)\263\0%" + ")\263\0%)\263\0%)\263\0%)\263\0%)\263\0%\"\273\0\17\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32\263" + "\0\12&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263" + "\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33&\263\0\33.\271\0\13\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0+\252\0\6-\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21-" + "\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21-\264\0\21" + "$\266\0\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -141,108 +142,109 @@ static const guint8 gnome_stock_pickup[] = #pragma align 4 (gnome_stock_hangup) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_hangup[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_hangup[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_hangup[] = +static const guint8 gnome_stock_hangup[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\0\0\3\277\40\0\10\277\40" - "\0\10\277\40\0\10\277\40\0\10\277\40\0\10\277\40\0\10\266$\0\7\266$\0" - "\7\266$\0\7\266$\0\7\266$\0\7\266$\0\7\252\0\0\3\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\237\40\0" - "\10\256\33\0\23\256\33\0\23\252\34\0\22\252\34\0\22\252\34\0\22\252\34" - "\0\22\252\34\0\22\252\34\0\22\252\34\0\22\252\34\0\22\252\34\0\22\252" - "\34\0\22\277\40\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\25\0\14\260\32\0\35\260\32\0\35" - "\260\32\0\35\260\32\0\35\260\32\0\35\260\32\0\35\260\32\0\35\260\32\0" - "\35\255\33\0\34\255\33\0\34\255\33\0\34\255\33\0\34\261\24\0\15\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\277\40\0\20\263\32\0(\263\32\0(\263\32\0(\263\32\0(\261\32\0'" - "\261\32\0'\261\32\0'\261\32\0'\261\32\0'\261\32\0'\261\32\0'\261\32\0" - "'\270\34\0\22\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\252\30\0\25\257\31\0""3\263\32\0""2\263\32\0" - "2\263\32\0""2\263\32\0""2\263\32\0""2\263\32\0""2\263\32\0""2\263\32" - "\0""2\263\32\0""2\261\32\0""1\261\32\0""1\261\26\0\27\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255" - "\24\0\31\260\31\0=\260\31\0=\260\31\0=\260\31\0=\260\31\0=\260\31\0=" - "\260\31\0=\256\32\0<\256\32\0<\256\32\0<\256\32\0<\256\32\0<\255\33\0" - "\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\263\21\0\36\261\25\0H\261\25\0H\261\25\0H\260\26\0G\260" - "\26\0G\260\26\0G\260\26\0G\260\26\0G\260\26\0G\260\26\0G\260\26\0G\260" - "\26\0G\262\27\0!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255\27\0\"\261\26\0R\261\26\0R\261\26\0" - "R\261\26\0R\261\26\0R\261\26\0R\261\26\0R\261\26\0R\261\26\0R\260\26" - "\0Q\260\26\0Q\260\26\0Q\256\24\0&\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\256\24\0&\257\23\0]\257" - "\23\0]\257\23\0]\257\23\0]\257\23\0]\257\26\0\\\257\26\0\\\257\26\0\\" - "\257\26\0\\\257\26\0\\\257\26\0\\\257\26\0\\\262\30\0+\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\262" - "\22\0+\261\24\0h\260\24\0g\260\24\0g\260\24\0g\260\24\0g\260\24\0g\260" - "\24\0g\260\24\0g\260\24\0g\260\24\0g\260\24\0g\257\24\0f\257\25\0""0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\263\20\0/\261\22\0r\261\22\0r\261\22\0r\261\22\0r\261\22" - "\0r\261\22\0r\261\22\0r\260\22\0q\260\22\0q\260\22\0q\260\22\0q\260\22" - "\0q\262\23\0""5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\257\17\0""3\257\20\0}\257\20\0}\257\20\0}" - "\261\20\0|\261\20\0|\261\20\0|\261\20\0|\261\20\0|\261\20\0|\261\20\0" - "|\261\20\0|\261\20\0|\260\22\0:\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\255\22\0\34\260\21\0-\260\21\0-\260\21\0-\260\21\0-\261\20\0R\260" - "\17\0\207\260\17\0\207\260\17\0\207\260\17\0\207\260\17\0\207\260\17" - "\0\207\260\17\0\207\260\17\0\207\260\17\0\207\257\17\0\206\257\17\0\206" - "\257\17\0\206\260\17\0W\260\21\0-\260\21\0-\260\21\0-\260\21\0-\260\22" - "\0\35\261\24\0\15\256\15\0x\260\16\0\222\260\16\0\222\260\16\0\222\260" - "\16\0\222\260\16\0\222\260\16\0\222\260\16\0\222\260\16\0\222\260\16" - "\0\222\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221" - "\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221\257" - "\16\0\220\257\17\0y\257\20\0\20\0\0\0\0\263\0\0\12\256\12\0{\257\13\0" - "\235\257\13\0\235\257\13\0\235\257\13\0\235\257\13\0\235\261\13\0\234" - "\261\13\0\234\261\13\0\234\261\13\0\234\261\13\0\234\261\13\0\234\261" - "\13\0\234\261\13\0\234\261\13\0\234\260\14\0\233\260\14\0\233\260\14" - "\0\233\260\14\0\233\260\14\0~\261\24\0\15\0\0\0\0\0\0\0\0\0\0\0\0\237" - "\0\0\10\260\12\0~\260\13\0\247\260\13\0\247\260\13\0\247\260\13\0\247" - "\260\13\0\247\260\13\0\247\260\13\0\247\260\13\0\247\260\13\0\247\260" - "\13\0\247\261\13\0\246\261\13\0\246\261\13\0\246\261\13\0\246\261\13" - "\0\246\261\13\0\246\261\12\0\202\271\0\0\13\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\252\0\0\6\260\10\0~\260\11\0\262\260\11\0\262\260\11\0" - "\262\260\11\0\262\260\11\0\262\260\12\0\261\260\12\0\261\260\12\0\261" - "\260\12\0\261\260\12\0\261\260\12\0\261\260\12\0\261\260\12\0\261\260" - "\12\0\261\257\12\0\203\277\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\277\0\0\4\257\10\0}\260\10\0\274\260\10\0\274\260" - "\10\0\274\260\10\0\274\260\10\0\274\260\10\0\274\260\10\0\274\260\10" - "\0\274\260\10\0\274\260\10\0\274\260\10\0\273\260\10\0\273\260\10\0\204" - "\266\0\0\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\377\0\0\2\257\6\0|\260\6\0\307\260\6\0\307\260\6\0\307" - "\260\6\0\307\260\6\0\307\260\6\0\306\260\6\0\306\260\6\0\306\260\6\0" - "\306\260\6\0\306\261\6\0\202\231\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\1" - "\260\4\0x\260\5\0\321\260\5\0\321\260\5\0\321\260\5\0\321\260\5\0\321" - "\260\5\0\321\260\5\0\321\260\5\0\321\260\4\0\201\377\0\0\2\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\261\4\0r\260\3\0\334\260\3\0\334\260" - "\3\0\334\260\3\0\334\260\3\0\334\260\3\0\333\257\4\0}\377\0\0\1\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\257\2\0m\260\3" - "\0\346\260\3\0\346\260\3\0\346\260\3\0\346\260\4\0w\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\260" - "\0\0d\257\1\0\360\260\1\0\361\257\0\0p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\257\0\0\\\257\0\0i\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\0\0\3\277\40\0\10\277\40" + "\0\10\277\40\0\10\277\40\0\10\277\40\0\10\277\40\0\10\266$\0\7\266$\0" + "\7\266$\0\7\266$\0\7\266$\0\7\266$\0\7\252\0\0\3\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\237\40\0" + "\10\256\33\0\23\256\33\0\23\252\34\0\22\252\34\0\22\252\34\0\22\252\34" + "\0\22\252\34\0\22\252\34\0\22\252\34\0\22\252\34\0\22\252\34\0\22\252" + "\34\0\22\277\40\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\25\0\14\260\32\0\35\260\32\0\35" + "\260\32\0\35\260\32\0\35\260\32\0\35\260\32\0\35\260\32\0\35\260\32\0" + "\35\255\33\0\34\255\33\0\34\255\33\0\34\255\33\0\34\261\24\0\15\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\277\40\0\20\263\32\0(\263\32\0(\263\32\0(\263\32\0(\261\32\0'" + "\261\32\0'\261\32\0'\261\32\0'\261\32\0'\261\32\0'\261\32\0'\261\32\0" + "'\270\34\0\22\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\252\30\0\25\257\31\0""3\263\32\0""2\263\32\0" + "2\263\32\0""2\263\32\0""2\263\32\0""2\263\32\0""2\263\32\0""2\263\32" + "\0""2\263\32\0""2\261\32\0""1\261\32\0""1\261\26\0\27\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255" + "\24\0\31\260\31\0=\260\31\0=\260\31\0=\260\31\0=\260\31\0=\260\31\0=" + "\260\31\0=\256\32\0<\256\32\0<\256\32\0<\256\32\0<\256\32\0<\255\33\0" + "\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\263\21\0\36\261\25\0H\261\25\0H\261\25\0H\260\26\0G\260" + "\26\0G\260\26\0G\260\26\0G\260\26\0G\260\26\0G\260\26\0G\260\26\0G\260" + "\26\0G\262\27\0!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255\27\0\"\261\26\0R\261\26\0R\261\26\0" + "R\261\26\0R\261\26\0R\261\26\0R\261\26\0R\261\26\0R\261\26\0R\260\26" + "\0Q\260\26\0Q\260\26\0Q\256\24\0&\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\256\24\0&\257\23\0]\257" + "\23\0]\257\23\0]\257\23\0]\257\23\0]\257\26\0\\\257\26\0\\\257\26\0\\" + "\257\26\0\\\257\26\0\\\257\26\0\\\257\26\0\\\262\30\0+\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\262" + "\22\0+\261\24\0h\260\24\0g\260\24\0g\260\24\0g\260\24\0g\260\24\0g\260" + "\24\0g\260\24\0g\260\24\0g\260\24\0g\260\24\0g\257\24\0f\257\25\0""0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\263\20\0/\261\22\0r\261\22\0r\261\22\0r\261\22\0r\261\22" + "\0r\261\22\0r\261\22\0r\260\22\0q\260\22\0q\260\22\0q\260\22\0q\260\22" + "\0q\262\23\0""5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\257\17\0""3\257\20\0}\257\20\0}\257\20\0}" + "\261\20\0|\261\20\0|\261\20\0|\261\20\0|\261\20\0|\261\20\0|\261\20\0" + "|\261\20\0|\261\20\0|\260\22\0:\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\255\22\0\34\260\21\0-\260\21\0-\260\21\0-\260\21\0-\261\20\0R\260" + "\17\0\207\260\17\0\207\260\17\0\207\260\17\0\207\260\17\0\207\260\17" + "\0\207\260\17\0\207\260\17\0\207\260\17\0\207\257\17\0\206\257\17\0\206" + "\257\17\0\206\260\17\0W\260\21\0-\260\21\0-\260\21\0-\260\21\0-\260\22" + "\0\35\261\24\0\15\256\15\0x\260\16\0\222\260\16\0\222\260\16\0\222\260" + "\16\0\222\260\16\0\222\260\16\0\222\260\16\0\222\260\16\0\222\260\16" + "\0\222\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221" + "\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221\260\16\0\221\257" + "\16\0\220\257\17\0y\257\20\0\20\0\0\0\0\263\0\0\12\256\12\0{\257\13\0" + "\235\257\13\0\235\257\13\0\235\257\13\0\235\257\13\0\235\261\13\0\234" + "\261\13\0\234\261\13\0\234\261\13\0\234\261\13\0\234\261\13\0\234\261" + "\13\0\234\261\13\0\234\261\13\0\234\260\14\0\233\260\14\0\233\260\14" + "\0\233\260\14\0\233\260\14\0~\261\24\0\15\0\0\0\0\0\0\0\0\0\0\0\0\237" + "\0\0\10\260\12\0~\260\13\0\247\260\13\0\247\260\13\0\247\260\13\0\247" + "\260\13\0\247\260\13\0\247\260\13\0\247\260\13\0\247\260\13\0\247\260" + "\13\0\247\261\13\0\246\261\13\0\246\261\13\0\246\261\13\0\246\261\13" + "\0\246\261\13\0\246\261\12\0\202\271\0\0\13\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\252\0\0\6\260\10\0~\260\11\0\262\260\11\0\262\260\11\0" + "\262\260\11\0\262\260\11\0\262\260\12\0\261\260\12\0\261\260\12\0\261" + "\260\12\0\261\260\12\0\261\260\12\0\261\260\12\0\261\260\12\0\261\260" + "\12\0\261\257\12\0\203\277\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\277\0\0\4\257\10\0}\260\10\0\274\260\10\0\274\260" + "\10\0\274\260\10\0\274\260\10\0\274\260\10\0\274\260\10\0\274\260\10" + "\0\274\260\10\0\274\260\10\0\274\260\10\0\273\260\10\0\273\260\10\0\204" + "\266\0\0\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\0\0\2\257\6\0|\260\6\0\307\260\6\0\307\260\6\0\307" + "\260\6\0\307\260\6\0\307\260\6\0\306\260\6\0\306\260\6\0\306\260\6\0" + "\306\260\6\0\306\261\6\0\202\231\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\1" + "\260\4\0x\260\5\0\321\260\5\0\321\260\5\0\321\260\5\0\321\260\5\0\321" + "\260\5\0\321\260\5\0\321\260\5\0\321\260\4\0\201\377\0\0\2\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\261\4\0r\260\3\0\334\260\3\0\334\260" + "\3\0\334\260\3\0\334\260\3\0\334\260\3\0\333\257\4\0}\377\0\0\1\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\257\2\0m\260\3" + "\0\346\260\3\0\346\260\3\0\346\260\3\0\346\260\4\0w\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\260" + "\0\0d\257\1\0\360\260\1\0\361\257\0\0p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\257\0\0\\\257\0\0i\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -250,101 +252,102 @@ static const guint8 gnome_stock_hangup[] = #pragma align 4 (gnome_stock_onhold) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_onhold[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_onhold[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_onhold[] = +static const guint8 gnome_stock_onhold[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\40jj\30\34knQ\35kp\217\33mq\330\35jo\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU\3\33mm/\35joj\34lr\254\33mq\350" - "\34jo\374\27sy\362\20~\207\374\13\207\217\377\35jo\377\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\"" - "fw\17\34jnH\35lp\202\33ns\310\35kq\367\33nr\365\24z\201\364\15\206\217" - "\377\6\220\231\377\1\231\242\377\0\230\242\377\0\227\241\377\2\222\235" - "\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "$mm\16\33ls\247\33ns\337\34ko\374\30sy\361\21\201\210\371\12\215\226" - "\377\3\227\242\377\0\234\247\377\0\233\246\377\1\231\243\377\6\216\230" - "\377\15\204\213\377\24sx\374\34kp\377\2\220\233\377\35jo\377\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32fo\36\35jo\377\7\224" - "\236\377\1\237\252\377\0\240\252\377\0\236\251\377\2\231\244\377\11\215" - "\226\377\17\201\210\376\27pv\371\34jo\375\33gk\370\26TW\341\22EG\324" - "\35jo\377\2\216\230\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\14\13+/G\33lp\373\1\236\251\377\13\213\223\377\22" - "{\203\374\30mr\372\34jn\376\30af\360\23IM\330\15.1\302\4\20\22\255\0" - "\0\0\243\0\0\0\243\4\22\23\256\33ko\373\2\214\225\377\35jo\377\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0x\4\22\23\254\33ko\375" - "\3\227\241\377\35jo\377\21@D\317\12%&\272\2\6\6\247\0\0\0\243\0\0\0\233" - "\0\0\0\232\0\0\0\234\0\0\0\243\0\0\0\237\4\22\23\256\33ko\373\2\212\223" - "\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t" - "\4\22\23\256\33jo\375\3\225\237\377\33im\374\0\0\0\231\0\0\0\237\0\0" - "\0\213\0\0\0c\0\0\0;\0\0\0\30\0\0\0\0\0\0\0:\0\0\0\234\4\22\23\256\33" - "ko\373\2\207\220\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0t\4\22\23\256\33jo\375\3\223\235\377\34ko\371\0\0\0$\0" - "\0\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0:\0\0\0\234\4\22" - "\23\256\33ko\373\2\205\217\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jo\375\3\221\233\377\34lp\366" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0:\0\0\0" - "\234\4\22\23\256\33ko\373\2\202\214\377\35jo\377\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jo\375\3\217\230\377" - "\34lp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0:\0\0\0\234\4\22\23\256\33ko\373\2\200\212\377\35jo\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jn\375\3\215" - "\226\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0:\0\0\0\234\4\22\23\256\33jo\373\2~\207\377\35jo\377\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jn\375" - "\3\212\224\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0:\0\0\0\234\4\22\23\256\33jo\373\2|\204\377\35jo\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33" - "jn\375\3\210\221\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\30mm\25\26QT\216\25UZ\342\31bf\364\35jo\377\2z\202\377\35jo" - "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256" - "\33jn\375\3\206\220\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU" - "\3\32bf\177\35ko\371\24ms\372\13u|\377\10w~\377\12t|\377\2w\177\377\35" - "jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23" - "\256\33jn\375\3\204\215\377\34ko\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0*\26" - "SV\325\27kq\373\5z\202\377\0|\204\377\0z\202\377\0y\201\377\0w\177\377" - "\5t{\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\36lp;\22EH" - "\264\25RV\342\35jo\377\3\202\213\377\34ko\366\0\0\0\0\0\0\0\0\0\0\0O" - "\15""13\275\27jp\373\1{\203\377\0z\203\377\0y\201\377\0x\200\377\0v~" - "\377\0u}\377\11qw\377\33kp\311\0\0\0\0\0\0\0\0\0\0\0\0\31aeG\32gn\350" - "\32lp\370\21tz\375\16x\200\377\20v}\377\3\200\211\377\34ko\366\0\0\0" - "\0\0\0\0%\0\0\0\233\26W]\347\13u{\377\0y\202\377\0x\200\377\0v~\377\0" - "u}\377\0t|\377\6px\377\34jp\366\35lq4\0\0\0\0\0\0\0\12\22GJ\251\33jn" - "\374\13}\203\377\0\206\217\377\0\205\216\377\0\204\214\377\0\202\213" - "\377\7{\203\377\35jo\377\0\0\0\0\0\0\0d\0\0\0\242\26SV\341\21ou\375\0" - "w\177\377\0v~\377\0t|\377\4rz\377\20kr\375\34jn\367\33jmT\0\0\0\0\0\0" - "\0\12\13$&\250\32jn\373\3\204\215\377\0\205\216\377\0\204\215\377\0\203" - "\213\377\0\201\212\377\0\200\210\377\11x\200\377\34lp\346\0\0\0\0\0\0" - "\0D\0\0\0\234\4\22\22\255\31`e\362\32gm\374\27gm\371\32hl\372\34hn\371" - "\34hl\245!kk\37\0\0\0\0\0\0\0\0\0\0\0h\24RX\340\14y\201\377\0\204\215" - "\377\0\203\214\377\0\201\212\377\0\200\211\377\0\177\207\377\3{\204\377" - "\32mq\364\34ipI\0\0\0\0\0\0\0\1\0\0\0G\0\0\0\202\0\0\0\222\5\25\26\225" - "\16""02\200\20@D@3ff\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\230\26W" - "]\347\15w\177\377\0\202\212\377\0\201\211\377\0\177\210\377\1}\206\377" - "\13v|\377\33kp\370\35io\205\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0k\11\40!\261\33hm\373\25jp\372\20pv\374\23lr\372\33in\374\33" - "gm\341\34jnH\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\3\0\0\0A\4\21\21z\16""47\241\23FI\245\25PTy\35ch,\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\40jj\30\34knQ\35kp\217\33mq\330\35jo\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU\3\33mm/\35joj\34lr\254\33mq\350" + "\34jo\374\27sy\362\20~\207\374\13\207\217\377\35jo\377\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\"" + "fw\17\34jnH\35lp\202\33ns\310\35kq\367\33nr\365\24z\201\364\15\206\217" + "\377\6\220\231\377\1\231\242\377\0\230\242\377\0\227\241\377\2\222\235" + "\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "$mm\16\33ls\247\33ns\337\34ko\374\30sy\361\21\201\210\371\12\215\226" + "\377\3\227\242\377\0\234\247\377\0\233\246\377\1\231\243\377\6\216\230" + "\377\15\204\213\377\24sx\374\34kp\377\2\220\233\377\35jo\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32fo\36\35jo\377\7\224" + "\236\377\1\237\252\377\0\240\252\377\0\236\251\377\2\231\244\377\11\215" + "\226\377\17\201\210\376\27pv\371\34jo\375\33gk\370\26TW\341\22EG\324" + "\35jo\377\2\216\230\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\14\13+/G\33lp\373\1\236\251\377\13\213\223\377\22" + "{\203\374\30mr\372\34jn\376\30af\360\23IM\330\15.1\302\4\20\22\255\0" + "\0\0\243\0\0\0\243\4\22\23\256\33ko\373\2\214\225\377\35jo\377\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0x\4\22\23\254\33ko\375" + "\3\227\241\377\35jo\377\21@D\317\12%&\272\2\6\6\247\0\0\0\243\0\0\0\233" + "\0\0\0\232\0\0\0\234\0\0\0\243\0\0\0\237\4\22\23\256\33ko\373\2\212\223" + "\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t" + "\4\22\23\256\33jo\375\3\225\237\377\33im\374\0\0\0\231\0\0\0\237\0\0" + "\0\213\0\0\0c\0\0\0;\0\0\0\30\0\0\0\0\0\0\0:\0\0\0\234\4\22\23\256\33" + "ko\373\2\207\220\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0t\4\22\23\256\33jo\375\3\223\235\377\34ko\371\0\0\0$\0" + "\0\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0:\0\0\0\234\4\22" + "\23\256\33ko\373\2\205\217\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jo\375\3\221\233\377\34lp\366" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0:\0\0\0" + "\234\4\22\23\256\33ko\373\2\202\214\377\35jo\377\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jo\375\3\217\230\377" + "\34lp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0:\0\0\0\234\4\22\23\256\33ko\373\2\200\212\377\35jo\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jn\375\3\215" + "\226\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0:\0\0\0\234\4\22\23\256\33jo\373\2~\207\377\35jo\377\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33jn\375" + "\3\212\224\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0:\0\0\0\234\4\22\23\256\33jo\373\2|\204\377\35jo\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256\33" + "jn\375\3\210\221\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\30mm\25\26QT\216\25UZ\342\31bf\364\35jo\377\2z\202\377\35jo" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23\256" + "\33jn\375\3\206\220\377\34kp\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU" + "\3\32bf\177\35ko\371\24ms\372\13u|\377\10w~\377\12t|\377\2w\177\377\35" + "jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0t\4\22\23" + "\256\33jn\375\3\204\215\377\34ko\366\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0*\26" + "SV\325\27kq\373\5z\202\377\0|\204\377\0z\202\377\0y\201\377\0w\177\377" + "\5t{\377\35jo\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\36lp;\22EH" + "\264\25RV\342\35jo\377\3\202\213\377\34ko\366\0\0\0\0\0\0\0\0\0\0\0O" + "\15""13\275\27jp\373\1{\203\377\0z\203\377\0y\201\377\0x\200\377\0v~" + "\377\0u}\377\11qw\377\33kp\311\0\0\0\0\0\0\0\0\0\0\0\0\31aeG\32gn\350" + "\32lp\370\21tz\375\16x\200\377\20v}\377\3\200\211\377\34ko\366\0\0\0" + "\0\0\0\0%\0\0\0\233\26W]\347\13u{\377\0y\202\377\0x\200\377\0v~\377\0" + "u}\377\0t|\377\6px\377\34jp\366\35lq4\0\0\0\0\0\0\0\12\22GJ\251\33jn" + "\374\13}\203\377\0\206\217\377\0\205\216\377\0\204\214\377\0\202\213" + "\377\7{\203\377\35jo\377\0\0\0\0\0\0\0d\0\0\0\242\26SV\341\21ou\375\0" + "w\177\377\0v~\377\0t|\377\4rz\377\20kr\375\34jn\367\33jmT\0\0\0\0\0\0" + "\0\12\13$&\250\32jn\373\3\204\215\377\0\205\216\377\0\204\215\377\0\203" + "\213\377\0\201\212\377\0\200\210\377\11x\200\377\34lp\346\0\0\0\0\0\0" + "\0D\0\0\0\234\4\22\22\255\31`e\362\32gm\374\27gm\371\32hl\372\34hn\371" + "\34hl\245!kk\37\0\0\0\0\0\0\0\0\0\0\0h\24RX\340\14y\201\377\0\204\215" + "\377\0\203\214\377\0\201\212\377\0\200\211\377\0\177\207\377\3{\204\377" + "\32mq\364\34ipI\0\0\0\0\0\0\0\1\0\0\0G\0\0\0\202\0\0\0\222\5\25\26\225" + "\16""02\200\20@D@3ff\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\230\26W" + "]\347\15w\177\377\0\202\212\377\0\201\211\377\0\177\210\377\1}\206\377" + "\13v|\377\33kp\370\35io\205\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0k\11\40!\261\33hm\373\25jp\372\20pv\374\23lr\372\33in\374\33" + "gm\341\34jnH\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\3\0\0\0A\4\21\21z\16""47\241\23FI\245\25PTy\35ch,\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -352,109 +355,110 @@ static const guint8 gnome_stock_onhold[] = #pragma align 4 (gnome_stock_dial) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_dial[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_dial[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_dial[] = +static const guint8 gnome_stock_dial[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" - "\377\2f\231\\\31\200\257\200\20\377\377\377\2\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\5\377" - "\377\354)\374\374\352J\252\305\230r\316\335\271b\373\373\351G\377\377" - "\360#\377\377\377\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\377\377\377\11\377\377\354D\375\375\337g\375\375\332}\302\325\243" - "\236\334\347\271\222\375\375\332{\374\374\340b\373\373\352=\377\377\377" - "\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\2\210\256zk\347\355" - "\312t\374\374\323\222\374\373\313\257\307\330\243\262\341\351\267\253" - "\374\373\315\254\373\373\326\216\333\346\300r\204\255y]\0\0\0\0\0\0\0" - "\0\24v\0\15\27\200\0\247\30\200\0\270\30~\0\270\26~\0i\0\0\0\0$m\0\7" - "\26\200\0\241\30\200\0\270\30~\0\270\30~\0u\377\377\363\26\355\365\325" - "b\211\266o\335\231\276w\354\236\311\200\335\240\312\205\266\375\375\337" - "p\362\366\315\213\270\316\223\302\257\310\222\242\363\366\334X\377\377" - "\353\15\0\0\0\0\24z\0d\40\231\0\377!\232\0\377\40\226\0\377\30~\0\323" - "\0\0\0\0\24w\0M\37\225\0\375!\232\0\377\40\226\0\377\30\201\0\334\377" - "\377\356-\311\336\256\215\255\324\206\373\223\312q\377q\274T\377R\242" - ";\351\345\360\317E\365\367\331e\353\360\304\230\374\374\321\233\375\375" - "\337g\377\377\357\40\0\0\0\0\27|\0m\35\221\0\377\36\217\0\377\35\212" - "\0\377\26z\0\325\0\0\0\0\25w\0V\34\214\0\377\36\217\0\377\35\213\0\377" - "\27{\0\337\377\377\3545\310\336\253\225\264\326\213\373\216\306m\377" - "_\255E\377.\211\27\347\266\325\252*\374\374\346S\373\373\326\211\374" - "\372\317\243\375\375\336m\377\377\354(\0\0\0\0\25y\0c\34\206\0\377\34" - "\204\0\377\33\177\0\377\26v\0\321\0\0\0\0\24w\0K\33\204\0\374\34\204" - "\0\377\33\200\0\377\26w\0\333\377\377\356-\314\340\260\213\253\317\206" - "\372\203\266e\377l\254R\377P\232:\350\345\360\322D\351\356\316h\307\330" - "\246\244\374\374\321\233\375\375\337g\377\377\357\40\0\0\0\0\34q\0\11" - "\25w\0\235\25v\0\255\25t\0\255\25r\0b\0\0\0\0\0f\0\5\24v\0\227\25v\0" - "\255\25t\0\255\23p\0m\377\377\363\26\276\325\254r\204\260k\334\257\313" - "\211\346\241\306\204\327\234\300\201\266\361\366\326q\373\373\327\207" - "\324\341\254\270\237\275\206\252\313\334\267g\377\377\377\15\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\377\377\377\2\247\304\231Z\375\375\336m\374\374" - "\324\223\374\373\313\260\310\330\243\261\341\351\267\253\374\373\313" - "\255\373\373\324\217\370\372\333i\237\277\217P\0\0\0\0\0\0\0\0\0\0\0" - "\0\26y\0""9\23|\0P\23|\0P\24z\0\31\0\0\0\0\0\0\0\0\24x\0""3\23|\0P\23" - "|\0P\21w\0\36\0\0\0\0\377\377\346\12\262\320\236f\263\323\230\227\305" - "\337\245\247\262\315\226\254\335\347\272\224\375\375\332|\374\374\340" - "c\373\373\357>\377\377\377\5\0\0\0\0\0\0\0\0\25w\0<\34\217\0\365\37\225" - "\0\377\36\222\0\377\30~\0\316\0\0\0\0\23s\0(\33\214\0\360\37\225\0\377" - "\36\222\0\377\30\200\0\330\0\0\0\0\24v\0\32\40\213\5\352E\250(\377`\261" - "E\377_\242I\355\311\332\261h\373\373\352H\377\377\361%\377\377\377\3" - "\0\0\0\0\0\0\0\0\0\0\0\0\25w\0V\35\221\0\377\37\223\0\377\36\217\0\377" - "\30}\0\327\0\0\0\0\21s\0<\34\217\0\377\37\223\0\377\36\217\0\377\30~" - "\0\337\0\0\0\0\21q\0-\34\215\0\364\37\224\0\377!\220\3\377!\203\13\347" - "X\235N\32\377\377\377\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\25w\0" - "V\34\210\0\377\35\210\0\377\34\204\0\377\27y\0\327\0\0\0\0\21s\0<\33" - "\207\0\377\35\210\0\377\34\204\0\377\27x\0\337\0\0\0\0\21q\0-\33\206" - "\0\364\35\211\0\377\34\204\0\377\27y\0\345\21w\0\17\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20s\0\37\27x\0\325\26w\0\337\25u\0\337" - "\25t\0\251\0\0\0\0\15s\0\24\26x\0\322\26w\0\337\25v\0\337\25s\0\266\0" - "\0\0\0\25j\0\14\27w\0\314\26w\0\337\25v\0\337\24t\0\300\0\200\0\2\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\20x\0\40\31\204\0\316\32\210\0\322\32\206\0\322" - "\27\177\0\243\0\0\0\0\15s\0\24\30\204\0\313\32\210\0\322\32\206\0\322" - "\26}\0\257\0\0\0\0\25j\0\14\27\203\0\306\32\210\0\322\32\206\0\322\30" - "\200\0\266\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\27" - "|\0m\36\224\0\377\40\227\0\377\37\222\0\377\30\177\0\327\0\0\0\0\24t" - "\0K\35\222\0\377\40\227\0\377\37\223\0\377\30\200\0\337\0\0\0\0\21q\0" - "-\35\220\0\364\40\230\0\377\37\223\0\377\32\201\0\345\21w\0\17\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\27|\0m\35\213\0\377\36\214" - "\0\377\35\207\0\377\30z\0\327\0\0\0\0\24t\0K\34\212\0\377\36\214\0\377" - "\35\210\0\377\27z\0\337\0\0\0\0\21q\0-\33\210\0\364\36\215\0\377\35\210" - "\0\377\30|\0\345\21w\0\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\24w\0K\32~\0\367\32\177\0\377\32z\0\377\25u\0\315\0\0\0\0\24u\0" - "2\30}\0\363\32\177\0\377\32{\0\377\24u\0\327\0\0\0\0\22r\0\35\30}\0\352" - "\32\200\0\377\32{\0\377\26u\0\336$m\0\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\27v\0C\23r\0`\23r\0`\22r\0\35\0\0\0\0\0\0" - "\0\0\25q\0=\23r\0`\23r\0`\16q\0$\0\0\0\0\0\0\0\0\27r\0""8\23r\0`\23r" - "\0`\22w\0+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" + "\377\2f\231\\\31\200\257\200\20\377\377\377\2\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\5\377" + "\377\354)\374\374\352J\252\305\230r\316\335\271b\373\373\351G\377\377" + "\360#\377\377\377\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\377\377\377\11\377\377\354D\375\375\337g\375\375\332}\302\325\243" + "\236\334\347\271\222\375\375\332{\374\374\340b\373\373\352=\377\377\377" + "\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\2\210\256zk\347\355" + "\312t\374\374\323\222\374\373\313\257\307\330\243\262\341\351\267\253" + "\374\373\315\254\373\373\326\216\333\346\300r\204\255y]\0\0\0\0\0\0\0" + "\0\24v\0\15\27\200\0\247\30\200\0\270\30~\0\270\26~\0i\0\0\0\0$m\0\7" + "\26\200\0\241\30\200\0\270\30~\0\270\30~\0u\377\377\363\26\355\365\325" + "b\211\266o\335\231\276w\354\236\311\200\335\240\312\205\266\375\375\337" + "p\362\366\315\213\270\316\223\302\257\310\222\242\363\366\334X\377\377" + "\353\15\0\0\0\0\24z\0d\40\231\0\377!\232\0\377\40\226\0\377\30~\0\323" + "\0\0\0\0\24w\0M\37\225\0\375!\232\0\377\40\226\0\377\30\201\0\334\377" + "\377\356-\311\336\256\215\255\324\206\373\223\312q\377q\274T\377R\242" + ";\351\345\360\317E\365\367\331e\353\360\304\230\374\374\321\233\375\375" + "\337g\377\377\357\40\0\0\0\0\27|\0m\35\221\0\377\36\217\0\377\35\212" + "\0\377\26z\0\325\0\0\0\0\25w\0V\34\214\0\377\36\217\0\377\35\213\0\377" + "\27{\0\337\377\377\3545\310\336\253\225\264\326\213\373\216\306m\377" + "_\255E\377.\211\27\347\266\325\252*\374\374\346S\373\373\326\211\374" + "\372\317\243\375\375\336m\377\377\354(\0\0\0\0\25y\0c\34\206\0\377\34" + "\204\0\377\33\177\0\377\26v\0\321\0\0\0\0\24w\0K\33\204\0\374\34\204" + "\0\377\33\200\0\377\26w\0\333\377\377\356-\314\340\260\213\253\317\206" + "\372\203\266e\377l\254R\377P\232:\350\345\360\322D\351\356\316h\307\330" + "\246\244\374\374\321\233\375\375\337g\377\377\357\40\0\0\0\0\34q\0\11" + "\25w\0\235\25v\0\255\25t\0\255\25r\0b\0\0\0\0\0f\0\5\24v\0\227\25v\0" + "\255\25t\0\255\23p\0m\377\377\363\26\276\325\254r\204\260k\334\257\313" + "\211\346\241\306\204\327\234\300\201\266\361\366\326q\373\373\327\207" + "\324\341\254\270\237\275\206\252\313\334\267g\377\377\377\15\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\377\377\377\2\247\304\231Z\375\375\336m\374\374" + "\324\223\374\373\313\260\310\330\243\261\341\351\267\253\374\373\313" + "\255\373\373\324\217\370\372\333i\237\277\217P\0\0\0\0\0\0\0\0\0\0\0" + "\0\26y\0""9\23|\0P\23|\0P\24z\0\31\0\0\0\0\0\0\0\0\24x\0""3\23|\0P\23" + "|\0P\21w\0\36\0\0\0\0\377\377\346\12\262\320\236f\263\323\230\227\305" + "\337\245\247\262\315\226\254\335\347\272\224\375\375\332|\374\374\340" + "c\373\373\357>\377\377\377\5\0\0\0\0\0\0\0\0\25w\0<\34\217\0\365\37\225" + "\0\377\36\222\0\377\30~\0\316\0\0\0\0\23s\0(\33\214\0\360\37\225\0\377" + "\36\222\0\377\30\200\0\330\0\0\0\0\24v\0\32\40\213\5\352E\250(\377`\261" + "E\377_\242I\355\311\332\261h\373\373\352H\377\377\361%\377\377\377\3" + "\0\0\0\0\0\0\0\0\0\0\0\0\25w\0V\35\221\0\377\37\223\0\377\36\217\0\377" + "\30}\0\327\0\0\0\0\21s\0<\34\217\0\377\37\223\0\377\36\217\0\377\30~" + "\0\337\0\0\0\0\21q\0-\34\215\0\364\37\224\0\377!\220\3\377!\203\13\347" + "X\235N\32\377\377\377\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\25w\0" + "V\34\210\0\377\35\210\0\377\34\204\0\377\27y\0\327\0\0\0\0\21s\0<\33" + "\207\0\377\35\210\0\377\34\204\0\377\27x\0\337\0\0\0\0\21q\0-\33\206" + "\0\364\35\211\0\377\34\204\0\377\27y\0\345\21w\0\17\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20s\0\37\27x\0\325\26w\0\337\25u\0\337" + "\25t\0\251\0\0\0\0\15s\0\24\26x\0\322\26w\0\337\25v\0\337\25s\0\266\0" + "\0\0\0\25j\0\14\27w\0\314\26w\0\337\25v\0\337\24t\0\300\0\200\0\2\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\20x\0\40\31\204\0\316\32\210\0\322\32\206\0\322" + "\27\177\0\243\0\0\0\0\15s\0\24\30\204\0\313\32\210\0\322\32\206\0\322" + "\26}\0\257\0\0\0\0\25j\0\14\27\203\0\306\32\210\0\322\32\206\0\322\30" + "\200\0\266\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\27" + "|\0m\36\224\0\377\40\227\0\377\37\222\0\377\30\177\0\327\0\0\0\0\24t" + "\0K\35\222\0\377\40\227\0\377\37\223\0\377\30\200\0\337\0\0\0\0\21q\0" + "-\35\220\0\364\40\230\0\377\37\223\0\377\32\201\0\345\21w\0\17\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\27|\0m\35\213\0\377\36\214" + "\0\377\35\207\0\377\30z\0\327\0\0\0\0\24t\0K\34\212\0\377\36\214\0\377" + "\35\210\0\377\27z\0\337\0\0\0\0\21q\0-\33\210\0\364\36\215\0\377\35\210" + "\0\377\30|\0\345\21w\0\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\24w\0K\32~\0\367\32\177\0\377\32z\0\377\25u\0\315\0\0\0\0\24u\0" + "2\30}\0\363\32\177\0\377\32{\0\377\24u\0\327\0\0\0\0\22r\0\35\30}\0\352" + "\32\200\0\377\32{\0\377\26u\0\336$m\0\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\27v\0C\23r\0`\23r\0`\22r\0\35\0\0\0\0\0\0" + "\0\0\25q\0=\23r\0`\23r\0`\16q\0$\0\0\0\0\0\0\0\0\27r\0""8\23r\0`\23r" + "\0`\22w\0+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -462,104 +466,105 @@ static const guint8 gnome_stock_dial[] = #pragma align 4 (gnome_stock_transfer) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_transfer[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_transfer[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_transfer[] = +static const guint8 gnome_stock_transfer[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\21i\377=\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\21i\377\210\24h\377@\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\21i\377\210\22h\377\232\24i\3773\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\21i\377\210\22i\377\234\23h\377\237\22k\377+\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\21i\377\210\22i\377\234\22h\377\246\21h\377\247\17d\377" - "!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\377\4\27]\377" - "\13\17i\377\21\26o\377\27\22j\377\35\16c\377$\22e\377+\25h\3771\23k\377" - "7\20g\377>\23i\377D\21k\377J\20i\377P\22h\377\216\22i\377\234\22h\377" - "\246\21h\377\261\22h\377\246\27h\377\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<" - "\22h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22" - "h\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22i\377\250" - "\17i\377\21\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0m\377\7\16c\377\22\22d\377" - "\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22" - "h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21h\377" - "\261\22h\377\273\22h\377\306\23h\377\244\34U\377\11\0\0\0\0\0\0\0\0\0" - "\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22h" - "\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h\377" - "\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306\22h" - "\377\321\21h\377\230\0f\377\5\0\0\0\0\0\0\0\0\0m\377\7\16c\377\22\22" - "d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377" - "g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21" - "h\377\261\22h\377\273\22h\377\306\22h\377\321\21h\377\333\21g\377\224" - "\0\0\377\1\0\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21" - "f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377" - "\206\22h\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h" - "\377\306\22h\377\321\21h\377\333\22h\377\346\22h\377\200\0\0\0\0\0m\377" - "\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377" - "Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377" - "\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306\22h\377\321\21h" - "\377\333\22h\377\346\22h\377\361\23h\377n\0m\377\7\16c\377\22\22d\377" - "\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22" - "h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21h\377" - "\261\22h\377\273\22h\377\306\22h\377\321\21h\377\333\22h\377\346\22h" - "\377\361\21h\377v\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21" - "f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377" - "\206\22h\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h" - "\377\306\22h\377\321\21h\377\333\22h\377\346\22g\377\212\0\0\0\0\0m\377" - "\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377" - "Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377" - "\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306\22h\377\321\21h" - "\377\333\21g\377\224\0\0\377\1\0\0\0\0\0m\377\7\16c\377\22\22d\377\34" - "\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22h" - "\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21h\377" - "\261\22h\377\273\22h\377\306\22h\377\321\21h\377\242\0f\377\5\0\0\0\0" - "\0\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22" - "h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h" - "\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306" - "\23h\377\245\24b\377\15\0\0\0\0\0\0\0\0\0\0\0\0\0m\377\7\16c\377\22\22" - "d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377" - "g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21" - "h\377\261\22h\377\273\22i\377\252\17i\377\21\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\200\377\4\27]\377\13\17i\377\21\26o\377\27\22j\377\35\16c" - "\377$\22e\377+\25h\3771\23k\3777\20g\377>\23i\377D\21k\377J\20i\377P" - "\22h\377\216\22i\377\234\22h\377\246\21h\377\261\22h\377\254\22d\377" - "\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\21i\377\210\22i\377\234\22h\377\246\21h\377\247\17i\377\"" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\21i\377\210\22i\377\234\23h\377\242\21i\377.\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\21i\377\210\22h\377\232\22j\377:\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\21i\377\210\24h\377@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\23i\377D\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\21i\377=\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\21i\377\210\24h\377@\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\21i\377\210\22h\377\232\24i\3773\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\21i\377\210\22i\377\234\23h\377\237\22k\377+\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\21i\377\210\22i\377\234\22h\377\246\21h\377\247\17d\377" + "!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\377\4\27]\377" + "\13\17i\377\21\26o\377\27\22j\377\35\16c\377$\22e\377+\25h\3771\23k\377" + "7\20g\377>\23i\377D\21k\377J\20i\377P\22h\377\216\22i\377\234\22h\377" + "\246\21h\377\261\22h\377\246\27h\377\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<" + "\22h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22" + "h\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22i\377\250" + "\17i\377\21\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0m\377\7\16c\377\22\22d\377" + "\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22" + "h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21h\377" + "\261\22h\377\273\22h\377\306\23h\377\244\34U\377\11\0\0\0\0\0\0\0\0\0" + "\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22h" + "\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h\377" + "\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306\22h" + "\377\321\21h\377\230\0f\377\5\0\0\0\0\0\0\0\0\0m\377\7\16c\377\22\22" + "d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377" + "g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21" + "h\377\261\22h\377\273\22h\377\306\22h\377\321\21h\377\333\21g\377\224" + "\0\0\377\1\0\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21" + "f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377" + "\206\22h\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h" + "\377\306\22h\377\321\21h\377\333\22h\377\346\22h\377\200\0\0\0\0\0m\377" + "\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377" + "Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377" + "\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306\22h\377\321\21h" + "\377\333\22h\377\346\22h\377\361\23h\377n\0m\377\7\16c\377\22\22d\377" + "\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22" + "h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21h\377" + "\261\22h\377\273\22h\377\306\22h\377\321\21h\377\333\22h\377\346\22h" + "\377\361\21h\377v\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21" + "f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377" + "\206\22h\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h" + "\377\306\22h\377\321\21h\377\333\22h\377\346\22g\377\212\0\0\0\0\0m\377" + "\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377" + "Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377" + "\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306\22h\377\321\21h" + "\377\333\21g\377\224\0\0\377\1\0\0\0\0\0m\377\7\16c\377\22\22d\377\34" + "\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377g\22h" + "\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21h\377" + "\261\22h\377\273\22h\377\306\22h\377\321\21h\377\242\0f\377\5\0\0\0\0" + "\0\0\0\0\0m\377\7\16c\377\22\22d\377\34\24i\377'\20h\3771\21f\377<\22" + "h\377G\23h\377Q\21i\377\\\21h\377g\22h\377q\23i\377|\21i\377\206\22h" + "\377\221\22i\377\234\22h\377\246\21h\377\261\22h\377\273\22h\377\306" + "\23h\377\245\24b\377\15\0\0\0\0\0\0\0\0\0\0\0\0\0m\377\7\16c\377\22\22" + "d\377\34\24i\377'\20h\3771\21f\377<\22h\377G\23h\377Q\21i\377\\\21h\377" + "g\22h\377q\23i\377|\21i\377\206\22h\377\221\22i\377\234\22h\377\246\21" + "h\377\261\22h\377\273\22i\377\252\17i\377\21\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\200\377\4\27]\377\13\17i\377\21\26o\377\27\22j\377\35\16c" + "\377$\22e\377+\25h\3771\23k\3777\20g\377>\23i\377D\21k\377J\20i\377P" + "\22h\377\216\22i\377\234\22h\377\246\21h\377\261\22h\377\254\22d\377" + "\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\21i\377\210\22i\377\234\22h\377\246\21h\377\247\17i\377\"" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\21i\377\210\22i\377\234\23h\377\242\21i\377.\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\21i\377\210\22h\377\232\22j\377:\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\21i\377\210\24h\377@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\23i\377D\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -568,96 +573,97 @@ static const guint8 gnome_stock_transfer[] = #pragma align 4 (gnome_stock_offhold) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_offhold[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_offhold[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_offhold[] = +static const guint8 gnome_stock_offhold[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0ix\21\0mss\0mr\210\0lt@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "3ff\5\14kqV\14lr\250\0lr}\0mv\34\0\0\0\0\0ht\26\0ls\343\0ls\377\0ls\377" - "\0ls\377\0ms\242\0\200\200\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\34qq\11\33mm/\32kqX\33ms\205\26lq\320\17ou\377\22kp" - "\377\0ls\377\0ls\364\0lq-\0ks\212\0ls\377\0ls\377\0ls\377\0ls\377\0l" - "s\377\0ks\253\0ff\5\0\0\0\0\0\0\0\0\40`p\20\34mm6\35nta\33ms\214\34k" - "p\235\26tz\230\16\202\212\237\5\206\216\324\1\207\217\377\1\205\216\377" - "\21lq\377\0ls\377\0ls\377\0ks\262\0lr\256\0ls\377\0ls\377\0ls\377\0l" - "s\377\0ls\377\3lr\377\11lr\300\32mtn\34ns\222\34lq\234\26y\200\230\15" - "\207\217\240\6\222\233\241\0\233\245\241\0\232\245\241\0\216\226\324" - "\4\201\211\377\10z\200\377\2\203\213\377\21lq\377\0ls\377\0ls\377\0l" - "t\326\0lsv\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\22lq\377\16sy\377" - "\11\202\212\341\5\226\241\243\0\236\251\241\0\236\250\241\2\232\245\241" - "\6\217\230\241\16\202\212\237\20qy\321\21lq\377\17ls\377\22kp\377\2\201" - "\211\377\21kq\377\0ls\377\0ls\377\0ks\235\0\200\200\6\0ls\377\0ls\377" - "\0ls\377\0ls\377\0ls\377\17ls\377\3\210\220\377\1\212\223\377\6\205\215" - "\342\16\201\211\240\27rw\230\35ko\236\33lt\206\15lq\266\6ls\377\1ls\377" - "\0ls\377\21lq\377\2\177\207\377\21kq\377\0ls\377\0lr\341\0ju\30\0\0\0" - "\0\0pp\20\0ms\312\0ls\377\0ls\377\0ls\377\17ls\377\3\207\216\377\22k" - "p\377\15ms\377\13mr\314\26ot.$mm\7\0lr\223\0ls\377\0ls\377\0ls\377\0" - "ls\377\21lq\377\2~\206\377\21kq\377\0ls\340\0lt!\0\0\0\0\0\0\0\0\0\0" - "\0\0\0fw\17\0ls\307\0ls\377\0ls\377\17ls\377\3\205\216\377\22kp\377\0" - "ls\377\0ls\377\0ls\266\0kr\230\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377" - "\21lq\377\2}\204\377\22kq\362\0pp\40\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0fw\17\0ks\305\0ls\377\17ls\377\3\204\214\377\22kp\377\0ls\377" - "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\21l" - "q\377\2|\204\362\32ko\247\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0mm\16\0lr\304\17ls\377\3\202\213\377\22kp\377\0ls\377\0" - "ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\22lp\361" - "\3~\210\254\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0vv\15\21ls\345\3\201\211\377\22kp\377\0ls\377\0ls\377" - "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\332\32lo\247\3\177" - "\210\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\32mr\224\3\201\211\351\22kp\377\0ls\377\0ls\377" - "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0mt\332\0hq\33\34lo\234\3}\205" - "\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\33lq\220\3\201\211\335\22kp\377\0ls\377\0ls\377\0ls" - "\377\0ls\377\0ls\377\0ls\377\0ls\377\0ms\305\0f\200\12\34lo\234\3z\203" - "\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0UU\3\22lr\326\3}\205\377\22kp\377\0ls\377\0ls\377\0ls\377\0" - "ls\377\0ls\377\0ls\377\4ls\377\12lr\377\17mq\337\34ko\245\3x\200\241" - "\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U" - "U\3\0ks\244\17lr\377\3|\204\377\22kp\377\0ls\377\0ls\377\0ls\377\0ls" - "\377\3ls\377\16lq\377\17lr\377\11rx\377\5sz\377\7rx\351\3w\177\245\35" - "ko\236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU\3\0ls\246" - "\0ls\377\17kr\377\3{\202\377\22kp\377\0ls\377\0ls\377\0ls\377\2ls\377" - "\20lq\377\10rx\377\0v}\377\0u}\377\0t{\377\0sz\377\3rx\351\34jo\246\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\4\3ls\257\10lr\377\13" - "lr\377\22kp\377\3y\201\377\22kp\377\0ls\377\0ls\377\0ls\324\16lr\333" - "\10ry\377\0v}\377\0t|\377\0t{\377\0sz\377\0ry\377\6nv\377\16kr\337\0" - "fw\17\0\0\0\0\0\0\0\0\0\0\0\0\22mm\16\16lr\315\21lr\377\13qx\377\6v}" - "\377\10u{\377\2y\201\377\22kp\377\0ls\377\0ls\317\0ht\26\35kp\240\1u" - "|\344\0t{\377\0sz\377\0ry\377\0qx\377\4ov\377\20kq\377\3ls\377\0ls\307" - "\0fw\17\0\0\0\0\40\200\200\10\22lr\331\13qy\377\1}\204\377\0|\204\377" - "\0{\202\377\0z\202\377\1x\177\377\22kp\377\0ls\316\0ky\23\0\0\0\0\35" - "kp\217\13sy\242\1t|\343\0qx\377\4pv\377\13mt\377\20kp\377\4kr\377\0l" - "s\377\0ls\377\0ls\377\0\200\200\6\17mr\233\12ry\377\0}\204\377\0{\203" - "\377\0{\202\377\0y\201\377\0y\200\377\4u|\377\17lq\347\0qq\22\0\0\0\0" - "\0\0\0\0\34hq\33\32lp\200\34kp\235\23kp\341\17lq\377\11lr\377\1ks\377" - "\0ls\377\0ls\377\0ls\377\0ls\377\0lt\213\23kr\333\3y\201\377\0{\202\377" - "\0z\201\377\0y\200\377\0x\177\377\3v|\377\21jr\353\23mv6\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0mr\260\0ls\377\0ls" - "\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\322\22lr\313\10s{\377\0y\200" - "\377\0x\200\377\2v}\377\11qw\377\21kq\353\27koL\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0ls\255\0ls\377" - "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\273\14jnA\17lq\370\21kq\377\20k" - "r\377\20lq\377\15kr\335\24bo'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ff\5\0lt\252\0ls\377\0ls\377" - "\0ls\377\0ls\374\0ksE\0\0\0\0\0lq-\2ms\242\1ls\275\0lrt\0tt\13\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0lrU\0mt\267\0lt\254\0js<\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0ix\21\0mss\0mr\210\0lt@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "3ff\5\14kqV\14lr\250\0lr}\0mv\34\0\0\0\0\0ht\26\0ls\343\0ls\377\0ls\377" + "\0ls\377\0ms\242\0\200\200\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\34qq\11\33mm/\32kqX\33ms\205\26lq\320\17ou\377\22kp" + "\377\0ls\377\0ls\364\0lq-\0ks\212\0ls\377\0ls\377\0ls\377\0ls\377\0l" + "s\377\0ks\253\0ff\5\0\0\0\0\0\0\0\0\40`p\20\34mm6\35nta\33ms\214\34k" + "p\235\26tz\230\16\202\212\237\5\206\216\324\1\207\217\377\1\205\216\377" + "\21lq\377\0ls\377\0ls\377\0ks\262\0lr\256\0ls\377\0ls\377\0ls\377\0l" + "s\377\0ls\377\3lr\377\11lr\300\32mtn\34ns\222\34lq\234\26y\200\230\15" + "\207\217\240\6\222\233\241\0\233\245\241\0\232\245\241\0\216\226\324" + "\4\201\211\377\10z\200\377\2\203\213\377\21lq\377\0ls\377\0ls\377\0l" + "t\326\0lsv\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\22lq\377\16sy\377" + "\11\202\212\341\5\226\241\243\0\236\251\241\0\236\250\241\2\232\245\241" + "\6\217\230\241\16\202\212\237\20qy\321\21lq\377\17ls\377\22kp\377\2\201" + "\211\377\21kq\377\0ls\377\0ls\377\0ks\235\0\200\200\6\0ls\377\0ls\377" + "\0ls\377\0ls\377\0ls\377\17ls\377\3\210\220\377\1\212\223\377\6\205\215" + "\342\16\201\211\240\27rw\230\35ko\236\33lt\206\15lq\266\6ls\377\1ls\377" + "\0ls\377\21lq\377\2\177\207\377\21kq\377\0ls\377\0lr\341\0ju\30\0\0\0" + "\0\0pp\20\0ms\312\0ls\377\0ls\377\0ls\377\17ls\377\3\207\216\377\22k" + "p\377\15ms\377\13mr\314\26ot.$mm\7\0lr\223\0ls\377\0ls\377\0ls\377\0" + "ls\377\21lq\377\2~\206\377\21kq\377\0ls\340\0lt!\0\0\0\0\0\0\0\0\0\0" + "\0\0\0fw\17\0ls\307\0ls\377\0ls\377\17ls\377\3\205\216\377\22kp\377\0" + "ls\377\0ls\377\0ls\266\0kr\230\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377" + "\21lq\377\2}\204\377\22kq\362\0pp\40\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0fw\17\0ks\305\0ls\377\17ls\377\3\204\214\377\22kp\377\0ls\377" + "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\21l" + "q\377\2|\204\362\32ko\247\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0mm\16\0lr\304\17ls\377\3\202\213\377\22kp\377\0ls\377\0" + "ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\22lp\361" + "\3~\210\254\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0vv\15\21ls\345\3\201\211\377\22kp\377\0ls\377\0ls\377" + "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\332\32lo\247\3\177" + "\210\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\32mr\224\3\201\211\351\22kp\377\0ls\377\0ls\377" + "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0mt\332\0hq\33\34lo\234\3}\205" + "\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\33lq\220\3\201\211\335\22kp\377\0ls\377\0ls\377\0ls" + "\377\0ls\377\0ls\377\0ls\377\0ls\377\0ms\305\0f\200\12\34lo\234\3z\203" + "\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0UU\3\22lr\326\3}\205\377\22kp\377\0ls\377\0ls\377\0ls\377\0" + "ls\377\0ls\377\0ls\377\4ls\377\12lr\377\17mq\337\34ko\245\3x\200\241" + "\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U" + "U\3\0ks\244\17lr\377\3|\204\377\22kp\377\0ls\377\0ls\377\0ls\377\0ls" + "\377\3ls\377\16lq\377\17lr\377\11rx\377\5sz\377\7rx\351\3w\177\245\35" + "ko\236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU\3\0ls\246" + "\0ls\377\17kr\377\3{\202\377\22kp\377\0ls\377\0ls\377\0ls\377\2ls\377" + "\20lq\377\10rx\377\0v}\377\0u}\377\0t{\377\0sz\377\3rx\351\34jo\246\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\4\3ls\257\10lr\377\13" + "lr\377\22kp\377\3y\201\377\22kp\377\0ls\377\0ls\377\0ls\324\16lr\333" + "\10ry\377\0v}\377\0t|\377\0t{\377\0sz\377\0ry\377\6nv\377\16kr\337\0" + "fw\17\0\0\0\0\0\0\0\0\0\0\0\0\22mm\16\16lr\315\21lr\377\13qx\377\6v}" + "\377\10u{\377\2y\201\377\22kp\377\0ls\377\0ls\317\0ht\26\35kp\240\1u" + "|\344\0t{\377\0sz\377\0ry\377\0qx\377\4ov\377\20kq\377\3ls\377\0ls\307" + "\0fw\17\0\0\0\0\40\200\200\10\22lr\331\13qy\377\1}\204\377\0|\204\377" + "\0{\202\377\0z\202\377\1x\177\377\22kp\377\0ls\316\0ky\23\0\0\0\0\35" + "kp\217\13sy\242\1t|\343\0qx\377\4pv\377\13mt\377\20kp\377\4kr\377\0l" + "s\377\0ls\377\0ls\377\0\200\200\6\17mr\233\12ry\377\0}\204\377\0{\203" + "\377\0{\202\377\0y\201\377\0y\200\377\4u|\377\17lq\347\0qq\22\0\0\0\0" + "\0\0\0\0\34hq\33\32lp\200\34kp\235\23kp\341\17lq\377\11lr\377\1ks\377" + "\0ls\377\0ls\377\0ls\377\0ls\377\0lt\213\23kr\333\3y\201\377\0{\202\377" + "\0z\201\377\0y\200\377\0x\177\377\3v|\377\21jr\353\23mv6\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0mr\260\0ls\377\0ls" + "\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\322\22lr\313\10s{\377\0y\200" + "\377\0x\200\377\2v}\377\11qw\377\21kq\353\27koL\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0ls\255\0ls\377" + "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\273\14jnA\17lq\370\21kq\377\20k" + "r\377\20lq\377\15kr\335\24bo'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ff\5\0lt\252\0ls\377\0ls\377" + "\0ls\377\0ls\374\0ksE\0\0\0\0\0lq-\2ms\242\1ls\275\0lrt\0tt\13\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0lrU\0mt\267\0lt\254\0js<\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -666,206 +672,208 @@ static const guint8 gnome_stock_offhold[] = #pragma align 4 (gnome_stock_im) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_im[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_im[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_im[] = +static const guint8 gnome_stock_im[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\4\0\200\0&\0\201\0K\0\200\0" - "^\0\201\0i\0\200\0l\0~\0a\0\200\0P\0\200\0,\0\200\0\10\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\200\0\4\0\200\0N\0\200\0\226\0\177\0\323\0\200\0\334\0\200\0" - "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\177\0\327\0\200\0\241\0\201\0[\0\216\0\11\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\201\0K\0\200\0\301\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\314\0\201\0c\0\200\0\2\0\0\0\0\0\0\0\0\0\0" - "\0\0\0U\0\3\0\177\0\207\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\334\0\200\0\243\0q\0\11\0\0\0\0\0\0\0\0\0" - "\201\0u\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" - "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\232\0\0\0\0\0\205\0" - "\27\0\177\0\327\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" - "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "6\0\200\0D\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" - "\201\0i\0}\0""9\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" - "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\334\0\201\0]\0q\0\11\0\200\0\304\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" - "\200\0\325\0\200\0\34\0\0\0\0\0~\0A\0\177\0\327\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" - "\200\0`\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0B\0\177\0\313\0\200\0\334\0\200" - "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" - "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\324\0~\0[\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0y\0\23\0\200\0|\0\177\0\323\0\200\0\334\0" - "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" - "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" - "\330\0\177\0\215\0\200\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\200\0\16\0~\0M\0\200\0\215\0\200\0\271\0\177" - "\0\331\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\333\0" - "\177\0\277\0\200\0\225\0\200\0X\0y\0\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\26" - "\0\200\0,\0\203\0#\0\237\0\10\0\200\0\26\0|\0#\0\203\0%\0\200\0\30\0" - "\200\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\22\0\201\0\236\0" - "\200\0\315\0\200\0\315\0\200\0\315\0\200\0\277\0\201\0E\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0(\0\200" - "\0\307\0\200\0\315\0\200\0\315\0\200\0\315\0\200\0\315\0\200\0v\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0{\0\33\0\201\0Y\0\201\0q\0\201\0g\0\202\0""7\0\0\0\1\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\4\0~\0{\0\200\0\254" - "\0\200\0\250\0\200\0d\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\0\3\0\201\0k\0\200\0\236\0\177" - "\0\231\0\200\0T\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\4\0\200\0&\0\201\0K\0\200\0" + "^\0\201\0i\0\200\0l\0~\0a\0\200\0P\0\200\0,\0\200\0\10\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\200\0\4\0\200\0N\0\200\0\226\0\177\0\323\0\200\0\334\0\200\0" + "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\177\0\327\0\200\0\241\0\201\0[\0\216\0\11\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\201\0K\0\200\0\301\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\314\0\201\0c\0\200\0\2\0\0\0\0\0\0\0\0\0\0" + "\0\0\0U\0\3\0\177\0\207\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\334\0\200\0\243\0q\0\11\0\0\0\0\0\0\0\0\0" + "\201\0u\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" + "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\232\0\0\0\0\0\205\0" + "\27\0\177\0\327\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" + "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "6\0\200\0D\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" + "\201\0i\0}\0""9\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" + "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\334\0\201\0]\0q\0\11\0\200\0\304\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" + "\200\0\325\0\200\0\34\0\0\0\0\0~\0A\0\177\0\327\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" + "\200\0`\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0B\0\177\0\313\0\200\0\334\0\200" + "\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0" + "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\324\0~\0[\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0y\0\23\0\200\0|\0\177\0\323\0\200\0\334\0" + "\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334" + "\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0" + "\330\0\177\0\215\0\200\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\200\0\16\0~\0M\0\200\0\215\0\200\0\271\0\177" + "\0\331\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\334\0\200\0\333\0" + "\177\0\277\0\200\0\225\0\200\0X\0y\0\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\26" + "\0\200\0,\0\203\0#\0\237\0\10\0\200\0\26\0|\0#\0\203\0%\0\200\0\30\0" + "\200\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\22\0\201\0\236\0" + "\200\0\315\0\200\0\315\0\200\0\315\0\200\0\277\0\201\0E\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0(\0\200" + "\0\307\0\200\0\315\0\200\0\315\0\200\0\315\0\200\0\315\0\200\0v\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0{\0\33\0\201\0Y\0\201\0q\0\201\0g\0\202\0""7\0\0\0\1\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\4\0~\0{\0\200\0\254" + "\0\200\0\250\0\200\0d\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\0\3\0\201\0k\0\200\0\236\0\177" + "\0\231\0\200\0T\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; + - /* GdkPixbuf RGBA C-Source image dump */ #ifdef __SUNPRO_C #pragma align 4 (gnome_stock_call_current) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_call_current[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_call_current[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_call_current[] = +static const guint8 gnome_stock_call_current[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0-\0\0\0" - "/\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\12""8\0\205\21c\0\324\22f\0\326\12" - "-\0k\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\2\0\11\0:\20U\0\262\26\205\0\362\23r\0\364\24}\0\364\20e\0" - "\334\3\30\0J\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0%\20^\0\316\33\241\0\376\32\241\0\377\30\224\0\377\21g\0\364" - "\23w\0\375\17S\0\277\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0=\214U*\0\377\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\20\20^\0\301\30\231\0\377\30\231\0\377\27\216\0\377" - "\24z\0\377\21b\0\363\17_\0\335\0\13\0-\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0<\214Ux:\217U0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15L\0\236\27\220\0\377\27\220\0\377\26\211" - "\0\377\23{\0\377\17]\0\356\17_\0\352\3\32\0M\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0""3\231M\12=\215S\\\0\0\0\0<\215Q/<\214Ux\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7+\0j\25\204\0\363\30\224\0\377" - "\26\211\0\377\24|\0\377\20Y\0\362\16M\0\265\0\5\0""2\0\0\0\0\0\0\0\0" - ":\216TF\0\377\0\1\0\0\0\0<\214T\203\0\0\0\0\0\377\0\1<\215S\245\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0""6\22o\0\332" - "\30\227\0\377\26\215\0\377\21h\0\355\12*\0\206\0\0\0\25\0\0\0\0\0\0\0" - "\0\0\0\0\0;\215R8>\213UB\0\0\0\0;\214S\201\0\0\0\0\0\0\0\0=\215T\244" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\20" - "`\0\305\31\233\0\377\27\220\0\377\24~\0\377\16I\0\250\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0<\216Ts\0\0\0\0;\215TyI\222I\7\0\0\0\0;\215T" - "\243\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\13A\0\212\27\214\0\370\30\224\0\377\26\211\0\377\17\\\0\326\0\0\0\26" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;\215Tt\0\0\0\0;\216Sh;\211X\32\0\0\0" - "\0=\215T\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\11\0""9\22n\0\332\30\227\0\377\26\214\0\377\23s\0\363\12;" - "\0\201\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;\215Tt\0\0\0\0<\216Ts3\231M\12" - "\0\0\0\0=\215T\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\11\17W\0\270\30\225\0\377\27\220\0\377\25\204\0" - "\377\16[\0\330\0\0\0\24\0\0\0\0\0\0\0\0""9\216U\11<\215Sn\0\0\0\0;\214" - "S\201\0\0\0\0\0\0\0\0=\215T\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\33\0T\24t\0\343\30\224\0\377\26" - "\211\0\377\22s\0\364\13=\0\215\0\0\0\0\0\0\0\0<\214SY>\213U!\0\0\0\0" - ";\216T\205\0\0\0\0""9\216U\11<\214T\236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\17Z\0\273\27\221" - "\0\377\26\214\0\377\25\202\0\377\20^\0\337\5\35\0""5\0\0\0\0>\213U!\0" - "\0\0\0+\200U\6<\215U{\0\0\0\0=\214SG;\216S_\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\31\0R\22o\0" - "\341\27\220\0\377\25\205\0\377\23w\0\377\15Q\0\304\0\0\0\12\0\0\0\0\0" - "\0\0\0\0\0\0\0@\200@\4\0\0\0\0;\216T\205;\211X\32\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10" - "\15H\0\233\25\202\0\364\26\211\0\377\24~\0\377\21g\0\357\12@\0\224\0" - "\0\0\5\0\0\0\7\3\25\0J\0\0\0\35\0\0\0\0\0\377\0\1\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\40\20]\0\313\26\211\0\377\25\201\0\377\23w\0\377\20_\0" - "\345\11""1\0\210\16U\0\326\23l\0\346\20`\0\315\4\27\0C\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\27\0N\20d\0\334\25\204\0\377\23z\0\377" - "\21o\0\377\20a\0\357\21k\0\375\23g\0\366\24|\0\375\17Z\0\313\0\7\0#\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\11(\0l\21j\0\342\24~\0\377" - "\22s\0\377\20h\0\377\20b\0\377\20f\0\377\21b\0\365\21m\0\370\13:\0\210" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11\11<\0\210\22i\0" - "\346\23w\0\377\21k\0\377\17a\0\377\17_\0\377\17[\0\373\20d\0\371\16S" - "\0\304\0\0\0\14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15\12" - ";\0\206\21f\0\346\21o\0\377\17d\0\377\17_\0\377\17_\0\377\20Z\0\362\17" - "U\0\316\0\0\0\32\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\15\12""7\0\202\20`\0\340\20h\0\377\17_\0\377\17\\\0\366\20V\0" - "\363\10,\0y\0\0\0\11\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\12\7)\0k\17Z\0\336\16U\0\324\13""9\0\212\0\6\0(\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\4\3\15\0P\0\0\0+\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0-\0\0\0" + "/\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\12""8\0\205\21c\0\324\22f\0\326\12" + "-\0k\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\2\0\11\0:\20U\0\262\26\205\0\362\23r\0\364\24}\0\364\20e\0" + "\334\3\30\0J\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0%\20^\0\316\33\241\0\376\32\241\0\377\30\224\0\377\21g\0\364" + "\23w\0\375\17S\0\277\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0=\214U*\0\377\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\20\20^\0\301\30\231\0\377\30\231\0\377\27\216\0\377" + "\24z\0\377\21b\0\363\17_\0\335\0\13\0-\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0<\214Ux:\217U0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15L\0\236\27\220\0\377\27\220\0\377\26\211" + "\0\377\23{\0\377\17]\0\356\17_\0\352\3\32\0M\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0""3\231M\12=\215S\\\0\0\0\0<\215Q/<\214Ux\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7+\0j\25\204\0\363\30\224\0\377" + "\26\211\0\377\24|\0\377\20Y\0\362\16M\0\265\0\5\0""2\0\0\0\0\0\0\0\0" + ":\216TF\0\377\0\1\0\0\0\0<\214T\203\0\0\0\0\0\377\0\1<\215S\245\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0""6\22o\0\332" + "\30\227\0\377\26\215\0\377\21h\0\355\12*\0\206\0\0\0\25\0\0\0\0\0\0\0" + "\0\0\0\0\0;\215R8>\213UB\0\0\0\0;\214S\201\0\0\0\0\0\0\0\0=\215T\244" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\20" + "`\0\305\31\233\0\377\27\220\0\377\24~\0\377\16I\0\250\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0<\216Ts\0\0\0\0;\215TyI\222I\7\0\0\0\0;\215T" + "\243\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\13A\0\212\27\214\0\370\30\224\0\377\26\211\0\377\17\\\0\326\0\0\0\26" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;\215Tt\0\0\0\0;\216Sh;\211X\32\0\0\0" + "\0=\215T\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\11\0""9\22n\0\332\30\227\0\377\26\214\0\377\23s\0\363\12;" + "\0\201\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;\215Tt\0\0\0\0<\216Ts3\231M\12" + "\0\0\0\0=\215T\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\11\17W\0\270\30\225\0\377\27\220\0\377\25\204\0" + "\377\16[\0\330\0\0\0\24\0\0\0\0\0\0\0\0""9\216U\11<\215Sn\0\0\0\0;\214" + "S\201\0\0\0\0\0\0\0\0=\215T\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\33\0T\24t\0\343\30\224\0\377\26" + "\211\0\377\22s\0\364\13=\0\215\0\0\0\0\0\0\0\0<\214SY>\213U!\0\0\0\0" + ";\216T\205\0\0\0\0""9\216U\11<\214T\236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\17Z\0\273\27\221" + "\0\377\26\214\0\377\25\202\0\377\20^\0\337\5\35\0""5\0\0\0\0>\213U!\0" + "\0\0\0+\200U\6<\215U{\0\0\0\0=\214SG;\216S_\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\31\0R\22o\0" + "\341\27\220\0\377\25\205\0\377\23w\0\377\15Q\0\304\0\0\0\12\0\0\0\0\0" + "\0\0\0\0\0\0\0@\200@\4\0\0\0\0;\216T\205;\211X\32\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10" + "\15H\0\233\25\202\0\364\26\211\0\377\24~\0\377\21g\0\357\12@\0\224\0" + "\0\0\5\0\0\0\7\3\25\0J\0\0\0\35\0\0\0\0\0\377\0\1\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\40\20]\0\313\26\211\0\377\25\201\0\377\23w\0\377\20_\0" + "\345\11""1\0\210\16U\0\326\23l\0\346\20`\0\315\4\27\0C\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\27\0N\20d\0\334\25\204\0\377\23z\0\377" + "\21o\0\377\20a\0\357\21k\0\375\23g\0\366\24|\0\375\17Z\0\313\0\7\0#\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\11(\0l\21j\0\342\24~\0\377" + "\22s\0\377\20h\0\377\20b\0\377\20f\0\377\21b\0\365\21m\0\370\13:\0\210" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11\11<\0\210\22i\0" + "\346\23w\0\377\21k\0\377\17a\0\377\17_\0\377\17[\0\373\20d\0\371\16S" + "\0\304\0\0\0\14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15\12" + ";\0\206\21f\0\346\21o\0\377\17d\0\377\17_\0\377\17_\0\377\20Z\0\362\17" + "U\0\316\0\0\0\32\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\15\12""7\0\202\20`\0\340\20h\0\377\17_\0\377\17\\\0\366\20V\0" + "\363\10,\0y\0\0\0\11\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\12\7)\0k\17Z\0\336\16U\0\324\13""9\0\212\0\6\0(\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\4\3\15\0P\0\0\0+\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -873,134 +881,135 @@ static const guint8 gnome_stock_call_current[] = #pragma align 4 (gnome_stock_addressbook) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_addressbook[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_addressbook[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_addressbook[] = +static const guint8 gnome_stock_addressbook[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0#Q\220n3[\226\3105]\231\3125]\231\3125]\231\312" - "5]\231\3125]\231\3125]\231\3125]\231\3125]\231\3125]\231\3125]\231\312" - "5]\231\3125]\231\3125]\231\3121[\227\306&Q\213X\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\200\200\200\2\227\241\244bGl\237\367\\\202\263\377" - "~\234\301\377~\234\301\377~\234\301\377~\234\301\377~\234\301\377~\234" - "\301\377~\234\301\377~\234\301\377~\234\301\377~\234\301\377~\234\301" - "\377~\234\301\377~\234\301\377r\223\274\3778a\232\332\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\304\304\261\15\307\312\304\312\276\304\310\377Os\246" - "\376\237\263\313\377\334\343\352\377\334\343\352\377\334\343\352\377" - "\334\343\352\377\334\343\352\377\334\343\352\377\334\343\352\377\334" - "\343\352\377\334\343\352\377\334\343\352\377\334\343\352\377\334\343" - "\352\377\333\342\350\377\310\321\332\377=d\234\341\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\331\335\326\301\350\350\345\377f\201\242\264e\211\266" - "\375}\235\304\377\202\241\305\377\202\241\305\377\202\241\305\377\202" - "\241\305\377\202\241\305\377\202\241\305\377\201\240\305\377\201\240" - "\305\377\201\240\305\377\201\240\305\377\201\240\305\377\200\237\304" - "\377\177\236\304\377~\235\303\377Z~\257\374(U\2179\1\0\0\0\0\0\0\0\0" - "\0\0\0\326\330\324\376\326\330\322\373Dj\237\314\221\265\331\377a\215" - "\300\377q\236\316\377r\237\317\377r\237\317\377r\237\317\377r\237\317" - "\377r\237\317\377r\237\317\377r\237\317\377r\237\317\377p\235\315\377" - "o\234\315\377n\233\314\377l\232\313\377k\231\312\377\217\260\326\377" - "7gs\347a\253\32\261Z\251\13D\0\0\0\0\300\303\274\342\323\324\320\377" - "\223\241\255\377\247\257\264\377\257\267\272\377Lv\254\377r\237\317\377" - "r\237\317\377r\237\317\377r\237\317\377r\237\317\377r\237\317\377q\236" - "\316\377o\234\315\377n\233\314\377m\232\313\377k\231\312\377j\230\311" - "\377i\227\311\377\216\260\326\377Gw\200\377\257\347w\377q\267.\306\0" - "\0\0\0\310\313\305\257\275\277\271\377\305\306\303\377\274\276\274\377" - "|\216\237\377_\213\276\377r\237\317\377r\237\317\377r\237\317\377r\237" - "\317\377q\236\316\377p\235\315\377o\234\314\377m\232\313\377l\231\313" - "\377k\230\312\377j\227\311\377h\226\310\377g\225\307\377\213\255\324" - "\377Aut\377\232\342S\377v\2744\306\0\0\0\0\333\335\327\376\333\335\331" - "\374Hm\240\313\216\262\331\377n\233\314\377r\237\317\377r\237\317\377" - "r\237\317\377r\237\317\377\206\254\325\377\304\326\352\377\350\357\367" - "\377\362\366\372\377\344\354\365\377\273\320\346\377x\241\316\377g\225" - "\307\377f\224\307\377e\223\306\377\210\253\323\377Buv\377\237\343\\\377" - "t\2721\305\0\0\0\0\304\306\300\360\320\321\315\377\202\225\251\376\226" - "\247\262\377\230\245\262\377R~\262\377r\237\317\377q\236\316\377\250" - "\303\341\377\373\374\376\377\322\340\357\377\242\276\335\377\221\263" - "\327\377\237\274\334\377\324\341\357\377\367\371\374\377\217\260\325" - "\377d\222\305\377c\221\304\377\206\251\321\377Cux\377\242\343a\377r\271" - "-\305\0\0\0\0\274\277\271\234\276\301\273\377\313\314\310\377\307\310" - "\305\377\231\242\251\377W\203\267\377p\235\315\377\225\266\332\377\372" - "\373\375\377\227\270\332\377k\230\312\377o\232\313\377o\233\312\377g" - "\225\307\377f\223\306\377\244\277\335\377\370\372\374\377p\232\311\377" - "a\217\303\377\202\247\317\377Dlu\376\241\306A\376{\253\26\305\0\0\0\0" - "\337\342\334\375\337\340\333\375Xt\234\331\214\254\315\377p\235\316\377" - "o\234\315\377n\233\314\377\343\354\365\377\264\313\344\377j\227\311\377" - "\251\303\340\377\374\375\376\377\374\375\376\377\332\345\361\377\366" - "\371\374\377b\220\304\377\323\340\356\377\265\312\343\377_\215\301\377" - "\200\245\316\377Sn~\377\352\332l\377\347\322[\366\312\244\10C\311\314" - "\305\365\320\321\314\376r\213\247\372\214\241\267\377y\220\250\377W\202" - "\266\377}\245\320\377\377\377\377\377v\240\316\377z\241\316\377\375\375" - "\376\377\260\310\342\377s\234\312\377\340\351\363\377\366\370\373\377" - "`\216\303\377\246\300\335\377\323\337\356\377\\\213\300\377}\242\314" - "\377Tpw\377\364\342S\377\363\342o\377\311\246\10d\262\264\255\234\306" - "\310\302\377\314\315\311\377\314\315\311\377\257\263\263\377Mx\256\377" - "\214\257\325\377\367\372\374\377g\225\307\377\222\263\327\377\377\377" - "\377\377x\240\315\377b\220\304\377\260\307\341\377\366\370\373\377^\214" - "\301\377\245\277\334\377\317\335\354\377Z\211\277\377{\240\313\377To" - "z\377\364\345d\377\363\342r\377\311\246\10d\337\341\335\371\333\334\327" - "\376h}\231\352\207\242\275\377d\217\300\377i\226\310\377\201\246\321" - "\377\375\376\376\377j\227\310\377\203\250\321\377\377\377\377\377\217" - "\260\324\377`\216\302\377\310\330\352\377\365\370\373\377b\220\302\377" - "\337\350\363\377\246\277\334\377X\207\275\377w\235\311\377To{\377\364" - "\346q\377\362\342q\377\311\246\10d\316\320\312\371\316\321\313\376[z" - "\241\356\200\236\276\377]}\246\377Y\205\272\377f\224\306\377\361\365" - "\372\377\231\267\330\377b\220\303\377\321\337\356\377\366\371\374\377" - "\335\347\362\377\363\367\373\377\374\375\376\377\356\363\370\377\317" - "\335\354\377_\213\300\377V\205\274\377u\233\310\377Tp\200\377\365\350" - "|\377\360\336j\375\311\245\6U\263\266\256\261\314\316\311\377\313\314" - "\311\377\316\320\314\377\272\274\270\377Cm\245\377c\221\305\377\250\301" - "\336\377\356\363\371\377r\233\311\377a\217\302\377\220\257\324\377\221" - "\260\324\377{\241\314\377\230\265\327\377{\240\313\377W\205\274\377U" - "\204\273\377T\203\272\377r\231\306\377Xez\375\343\235N\367\347\240R\364" - "\333z\36\254\336\341\334\362\320\323\316\377z\213\235\366\206\233\260" - "\377[\201\254\377`\216\303\377a\217\303\377a\217\302\377\311\331\352" - "\377\360\364\371\377\233\270\330\377i\223\305\377^\213\300\377w\235\311" - "\377\271\315\343\377\305\325\350\377U\204\273\377S\202\272\377R\201\271" - "\377p\226\305\377_jw\377\371\260C\377\374\272Y\377\345\224E\326\320\322" - "\315\372\317\320\313\374Jn\235\340t\232\306\377Jr\243\377Z\207\274\377" - "_\215\302\377^\214\301\377^\213\300\377\235\271\331\377\347\356\366\377" - "\377\377\377\377\377\377\377\377\375\376\376\377\324\340\356\377~\242" - "\313\377S\202\271\377Q\200\270\377P\177\267\377l\223\302\377^iv\377\371" - "\261G\377\374\267S\377\344\221@\326\267\273\263\306\322\323\317\377\275" - "\300\277\377\306\310\304\377\300\300\275\377\77j\241\377]\213\300\377" - "\\\212\277\377Z\211\277\377Y\210\276\377X\207\275\377g\220\302\377p\227" - "\306\377_\213\276\377S\202\271\377R\201\270\377P\177\267\377O~\267\377" - "N}\266\377j\221\301\377^jy\377\372\271Y\377\374\273\\\377\343\216=\325" - "\333\335\331\336\306\307\304\377\231\243\251\375\226\243\256\377Zz\236" - "\377[\211\275\377`\216\302\377_\215\302\377_\214\301\377]\213\300\377" - "\\\212\277\377[\212\277\377Z\210\276\377Y\207\276\377X\206\275\377W\206" - "\274\377V\205\273\377U\203\272\377T\202\272\377m\225\304\377^l}\377\372" - "\276g\377\374\300f\377\342\2147\324\323\326\321\375\322\324\317\373=" - "g\235\303w\237\314\377N{\261\377a\220\303\377d\222\305\377c\221\305\377" - "b\221\304\377b\220\304\377a\217\303\377a\217\303\377_\216\302\377_\215" - "\302\377^\215\301\377]\214\301\377]\214\301\377\\\212\300\377[\212\277" - "\377s\233\311\377P]u\361\341\2105\314\342\2101\314\331r\23\206\273\275" - "\270\326\323\325\321\377\247\260\265\374\266\272\270\377\272\276\274" - "\377Fp\247\377i\227\311\377i\226\311\377h\226\311\377h\225\310\377h\225" - "\310\377g\225\310\377g\224\310\377f\224\307\377f\223\307\377e\223\307" - "\377e\223\306\377e\222\306\377d\222\306\377z\241\316\377%O\210\273\0" - "\0\0\3\0\0\0\0\0\0\0\0\221\230\221%\251\254\246\343\266\270\270\377\255" - "\263\264\377l\203\234\377c\221\303\377q\236\317\377q\236\317\377q\236" - "\316\377q\236\316\377q\236\316\377p\236\316\377p\236\316\377p\236\316" - "\377p\235\316\377p\235\316\377p\235\316\377p\235\316\377o\235\316\377" - "\177\247\322\377\"H\177\273\0\0\0\36\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\34" - "\30""0R`Qy\253\351e\214\273\364e\214\272\364e\213\272\364e\213\272\364" - "e\213\272\364d\213\272\364d\213\272\364c\212\271\364c\212\271\364b\212" - "\271\364b\212\271\364a\211\271\364a\211\270\364a\210\270\364`\210\270" - "\364Fo\242\344\21\37;J\0\0\0\32\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0#Q\220n3[\226\3105]\231\3125]\231\3125]\231\312" + "5]\231\3125]\231\3125]\231\3125]\231\3125]\231\3125]\231\3125]\231\312" + "5]\231\3125]\231\3125]\231\3121[\227\306&Q\213X\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\200\200\200\2\227\241\244bGl\237\367\\\202\263\377" + "~\234\301\377~\234\301\377~\234\301\377~\234\301\377~\234\301\377~\234" + "\301\377~\234\301\377~\234\301\377~\234\301\377~\234\301\377~\234\301" + "\377~\234\301\377~\234\301\377r\223\274\3778a\232\332\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\304\304\261\15\307\312\304\312\276\304\310\377Os\246" + "\376\237\263\313\377\334\343\352\377\334\343\352\377\334\343\352\377" + "\334\343\352\377\334\343\352\377\334\343\352\377\334\343\352\377\334" + "\343\352\377\334\343\352\377\334\343\352\377\334\343\352\377\334\343" + "\352\377\333\342\350\377\310\321\332\377=d\234\341\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\331\335\326\301\350\350\345\377f\201\242\264e\211\266" + "\375}\235\304\377\202\241\305\377\202\241\305\377\202\241\305\377\202" + "\241\305\377\202\241\305\377\202\241\305\377\201\240\305\377\201\240" + "\305\377\201\240\305\377\201\240\305\377\201\240\305\377\200\237\304" + "\377\177\236\304\377~\235\303\377Z~\257\374(U\2179\1\0\0\0\0\0\0\0\0" + "\0\0\0\326\330\324\376\326\330\322\373Dj\237\314\221\265\331\377a\215" + "\300\377q\236\316\377r\237\317\377r\237\317\377r\237\317\377r\237\317" + "\377r\237\317\377r\237\317\377r\237\317\377r\237\317\377p\235\315\377" + "o\234\315\377n\233\314\377l\232\313\377k\231\312\377\217\260\326\377" + "7gs\347a\253\32\261Z\251\13D\0\0\0\0\300\303\274\342\323\324\320\377" + "\223\241\255\377\247\257\264\377\257\267\272\377Lv\254\377r\237\317\377" + "r\237\317\377r\237\317\377r\237\317\377r\237\317\377r\237\317\377q\236" + "\316\377o\234\315\377n\233\314\377m\232\313\377k\231\312\377j\230\311" + "\377i\227\311\377\216\260\326\377Gw\200\377\257\347w\377q\267.\306\0" + "\0\0\0\310\313\305\257\275\277\271\377\305\306\303\377\274\276\274\377" + "|\216\237\377_\213\276\377r\237\317\377r\237\317\377r\237\317\377r\237" + "\317\377q\236\316\377p\235\315\377o\234\314\377m\232\313\377l\231\313" + "\377k\230\312\377j\227\311\377h\226\310\377g\225\307\377\213\255\324" + "\377Aut\377\232\342S\377v\2744\306\0\0\0\0\333\335\327\376\333\335\331" + "\374Hm\240\313\216\262\331\377n\233\314\377r\237\317\377r\237\317\377" + "r\237\317\377r\237\317\377\206\254\325\377\304\326\352\377\350\357\367" + "\377\362\366\372\377\344\354\365\377\273\320\346\377x\241\316\377g\225" + "\307\377f\224\307\377e\223\306\377\210\253\323\377Buv\377\237\343\\\377" + "t\2721\305\0\0\0\0\304\306\300\360\320\321\315\377\202\225\251\376\226" + "\247\262\377\230\245\262\377R~\262\377r\237\317\377q\236\316\377\250" + "\303\341\377\373\374\376\377\322\340\357\377\242\276\335\377\221\263" + "\327\377\237\274\334\377\324\341\357\377\367\371\374\377\217\260\325" + "\377d\222\305\377c\221\304\377\206\251\321\377Cux\377\242\343a\377r\271" + "-\305\0\0\0\0\274\277\271\234\276\301\273\377\313\314\310\377\307\310" + "\305\377\231\242\251\377W\203\267\377p\235\315\377\225\266\332\377\372" + "\373\375\377\227\270\332\377k\230\312\377o\232\313\377o\233\312\377g" + "\225\307\377f\223\306\377\244\277\335\377\370\372\374\377p\232\311\377" + "a\217\303\377\202\247\317\377Dlu\376\241\306A\376{\253\26\305\0\0\0\0" + "\337\342\334\375\337\340\333\375Xt\234\331\214\254\315\377p\235\316\377" + "o\234\315\377n\233\314\377\343\354\365\377\264\313\344\377j\227\311\377" + "\251\303\340\377\374\375\376\377\374\375\376\377\332\345\361\377\366" + "\371\374\377b\220\304\377\323\340\356\377\265\312\343\377_\215\301\377" + "\200\245\316\377Sn~\377\352\332l\377\347\322[\366\312\244\10C\311\314" + "\305\365\320\321\314\376r\213\247\372\214\241\267\377y\220\250\377W\202" + "\266\377}\245\320\377\377\377\377\377v\240\316\377z\241\316\377\375\375" + "\376\377\260\310\342\377s\234\312\377\340\351\363\377\366\370\373\377" + "`\216\303\377\246\300\335\377\323\337\356\377\\\213\300\377}\242\314" + "\377Tpw\377\364\342S\377\363\342o\377\311\246\10d\262\264\255\234\306" + "\310\302\377\314\315\311\377\314\315\311\377\257\263\263\377Mx\256\377" + "\214\257\325\377\367\372\374\377g\225\307\377\222\263\327\377\377\377" + "\377\377x\240\315\377b\220\304\377\260\307\341\377\366\370\373\377^\214" + "\301\377\245\277\334\377\317\335\354\377Z\211\277\377{\240\313\377To" + "z\377\364\345d\377\363\342r\377\311\246\10d\337\341\335\371\333\334\327" + "\376h}\231\352\207\242\275\377d\217\300\377i\226\310\377\201\246\321" + "\377\375\376\376\377j\227\310\377\203\250\321\377\377\377\377\377\217" + "\260\324\377`\216\302\377\310\330\352\377\365\370\373\377b\220\302\377" + "\337\350\363\377\246\277\334\377X\207\275\377w\235\311\377To{\377\364" + "\346q\377\362\342q\377\311\246\10d\316\320\312\371\316\321\313\376[z" + "\241\356\200\236\276\377]}\246\377Y\205\272\377f\224\306\377\361\365" + "\372\377\231\267\330\377b\220\303\377\321\337\356\377\366\371\374\377" + "\335\347\362\377\363\367\373\377\374\375\376\377\356\363\370\377\317" + "\335\354\377_\213\300\377V\205\274\377u\233\310\377Tp\200\377\365\350" + "|\377\360\336j\375\311\245\6U\263\266\256\261\314\316\311\377\313\314" + "\311\377\316\320\314\377\272\274\270\377Cm\245\377c\221\305\377\250\301" + "\336\377\356\363\371\377r\233\311\377a\217\302\377\220\257\324\377\221" + "\260\324\377{\241\314\377\230\265\327\377{\240\313\377W\205\274\377U" + "\204\273\377T\203\272\377r\231\306\377Xez\375\343\235N\367\347\240R\364" + "\333z\36\254\336\341\334\362\320\323\316\377z\213\235\366\206\233\260" + "\377[\201\254\377`\216\303\377a\217\303\377a\217\302\377\311\331\352" + "\377\360\364\371\377\233\270\330\377i\223\305\377^\213\300\377w\235\311" + "\377\271\315\343\377\305\325\350\377U\204\273\377S\202\272\377R\201\271" + "\377p\226\305\377_jw\377\371\260C\377\374\272Y\377\345\224E\326\320\322" + "\315\372\317\320\313\374Jn\235\340t\232\306\377Jr\243\377Z\207\274\377" + "_\215\302\377^\214\301\377^\213\300\377\235\271\331\377\347\356\366\377" + "\377\377\377\377\377\377\377\377\375\376\376\377\324\340\356\377~\242" + "\313\377S\202\271\377Q\200\270\377P\177\267\377l\223\302\377^iv\377\371" + "\261G\377\374\267S\377\344\221@\326\267\273\263\306\322\323\317\377\275" + "\300\277\377\306\310\304\377\300\300\275\377\77j\241\377]\213\300\377" + "\\\212\277\377Z\211\277\377Y\210\276\377X\207\275\377g\220\302\377p\227" + "\306\377_\213\276\377S\202\271\377R\201\270\377P\177\267\377O~\267\377" + "N}\266\377j\221\301\377^jy\377\372\271Y\377\374\273\\\377\343\216=\325" + "\333\335\331\336\306\307\304\377\231\243\251\375\226\243\256\377Zz\236" + "\377[\211\275\377`\216\302\377_\215\302\377_\214\301\377]\213\300\377" + "\\\212\277\377[\212\277\377Z\210\276\377Y\207\276\377X\206\275\377W\206" + "\274\377V\205\273\377U\203\272\377T\202\272\377m\225\304\377^l}\377\372" + "\276g\377\374\300f\377\342\2147\324\323\326\321\375\322\324\317\373=" + "g\235\303w\237\314\377N{\261\377a\220\303\377d\222\305\377c\221\305\377" + "b\221\304\377b\220\304\377a\217\303\377a\217\303\377_\216\302\377_\215" + "\302\377^\215\301\377]\214\301\377]\214\301\377\\\212\300\377[\212\277" + "\377s\233\311\377P]u\361\341\2105\314\342\2101\314\331r\23\206\273\275" + "\270\326\323\325\321\377\247\260\265\374\266\272\270\377\272\276\274" + "\377Fp\247\377i\227\311\377i\226\311\377h\226\311\377h\225\310\377h\225" + "\310\377g\225\310\377g\224\310\377f\224\307\377f\223\307\377e\223\307" + "\377e\223\306\377e\222\306\377d\222\306\377z\241\316\377%O\210\273\0" + "\0\0\3\0\0\0\0\0\0\0\0\221\230\221%\251\254\246\343\266\270\270\377\255" + "\263\264\377l\203\234\377c\221\303\377q\236\317\377q\236\317\377q\236" + "\316\377q\236\316\377q\236\316\377p\236\316\377p\236\316\377p\236\316" + "\377p\235\316\377p\235\316\377p\235\316\377p\235\316\377o\235\316\377" + "\177\247\322\377\"H\177\273\0\0\0\36\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\34" + "\30""0R`Qy\253\351e\214\273\364e\214\272\364e\213\272\364e\213\272\364" + "e\213\272\364d\213\272\364d\213\272\364c\212\271\364c\212\271\364b\212" + "\271\364b\212\271\364a\211\271\364a\211\270\364a\210\270\364`\210\270" + "\364Fo\242\344\21\37;J\0\0\0\32\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -1008,109 +1017,110 @@ static const guint8 gnome_stock_addressbook[] = #pragma align 4 (gnome_stock_calls) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_calls[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_calls[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_calls[] = +static const guint8 gnome_stock_calls[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34\0\0\0\2\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\22\11.\0p\20^\0\311\12\77\0\202\0\0\0\13\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34q\34\11\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3" - "\4\14\0>\15Z\0\275\23p\0\365\24w\0\361\24v\0\353\11<\0\210\0\0\0\4\0" - "\0\0\0\0\0\0\0\0\0\0\0\377\377\377\3\377\377\370#\377\377\370H\224\267" - "\207\206\377\377\366U\377\377\3655\377\377\355\16\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\31\0e\22s\0\344\32\241\0\376\31\234\0" - "\377\24y\0\367\22p\0\364\21c\0\335\4\21\0;\0\0\0\0\0\0\0\0\377\377\346" - "\12\377\377\365P\377\377\360{\375\375\360\225\261\312\242\272\375\375" - "\357\234\375\375\360\211\377\377\365h\377\377\370&\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\5\36\0]\24}\0\352\31\234\0\377\31\227\0\377\26" - "\210\0\377\21c\0\363\22o\0\375\14E\0\233\0\0\0\0t\242t\13\275\323\263" - "h\375\375\360\212\376\376\353\267\376\376\350\326\301\325\254\352\376" - "\376\347\340\376\376\352\307\375\375\355\240\360\364\345t\206\260}7\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\21o\0\333\30\225\0\377\27\221" - "\0\377\24\203\0\377\22i\0\375\20d\0\364\15Q\0\300\0\0\0\2\377\377\370" - "&\277\324\261\223\262\313\243\313\357\365\331\335\376\376\354\262\346" - "\356\330\244\375\375\354\245\374\374\351\306\314\335\272\331\256\311" - "\240\263\344\354\327_\377\377\377\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0!\20" - "g\0\313\31\230\0\377\27\216\0\377\25\203\0\377\22o\0\377\17W\0\365\13" - "A\0\244\0\0\0\4\377\377\365N\375\375\360\227\372\373\343\332\315\335" - "\276\275\377\377\362z\377\377\366Y\377\377\365f\336\347\321\240\346\356" - "\322\326\376\376\353\264\377\377\362r\377\377\377\22\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\5\16U\0\261\30\226\0\377\27\221\0\377\25\205\0\377\17" - "Y\0\347\7(\0r\0\0\0\26\377\377\377\1\377\377\364_\375\375\354\243\376" - "\376\347\337\375\375\356\232\377\377\366V\377\377\377\30\377\377\372" - "8\377\377\360{\376\376\352\300\376\376\352\303\377\377\361}\377\377\366" - "\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7-\0l\25\203\0\361\30\225\0\377\26" - "\212\0\377\21^\0\330\0\0\0!\0\0\0\0\377\377\377\1\377\377\364[\375\375" - "\355\240\376\376\350\344\347\356\326\250\377\377\364a\377\377\3724\377" - "\377\370I\351\360\335\211\367\372\345\306\376\376\352\276\377\377\362" - "z\377\377\377\31\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0""3\23m\0\330\31" - "\230\0\377\27\216\0\377\22q\0\361\7""1\0n\0\0\0\0\0\0\0\0\377\377\367" - "=\347\356\333\223\270\320\246\331\321\340\277\314\375\375\357\222\377" - "\377\362x\375\375\361\202\356\363\335\257\276\323\253\351\311\333\272" - "\270\377\377\363i\377\377\377\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\11\17W\0\265\30\226\0\377\27\221\0\377\25\204\0\377\17V\0\314\0\0" - "\0\11\0\0\0\0\272\316\261\32\246\303\234\215\371\372\350\245\376\376" - "\350\324\376\376\351\315\270\317\247\316\376\376\352\303\376\376\347" - "\340\376\376\353\273\324\342\306\224\236\277\224_\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\36\0\\\25{\0\351\30\225\0\377\26\212\0" - "\377\21k\0\354\10/\0b\0\0\0\0\0\0\0\0\377\377\364.\377\377\362s\375\375" - "\357\234\376\376\352\271\273\320\251\325\376\376\352\301\376\376\355" - "\253\375\375\360\207\377\377\366U\377\377\377\7\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32\20a\0\313\30\226\0\377\27\215\0\377" - "\24\202\0\377\17V\0\317\0\0\0\13\0\0\0\0\0\0\0\0\377\377\370#\377\377" - "\364^\377\377\362w\245\302\231\242\377\377\361}\377\377\363k\377\377" - "\367@\377\377\377\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\7,\0m\25|\0\354\27\221\0\377\25\206\0\377\21l\0\360\13" - "=\0\206\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\4\377\377\363\26\230\274" - "\2179\377\377\366\35\377\377\377\13\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\31\20_\0\312\30" - "\221\0\377\26\212\0\377\24\177\0\377\17\\\0\336\5\31\0""3\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\40" - "\0Y\22n\0\341\27\215\0\377\25\203\0\377\23s\0\376\15P\0\305\0\0\0\21" - "\0\0\0\0\0\0\0\7\0\0\0\31\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\10\15G\0\232\24\177\0\363\25\206\0\377\23{\0\377\22i\0\364\15" - "H\0\256\7\25\0I\16U\0\267\21b\0\323\12""1\0i\0\0\0\3\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\40\17[\0\310\26\204\0\376\24\177\0\377\22" - "t\0\377\17`\0\357\20`\0\352\23m\0\367\26\202\0\364\22k\0\337\6#\0X\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\14\0>\20`\0\324\25\177\0" - "\377\23w\0\377\21m\0\377\21j\0\377\24w\0\377\23t\0\370\24\201\0\374\17" - "]\0\311\0\0\0\27\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\35\0Y" - "\20c\0\334\22z\0\377\22p\0\377\20e\0\377\21j\0\377\24y\0\377\21g\0\364" - "\22l\0\347\6\34\0R\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\3\5$\0b\20`\0\334\22s\0\377\20i\0\377\17_\0\377\22l\0\377\22i\0\363" - "\22q\0\377\12;\0z\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\3\5\40\0a\17^\0\331\21j\0\377\17b\0\377\17_\0\377\22b\0\365\17" - "Z\0\336\3\30\0V\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\3\3\26\0R\17X\0\320\20_\0\366\16W\0\327\13C\0\235\0\6\0" - "+\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\11\0<\13""5\0\213\0\5\0""0\0\0\0\2\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34\0\0\0\2\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\22\11.\0p\20^\0\311\12\77\0\202\0\0\0\13\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34q\34\11\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3" + "\4\14\0>\15Z\0\275\23p\0\365\24w\0\361\24v\0\353\11<\0\210\0\0\0\4\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\377\3\377\377\370#\377\377\370H\224\267" + "\207\206\377\377\366U\377\377\3655\377\377\355\16\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\31\0e\22s\0\344\32\241\0\376\31\234\0" + "\377\24y\0\367\22p\0\364\21c\0\335\4\21\0;\0\0\0\0\0\0\0\0\377\377\346" + "\12\377\377\365P\377\377\360{\375\375\360\225\261\312\242\272\375\375" + "\357\234\375\375\360\211\377\377\365h\377\377\370&\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\5\36\0]\24}\0\352\31\234\0\377\31\227\0\377\26" + "\210\0\377\21c\0\363\22o\0\375\14E\0\233\0\0\0\0t\242t\13\275\323\263" + "h\375\375\360\212\376\376\353\267\376\376\350\326\301\325\254\352\376" + "\376\347\340\376\376\352\307\375\375\355\240\360\364\345t\206\260}7\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\21o\0\333\30\225\0\377\27\221" + "\0\377\24\203\0\377\22i\0\375\20d\0\364\15Q\0\300\0\0\0\2\377\377\370" + "&\277\324\261\223\262\313\243\313\357\365\331\335\376\376\354\262\346" + "\356\330\244\375\375\354\245\374\374\351\306\314\335\272\331\256\311" + "\240\263\344\354\327_\377\377\377\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0!\20" + "g\0\313\31\230\0\377\27\216\0\377\25\203\0\377\22o\0\377\17W\0\365\13" + "A\0\244\0\0\0\4\377\377\365N\375\375\360\227\372\373\343\332\315\335" + "\276\275\377\377\362z\377\377\366Y\377\377\365f\336\347\321\240\346\356" + "\322\326\376\376\353\264\377\377\362r\377\377\377\22\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\5\16U\0\261\30\226\0\377\27\221\0\377\25\205\0\377\17" + "Y\0\347\7(\0r\0\0\0\26\377\377\377\1\377\377\364_\375\375\354\243\376" + "\376\347\337\375\375\356\232\377\377\366V\377\377\377\30\377\377\372" + "8\377\377\360{\376\376\352\300\376\376\352\303\377\377\361}\377\377\366" + "\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7-\0l\25\203\0\361\30\225\0\377\26" + "\212\0\377\21^\0\330\0\0\0!\0\0\0\0\377\377\377\1\377\377\364[\375\375" + "\355\240\376\376\350\344\347\356\326\250\377\377\364a\377\377\3724\377" + "\377\370I\351\360\335\211\367\372\345\306\376\376\352\276\377\377\362" + "z\377\377\377\31\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0""3\23m\0\330\31" + "\230\0\377\27\216\0\377\22q\0\361\7""1\0n\0\0\0\0\0\0\0\0\377\377\367" + "=\347\356\333\223\270\320\246\331\321\340\277\314\375\375\357\222\377" + "\377\362x\375\375\361\202\356\363\335\257\276\323\253\351\311\333\272" + "\270\377\377\363i\377\377\377\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\11\17W\0\265\30\226\0\377\27\221\0\377\25\204\0\377\17V\0\314\0\0" + "\0\11\0\0\0\0\272\316\261\32\246\303\234\215\371\372\350\245\376\376" + "\350\324\376\376\351\315\270\317\247\316\376\376\352\303\376\376\347" + "\340\376\376\353\273\324\342\306\224\236\277\224_\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\36\0\\\25{\0\351\30\225\0\377\26\212\0" + "\377\21k\0\354\10/\0b\0\0\0\0\0\0\0\0\377\377\364.\377\377\362s\375\375" + "\357\234\376\376\352\271\273\320\251\325\376\376\352\301\376\376\355" + "\253\375\375\360\207\377\377\366U\377\377\377\7\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32\20a\0\313\30\226\0\377\27\215\0\377" + "\24\202\0\377\17V\0\317\0\0\0\13\0\0\0\0\0\0\0\0\377\377\370#\377\377" + "\364^\377\377\362w\245\302\231\242\377\377\361}\377\377\363k\377\377" + "\367@\377\377\377\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\7,\0m\25|\0\354\27\221\0\377\25\206\0\377\21l\0\360\13" + "=\0\206\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\4\377\377\363\26\230\274" + "\2179\377\377\366\35\377\377\377\13\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\31\20_\0\312\30" + "\221\0\377\26\212\0\377\24\177\0\377\17\\\0\336\5\31\0""3\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\40" + "\0Y\22n\0\341\27\215\0\377\25\203\0\377\23s\0\376\15P\0\305\0\0\0\21" + "\0\0\0\0\0\0\0\7\0\0\0\31\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\10\15G\0\232\24\177\0\363\25\206\0\377\23{\0\377\22i\0\364\15" + "H\0\256\7\25\0I\16U\0\267\21b\0\323\12""1\0i\0\0\0\3\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\40\17[\0\310\26\204\0\376\24\177\0\377\22" + "t\0\377\17`\0\357\20`\0\352\23m\0\367\26\202\0\364\22k\0\337\6#\0X\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\14\0>\20`\0\324\25\177\0" + "\377\23w\0\377\21m\0\377\21j\0\377\24w\0\377\23t\0\370\24\201\0\374\17" + "]\0\311\0\0\0\27\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\35\0Y" + "\20c\0\334\22z\0\377\22p\0\377\20e\0\377\21j\0\377\24y\0\377\21g\0\364" + "\22l\0\347\6\34\0R\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\3\5$\0b\20`\0\334\22s\0\377\20i\0\377\17_\0\377\22l\0\377\22i\0\363" + "\22q\0\377\12;\0z\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\3\5\40\0a\17^\0\331\21j\0\377\17b\0\377\17_\0\377\22b\0\365\17" + "Z\0\336\3\30\0V\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\3\3\26\0R\17X\0\320\20_\0\366\16W\0\327\13C\0\235\0\6\0" + "+\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\11\0<\13""5\0\213\0\5\0""0\0\0\0\2\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; @@ -1120,528 +1130,529 @@ static const guint8 gnome_stock_calls[] = #pragma align 4 (gnome_stock_sflphone) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_sflphone[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_sflphone[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_sflphone[] = +static const guint8 gnome_stock_sflphone[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (14400) */ - "\0\0""8X" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (240) */ - "\0\0\0\360" - /* width (60) */ - "\0\0\0<" - /* height (60) */ - "\0\0\0<" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0++\6\0&+5\0$*[\0%+" - "\203\0%+\240\0%+\254\0%,\273\0%,\273\0%+\263\0$+\250\0%,\222\0%,n\0$" - "+G\0''\32\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0$,#\0$+x\0%,\273\0%+\365\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" - "\377\0%+\330\0%*\227\0%,K\0""33\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0++\6\0%*a\0%,\301\0" - "%+\376\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\26""8=\377+JO\3774QV\377" - ">Z_\377>Z_\3778UZ\3771OT\377\40@F\377\12.3\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\351\0%+\217\0$,#\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\34""9\11\0%*m\0%+\342\0%+\377\0%+\377\0%+\377" - "\6*0\377.LQ\377Unr\377|\217\222\377\226\245\250\377\221\241\244\377~" - "\221\224\377r\206\211\377k\200\203\377g}\200\377q\205\210\377x\213\216" - "\377\206\230\232\377\231\250\252\377\213\234\237\377g}\201\377@\\`\377" - "\25""7<\377\0%+\377\0%+\377\0%+\377\0%+\374\0%+\245\0%,)\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0&*I\0%+\333\0%+\377\0%+\377\0%+\377$DI\377]ux\377\217" - "\237\242\377y\214\220\377Rko\377.MQ\377\25""7<\377\7+1\377\10,2\377\10" - ",2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\14/5\377!BG\377A" - "]a\377g}\200\377\217\237\242\377w\213\216\377\77[_\377\7+1\377\0%+\377" - "\0%+\377\0%+\373\0%+\217\0''\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40""0\20\0&*\251\0%+\377\0%+\377\0%+\377" - ",KP\377u\211\214\377\207\230\233\377Lfj\377\33<A\377\11-2\377\11-2\377" - "\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2" - "\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\12-3\3776TX\377" - "k\200\203\377\215\236\240\377Mgk\377\14/5\377\0%+\377\0%+\377\0%+\346" - "\0$,F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',4\0%+\336\0%" - "+\377\0%+\377\26""8=\377o\204\207\377\203\225\230\377<Y]\377\13/4\377" - "\11-2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2" - "\377\10,2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377" - "\7+1\377\7+1\377\7+1\377\7+1\377\6*0\377\37\77D\377cz}\377\214\235\237" - "\377=Y^\377\1&,\377\0%+\377\0%+\375\0&+\210\0@@\4\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0&,W\0%+\371\0%+\377\1&,\377Fae\377\215\236\240\377Hcg\377\13/4" - "\377\11-2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10" - ",2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1" - "\377\7+1\377\7+1\377\7+1\377\7+1\377\6*0\377\6*0\377\6*0\377\6*0\377" - "\6*0\377#CI\377z\214\220\377u\211\214\377\23""5;\377\0%+\377\0%+\377" - "\0%+\271\0++\14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0&+k\0%+\375\0%+\377\14/5\377j\200\203\377t\210" - "\213\377\31:@\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377" - "\10,2\377\10,2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377" - "\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\6*0\377\6*0\377\6*0\377\6*0" - "\377\6*0\377\6*0\377\6*0\377\6*0\377\6*0\377\7+1\377Gbf\377\212\233\236" - "\377/MR\377\0%+\377\0%+\377\0%+\312\0$1\25\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$,i\0%+\377\0%+\377\22""4:\377~\221" - "\224\377Tmq\377\12.3\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377" - "\10,2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\7" - "+1\377\6*0\377\6*0\377\6*0\377\5)/\377\5)/\377\5)/\377\6*0\377\6*0\377" - "\6*0\377\6*0\377\6*0\377\6*0\377\6*0\377\5)/\377\5)/\377\5)/\377\5)/" - "\377%DI\377\204\226\231\377@\\`\377\0%+\377\0%+\377\0$+\322\0\"3\17\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+Z\0%+\374\0%+\377\27""9" - ">\377\203\225\230\377@[`\377\10,2\377\10,2\377\10,2\377\10,2\377\10," - "2\377\10,2\377\31:\77\377\12.4\377\7+1\377\7+1\377\7+1\377\7+1\377\5" - ")/\377\3(-\377\2'-\377\1&,\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\2'-\377\3(-\377\4(.\377\5)/\377\5)/\377\5)/" - "\377\5)/\377\5)/\377\5)/\377\5)/\377\25""7<\377|\217\222\377Jdi\377\0" - "%+\377\0%+\377\0&+\276\0\32""3\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&+5\0%" - "+\371\0%+\377\20""38\377\201\223\226\3775RV\377\10,2\377\10,2\377\10" - ",2\377\10,2\377\10,2\377\12.4\377\203\224\226\377\351\353\353\377\225" - "\242\245\377\7+1\377\5)/\377\2'-\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" - "\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\4(.\377\5)/\377\5)/\377" - "\5)/\377\5)/\377\4(.\377\15""05\377t\210\213\377D_d\377\0%+\377\0%+\377" - "\0%,\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40""0\20\0%+\337\0%+\377\10,2\377x\214" - "\217\377>Y^\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377'FK\377\312" - "\317\321\377\360\360\360\377\360\360\360\377\355\355\356\377Ump\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%,\377\0KX\377\0FR\377" - "\0%+\377\0FQ\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" - "\377\0%+\377\0%+\377\0%+\377\1&,\377\3(-\377\4(.\377\4(.\377\4(.\377" - "\4(.\377\17""17\377}\220\223\3773QU\377\0%+\377\0%+\377\0&+d\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0&,\252\0%+\377\0%+\377`w{\377Hcg\377\7+1\377\10,2\377\10,2\377" - "\7+1\377\7+1\377\32;@\377\341\343\343\377\360\360\360\377\357\357\357" - "\377\357\357\357\377\356\356\356\377\341\343\344\377#BG\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0""19\377\0o\202\377\0o\202\377\0%+\377" - "\0o\202\377\0Ve\377\0:D\377\0%+\377\0""6>\377\0&,\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\1&,\377\3(-\377\4(.\377\4(." - "\377\4(.\377\30""9>\377\200\222\225\377\26""8=\377\0%+\377\0%+\365\0" - "&-(\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&*I\0%+\377\0%+\3779VZ\377j\200\203\377\10,2\377\10,2\377\7+1\377\7+" - "1\377\7+1\377fz}\377fvy\377\244\254\255\377\357\357\357\377\356\356\356" - "\377\356\356\356\377\355\355\355\377\354\354\354\377\305\313\314\377" - "\6*0\377\0;D\377\0.6\377\0%+\377\0gy\377\0o\202\377\0o\202\377\0o\202" - "\377\0%+\377\0o\202\377\0fx\377\0o\202\377\0%+\377\0o\202\377\0Ra\377" - "\0\77J\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0" - "%+\377\2'-\377\4(.\377\3(-\377\3(-\377+JO\377v\212\215\377\4(.\377\0" - "%+\377\0$+\275\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\40\40\10\0%+\333\0%+\377\15""06\377|\217\222\377\21""39\377\7+1" - "\377\7+1\377\7+1\377\7+1\377Jch\377\352\353\353\377\347\350\350\3779" - "LP\377\314\317\320\377\355\355\355\377\355\355\355\377\354\354\354\377" - "\354\354\354\377\353\353\353\377\225\243\245\377\0Yi\377\0\77J\377\0" - "2:\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0%+\377\0o\202\377" - "\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Yi\377\0o\202\377\0]m\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\1&," - "\377\3(-\377\3(-\377\3(-\377Qjo\377E`d\377\0%+\377\0%+\377\0%+Y\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%*m\0%+\377\0%+\377[sw\377" - "7TY\377\7+1\377\7+1\377\7+1\377\7+1\377\6',\377\317\324\324\377\357\357" - "\357\377\356\356\356\377\322\325\325\3774HK\377\342\343\343\377\354\354" - "\354\377\353\353\353\377\353\353\353\377\352\352\352\377\351\351\351" - "\377V\223\236\377\0DP\377\0n\200\377\0o\202\377\0o\202\377\0o\202\377" - "\0o\202\377\0%+\377\0n\200\377\0o\202\377\0o\202\377\0%+\377\0o\202\377" - "\0Ve\377\0o\202\377\0o\202\377\0)0\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\3(-\377\3(-\377\11-3\377y\214" - "\220\377\21""49\377\0%+\377\0%+\335\0@@\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0++\6\0%+\342\0%+\377\27""9>\377m\202\206\377\6*0\377\7+1\377\7" - "+1\377\7+1\377\7).\377I[^\377\356\356\356\377\356\356\356\377\355\355" - "\355\377\354\354\354\377\254\263\264\377[jl\377\352\352\352\377\352\352" - "\352\377\352\352\352\377\351\351\351\377\350\350\350\377\321\330\331" - "\377\33mz\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" - "\0%+\377\0j{\377\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Uc\377\0o" - "\202\377\0o\202\377\0bs\377\0+2\377\0%+\377\0%+\377\0%+\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\2'-\377/MR\377Wos\377" - "\0%+\377\0%+\377\0$,]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%*a\0%+\377\0" - "%+\377[sw\377'FK\377\7+1\377\7+1\377\7+1\377\6*0\377\5\40%\377\221\232" - "\233\377\355\355\355\377\355\355\355\377\354\354\354\377\354\354\354" - "\377\353\353\353\377w\203\205\377\223\234\236\377\351\351\351\377\351" - "\351\351\377\350\350\350\377\342\342\342\377\337\337\337\377\255\302" - "\306\377\4q\203\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0%+\377" - "\0fw\377\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Uc\377\0o\202\377" - "\0o\202\377\0i{\377\0j}\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\2'-\377o\204\207\377\20" - "38\377\0%+\377\0%+\325\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+\302\0%+\377" - "\21""49\377l\201\205\377\5)/\377\7+1\377\6*0\377\6*0\377\6).\377\4\34" - "!\377\255\264\265\377\354\354\354\377\354\354\354\377\353\353\353\377" - "\353\353\353\377\352\352\352\377\346\346\347\377FWZ\377\277\304\304\377" - "\350\350\350\377\344\344\344\377\337\337\337\377\337\337\337\377\337" - "\337\337\377r\250\262\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" - "\0%+\377\0aq\377\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Xh\377\0o" - "\202\377\0o\202\377\0n\201\377\0o\202\377\0""2:\377\0%+\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377" - "/MR\377Pin\377\0%+\377\0%+\377\0$-9\0\0\0\0\0\0\0\0\0&-\"\0%+\376\0%" - "+\377E`d\3776SX\377\6*0\377\6*0\377\6*0\377\6*0\377\5%+\377\1\32\37\377" - "\271\276\277\377\353\353\353\377\353\353\353\377\352\352\352\377\352" - "\352\352\377\351\351\351\377\350\350\350\377\325\327\327\3778KN\377\330" - "\332\332\377\340\340\340\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\326\332\333\377\16v\210\377\0o\202\377\0o\202\377\0o\202\377" - "\0'.\377\0\\l\377\0o\202\377\0o\202\377\0&-\377\0o\202\377\0Yi\377\0" - "o\202\377\0o\202\377\0n\201\377\0o\202\377\0LY\377\0-4\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\1&,\377" - "\3(.\377u\211\214\377\3(-\377\0%+\377\0&+\225\0\0\0\0\0\0\0\0\0&*y\0" - "%+\377\1&,\377s\207\213\377\12-3\377\6*0\377\6*0\377\6*0\377\6*0\377" - "\3\"'\377\0\31\35\377\252\261\261\377\352\352\352\377\352\352\352\377" - "\351\351\351\377\351\351\351\377\350\350\350\377\350\350\350\377\347" - "\347\347\377\265\272\273\377FWZ\377\336\336\336\377\337\337\337\377\337" - "\337\337\377\334\335\336\377N\226\243\377\0o\202\377\0o\202\377\0o\202" - "\377\0o\202\377\0*0\377\0Tc\377\0o\202\377\0m\177\377\0+2\377\0o\202" - "\377\0Yi\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0n\201\377\0" - "BM\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\1&,\377Nhl\377,KP\377\0%+\377\0%+\352\0\0\0\2\0\0\0" - "\0\0%+\272\0%+\377\32;A\377_vz\377\5)/\377\6*0\377\6*0\377\6*0\377\5" - ")/\377\0\37$\377\0\31\35\377\226\237\240\377\351\351\351\377\351\351" - "\351\377\350\350\350\377\350\350\350\377\347\347\347\377\347\347\347" - "\377\346\346\346\377\345\345\345\377z\205\206\377x\204\205\377\337\337" - "\337\377\312\321\322\3779\206\224\377\0o\202\377\0o\202\377\0o\202\377" - "\0o\202\377\0o\202\377\0,4\377\0P]\377\0o\202\377\0i{\377\0""08\377\0" - "o\202\377\0Yi\377\0o\202\377\0o\202\377\0o\201\377\0o\202\377\0n\201" - "\377\0\77J\377\0O]\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\40@F\377Zrv\377\0%+\377\0%+\377\0&+" - "/\0++\6\0%+\365\0%+\377>Z_\377<X]\377\6*0\377\6*0\377\5)/\377\5)/\377" - "\2'-\377\0\40&\377\0\40%\377{\213\215\377\350\350\350\377\350\350\350" - "\377\347\347\347\377\347\347\347\377\346\346\346\377\346\346\346\377" - "\345\345\345\377\342\342\342\377\336\336\336\377J[]\377o\202\205\377" - "\25n}\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" - "\377\0""07\377\0JW\377\0o\202\377\0fw\377\0""4=\377\0o\202\377\0Yi\377" - "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0AL\377\0o\202" - "\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\2'-\377v\212\215\377\0%+\377\0%+\377\0&+r\0&+5\0%+\377" - "\0%+\377`w{\377\31;@\377\5)/\377\5)/\377\5)/\377\4(.\377\0%+\377\0^m" - "\377\0KX\377=fn\377\350\350\350\377\347\347\347\377\346\346\346\377\346" - "\346\346\377\345\345\345\377\345\345\345\377\344\344\344\377\340\340" - "\340\377\337\337\337\377Xhk\377\0""6>\377\0o\202\377\0o\202\377\0o\202" - "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0j}\377\0Tb\377\0o\202" - "\377\0fw\377\0""9B\377\0o\202\377\0[j\377\0o\202\377\0o\202\377\0o\202" - "\377\0o\202\377\0o\202\377\0DP\377\0o\202\377\0Xg\377\0)0\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377by|\377" - "\26""8=\377\0%+\377\0&,\252\0$*[\0%+\377\0%+\377u\211\214\377\5*/\377" - "\5)/\377\5)/\377\5)/\377\2'-\377\0%+\377\0fx\377\0KX\377\4AL\377\332" - "\334\334\377\346\346\346\377\345\345\345\377\345\345\345\377\344\344" - "\344\377\344\344\344\377\343\343\343\377\337\337\337\377\337\337\337" - "\377\34;A\377\0;D\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o" - "\202\377\0o\202\377\0o\202\377\0o\202\377\0du\377\0o\202\377\0fw\377" - "\0>H\377\0o\202\377\0^m\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" - "\0o\202\377\0KW\377\0o\202\377\0o\202\377\0ar\377\0""08\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377Hcg\377/MR\377" - "\0%+\377\0%+\321\0%+\204\0%+\377\6*0\377q\206\211\377\4(.\377\5)/\377" - "\5)/\377\5.4\377\0%,\377\0AL\377\0n\201\377\0MZ\377\0DO\377\244\263\266" - "\377\345\345\345\377\344\344\344\377\344\344\344\377\343\343\343\377" - "\343\343\343\377\341\341\341\377\337\337\337\377\337\337\337\377B\\`" - "\377\0;D\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" - "o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0fw\377\0BN\377" - "\0o\202\377\0^m\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" - "\377\0P\\\377\0m\177\377\0o\202\377\0o\202\377\0N\\\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\3774QV\377C^c\377\0%+\377" - "\0%+\367\0$+\241\0%+\377\26""8=\377_vz\377\4(.\377\5)/\377\5)/\377\3" - "hy\377\0""2:\377\0dv\377\0o\202\377\0Ud\377\0KX\377Ku|\377\344\344\344" - "\377\344\344\344\377\343\343\343\377\342\342\342\377\342\342\342\377" - "\340\340\340\377\337\337\337\377\337\337\337\377\203\235\241\377\0;D" - "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0fw\377\0GS\377\0o\202\377" - "\0^m\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0Xh\377" - "\0h{\377\0o\202\377\0o\202\377\0o\202\377\0""5>\377\0%+\377\0%+\377\0" - "%+\377\0EQ\377\0%+\377\0%+\377\0%+\377\"BG\377Unr\377\0%+\377\0%+\377" - "\0%+\255\0%+\377\40@F\377Vor\377\4(.\377\4(.\377\4_n\377\1p\202\377\0" - "MZ\377\0fx\377\0o\202\377\0_p\377\0KX\377\2LY\377\307\321\322\377\343" - "\343\343\377\342\342\342\377\341\341\341\377\341\341\341\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\331\334\335\377\40U^\377\0o" - "\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" - "\377\0o\202\377\0o\202\377\0o\202\377\0hz\377\0LY\377\0o\202\377\0^m" - "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0`p\377\0" - "du\377\0o\202\377\0o\202\377\0o\202\377\0fx\377\0DP\377\0DP\377\0%+\377" - "\0o\202\377\0%+\377\0%+\377\0%+\377\27""9>\377]ux\377\0%+\377\0%+\377" - "\0%+\272\0%+\377&EK\377Nhl\377\4(.\377\4""07\377\4q\204\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\0l\177\377\0MZ\377\0KX\377f\217\226" - "\377\342\342\342\377\341\341\341\377\341\341\341\377\340\340\340\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\242" - "\300\306\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" - "o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0l~\377\0P^\377" - "\0o\202\377\0^n\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" - "\377\0hz\377\0]m\377\0o\202\377\0o\202\377\0o\202\377\0m\200\377\0Wf" - "\377\0o\202\377\0Xh\377\0o\202\377\0%+\377\0%+\377\0%+\377\21""49\377" - "dz~\377\0%+\377\0%+\377\0%,\301\0%+\377'FK\377Lfj\377\4""6>\377\4q\204" - "\377\3q\203\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" - "\0Yi\377\0KX\377\13R_\377\316\324\326\377\340\340\340\377\340\340\340" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377Y\234\247\377\0o\202\377\0o\202\377\0" - "o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" - "\377\0o\202\377\0P^\377\0o\202\377\0bs\377\0o\202\377\0o\202\377\0o\202" - "\377\0o\202\377\0o\202\377\0o\201\377\0]m\377\0o\202\377\0o\202\377\0" - "n\201\377\0o\202\377\0Zj\377\0o\202\377\0o\202\377\0o\202\377\0[j\377" - "\0_o\377\0%,\377\20""38\377e{\177\377\0%+\377\0%+\377\0%+\264\0%+\377" - "\"BG\377Qjn\377\4+2\377\4q\204\377\2p\203\377\0o\202\377\0o\202\377\0" - "o\202\377\0o\202\377\0o\202\377\0i{\377\0KX\377\0KX\377Y\206\216\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\326\332" - "\333\377%\202\222\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o" - "\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0Tc\377\0o\202\377" - "\0bs\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" - "\377\0]l\377\0o\202\377\0o\202\377\0j}\377\0o\202\377\0Yi\377\0j|\377" - "\0fw\377\0o\202\377\0o\202\377\0P]\377\0.6\377\25""7<\377_vz\377\0%+" - "\377\0%+\377\0%+\245\0%+\377\33<A\377Wos\377\3(-\377\3""4<\377\1o\201" - "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" - "\0We\377\0KX\377\3MZ\377\266\304\306\377\337\337\337\377\337\337\337" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\270\307\311\377\10s\205\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" - "o\202\377\0Tc\377\0o\202\377\0bs\377\0o\202\377\0o\202\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\0^m\377\0o\202\377\0o\202\377\0j}\377" - "\0o\202\377\0KX\377\0j}\377\0ev\377\0o\202\377\0HT\377\0%+\377\0%+\377" - "\33<A\377Wos\377\0%+\377\0%+\377\0$+\224\0%+\377\16""17\377e{\177\377" - "\2'-\377\3(-\377\1+3\377\0o\202\377\0^m\377\0o\202\377\0o\202\377\0o" - "\202\377\0o\202\377\0j|\377\0LY\377\0KX\3779q{\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\210\264\273" - "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" - "\0o\202\377\0o\202\377\0Xh\377\0o\202\377\0du\377\0o\202\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0^n\377\0o\202\377\0o\202" - "\377\0`q\377\0o\202\377\0""7A\377\0n\201\377\0o\202\377\0<F\377\0""0" - "8\377\0%+\377\0%+\377(GL\377Jdi\377\0%+\377\0%+\377\0%*m\0%+\377\0%+" - "\377q\206\211\377\2'-\377\3(-\377\1&,\377\0KX\377\0N[\377\0&,\377\0o" - "\202\377\0o\202\377\0o\202\377\0o\202\377\0[k\377\0KX\377\0KX\377\213" - "\247\254\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377[\235\250\377\0o\202\377\0o\202\377\0o\202\377\0" - "o\202\377\0o\202\377\0o\202\377\0o\202\377\0Yh\377\0o\202\377\0gy\377" - "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" - "bs\377\0o\202\377\0o\202\377\0Tc\377\0o\202\377\0.5\377\0HT\377\0]m\377" - "\0%+\377\0%+\377\0%+\377\0%+\377=Y^\3775RW\377\0%+\377\0%+\342\0#+H\0" - "%+\377\0%+\377g}\201\377\13/4\377\3(-\377\1&,\377\0*0\377\0*0\377\0%" - "+\377\0o\202\377\0o\202\377\0o\202\377\0""7@\377\0Ra\377\0N\\\377\0K" - "X\377\13R_\377\303\314\316\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377\332\335\335\3774\211\227\377\0o\202\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0]m\377\0n\200\377\0l\177" - "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0du\377\0""9C\377\0" - "^o\377\0o\202\377\0o\202\377\0""6\77\377\0o\202\377\0/7\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377Pin\377!AF\377\0%+\377\0$+\275" - "\0))\31\0%+\377\0%+\377Hcg\377(GL\377\2'-\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0.6\377\0o\202\377\0o\202\377\0%+\377\0%+\377\0du\377\0KX\377" - "\0KX\3774nx\377\333\334\335\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377\313\325\327\377\32|\215\377\0o\202\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\0[j\377\0m\200\3770\207\226\377\255" - "\306\312\377v\252\263\377\0o\202\377\0o\202\377\0%+\377\0%+\377\0^m\377" - "\0o\202\377\0o\202\377\0%+\377\0'-\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377j\200\203\377\6*0\377\0%+\377\0%+\217\0\0\0\0" - "\0%+\330\0%+\377'FK\377Hcg\377\2'-\377\1&,\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0o\202\377\0o\202\377\0%+\377\0%+\377\0o\202\377\0Yh\377\0K" - "X\377\0KX\377c\215\224\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\300\320\322\377\27{\214\377\0o\202\377" - "\0o\202\377\0o\202\377\0o\202\377\1[i\377k\245\256\377\334\335\336\377" - "\337\337\337\377\337\337\337\377U\232\246\377\0o\202\377\0%+\377\0%+" - "\377\0\\k\377\0o\202\377\0""3<\377\0%+\377\0%+\377\0%+\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\16""17\377ax|\377\0%+\377\0%+\377\0$+" - "M\0\0\0\0\0%*\227\0%+\377\7+1\377h~\201\377\1&,\377\1&,\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0EQ\377\0_n\377\0%+\377\0%+\377\0FS\377\0m\177" - "\377\0Q^\377\0KX\377\1LY\377\225\250\253\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\272\314\317\377" - "!\177\220\377\0o\202\377\0o\202\377\0o\202\377\212\250\255\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\327\333\334" - "\377,\205\225\377\0%+\377\0%+\377\0]l\377\0j|\377\0/6\377\0%+\377\0%" - "+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\3773QU\377=Y^\377\0" - "%+\377\0%+\374\0\"3\17\0\0\0\0\0%,K\0%+\377\0%+\377Rko\377\34=B\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0Zh\377\0i{\377\0MZ\377\0KX\377\13#'\377\270\274\275\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\332\335\335\377|\255\266\377L\225\241\377N\213\225\377p\215\222" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\303\321\323\377\21""39\377\0%+\377\0LY\377\0""8A\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" - "\377^uy\377\17""27\377\0%+\377\0%+\277\0\0\0\0\0\0\0\0\0@@\4\0%+\351" - "\0%+\377%EJ\377Ich\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0o\202\377\0bs\377\0KX\377\0" - "\31\35\377\33""15\377\315\317\320\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377Ty\200\377\241\266\272\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\241\253" - "\255\377\2'-\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" - "\377\0%+\377\0%+\377\0%+\377\21""49\377]ux\377\0%+\377\0%+\377\0$,c\0" - "\0\0\0\0\0\0\0\0\0\0\0\0%+\217\0%+\377\1&,\377dz~\377\12.3\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" - "\377\0""7@\377\0Yh\377\1IV\377\5\35!\377\7\37#\3776IL\377\331\332\332" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\326\331\331\3777oy\377\305" - "\316\317\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377i}\200\377\0%+\377\0%+\377\0%+\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377Hcg\377&EK\377\0%+\377" - "\0%+\366\0$$\16\0\0\0\0\0\0\0\0\0\0\0\0\0#+$\0%+\373\0%+\377/MR\377A" - "]a\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\1&,\377\4(.\377\6>G\377\5R`\377\13&+\377\14#'\377\16%)\377O" - "_a\377\334\334\335\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\275\310" - "\312\377<s|\377\332\334\334\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\333\334\334\377/LQ\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\15""06\377ax|\377\1&,\377\0" - "%+\377\0%+\226\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+\245\0%+\377" - "\2'-\377f|\200\377\21""49\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\3(-\377\7+1\377\14/5\377\17""27\377\22""4:\377\26""7" - "<\377\22+.\377\22),\377\24*-\377^kn\377\336\336\336\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\225\256\262\377_\212\221\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\301" - "\306\306\377\15""06\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377Pin\377)HM\377\0%+\377\0%+\372\0!)\37\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0$+*\0%+\373\0%+\377%EJ\377Vor\377\0%+\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\1&,\377\5)/\377\12.3\377\16""17\377\22""4:\377" - "\26""8=\377\31:@\377\34=B\377\37>D\377\31""04\377\31/2\377\32/3\377^" - "ln\377\332\332\332\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377_\212\221" - "\377\224\255\262\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\221\236\240\377\2'-\377\0%+\377\0%+" - "\377\0%+\377\0%+\377\0%+\377\37@E\377[sw\377\1&,\377\0%+\377\0%+\231" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+\217\0%+" - "\377\0%+\377Tmq\3770NS\377\0%+\377\0%+\377\0%+\377\2'-\377\7+1\377\14" - "/5\377\20""38\377\25""7<\377\31:@\377\34=B\377\40@F\377$DI\377'FK\377" - "(FK\377\37""69\377\40""48\377!58\377P_b\377\322\324\324\377\337\337\337" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\332\334\334\3777oy\377\276\305\307\377\337\337\337\377\337" - "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377A[_\377\4" - "(.\377\0%+\377\0%+\377\0%+\377\10,2\377g}\201\377\24""6<\377\0%+\377" - "\0%+\355\0$1\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0$$\16\0%+\344\0%+\377\13.4\377i\177\202\377\26""8=\377\0%+\377\2" - "'-\377\7+1\377\14/5\377\21""49\377\26""8=\377\33<A\377\37@E\377#CH\377" - "'FK\377*IN\377.LQ\3771OT\3772NS\377(=A\377&:=\377':=\377>PR\377\265\274" - "\275\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\302\311\312\377HXZ\377\327\330\330\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\241\254\255\377\22""4" - "9\377\12.3\377\5)/\377\0%+\377\1&,\377Tmq\3776SX\377\0%+\377\0%+\377" - "\0$,i\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0#+H\0%+\376\0%+\377\37@E\377h~\201\377\20""38\377\7+1\377\15" - "06\377\22""4:\377\27""9>\377\34=B\377!AF\377%EJ\377*IN\377.LQ\3771OT" - "\3774QV\3778UZ\377;W\\\377=X]\3770FI\377,\77B\377-@C\377/BE\377u\227" - "\234\377\332\334\334\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\234\243\245\377cps\377\337\337\337\377" - "\337\337\337\377\227\241\243\377\40@F\377\25""7<\377\20""38\377\12.3" - "\377\5)/\377\77[_\377Tmq\377\1&,\377\0%+\377\0%+\270\0\0\0\2\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0$,\206\0%+\377\0%+\3771OT\377e{\177\377\23""5;\377\22""4:\377\30" - ":\77\377\35>C\377\"BG\377'FK\377,KP\3770NS\3774QV\3779VZ\377<X]\377\77" - "[_\377B]b\377D_d\377Gbf\377=SW\3772DH\3773EG\3773EI\377\40`k\377\237" - "\264\270\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" - "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" - "\377\337\337\337\377my{\377\207\221\222\377l{}\377%DI\377\40@F\377\33" - "<A\377\26""8=\377\20""38\3779VZ\377cz}\377\7+1\377\0%+\377\0%+\345\0" - "#.\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\3\0$+\275\0%+\377\0%+\377<X]\377g}\201" - "\377\"BG\377\36\77D\377#CH\377(GL\377-KP\3772PU\3777TY\377;W\\\377\77" - "[_\377C^c\377Fae\377Ich\377Lfj\377Nhl\377Pin\377Kbf\377<NQ\3778IL\377" - "4IM\377\0KX\377Xfh\377\216\251\256\377\327\330\330\377\337\337\337\377" - "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" - "\337\337\377\234\243\244\377*AE\377/LQ\377*IN\377%EJ\377\40@F\377\33" - "<A\377D_d\377g}\201\377\12.3\377\0%+\377\0%+\365\0%*7\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\32""3\12\0%+\310\0%+\377\0%+\3779VZ\377p\205\210" - "\3772PU\377)HM\377.LQ\3773QU\3778UZ\377=Y^\377A]a\377Fae\377Ich\377M" - "gk\377Pin\377Slp\377Vor\377Wos\377Yqu\377Zrv\377Ocg\377ART\3770MS\377" - "=MP\377<LO\377\77PR\377fsu\377\204\215\217\377\227\236\237\377\222\232" - "\233\377\200\214\216\377Rhk\3778QU\377:W[\3775RW\3770NS\377+JO\377'F" - "K\377Vor\377e{\177\377\14/5\377\0%+\377\0%+\374\0$+N\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$1\25\0%+\321\0%+\377\0%+\377-" - "KP\377w\213\216\377Nhl\3774QV\3779VZ\377>Z_\377C^c\377Gbf\377Lfj\377" - "Pin\377Tmq\377Wos\377[sw\377]ux\377_vz\377`w{\377by|\377by|\377ax{\377" - "Vjl\377I[^\377BQT\377@OR\377>NQ\377<MO\377:KM\3778IL\377\77TW\377Ich" - "\377E`d\377@\\`\377;W\\\3776SX\3779VZ\377k\200\204\377[sw\377\7+1\377" - "\0%+\377\0%+\374\0$,b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\40""0\20\0%+\300\0%+\377\0%+\377\27""9>\377l\201" - "\205\377k\200\204\377Fae\377C^c\377Ich\377Mgk\377Rko\377Vor\377[sw\377" - "^uy\377ax|\377dz~\377f|\200\377h~\201\377j\200\203\377j\200\203\377j" - "\200\203\377j\200\203\377i\177\202\377e{~\377\\pt\377Wkn\377Thl\377S" - "il\377Wnr\377Tmq\377Pin\377Kei\377Fae\377B]b\377Yqu\377y\214\220\377" - "<X]\377\2'-\377\0%+\377\0%+\366\0$*O\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40\40\10\0%,\244" - "\0%+\377\0%+\377\7+1\377E`d\377~\221\224\377j\200\203\377Qjn\377Tmq\377" - "Xpt\377]ux\377ax|\377e{\177\377i\177\202\377k\200\204\377n\203\206\377" - "o\204\207\377q\206\211\377r\206\212\377r\206\212\377q\206\211\377p\205" - "\210\377o\204\207\377m\202\206\377j\200\203\377f|\200\377cz}\377_vz\377" - "[sw\377Vor\377Qjn\377[sw\377y\214\220\377i\177\202\377\34=B\377\0%+\377" - "\0%+\377\0%+\344\0#,:\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&+e\0%" - "+\365\0%+\377\0%+\377\26""8=\377]ux\377\203\225\230\377v\212\215\377" - "dz~\377cz}\377h~\201\377l\201\205\377o\204\207\377s\207\213\377u\211" - "\214\377w\213\216\377y\214\220\377y\214\220\377y\214\220\377y\214\220" - "\377x\214\217\377v\212\215\377t\210\213\377q\206\211\377n\203\206\377" - "j\200\203\377e{\177\377ax|\377k\200\204\377\177\222\225\377y\214\220" - "\3774QV\377\2'-\377\0%+\377\0%+\377\0%+\271\0$1\25\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&-(\0$+\275\0%+\377\0%+\377\0" - "%+\377\31:@\377Vor\377\205\227\232\377\210\231\234\377\200\222\225\377" - "w\213\216\377v\212\215\377y\214\220\377}\220\223\377~\221\224\377\200" - "\222\225\377\201\223\226\377\201\223\226\377\201\223\226\377\177\222" - "\225\377~\221\224\377{\216\221\377x\214\217\377u\211\214\377|\217\222" - "\377\206\230\232\377\210\231\234\377q\206\211\3773QU\377\5)/\377\0%+" - "\377\0%+\377\0&+\356\0%,h\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&+X\0%+\336\0%+\377\0%" - "+\377\0%+\377\12.3\3771OT\377cz}\377\210\231\234\377\217\237\242\377" - "\225\244\247\377\230\247\251\377\225\244\247\377\223\243\245\377\222" - "\242\244\377\221\241\244\377\223\243\245\377\224\244\246\377\226\245" - "\250\377\227\246\251\377\221\241\244\377\216\236\241\377v\212\215\377" - "Gbf\377\32;A\377\1&,\377\0%+\377\0%+\377\0%+\372\0$+\233\0&&\24\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0@@\4\0$,]\0%+\324\0%+\377\0%+\377\0%" - "+\377\0%+\377\4(.\377\35>C\3772PU\377Hcg\377ax|\377o\204\207\377y\214" - "\220\377{\216\221\377r\206\212\377j\200\203\377Vor\377:W[\377(GL\377" - "\16""17\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\366\0%+\226\0((\40\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0$-9\0$+\224\0%+\352\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" - "\0%+\377\0%+\377\0%+\374\0%+\300\0$,b\0\"3\17\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\2\0&+/\0$+q\0%+\253\0%+\321\0%+\367\0%+\377\0" - "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\343\0%+\274\0%+\217" - "\0$+M\0\"3\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (14400) */ + "\0\0""8X" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (240) */ + "\0\0\0\360" + /* width (60) */ + "\0\0\0<" + /* height (60) */ + "\0\0\0<" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0++\6\0&+5\0$*[\0%+" + "\203\0%+\240\0%+\254\0%,\273\0%,\273\0%+\263\0$+\250\0%,\222\0%,n\0$" + "+G\0''\32\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0$,#\0$+x\0%,\273\0%+\365\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" + "\377\0%+\330\0%*\227\0%,K\0""33\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0++\6\0%*a\0%,\301\0" + "%+\376\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\26""8=\377+JO\3774QV\377" + ">Z_\377>Z_\3778UZ\3771OT\377\40@F\377\12.3\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\351\0%+\217\0$,#\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\34""9\11\0%*m\0%+\342\0%+\377\0%+\377\0%+\377" + "\6*0\377.LQ\377Unr\377|\217\222\377\226\245\250\377\221\241\244\377~" + "\221\224\377r\206\211\377k\200\203\377g}\200\377q\205\210\377x\213\216" + "\377\206\230\232\377\231\250\252\377\213\234\237\377g}\201\377@\\`\377" + "\25""7<\377\0%+\377\0%+\377\0%+\377\0%+\374\0%+\245\0%,)\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0&*I\0%+\333\0%+\377\0%+\377\0%+\377$DI\377]ux\377\217" + "\237\242\377y\214\220\377Rko\377.MQ\377\25""7<\377\7+1\377\10,2\377\10" + ",2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\14/5\377!BG\377A" + "]a\377g}\200\377\217\237\242\377w\213\216\377\77[_\377\7+1\377\0%+\377" + "\0%+\377\0%+\373\0%+\217\0''\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40""0\20\0&*\251\0%+\377\0%+\377\0%+\377" + ",KP\377u\211\214\377\207\230\233\377Lfj\377\33<A\377\11-2\377\11-2\377" + "\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2" + "\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\12-3\3776TX\377" + "k\200\203\377\215\236\240\377Mgk\377\14/5\377\0%+\377\0%+\377\0%+\346" + "\0$,F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',4\0%+\336\0%" + "+\377\0%+\377\26""8=\377o\204\207\377\203\225\230\377<Y]\377\13/4\377" + "\11-2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2" + "\377\10,2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377" + "\7+1\377\7+1\377\7+1\377\7+1\377\6*0\377\37\77D\377cz}\377\214\235\237" + "\377=Y^\377\1&,\377\0%+\377\0%+\375\0&+\210\0@@\4\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0&,W\0%+\371\0%+\377\1&,\377Fae\377\215\236\240\377Hcg\377\13/4" + "\377\11-2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10" + ",2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1" + "\377\7+1\377\7+1\377\7+1\377\7+1\377\6*0\377\6*0\377\6*0\377\6*0\377" + "\6*0\377#CI\377z\214\220\377u\211\214\377\23""5;\377\0%+\377\0%+\377" + "\0%+\271\0++\14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0&+k\0%+\375\0%+\377\14/5\377j\200\203\377t\210" + "\213\377\31:@\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377" + "\10,2\377\10,2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377" + "\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\6*0\377\6*0\377\6*0\377\6*0" + "\377\6*0\377\6*0\377\6*0\377\6*0\377\6*0\377\7+1\377Gbf\377\212\233\236" + "\377/MR\377\0%+\377\0%+\377\0%+\312\0$1\25\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$,i\0%+\377\0%+\377\22""4:\377~\221" + "\224\377Tmq\377\12.3\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377" + "\10,2\377\10,2\377\10,2\377\7+1\377\7+1\377\7+1\377\7+1\377\7+1\377\7" + "+1\377\6*0\377\6*0\377\6*0\377\5)/\377\5)/\377\5)/\377\6*0\377\6*0\377" + "\6*0\377\6*0\377\6*0\377\6*0\377\6*0\377\5)/\377\5)/\377\5)/\377\5)/" + "\377%DI\377\204\226\231\377@\\`\377\0%+\377\0%+\377\0$+\322\0\"3\17\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+Z\0%+\374\0%+\377\27""9" + ">\377\203\225\230\377@[`\377\10,2\377\10,2\377\10,2\377\10,2\377\10," + "2\377\10,2\377\31:\77\377\12.4\377\7+1\377\7+1\377\7+1\377\7+1\377\5" + ")/\377\3(-\377\2'-\377\1&,\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\2'-\377\3(-\377\4(.\377\5)/\377\5)/\377\5)/" + "\377\5)/\377\5)/\377\5)/\377\5)/\377\25""7<\377|\217\222\377Jdi\377\0" + "%+\377\0%+\377\0&+\276\0\32""3\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&+5\0%" + "+\371\0%+\377\20""38\377\201\223\226\3775RV\377\10,2\377\10,2\377\10" + ",2\377\10,2\377\10,2\377\12.4\377\203\224\226\377\351\353\353\377\225" + "\242\245\377\7+1\377\5)/\377\2'-\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" + "\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\4(.\377\5)/\377\5)/\377" + "\5)/\377\5)/\377\4(.\377\15""05\377t\210\213\377D_d\377\0%+\377\0%+\377" + "\0%,\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40""0\20\0%+\337\0%+\377\10,2\377x\214" + "\217\377>Y^\377\10,2\377\10,2\377\10,2\377\10,2\377\10,2\377'FK\377\312" + "\317\321\377\360\360\360\377\360\360\360\377\355\355\356\377Ump\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%,\377\0KX\377\0FR\377" + "\0%+\377\0FQ\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" + "\377\0%+\377\0%+\377\0%+\377\1&,\377\3(-\377\4(.\377\4(.\377\4(.\377" + "\4(.\377\17""17\377}\220\223\3773QU\377\0%+\377\0%+\377\0&+d\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0&,\252\0%+\377\0%+\377`w{\377Hcg\377\7+1\377\10,2\377\10,2\377" + "\7+1\377\7+1\377\32;@\377\341\343\343\377\360\360\360\377\357\357\357" + "\377\357\357\357\377\356\356\356\377\341\343\344\377#BG\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0""19\377\0o\202\377\0o\202\377\0%+\377" + "\0o\202\377\0Ve\377\0:D\377\0%+\377\0""6>\377\0&,\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\1&,\377\3(-\377\4(.\377\4(." + "\377\4(.\377\30""9>\377\200\222\225\377\26""8=\377\0%+\377\0%+\365\0" + "&-(\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&*I\0%+\377\0%+\3779VZ\377j\200\203\377\10,2\377\10,2\377\7+1\377\7+" + "1\377\7+1\377fz}\377fvy\377\244\254\255\377\357\357\357\377\356\356\356" + "\377\356\356\356\377\355\355\355\377\354\354\354\377\305\313\314\377" + "\6*0\377\0;D\377\0.6\377\0%+\377\0gy\377\0o\202\377\0o\202\377\0o\202" + "\377\0%+\377\0o\202\377\0fx\377\0o\202\377\0%+\377\0o\202\377\0Ra\377" + "\0\77J\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0" + "%+\377\2'-\377\4(.\377\3(-\377\3(-\377+JO\377v\212\215\377\4(.\377\0" + "%+\377\0$+\275\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\40\40\10\0%+\333\0%+\377\15""06\377|\217\222\377\21""39\377\7+1" + "\377\7+1\377\7+1\377\7+1\377Jch\377\352\353\353\377\347\350\350\3779" + "LP\377\314\317\320\377\355\355\355\377\355\355\355\377\354\354\354\377" + "\354\354\354\377\353\353\353\377\225\243\245\377\0Yi\377\0\77J\377\0" + "2:\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0%+\377\0o\202\377" + "\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Yi\377\0o\202\377\0]m\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\1&," + "\377\3(-\377\3(-\377\3(-\377Qjo\377E`d\377\0%+\377\0%+\377\0%+Y\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%*m\0%+\377\0%+\377[sw\377" + "7TY\377\7+1\377\7+1\377\7+1\377\7+1\377\6',\377\317\324\324\377\357\357" + "\357\377\356\356\356\377\322\325\325\3774HK\377\342\343\343\377\354\354" + "\354\377\353\353\353\377\353\353\353\377\352\352\352\377\351\351\351" + "\377V\223\236\377\0DP\377\0n\200\377\0o\202\377\0o\202\377\0o\202\377" + "\0o\202\377\0%+\377\0n\200\377\0o\202\377\0o\202\377\0%+\377\0o\202\377" + "\0Ve\377\0o\202\377\0o\202\377\0)0\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\3(-\377\3(-\377\11-3\377y\214" + "\220\377\21""49\377\0%+\377\0%+\335\0@@\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0++\6\0%+\342\0%+\377\27""9>\377m\202\206\377\6*0\377\7+1\377\7" + "+1\377\7+1\377\7).\377I[^\377\356\356\356\377\356\356\356\377\355\355" + "\355\377\354\354\354\377\254\263\264\377[jl\377\352\352\352\377\352\352" + "\352\377\352\352\352\377\351\351\351\377\350\350\350\377\321\330\331" + "\377\33mz\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" + "\0%+\377\0j{\377\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Uc\377\0o" + "\202\377\0o\202\377\0bs\377\0+2\377\0%+\377\0%+\377\0%+\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\2'-\377/MR\377Wos\377" + "\0%+\377\0%+\377\0$,]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%*a\0%+\377\0" + "%+\377[sw\377'FK\377\7+1\377\7+1\377\7+1\377\6*0\377\5\40%\377\221\232" + "\233\377\355\355\355\377\355\355\355\377\354\354\354\377\354\354\354" + "\377\353\353\353\377w\203\205\377\223\234\236\377\351\351\351\377\351" + "\351\351\377\350\350\350\377\342\342\342\377\337\337\337\377\255\302" + "\306\377\4q\203\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0%+\377" + "\0fw\377\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Uc\377\0o\202\377" + "\0o\202\377\0i{\377\0j}\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377\2'-\377o\204\207\377\20" + "38\377\0%+\377\0%+\325\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+\302\0%+\377" + "\21""49\377l\201\205\377\5)/\377\7+1\377\6*0\377\6*0\377\6).\377\4\34" + "!\377\255\264\265\377\354\354\354\377\354\354\354\377\353\353\353\377" + "\353\353\353\377\352\352\352\377\346\346\347\377FWZ\377\277\304\304\377" + "\350\350\350\377\344\344\344\377\337\337\337\377\337\337\337\377\337" + "\337\337\377r\250\262\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" + "\0%+\377\0aq\377\0o\202\377\0o\202\377\0%+\377\0o\202\377\0Xh\377\0o" + "\202\377\0o\202\377\0n\201\377\0o\202\377\0""2:\377\0%+\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\2'-\377" + "/MR\377Pin\377\0%+\377\0%+\377\0$-9\0\0\0\0\0\0\0\0\0&-\"\0%+\376\0%" + "+\377E`d\3776SX\377\6*0\377\6*0\377\6*0\377\6*0\377\5%+\377\1\32\37\377" + "\271\276\277\377\353\353\353\377\353\353\353\377\352\352\352\377\352" + "\352\352\377\351\351\351\377\350\350\350\377\325\327\327\3778KN\377\330" + "\332\332\377\340\340\340\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\326\332\333\377\16v\210\377\0o\202\377\0o\202\377\0o\202\377" + "\0'.\377\0\\l\377\0o\202\377\0o\202\377\0&-\377\0o\202\377\0Yi\377\0" + "o\202\377\0o\202\377\0n\201\377\0o\202\377\0LY\377\0-4\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\1&,\377" + "\3(.\377u\211\214\377\3(-\377\0%+\377\0&+\225\0\0\0\0\0\0\0\0\0&*y\0" + "%+\377\1&,\377s\207\213\377\12-3\377\6*0\377\6*0\377\6*0\377\6*0\377" + "\3\"'\377\0\31\35\377\252\261\261\377\352\352\352\377\352\352\352\377" + "\351\351\351\377\351\351\351\377\350\350\350\377\350\350\350\377\347" + "\347\347\377\265\272\273\377FWZ\377\336\336\336\377\337\337\337\377\337" + "\337\337\377\334\335\336\377N\226\243\377\0o\202\377\0o\202\377\0o\202" + "\377\0o\202\377\0*0\377\0Tc\377\0o\202\377\0m\177\377\0+2\377\0o\202" + "\377\0Yi\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0n\201\377\0" + "BM\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\1&,\377Nhl\377,KP\377\0%+\377\0%+\352\0\0\0\2\0\0\0" + "\0\0%+\272\0%+\377\32;A\377_vz\377\5)/\377\6*0\377\6*0\377\6*0\377\5" + ")/\377\0\37$\377\0\31\35\377\226\237\240\377\351\351\351\377\351\351" + "\351\377\350\350\350\377\350\350\350\377\347\347\347\377\347\347\347" + "\377\346\346\346\377\345\345\345\377z\205\206\377x\204\205\377\337\337" + "\337\377\312\321\322\3779\206\224\377\0o\202\377\0o\202\377\0o\202\377" + "\0o\202\377\0o\202\377\0,4\377\0P]\377\0o\202\377\0i{\377\0""08\377\0" + "o\202\377\0Yi\377\0o\202\377\0o\202\377\0o\201\377\0o\202\377\0n\201" + "\377\0\77J\377\0O]\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\40@F\377Zrv\377\0%+\377\0%+\377\0&+" + "/\0++\6\0%+\365\0%+\377>Z_\377<X]\377\6*0\377\6*0\377\5)/\377\5)/\377" + "\2'-\377\0\40&\377\0\40%\377{\213\215\377\350\350\350\377\350\350\350" + "\377\347\347\347\377\347\347\347\377\346\346\346\377\346\346\346\377" + "\345\345\345\377\342\342\342\377\336\336\336\377J[]\377o\202\205\377" + "\25n}\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" + "\377\0""07\377\0JW\377\0o\202\377\0fw\377\0""4=\377\0o\202\377\0Yi\377" + "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0AL\377\0o\202" + "\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\2'-\377v\212\215\377\0%+\377\0%+\377\0&+r\0&+5\0%+\377" + "\0%+\377`w{\377\31;@\377\5)/\377\5)/\377\5)/\377\4(.\377\0%+\377\0^m" + "\377\0KX\377=fn\377\350\350\350\377\347\347\347\377\346\346\346\377\346" + "\346\346\377\345\345\345\377\345\345\345\377\344\344\344\377\340\340" + "\340\377\337\337\337\377Xhk\377\0""6>\377\0o\202\377\0o\202\377\0o\202" + "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0j}\377\0Tb\377\0o\202" + "\377\0fw\377\0""9B\377\0o\202\377\0[j\377\0o\202\377\0o\202\377\0o\202" + "\377\0o\202\377\0o\202\377\0DP\377\0o\202\377\0Xg\377\0)0\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377by|\377" + "\26""8=\377\0%+\377\0&,\252\0$*[\0%+\377\0%+\377u\211\214\377\5*/\377" + "\5)/\377\5)/\377\5)/\377\2'-\377\0%+\377\0fx\377\0KX\377\4AL\377\332" + "\334\334\377\346\346\346\377\345\345\345\377\345\345\345\377\344\344" + "\344\377\344\344\344\377\343\343\343\377\337\337\337\377\337\337\337" + "\377\34;A\377\0;D\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o" + "\202\377\0o\202\377\0o\202\377\0o\202\377\0du\377\0o\202\377\0fw\377" + "\0>H\377\0o\202\377\0^m\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" + "\0o\202\377\0KW\377\0o\202\377\0o\202\377\0ar\377\0""08\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377Hcg\377/MR\377" + "\0%+\377\0%+\321\0%+\204\0%+\377\6*0\377q\206\211\377\4(.\377\5)/\377" + "\5)/\377\5.4\377\0%,\377\0AL\377\0n\201\377\0MZ\377\0DO\377\244\263\266" + "\377\345\345\345\377\344\344\344\377\344\344\344\377\343\343\343\377" + "\343\343\343\377\341\341\341\377\337\337\337\377\337\337\337\377B\\`" + "\377\0;D\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" + "o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0fw\377\0BN\377" + "\0o\202\377\0^m\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" + "\377\0P\\\377\0m\177\377\0o\202\377\0o\202\377\0N\\\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\3774QV\377C^c\377\0%+\377" + "\0%+\367\0$+\241\0%+\377\26""8=\377_vz\377\4(.\377\5)/\377\5)/\377\3" + "hy\377\0""2:\377\0dv\377\0o\202\377\0Ud\377\0KX\377Ku|\377\344\344\344" + "\377\344\344\344\377\343\343\343\377\342\342\342\377\342\342\342\377" + "\340\340\340\377\337\337\337\377\337\337\337\377\203\235\241\377\0;D" + "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0fw\377\0GS\377\0o\202\377" + "\0^m\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0Xh\377" + "\0h{\377\0o\202\377\0o\202\377\0o\202\377\0""5>\377\0%+\377\0%+\377\0" + "%+\377\0EQ\377\0%+\377\0%+\377\0%+\377\"BG\377Unr\377\0%+\377\0%+\377" + "\0%+\255\0%+\377\40@F\377Vor\377\4(.\377\4(.\377\4_n\377\1p\202\377\0" + "MZ\377\0fx\377\0o\202\377\0_p\377\0KX\377\2LY\377\307\321\322\377\343" + "\343\343\377\342\342\342\377\341\341\341\377\341\341\341\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\331\334\335\377\40U^\377\0o" + "\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" + "\377\0o\202\377\0o\202\377\0o\202\377\0hz\377\0LY\377\0o\202\377\0^m" + "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0`p\377\0" + "du\377\0o\202\377\0o\202\377\0o\202\377\0fx\377\0DP\377\0DP\377\0%+\377" + "\0o\202\377\0%+\377\0%+\377\0%+\377\27""9>\377]ux\377\0%+\377\0%+\377" + "\0%+\272\0%+\377&EK\377Nhl\377\4(.\377\4""07\377\4q\204\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\0l\177\377\0MZ\377\0KX\377f\217\226" + "\377\342\342\342\377\341\341\341\377\341\341\341\377\340\340\340\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\242" + "\300\306\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" + "o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0l~\377\0P^\377" + "\0o\202\377\0^n\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" + "\377\0hz\377\0]m\377\0o\202\377\0o\202\377\0o\202\377\0m\200\377\0Wf" + "\377\0o\202\377\0Xh\377\0o\202\377\0%+\377\0%+\377\0%+\377\21""49\377" + "dz~\377\0%+\377\0%+\377\0%,\301\0%+\377'FK\377Lfj\377\4""6>\377\4q\204" + "\377\3q\203\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" + "\0Yi\377\0KX\377\13R_\377\316\324\326\377\340\340\340\377\340\340\340" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377Y\234\247\377\0o\202\377\0o\202\377\0" + "o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" + "\377\0o\202\377\0P^\377\0o\202\377\0bs\377\0o\202\377\0o\202\377\0o\202" + "\377\0o\202\377\0o\202\377\0o\201\377\0]m\377\0o\202\377\0o\202\377\0" + "n\201\377\0o\202\377\0Zj\377\0o\202\377\0o\202\377\0o\202\377\0[j\377" + "\0_o\377\0%,\377\20""38\377e{\177\377\0%+\377\0%+\377\0%+\264\0%+\377" + "\"BG\377Qjn\377\4+2\377\4q\204\377\2p\203\377\0o\202\377\0o\202\377\0" + "o\202\377\0o\202\377\0o\202\377\0i{\377\0KX\377\0KX\377Y\206\216\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\326\332" + "\333\377%\202\222\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o" + "\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0Tc\377\0o\202\377" + "\0bs\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202" + "\377\0]l\377\0o\202\377\0o\202\377\0j}\377\0o\202\377\0Yi\377\0j|\377" + "\0fw\377\0o\202\377\0o\202\377\0P]\377\0.6\377\25""7<\377_vz\377\0%+" + "\377\0%+\377\0%+\245\0%+\377\33<A\377Wos\377\3(-\377\3""4<\377\1o\201" + "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" + "\0We\377\0KX\377\3MZ\377\266\304\306\377\337\337\337\377\337\337\337" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\270\307\311\377\10s\205\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" + "o\202\377\0Tc\377\0o\202\377\0bs\377\0o\202\377\0o\202\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\0^m\377\0o\202\377\0o\202\377\0j}\377" + "\0o\202\377\0KX\377\0j}\377\0ev\377\0o\202\377\0HT\377\0%+\377\0%+\377" + "\33<A\377Wos\377\0%+\377\0%+\377\0$+\224\0%+\377\16""17\377e{\177\377" + "\2'-\377\3(-\377\1+3\377\0o\202\377\0^m\377\0o\202\377\0o\202\377\0o" + "\202\377\0o\202\377\0j|\377\0LY\377\0KX\3779q{\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\210\264\273" + "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377" + "\0o\202\377\0o\202\377\0Xh\377\0o\202\377\0du\377\0o\202\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0^n\377\0o\202\377\0o\202" + "\377\0`q\377\0o\202\377\0""7A\377\0n\201\377\0o\202\377\0<F\377\0""0" + "8\377\0%+\377\0%+\377(GL\377Jdi\377\0%+\377\0%+\377\0%*m\0%+\377\0%+" + "\377q\206\211\377\2'-\377\3(-\377\1&,\377\0KX\377\0N[\377\0&,\377\0o" + "\202\377\0o\202\377\0o\202\377\0o\202\377\0[k\377\0KX\377\0KX\377\213" + "\247\254\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377[\235\250\377\0o\202\377\0o\202\377\0o\202\377\0" + "o\202\377\0o\202\377\0o\202\377\0o\202\377\0Yh\377\0o\202\377\0gy\377" + "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0" + "bs\377\0o\202\377\0o\202\377\0Tc\377\0o\202\377\0.5\377\0HT\377\0]m\377" + "\0%+\377\0%+\377\0%+\377\0%+\377=Y^\3775RW\377\0%+\377\0%+\342\0#+H\0" + "%+\377\0%+\377g}\201\377\13/4\377\3(-\377\1&,\377\0*0\377\0*0\377\0%" + "+\377\0o\202\377\0o\202\377\0o\202\377\0""7@\377\0Ra\377\0N\\\377\0K" + "X\377\13R_\377\303\314\316\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377\332\335\335\3774\211\227\377\0o\202\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0]m\377\0n\200\377\0l\177" + "\377\0o\202\377\0o\202\377\0o\202\377\0o\202\377\0du\377\0""9C\377\0" + "^o\377\0o\202\377\0o\202\377\0""6\77\377\0o\202\377\0/7\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377Pin\377!AF\377\0%+\377\0$+\275" + "\0))\31\0%+\377\0%+\377Hcg\377(GL\377\2'-\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0.6\377\0o\202\377\0o\202\377\0%+\377\0%+\377\0du\377\0KX\377" + "\0KX\3774nx\377\333\334\335\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377\313\325\327\377\32|\215\377\0o\202\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\0[j\377\0m\200\3770\207\226\377\255" + "\306\312\377v\252\263\377\0o\202\377\0o\202\377\0%+\377\0%+\377\0^m\377" + "\0o\202\377\0o\202\377\0%+\377\0'-\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377j\200\203\377\6*0\377\0%+\377\0%+\217\0\0\0\0" + "\0%+\330\0%+\377'FK\377Hcg\377\2'-\377\1&,\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0o\202\377\0o\202\377\0%+\377\0%+\377\0o\202\377\0Yh\377\0K" + "X\377\0KX\377c\215\224\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\300\320\322\377\27{\214\377\0o\202\377" + "\0o\202\377\0o\202\377\0o\202\377\1[i\377k\245\256\377\334\335\336\377" + "\337\337\337\377\337\337\337\377U\232\246\377\0o\202\377\0%+\377\0%+" + "\377\0\\k\377\0o\202\377\0""3<\377\0%+\377\0%+\377\0%+\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\16""17\377ax|\377\0%+\377\0%+\377\0$+" + "M\0\0\0\0\0%*\227\0%+\377\7+1\377h~\201\377\1&,\377\1&,\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0EQ\377\0_n\377\0%+\377\0%+\377\0FS\377\0m\177" + "\377\0Q^\377\0KX\377\1LY\377\225\250\253\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\272\314\317\377" + "!\177\220\377\0o\202\377\0o\202\377\0o\202\377\212\250\255\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\327\333\334" + "\377,\205\225\377\0%+\377\0%+\377\0]l\377\0j|\377\0/6\377\0%+\377\0%" + "+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\3773QU\377=Y^\377\0" + "%+\377\0%+\374\0\"3\17\0\0\0\0\0%,K\0%+\377\0%+\377Rko\377\34=B\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0Zh\377\0i{\377\0MZ\377\0KX\377\13#'\377\270\274\275\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\332\335\335\377|\255\266\377L\225\241\377N\213\225\377p\215\222" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\303\321\323\377\21""39\377\0%+\377\0LY\377\0""8A\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" + "\377^uy\377\17""27\377\0%+\377\0%+\277\0\0\0\0\0\0\0\0\0@@\4\0%+\351" + "\0%+\377%EJ\377Ich\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0o\202\377\0bs\377\0KX\377\0" + "\31\35\377\33""15\377\315\317\320\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377Ty\200\377\241\266\272\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\241\253" + "\255\377\2'-\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" + "\377\0%+\377\0%+\377\0%+\377\21""49\377]ux\377\0%+\377\0%+\377\0$,c\0" + "\0\0\0\0\0\0\0\0\0\0\0\0%+\217\0%+\377\1&,\377dz~\377\12.3\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+" + "\377\0""7@\377\0Yh\377\1IV\377\5\35!\377\7\37#\3776IL\377\331\332\332" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\326\331\331\3777oy\377\305" + "\316\317\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377i}\200\377\0%+\377\0%+\377\0%+\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377Hcg\377&EK\377\0%+\377" + "\0%+\366\0$$\16\0\0\0\0\0\0\0\0\0\0\0\0\0#+$\0%+\373\0%+\377/MR\377A" + "]a\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\1&,\377\4(.\377\6>G\377\5R`\377\13&+\377\14#'\377\16%)\377O" + "_a\377\334\334\335\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\275\310" + "\312\377<s|\377\332\334\334\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\333\334\334\377/LQ\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\15""06\377ax|\377\1&,\377\0" + "%+\377\0%+\226\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+\245\0%+\377" + "\2'-\377f|\200\377\21""49\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\3(-\377\7+1\377\14/5\377\17""27\377\22""4:\377\26""7" + "<\377\22+.\377\22),\377\24*-\377^kn\377\336\336\336\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\225\256\262\377_\212\221\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\301" + "\306\306\377\15""06\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377Pin\377)HM\377\0%+\377\0%+\372\0!)\37\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0$+*\0%+\373\0%+\377%EJ\377Vor\377\0%+\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\1&,\377\5)/\377\12.3\377\16""17\377\22""4:\377" + "\26""8=\377\31:@\377\34=B\377\37>D\377\31""04\377\31/2\377\32/3\377^" + "ln\377\332\332\332\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377_\212\221" + "\377\224\255\262\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\221\236\240\377\2'-\377\0%+\377\0%+" + "\377\0%+\377\0%+\377\0%+\377\37@E\377[sw\377\1&,\377\0%+\377\0%+\231" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0%+\217\0%+" + "\377\0%+\377Tmq\3770NS\377\0%+\377\0%+\377\0%+\377\2'-\377\7+1\377\14" + "/5\377\20""38\377\25""7<\377\31:@\377\34=B\377\40@F\377$DI\377'FK\377" + "(FK\377\37""69\377\40""48\377!58\377P_b\377\322\324\324\377\337\337\337" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\332\334\334\3777oy\377\276\305\307\377\337\337\337\377\337" + "\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377A[_\377\4" + "(.\377\0%+\377\0%+\377\0%+\377\10,2\377g}\201\377\24""6<\377\0%+\377" + "\0%+\355\0$1\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0$$\16\0%+\344\0%+\377\13.4\377i\177\202\377\26""8=\377\0%+\377\2" + "'-\377\7+1\377\14/5\377\21""49\377\26""8=\377\33<A\377\37@E\377#CH\377" + "'FK\377*IN\377.LQ\3771OT\3772NS\377(=A\377&:=\377':=\377>PR\377\265\274" + "\275\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\302\311\312\377HXZ\377\327\330\330\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\241\254\255\377\22""4" + "9\377\12.3\377\5)/\377\0%+\377\1&,\377Tmq\3776SX\377\0%+\377\0%+\377" + "\0$,i\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0#+H\0%+\376\0%+\377\37@E\377h~\201\377\20""38\377\7+1\377\15" + "06\377\22""4:\377\27""9>\377\34=B\377!AF\377%EJ\377*IN\377.LQ\3771OT" + "\3774QV\3778UZ\377;W\\\377=X]\3770FI\377,\77B\377-@C\377/BE\377u\227" + "\234\377\332\334\334\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\234\243\245\377cps\377\337\337\337\377" + "\337\337\337\377\227\241\243\377\40@F\377\25""7<\377\20""38\377\12.3" + "\377\5)/\377\77[_\377Tmq\377\1&,\377\0%+\377\0%+\270\0\0\0\2\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0$,\206\0%+\377\0%+\3771OT\377e{\177\377\23""5;\377\22""4:\377\30" + ":\77\377\35>C\377\"BG\377'FK\377,KP\3770NS\3774QV\3779VZ\377<X]\377\77" + "[_\377B]b\377D_d\377Gbf\377=SW\3772DH\3773EG\3773EI\377\40`k\377\237" + "\264\270\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337" + "\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337" + "\377\337\337\337\377my{\377\207\221\222\377l{}\377%DI\377\40@F\377\33" + "<A\377\26""8=\377\20""38\3779VZ\377cz}\377\7+1\377\0%+\377\0%+\345\0" + "#.\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\3\0$+\275\0%+\377\0%+\377<X]\377g}\201" + "\377\"BG\377\36\77D\377#CH\377(GL\377-KP\3772PU\3777TY\377;W\\\377\77" + "[_\377C^c\377Fae\377Ich\377Lfj\377Nhl\377Pin\377Kbf\377<NQ\3778IL\377" + "4IM\377\0KX\377Xfh\377\216\251\256\377\327\330\330\377\337\337\337\377" + "\337\337\337\377\337\337\337\377\337\337\337\377\337\337\337\377\337" + "\337\337\377\234\243\244\377*AE\377/LQ\377*IN\377%EJ\377\40@F\377\33" + "<A\377D_d\377g}\201\377\12.3\377\0%+\377\0%+\365\0%*7\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\32""3\12\0%+\310\0%+\377\0%+\3779VZ\377p\205\210" + "\3772PU\377)HM\377.LQ\3773QU\3778UZ\377=Y^\377A]a\377Fae\377Ich\377M" + "gk\377Pin\377Slp\377Vor\377Wos\377Yqu\377Zrv\377Ocg\377ART\3770MS\377" + "=MP\377<LO\377\77PR\377fsu\377\204\215\217\377\227\236\237\377\222\232" + "\233\377\200\214\216\377Rhk\3778QU\377:W[\3775RW\3770NS\377+JO\377'F" + "K\377Vor\377e{\177\377\14/5\377\0%+\377\0%+\374\0$+N\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$1\25\0%+\321\0%+\377\0%+\377-" + "KP\377w\213\216\377Nhl\3774QV\3779VZ\377>Z_\377C^c\377Gbf\377Lfj\377" + "Pin\377Tmq\377Wos\377[sw\377]ux\377_vz\377`w{\377by|\377by|\377ax{\377" + "Vjl\377I[^\377BQT\377@OR\377>NQ\377<MO\377:KM\3778IL\377\77TW\377Ich" + "\377E`d\377@\\`\377;W\\\3776SX\3779VZ\377k\200\204\377[sw\377\7+1\377" + "\0%+\377\0%+\374\0$,b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\40""0\20\0%+\300\0%+\377\0%+\377\27""9>\377l\201" + "\205\377k\200\204\377Fae\377C^c\377Ich\377Mgk\377Rko\377Vor\377[sw\377" + "^uy\377ax|\377dz~\377f|\200\377h~\201\377j\200\203\377j\200\203\377j" + "\200\203\377j\200\203\377i\177\202\377e{~\377\\pt\377Wkn\377Thl\377S" + "il\377Wnr\377Tmq\377Pin\377Kei\377Fae\377B]b\377Yqu\377y\214\220\377" + "<X]\377\2'-\377\0%+\377\0%+\366\0$*O\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40\40\10\0%,\244" + "\0%+\377\0%+\377\7+1\377E`d\377~\221\224\377j\200\203\377Qjn\377Tmq\377" + "Xpt\377]ux\377ax|\377e{\177\377i\177\202\377k\200\204\377n\203\206\377" + "o\204\207\377q\206\211\377r\206\212\377r\206\212\377q\206\211\377p\205" + "\210\377o\204\207\377m\202\206\377j\200\203\377f|\200\377cz}\377_vz\377" + "[sw\377Vor\377Qjn\377[sw\377y\214\220\377i\177\202\377\34=B\377\0%+\377" + "\0%+\377\0%+\344\0#,:\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&+e\0%" + "+\365\0%+\377\0%+\377\26""8=\377]ux\377\203\225\230\377v\212\215\377" + "dz~\377cz}\377h~\201\377l\201\205\377o\204\207\377s\207\213\377u\211" + "\214\377w\213\216\377y\214\220\377y\214\220\377y\214\220\377y\214\220" + "\377x\214\217\377v\212\215\377t\210\213\377q\206\211\377n\203\206\377" + "j\200\203\377e{\177\377ax|\377k\200\204\377\177\222\225\377y\214\220" + "\3774QV\377\2'-\377\0%+\377\0%+\377\0%+\271\0$1\25\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&-(\0$+\275\0%+\377\0%+\377\0" + "%+\377\31:@\377Vor\377\205\227\232\377\210\231\234\377\200\222\225\377" + "w\213\216\377v\212\215\377y\214\220\377}\220\223\377~\221\224\377\200" + "\222\225\377\201\223\226\377\201\223\226\377\201\223\226\377\177\222" + "\225\377~\221\224\377{\216\221\377x\214\217\377u\211\214\377|\217\222" + "\377\206\230\232\377\210\231\234\377q\206\211\3773QU\377\5)/\377\0%+" + "\377\0%+\377\0&+\356\0%,h\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&+X\0%+\336\0%+\377\0%" + "+\377\0%+\377\12.3\3771OT\377cz}\377\210\231\234\377\217\237\242\377" + "\225\244\247\377\230\247\251\377\225\244\247\377\223\243\245\377\222" + "\242\244\377\221\241\244\377\223\243\245\377\224\244\246\377\226\245" + "\250\377\227\246\251\377\221\241\244\377\216\236\241\377v\212\215\377" + "Gbf\377\32;A\377\1&,\377\0%+\377\0%+\377\0%+\372\0$+\233\0&&\24\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0@@\4\0$,]\0%+\324\0%+\377\0%+\377\0%" + "+\377\0%+\377\4(.\377\35>C\3772PU\377Hcg\377ax|\377o\204\207\377y\214" + "\220\377{\216\221\377r\206\212\377j\200\203\377Vor\377:W[\377(GL\377" + "\16""17\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\366\0%+\226\0((\40\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0$-9\0$+\224\0%+\352\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377" + "\0%+\377\0%+\377\0%+\374\0%+\300\0$,b\0\"3\17\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\2\0&+/\0$+q\0%+\253\0%+\321\0%+\367\0%+\377\0" + "%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\377\0%+\343\0%+\274\0%+\217" + "\0$+M\0\"3\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -1650,99 +1661,100 @@ static const guint8 gnome_stock_sflphone[] = #pragma align 4 (gnome_stock_fail) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_fail[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_fail[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_fail[] = +static const guint8 gnome_stock_fail[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (2304) */ - "\0\0\11\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (96) */ - "\0\0\0`" - /* width (24) */ - "\0\0\0\30" - /* height (24) */ - "\0\0\0\30" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0>\0\7%;\0\11""8;\0\24\15\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0@\0\0\4=\0\13" - ".9\0\13-U\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1=\0\13" - "\\N\0\17\321V\0\20\341E\0\16\251>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12C\0\15\211R\0\20\334R\0" - "\20\333A\0\15\2059\0\0\11\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0=\0\13\\R\0" - "\20\335v\0\30\377}\0\32\377d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0" - "\31\377{\0\32\377Z\0\21\355A\0\15\206I\0\0\7\0\0\0\0\0\0\0\0""8\0\14" - ")O\0\17\323u\0\30\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256" - ">\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356" - "{\0\31\377~\0\32\377~\0\32\377{\0\31\377X\0\21\352<\0\11Q\0\0\0\0\0\0" - "\0\0""9\0\13CZ\0\22\350~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" - "\377d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213" - "[\0\22\356{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377g\0\24\376" - "A\0\13r\0\0\0\0\0\0\0\0""9\0\16\22H\0\15\265i\0\25\375~\0\32\377~\0\32" - "\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256>\0\11\35""3\0" - "\0\12B\0\15\213[\0\22\356{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0" - "\32\377r\0\30\377N\0\17\3209\0\12""1\0\0\0\0\0\0\0\0\0\0\0\0;\0\15'I" - "\0\16\272i\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377" - "d\0\24\372G\0\15\264A\0\13\244[\0\22\356{\0\31\377~\0\32\377~\0\32\377" - "~\0\32\377~\0\32\377r\0\30\377N\0\16\3249\0\13H\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0;\0\15'H\0\16\273j\0\25\375~\0\32\377~\0\32\377~\0" - "\32\377~\0\32\377~\0\32\377e\0\24\372Y\0\21\361{\0\31\377~\0\32\377~" - "\0\32\377~\0\32\377~\0\32\377r\0\30\377O\0\20\3259\0\13H\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""9\0\15(J\0\16\273j\0\25" - "\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" - "\377~\0\32\377~\0\32\377~\0\32\377s\0\30\377O\0\20\325;\0\12J\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\0" - "\14)I\0\16\274j\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" - "\377~\0\32\377~\0\32\377~\0\32\377s\0\30\377O\0\20\325:\0\12K\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0=\0\14*H\0\15\300g\0\24\376~\0\32\377~\0\32\377~\0\32\377" - "~\0\32\377~\0\32\377~\0\32\377s\0\30\377N\0\16\3309\0\12L\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0""3\0\0\12\77\0\13\246Z\0\22\364~\0\32\377~\0\32\377" - "~\0\32\377~\0\32\377~\0\32\377~\0\32\377g\0\24\376F\0\15\267>\0\11\35" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0\31\377~\0\32\377" - "~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372" - "F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0\31\377~\0\32" - "\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" - "\377~\0\32\377d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0\31\377" - "~\0\32\377~\0\32\377~\0\32\377~\0\32\377s\0\30\377o\0\26\377~\0\32\377" - "~\0\32\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256>\0\11\35" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356" - "{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377q\0\27\377N\0\16\325" - "G\0\15\276i\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377" - "d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0@\0\0\4C\0\15\212" - "[\0\22\356{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377q\0\27\377" - "O\0\17\3239\0\13H<\0\15&I\0\16\272i\0\25\375~\0\32\377~\0\32\377~\0\32" - "\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256:\0\14\26\0\0\0\0\0\0\0\0" - ";\0\11""8U\0\20\337{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377" - "q\0\27\377O\0\17\3239\0\13H\0\0\0\0\0\0\0\0<\0\15&I\0\16\272i\0\25\375" - "~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377`\0\23\366@\0\15d\0" - "\0\0\0\0\0\0\0""9\0\11:V\0\20\341}\0\31\377~\0\32\377~\0\32\377~\0\32" - "\377q\0\27\377O\0\17\3239\0\13H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<\0\15" - "&I\0\16\272i\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377c\0\24\370" - "=\0\14h\0\0\0\0\0\0\0\0+\0\0\6D\0\14\223^\0\23\362}\0\31\377~\0\32\377" - "q\0\27\377O\0\17\3239\0\13H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0<\0\15&I\0\16\272i\0\25\375~\0\32\377~\0\32\377g\0\24\374H\0\16" - "\2659\0\11\33\0\0\0\0\0\0\0\0\0\0\0\0""7\0\22\16C\0\14\224\\\0\22\357" - "h\0\25\377N\0\17\3219\0\13H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0<\0\15&I\0\16\272d\0\23\372b\0\23\371H\0\15\265" - ":\0\7#\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;\0\0\15<\0\13]C\0\13s" - ":\0\12""5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0:\0\10\37@\0\14k\77\0\14j>\0\11\35\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (2304) */ + "\0\0\11\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (96) */ + "\0\0\0`" + /* width (24) */ + "\0\0\0\30" + /* height (24) */ + "\0\0\0\30" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0>\0\7%;\0\11""8;\0\24\15\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0@\0\0\4=\0\13" + ".9\0\13-U\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1=\0\13" + "\\N\0\17\321V\0\20\341E\0\16\251>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12C\0\15\211R\0\20\334R\0" + "\20\333A\0\15\2059\0\0\11\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0=\0\13\\R\0" + "\20\335v\0\30\377}\0\32\377d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0" + "\31\377{\0\32\377Z\0\21\355A\0\15\206I\0\0\7\0\0\0\0\0\0\0\0""8\0\14" + ")O\0\17\323u\0\30\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256" + ">\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356" + "{\0\31\377~\0\32\377~\0\32\377{\0\31\377X\0\21\352<\0\11Q\0\0\0\0\0\0" + "\0\0""9\0\13CZ\0\22\350~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" + "\377d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213" + "[\0\22\356{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377g\0\24\376" + "A\0\13r\0\0\0\0\0\0\0\0""9\0\16\22H\0\15\265i\0\25\375~\0\32\377~\0\32" + "\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256>\0\11\35""3\0" + "\0\12B\0\15\213[\0\22\356{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0" + "\32\377r\0\30\377N\0\17\3209\0\12""1\0\0\0\0\0\0\0\0\0\0\0\0;\0\15'I" + "\0\16\272i\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377" + "d\0\24\372G\0\15\264A\0\13\244[\0\22\356{\0\31\377~\0\32\377~\0\32\377" + "~\0\32\377~\0\32\377r\0\30\377N\0\16\3249\0\13H\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0;\0\15'H\0\16\273j\0\25\375~\0\32\377~\0\32\377~\0" + "\32\377~\0\32\377~\0\32\377e\0\24\372Y\0\21\361{\0\31\377~\0\32\377~" + "\0\32\377~\0\32\377~\0\32\377r\0\30\377O\0\20\3259\0\13H\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""9\0\15(J\0\16\273j\0\25" + "\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" + "\377~\0\32\377~\0\32\377~\0\32\377s\0\30\377O\0\20\325;\0\12J\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\0" + "\14)I\0\16\274j\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" + "\377~\0\32\377~\0\32\377~\0\32\377s\0\30\377O\0\20\325:\0\12K\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0=\0\14*H\0\15\300g\0\24\376~\0\32\377~\0\32\377~\0\32\377" + "~\0\32\377~\0\32\377~\0\32\377s\0\30\377N\0\16\3309\0\12L\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0""3\0\0\12\77\0\13\246Z\0\22\364~\0\32\377~\0\32\377" + "~\0\32\377~\0\32\377~\0\32\377~\0\32\377g\0\24\376F\0\15\267>\0\11\35" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0\31\377~\0\32\377" + "~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372" + "F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0\31\377~\0\32" + "\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32" + "\377~\0\32\377d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356{\0\31\377" + "~\0\32\377~\0\32\377~\0\32\377~\0\32\377s\0\30\377o\0\26\377~\0\32\377" + "~\0\32\377~\0\32\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256>\0\11\35" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""3\0\0\12B\0\15\213[\0\22\356" + "{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377q\0\27\377N\0\16\325" + "G\0\15\276i\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377" + "d\0\24\372F\0\15\256>\0\11\35\0\0\0\0\0\0\0\0\0\0\0\0@\0\0\4C\0\15\212" + "[\0\22\356{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377q\0\27\377" + "O\0\17\3239\0\13H<\0\15&I\0\16\272i\0\25\375~\0\32\377~\0\32\377~\0\32" + "\377~\0\32\377~\0\32\377d\0\24\372F\0\15\256:\0\14\26\0\0\0\0\0\0\0\0" + ";\0\11""8U\0\20\337{\0\31\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377" + "q\0\27\377O\0\17\3239\0\13H\0\0\0\0\0\0\0\0<\0\15&I\0\16\272i\0\25\375" + "~\0\32\377~\0\32\377~\0\32\377~\0\32\377~\0\32\377`\0\23\366@\0\15d\0" + "\0\0\0\0\0\0\0""9\0\11:V\0\20\341}\0\31\377~\0\32\377~\0\32\377~\0\32" + "\377q\0\27\377O\0\17\3239\0\13H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<\0\15" + "&I\0\16\272i\0\25\375~\0\32\377~\0\32\377~\0\32\377~\0\32\377c\0\24\370" + "=\0\14h\0\0\0\0\0\0\0\0+\0\0\6D\0\14\223^\0\23\362}\0\31\377~\0\32\377" + "q\0\27\377O\0\17\3239\0\13H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0<\0\15&I\0\16\272i\0\25\375~\0\32\377~\0\32\377g\0\24\374H\0\16" + "\2659\0\11\33\0\0\0\0\0\0\0\0\0\0\0\0""7\0\22\16C\0\14\224\\\0\22\357" + "h\0\25\377N\0\17\3219\0\13H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0<\0\15&I\0\16\272d\0\23\372b\0\23\371H\0\15\265" + ":\0\7#\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;\0\0\15<\0\13]C\0\13s" + ":\0\12""5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0:\0\10\37@\0\14k\77\0\14j>\0\11\35\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; /* GdkPixbuf RGBA C-Source image dump */ @@ -1751,420 +1763,421 @@ static const guint8 gnome_stock_fail[] = #pragma align 4 (gnome_stock_user) #endif #ifdef __GNUC__ -static const guint8 gnome_stock_user[] __attribute__ ((__aligned__ (4))) = +static const guint8 gnome_stock_user[] __attribute__ ( (__aligned__ (4))) = #else -static const guint8 gnome_stock_user[] = +static const guint8 gnome_stock_user[] = #endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (9216) */ - "\0\0$\30" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (192) */ - "\0\0\0\300" - /* width (48) */ - "\0\0\0""0" - /* height (48) */ - "\0\0\0""0" - /* pixel_data: */ - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\252\252\3\205" - "\211\201E\217\220\215\217\214\217\212\272\211\213\206\306\213\215\207" - "\302\217\220\214\261\215\217\210r\211\211\203'\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\212\217\2052\214\216\211\264\255\256\253\300\333\333\331\311" - "\360\360\357\311\367\367\367\311\365\365\364\311\353\354\353\311\320" - "\320\315\307\226\226\223\302\215\217\213\213\222\222\200\16\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216" - "\216\213M\223\224\220\301\337\341\336\311\365\365\364\311\364\364\362" - "\311\365\365\364\311\366\366\365\311\366\366\366\311\366\366\365\311" - "\366\366\365\311\365\365\364\311\307\307\303\305\213\216\212\265\213" - "\213\213\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\212\217\2052\225\227\222\300\353\353\351\311\360\360\357\311\357\357" - "\355\311\362\362\361\311\366\366\365\311\372\372\371\311\373\373\372" - "\311\367\367\367\311\365\365\364\311\362\362\360\311\364\364\364\311" - "\325\326\324\310\215\220\213\256\222\222\222\7\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\200\200\200\4\216\220\213\265\342\342\341\311" - "\354\354\351\311\353\353\351\311\357\357\355\311\364\364\362\311\367" - "\367\366\311\373\373\373\311\376\376\374\311\372\372\371\311\365\365" - "\364\311\361\361\360\311\355\355\353\311\362\362\361\311\277\300\274" - "\303\215\217\212k\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\214" - "\206T\266\270\264\301\355\355\353\311\346\346\344\311\351\351\350\311" - "\357\357\355\311\362\362\361\311\366\366\365\311\371\371\371\311\372" - "\372\372\311\367\367\367\311\364\364\364\311\360\360\357\311\354\354" - "\353\311\351\351\350\311\355\355\354\311\220\222\216\274\207\207\207" - "\21\377\377\377\1\207\207\207\21\200\200\200\4\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\217\220\212" - "\250\336\336\333\311\346\346\343\311\346\346\343\311\351\351\347\311" - "\355\355\353\311\360\360\357\311\364\364\362\311\365\365\364\311\366" - "\366\365\311\365\365\364\311\362\362\361\311\357\357\355\311\353\353" - "\351\311\347\347\346\311\337\337\336\317\235\236\233\343\216\220\213" - "\351\212\214\207\374\220\222\215\370\211\213\206\375\215\217\213\351" - "\216\220\211\232\212\212\2050\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\222\222\222\7\214\216\211\305\355\355\353\311\341\341\335\311" - "\343\343\341\311\347\347\346\311\351\351\350\311\355\355\354\311\360" - "\360\357\311\362\362\360\311\362\362\361\311\361\361\360\311\357\357" - "\355\311\354\354\351\311\351\351\347\311\263\264\261\344\221\223\216" - "\375\306\307\304\376\351\352\350\377\367\367\367\377\371\371\370\377" - "\371\371\371\377\357\357\356\377\320\321\317\376\224\226\221\366\215" - "\220\212\250\200\200\200\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\211\211" - "\34\227\232\225\300\353\353\351\311\336\336\333\311\341\341\336\311\346" - "\346\342\311\350\350\346\311\351\351\350\311\354\354\351\311\357\357" - "\354\311\357\357\354\311\355\355\353\311\353\353\351\311\351\351\347" - "\311\245\246\243\356\252\253\250\375\357\357\356\377\364\364\363\377" - "\364\364\362\377\365\365\364\377\367\367\366\377\367\367\366\377\366" - "\366\365\377\366\366\365\377\364\364\363\377\274\275\272\371\215\220" - "\213\327\210\210\210\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\211\211\34\227\232" - "\225\300\351\351\347\311\333\333\330\311\337\337\333\311\342\342\337" - "\311\344\344\342\311\347\347\344\311\350\350\346\311\351\351\347\311" - "\351\351\350\311\351\351\347\311\350\350\346\311\260\261\256\346\257" - "\260\254\375\361\361\360\377\356\356\354\377\357\357\356\377\363\363" - "\362\377\367\367\366\377\372\372\372\377\373\373\372\377\370\370\367" - "\377\364\364\363\377\361\361\360\377\364\364\363\377\306\306\304\372" - "\217\221\213\302\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\222\222\222\7\214\216" - "\211\305\351\351\350\311\331\331\325\311\333\333\331\311\337\337\333" - "\311\341\341\336\311\343\343\341\311\346\346\342\311\346\346\343\311" - "\346\346\343\311\346\346\343\311\323\324\317\321\231\233\227\374\356" - "\356\355\377\352\352\350\377\354\354\352\377\360\360\356\377\364\364" - "\363\377\370\370\367\377\374\374\374\377\375\375\374\377\371\371\370" - "\377\364\364\363\377\360\360\357\377\355\355\353\377\362\362\361\377" - "\254\255\251\362\212\214\207Y\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\214\216\211\251" - "\332\332\330\311\333\333\331\311\331\331\325\311\333\333\330\311\336" - "\336\332\311\337\337\333\311\341\341\336\311\341\341\336\311\341\341" - "\337\311\341\341\336\311\242\243\236\360\323\324\321\377\352\352\347" - "\377\347\347\345\377\353\353\351\377\357\357\355\377\363\363\362\377" - "\366\366\366\377\371\371\371\377\371\371\371\377\367\367\366\377\363" - "\363\362\377\357\357\356\377\354\354\352\377\352\352\350\377\346\346" - "\345\377\215\216\212\347\200\200\200\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0}\200z\\\263\263" - "\257\302\346\346\343\311\326\326\323\311\330\330\324\311\332\332\326" - "\311\333\333\330\311\335\335\331\311\335\335\332\311\335\335\332\311" - "\327\327\325\314\217\221\215\375\354\354\353\377\343\343\340\377\346" - "\346\343\377\352\352\347\377\355\355\354\377\361\361\357\377\363\363" - "\362\377\365\365\364\377\366\366\365\377\364\364\363\377\361\361\360" - "\377\356\356\354\377\352\352\350\377\346\346\344\377\357\357\355\377" - "\240\242\236\360\206\213\2067\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40\40\40\20\213\215\210" - "\271\333\333\331\311\341\341\335\311\326\326\323\311\326\326\323\311" - "\326\326\324\311\330\330\325\311\331\331\325\311\331\331\326\311\300" - "\301\275\327\250\251\246\374\353\353\350\377\340\340\335\377\344\344" - "\341\377\350\350\345\377\353\353\351\377\356\356\354\377\360\360\357" - "\377\361\361\360\377\361\361\360\377\360\360\357\377\356\356\354\377" - "\353\353\351\377\350\350\346\377\345\345\342\377\352\352\350\377\302" - "\303\277\373\207\211\205u\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\203|L\200\201~\303\224\227" - "\221\311\342\342\341\311\341\341\336\311\326\326\323\311\326\326\323" - "\311\326\326\323\311\326\326\323\311\326\326\323\311\266\267\263\334" - "\263\264\261\375\347\347\345\377\336\336\333\377\342\342\337\377\345" - "\345\343\377\350\350\346\377\352\352\350\377\354\354\352\377\355\355" - "\354\377\355\355\354\377\354\354\353\377\353\353\351\377\350\350\346" - "\377\345\345\343\377\342\342\337\377\346\346\344\377\314\315\311\377" - "\213\215\212\226\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\377\2\215\217\211\200\247\250\244\302\330\330" - "\326\311\256\257\255\311\222\223\217\311\326\326\324\311\350\350\346" - "\311\337\337\333\311\331\331\325\311\326\326\323\311\326\326\324\311" - "\273\273\267\333\261\262\256\375\346\346\344\377\334\334\331\377\337" - "\337\334\377\342\342\337\377\345\345\342\377\347\347\344\377\350\350" - "\346\377\351\351\347\377\351\351\347\377\350\350\346\377\347\347\345" - "\377\345\345\342\377\342\342\340\377\340\340\335\377\344\344\342\377" - "\311\312\307\377\212\214\207\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\2\217\217\211\210\270\270\263\302" - "\366\366\365\311\347\347\346\311\316\316\314\311\256\257\253\311\221" - "\221\214\311\247\247\244\311\320\320\316\311\343\343\341\311\351\351" - "\347\311\350\350\346\311\310\310\304\325\241\243\240\374\347\347\345" - "\377\331\331\326\377\334\334\331\377\337\337\334\377\341\341\336\377" - "\343\343\340\377\344\344\342\377\345\345\343\377\345\345\343\377\344" - "\344\342\377\343\343\341\377\341\341\337\377\337\337\334\377\335\335" - "\331\377\346\346\343\377\272\273\270\371\211\211\204l\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\217\221\213r\270\270\264" - "\302\364\364\364\311\357\357\354\311\357\357\355\311\337\337\336\311" - "\316\316\314\311\274\274\274\311\242\242\241\311\224\224\222\311\216" - "\221\212\311\212\214\206\311\214\215\210\311\221\222\214\312\213\215" - "\210\375\346\346\344\377\330\330\324\377\331\331\325\377\333\333\330" - "\377\336\336\332\377\337\337\334\377\340\340\335\377\341\341\336\377" - "\341\341\336\377\340\340\335\377\337\337\334\377\336\336\333\377\334" - "\334\330\377\331\331\326\377\352\352\347\377\227\230\225\363\206\214" - "\206(\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213\213\206" - "7\237\241\233\300\364\364\362\311\354\354\351\311\354\354\353\311\357" - "\357\355\311\361\361\357\311\343\343\342\311\324\324\323\311\310\310" - "\310\311\300\300\300\311\271\271\271\311\270\270\270\311\272\272\272" - "\311\275\275\274\311\230\231\226\354\306\306\303\376\342\342\337\377" - "\326\326\322\377\330\330\324\377\332\332\326\377\333\333\330\377\334" - "\334\331\377\335\335\332\377\335\335\332\377\334\334\331\377\333\333" - "\330\377\332\332\326\377\330\330\324\377\336\336\333\377\330\330\325" - "\377\213\215\210\331\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\200\200\200\2\216\220\212\265\351\351\350\311\355\355\353\311\351" - "\351\350\311\354\354\353\311\357\357\355\311\361\361\357\311\364\364" - "\362\311\355\355\354\311\342\342\342\311\332\332\332\311\326\326\326" - "\311\324\324\324\311\325\325\325\311\331\331\330\311\303\303\302\321" - "\220\222\216\375\343\343\341\377\335\335\332\377\326\326\322\377\326" - "\326\322\377\327\327\323\377\330\330\324\377\331\331\325\377\331\331" - "\325\377\330\330\325\377\327\327\324\377\326\326\322\377\332\332\326" - "\377\347\347\345\377\231\232\226\367knkJ\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\211\214\205E\265\265\262\300\362\362\360\311" - "\350\350\346\311\351\351\350\311\354\354\351\311\357\357\355\311\360" - "\360\357\311\362\362\361\311\365\365\364\311\367\367\366\311\366\366" - "\365\311\362\362\362\311\360\360\360\311\362\362\362\311\360\360\357" - "\313\245\246\243\354\213\213\207\376\234\236\231\377\345\345\343\377" - "\340\340\335\377\326\326\322\377\326\326\322\377\326\326\322\377\326" - "\326\322\377\326\326\322\377\326\326\322\377\326\326\322\377\335\335" - "\331\377\351\351\346\377\255\257\253\377\207\211\205\374\200\202\177" - "\215\252\252\252\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\221" - "\214\236\341\342\341\311\351\351\351\311\347\347\346\311\351\351\347" - "\311\351\351\347\311\357\357\354\311\360\360\357\311\362\362\360\311" - "\364\364\364\311\366\366\365\311\367\367\366\311\367\367\367\311\371" - "\371\371\311\354\354\353\316\230\231\225\370\306\310\304\376\330\330" - "\327\377\246\247\245\377\226\227\224\377\332\333\327\377\350\350\346" - "\377\337\337\334\377\333\333\327\377\331\331\325\377\332\332\326\377" - "\336\336\333\377\346\346\344\377\341\341\336\377\242\244\240\377\236" - "\237\233\377\330\330\327\377\256\261\254\367\216\217\212\302\200\200" - "\200\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0fff\5\214\217\211\303\364\364\362\311" - "\346\346\343\311\347\347\344\311\336\336\333\311\351\351\350\311\355" - "\355\353\311\357\357\355\311\361\361\357\311\362\362\361\311\364\364" - "\364\311\365\365\364\311\366\366\366\311\350\351\346\317\230\231\224" - "\371\331\332\330\376\365\365\364\377\341\341\340\377\313\313\312\377" - "\252\253\251\377\217\221\213\377\245\247\243\377\314\315\312\377\336" - "\336\333\377\344\344\341\377\340\340\335\377\322\322\320\377\260\261" - "\256\377\216\220\212\377\245\245\242\377\315\315\313\377\346\346\344" - "\377\367\367\366\377\300\301\275\370\216\217\212\304\216\216\216\11\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\211\211\200\32\227\232\226\300\362\362\361\311\344" - "\344\341\311\344\344\342\311\310\310\307\311\351\351\350\311\354\354" - "\351\311\357\357\354\311\357\357\357\311\361\361\360\311\362\362\361" - "\311\364\364\362\311\360\360\360\312\232\234\230\367\332\332\330\376" - "\363\363\363\377\355\355\353\377\357\357\355\377\336\336\335\377\314" - "\314\313\377\273\273\273\377\243\243\242\377\225\227\223\377\220\222" - "\215\377\215\217\213\377\217\221\215\377\225\226\222\377\240\241\237" - "\377\273\273\272\377\315\315\314\377\337\337\336\377\357\357\356\377" - "\357\357\355\377\366\366\365\377\276\300\275\370\216\217\213\262\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\207\207\200\"\234\237\233\277\361\361\360\311\343\343" - "\341\311\306\306\305\311\333\333\331\311\351\351\347\311\351\351\351" - "\311\354\354\351\311\357\357\354\311\357\357\357\311\360\360\357\311" - "\361\361\360\311\264\265\261\350\303\303\301\375\364\364\362\377\353" - "\353\351\377\355\355\353\377\357\357\356\377\361\361\360\377\341\341" - "\340\377\324\324\323\377\310\310\310\377\300\300\277\377\274\274\274" - "\377\273\273\273\377\274\274\274\377\301\301\301\377\311\311\311\377" - "\325\325\324\377\343\343\342\377\362\362\360\377\357\357\356\377\355" - "\355\354\377\355\355\353\377\365\365\364\377\250\250\244\364\210\213" - "\206e\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\211\211\211\15\220\221\214\303\364\364\362\311\333\333" - "\331\311\270\270\265\311\346\346\343\311\347\347\346\311\351\351\347" - "\311\353\353\351\311\354\354\351\311\355\355\354\311\357\357\355\311" - "\336\336\336\320\233\234\227\374\362\362\361\377\352\352\350\377\353" - "\353\351\377\355\355\353\377\357\357\356\377\361\361\360\377\363\363" - "\362\377\355\355\354\377\343\343\342\377\334\334\333\377\330\330\330" - "\377\327\327\327\377\330\330\330\377\334\334\334\377\344\344\343\377" - "\357\357\356\377\364\364\363\377\362\362\360\377\357\357\356\377\355" - "\355\354\377\353\353\351\377\355\355\353\377\357\357\355\377\217\221" - "\214\357\217\217\200\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213\216\212\267\347\347\346\311\313" - "\313\312\311\312\312\310\311\344\344\342\311\346\346\343\311\347\347" - "\346\311\351\351\347\311\351\351\350\311\353\353\351\311\354\354\353" - "\311\254\255\247\354\325\326\324\376\356\356\354\377\350\350\346\377" - "\352\352\351\377\355\355\353\377\357\357\355\377\361\361\360\377\363" - "\363\362\377\365\365\364\377\367\367\366\377\367\367\366\377\364\364" - "\364\377\364\364\364\377\364\364\364\377\370\370\370\377\367\367\367" - "\377\365\365\364\377\363\363\362\377\361\361\360\377\357\357\356\377" - "\355\355\353\377\353\353\351\377\351\351\347\377\360\360\356\377\313" - "\314\311\371\214\216\213\212\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\214\214\207j\276\276\272\304" - "\330\330\326\311\341\341\335\311\343\343\341\311\344\344\342\311\346" - "\346\343\311\347\347\346\311\350\350\346\311\351\351\347\311\347\347" - "\346\312\215\217\213\375\361\362\360\377\347\347\345\377\350\350\346" - "\377\352\352\350\377\352\352\350\377\356\356\354\377\360\360\357\377" - "\362\362\361\377\364\364\363\377\366\366\365\377\367\367\367\377\370" - "\370\370\377\371\371\370\377\371\371\370\377\367\367\367\377\366\366" - "\365\377\364\364\363\377\362\362\361\377\361\361\357\377\356\356\355" - "\377\353\353\352\377\352\352\350\377\350\350\346\377\350\350\346\377" - "\361\361\357\377\214\216\211\362\231\231\231\5\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0NNC\27\212\213\207" - "\277\325\325\324\311\351\351\350\311\341\341\336\311\343\343\341\311" - "\344\344\341\311\346\346\343\311\346\346\344\311\347\347\346\311\316" - "\317\315\325\252\253\246\374\361\361\360\377\345\345\343\377\347\347" - "\345\377\326\326\324\377\353\353\351\377\355\355\354\377\357\357\356" - "\377\361\361\360\377\363\363\361\377\364\364\363\377\365\365\364\377" - "\366\366\365\377\367\367\366\377\366\366\366\377\366\366\365\377\364" - "\364\363\377\363\363\362\377\361\361\360\377\357\357\356\377\356\356" - "\354\377\354\354\352\377\352\352\350\377\350\350\345\377\346\346\343" - "\377\361\361\360\377\253\256\251\361\211\211\205C\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16^^[L\220" - "\220\214\303\344\344\342\311\357\357\355\311\347\347\346\311\344\344" - "\342\311\344\344\342\311\344\344\342\311\346\346\343\311\300\301\277" - "\333\271\271\266\375\356\356\355\377\344\344\342\377\332\332\330\377" - "\326\326\324\377\352\352\350\377\354\354\352\377\356\356\354\377\357" - "\357\356\377\361\361\360\377\362\362\361\377\363\363\362\377\364\364" - "\363\377\364\364\363\377\364\364\363\377\364\364\363\377\362\362\361" - "\377\361\361\360\377\360\360\356\377\356\356\355\377\354\354\353\377" - "\352\352\351\377\332\332\331\377\347\347\344\377\345\345\342\377\355" - "\355\353\377\310\310\306\374\210\212\206v\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\13\0\0\0\34UURT\211" - "\213\207\300\266\267\265\304\336\336\333\311\354\354\351\311\360\360" - "\357\311\364\364\364\311\365\365\364\311\306\306\303\336\274\276\272" - "\375\355\355\354\377\343\343\341\377\276\276\275\377\347\347\345\377" - "\351\351\347\377\353\353\351\377\354\354\353\377\356\356\354\377\357" - "\357\356\377\360\360\357\377\361\361\360\377\362\362\361\377\362\362" - "\361\377\362\362\361\377\361\361\360\377\361\361\357\377\357\357\356" - "\377\356\356\355\377\355\355\353\377\353\353\351\377\351\351\347\377" - "\336\336\333\377\317\317\315\377\344\344\341\377\352\352\350\377\325" - "\325\322\377\213\216\211\232\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\21\0\0\0\34\34\34\34-" - "ilgf\205\207\200\237\212\214\210\272\212\213\206\302\207\212\205\310" - "\210\212\205\311\210\212\205\327\251\253\247\374\360\360\356\377\315" - "\315\313\377\303\303\300\377\346\346\343\377\350\350\345\377\351\351" - "\347\377\353\353\351\377\354\354\352\377\355\355\354\377\356\356\355" - "\377\357\357\356\377\360\360\356\377\360\360\357\377\360\360\356\377" - "\357\357\356\377\356\356\355\377\356\356\354\377\354\354\353\377\353" - "\353\351\377\352\352\347\377\350\350\346\377\346\346\344\377\266\266" - "\264\377\327\327\324\377\352\352\350\377\320\320\316\377\214\216\210" - "\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\13\0\0\0\21\0\0\0\24\0\0\0\26\0\0\0\26" - "\0\0\0\26\0\0\0\26\0\0\0\26<<<&\213\215\211\370\360\360\357\377\272\272" - "\267\377\331\331\326\377\345\345\342\377\346\346\344\377\350\350\345" - "\377\351\351\347\377\352\352\350\377\353\353\352\377\354\354\353\377" - "\355\355\353\377\356\356\354\377\356\356\354\377\356\356\354\377\355" - "\355\353\377\354\354\353\377\354\354\352\377\352\352\351\377\351\351" - "\347\377\350\350\346\377\346\346\344\377\345\345\342\377\270\270\266" - "\377\265\265\263\377\355\355\353\377\273\274\267\366\210\213\206e\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\2\0\0\0\2\0\0\0\2\0\0" - "\0\2\0\0\0\2\0\0\0\2\214\215\211\272\316\317\314\376\323\323\321\377" - "\341\341\337\377\343\343\340\377\345\345\342\377\346\346\344\377\347" - "\347\345\377\350\350\346\377\351\351\347\377\352\352\350\377\353\353" - "\351\377\353\353\351\377\353\353\352\377\353\353\351\377\353\353\351" - "\377\352\352\350\377\352\352\347\377\351\351\346\377\347\347\345\377" - "\346\346\344\377\345\345\342\377\343\343\341\377\307\307\304\377\254" - "\254\252\377\350\350\346\377\217\221\215\366||u#\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0`d`8\207\210\205\367\342\342\341\377\350\350\346\377\341\341\337" - "\377\343\343\340\377\344\344\341\377\345\345\343\377\346\346\344\377" - "\347\347\345\377\350\350\346\377\351\351\347\377\351\351\347\377\351" - "\351\347\377\351\351\347\377\351\351\347\377\350\350\346\377\350\350" - "\345\377\347\347\344\377\346\346\343\377\344\344\342\377\343\343\340" - "\377\342\342\337\377\325\325\324\377\327\327\326\377\263\264\261\371" - "\202\203\177\261\0\0\0\21\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\26mmkz\227\231" - "\225\370\350\350\346\377\356\356\355\377\350\350\346\377\346\346\344" - "\377\346\346\344\377\345\345\344\377\346\346\344\377\347\347\345\377" - "\350\350\346\377\351\351\346\377\351\351\347\377\351\351\346\377\350" - "\350\346\377\350\350\346\377\347\347\345\377\347\347\345\377\347\347" - "\344\377\346\346\345\377\351\351\347\377\356\356\355\377\354\354\352" - "\377\257\260\256\373\207\210\203\341\36\36\36""3\0\0\0\24\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\22\0\0\0&_a]y\213\216\207\365\265\267\264\370\332" - "\332\330\377\346\346\345\377\354\354\352\377\362\362\361\377\361\361" - "\360\377\362\362\361\377\361\361\360\377\361\361\357\377\361\361\357" - "\377\361\361\357\377\360\360\357\377\360\360\357\377\360\360\357\377" - "\357\357\357\377\356\356\355\377\347\347\346\377\334\334\333\377\273" - "\274\272\374\216\220\212\370|}y\300\33\33\33A\0\0\0$\0\0\0\20\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\26\0\0\0%\34\34\34""7hhf}\203\204\177" - "\275\211\214\206\337\212\213\207\352\212\214\207\364\211\213\206\367" - "\211\213\206\367\211\213\206\367\211\213\206\367\211\213\206\367\211" - "\213\206\367\211\213\206\367\211\213\206\367\211\213\206\367\211\213" - "\206\367\212\214\207\362\212\213\206\342\205\210\203\315qro\223<<<L\0" - "\0\0-\0\0\0$\0\0\0\25\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2" - "\0\0\0\16\0\0\0\24\0\0\0\30\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0" - "\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0" - "\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\30\0\0\0\24" - "\0\0\0\15\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1" - "\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0" - "\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + { "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (9216) */ + "\0\0$\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (192) */ + "\0\0\0\300" + /* width (48) */ + "\0\0\0""0" + /* height (48) */ + "\0\0\0""0" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\252\252\3\205" + "\211\201E\217\220\215\217\214\217\212\272\211\213\206\306\213\215\207" + "\302\217\220\214\261\215\217\210r\211\211\203'\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\212\217\2052\214\216\211\264\255\256\253\300\333\333\331\311" + "\360\360\357\311\367\367\367\311\365\365\364\311\353\354\353\311\320" + "\320\315\307\226\226\223\302\215\217\213\213\222\222\200\16\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216" + "\216\213M\223\224\220\301\337\341\336\311\365\365\364\311\364\364\362" + "\311\365\365\364\311\366\366\365\311\366\366\366\311\366\366\365\311" + "\366\366\365\311\365\365\364\311\307\307\303\305\213\216\212\265\213" + "\213\213\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\212\217\2052\225\227\222\300\353\353\351\311\360\360\357\311\357\357" + "\355\311\362\362\361\311\366\366\365\311\372\372\371\311\373\373\372" + "\311\367\367\367\311\365\365\364\311\362\362\360\311\364\364\364\311" + "\325\326\324\310\215\220\213\256\222\222\222\7\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\200\200\200\4\216\220\213\265\342\342\341\311" + "\354\354\351\311\353\353\351\311\357\357\355\311\364\364\362\311\367" + "\367\366\311\373\373\373\311\376\376\374\311\372\372\371\311\365\365" + "\364\311\361\361\360\311\355\355\353\311\362\362\361\311\277\300\274" + "\303\215\217\212k\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\214" + "\206T\266\270\264\301\355\355\353\311\346\346\344\311\351\351\350\311" + "\357\357\355\311\362\362\361\311\366\366\365\311\371\371\371\311\372" + "\372\372\311\367\367\367\311\364\364\364\311\360\360\357\311\354\354" + "\353\311\351\351\350\311\355\355\354\311\220\222\216\274\207\207\207" + "\21\377\377\377\1\207\207\207\21\200\200\200\4\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\217\220\212" + "\250\336\336\333\311\346\346\343\311\346\346\343\311\351\351\347\311" + "\355\355\353\311\360\360\357\311\364\364\362\311\365\365\364\311\366" + "\366\365\311\365\365\364\311\362\362\361\311\357\357\355\311\353\353" + "\351\311\347\347\346\311\337\337\336\317\235\236\233\343\216\220\213" + "\351\212\214\207\374\220\222\215\370\211\213\206\375\215\217\213\351" + "\216\220\211\232\212\212\2050\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\222\222\222\7\214\216\211\305\355\355\353\311\341\341\335\311" + "\343\343\341\311\347\347\346\311\351\351\350\311\355\355\354\311\360" + "\360\357\311\362\362\360\311\362\362\361\311\361\361\360\311\357\357" + "\355\311\354\354\351\311\351\351\347\311\263\264\261\344\221\223\216" + "\375\306\307\304\376\351\352\350\377\367\367\367\377\371\371\370\377" + "\371\371\371\377\357\357\356\377\320\321\317\376\224\226\221\366\215" + "\220\212\250\200\200\200\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\211\211" + "\34\227\232\225\300\353\353\351\311\336\336\333\311\341\341\336\311\346" + "\346\342\311\350\350\346\311\351\351\350\311\354\354\351\311\357\357" + "\354\311\357\357\354\311\355\355\353\311\353\353\351\311\351\351\347" + "\311\245\246\243\356\252\253\250\375\357\357\356\377\364\364\363\377" + "\364\364\362\377\365\365\364\377\367\367\366\377\367\367\366\377\366" + "\366\365\377\366\366\365\377\364\364\363\377\274\275\272\371\215\220" + "\213\327\210\210\210\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\211\211\34\227\232" + "\225\300\351\351\347\311\333\333\330\311\337\337\333\311\342\342\337" + "\311\344\344\342\311\347\347\344\311\350\350\346\311\351\351\347\311" + "\351\351\350\311\351\351\347\311\350\350\346\311\260\261\256\346\257" + "\260\254\375\361\361\360\377\356\356\354\377\357\357\356\377\363\363" + "\362\377\367\367\366\377\372\372\372\377\373\373\372\377\370\370\367" + "\377\364\364\363\377\361\361\360\377\364\364\363\377\306\306\304\372" + "\217\221\213\302\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\222\222\222\7\214\216" + "\211\305\351\351\350\311\331\331\325\311\333\333\331\311\337\337\333" + "\311\341\341\336\311\343\343\341\311\346\346\342\311\346\346\343\311" + "\346\346\343\311\346\346\343\311\323\324\317\321\231\233\227\374\356" + "\356\355\377\352\352\350\377\354\354\352\377\360\360\356\377\364\364" + "\363\377\370\370\367\377\374\374\374\377\375\375\374\377\371\371\370" + "\377\364\364\363\377\360\360\357\377\355\355\353\377\362\362\361\377" + "\254\255\251\362\212\214\207Y\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\214\216\211\251" + "\332\332\330\311\333\333\331\311\331\331\325\311\333\333\330\311\336" + "\336\332\311\337\337\333\311\341\341\336\311\341\341\336\311\341\341" + "\337\311\341\341\336\311\242\243\236\360\323\324\321\377\352\352\347" + "\377\347\347\345\377\353\353\351\377\357\357\355\377\363\363\362\377" + "\366\366\366\377\371\371\371\377\371\371\371\377\367\367\366\377\363" + "\363\362\377\357\357\356\377\354\354\352\377\352\352\350\377\346\346" + "\345\377\215\216\212\347\200\200\200\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0}\200z\\\263\263" + "\257\302\346\346\343\311\326\326\323\311\330\330\324\311\332\332\326" + "\311\333\333\330\311\335\335\331\311\335\335\332\311\335\335\332\311" + "\327\327\325\314\217\221\215\375\354\354\353\377\343\343\340\377\346" + "\346\343\377\352\352\347\377\355\355\354\377\361\361\357\377\363\363" + "\362\377\365\365\364\377\366\366\365\377\364\364\363\377\361\361\360" + "\377\356\356\354\377\352\352\350\377\346\346\344\377\357\357\355\377" + "\240\242\236\360\206\213\2067\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40\40\40\20\213\215\210" + "\271\333\333\331\311\341\341\335\311\326\326\323\311\326\326\323\311" + "\326\326\324\311\330\330\325\311\331\331\325\311\331\331\326\311\300" + "\301\275\327\250\251\246\374\353\353\350\377\340\340\335\377\344\344" + "\341\377\350\350\345\377\353\353\351\377\356\356\354\377\360\360\357" + "\377\361\361\360\377\361\361\360\377\360\360\357\377\356\356\354\377" + "\353\353\351\377\350\350\346\377\345\345\342\377\352\352\350\377\302" + "\303\277\373\207\211\205u\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\203|L\200\201~\303\224\227" + "\221\311\342\342\341\311\341\341\336\311\326\326\323\311\326\326\323" + "\311\326\326\323\311\326\326\323\311\326\326\323\311\266\267\263\334" + "\263\264\261\375\347\347\345\377\336\336\333\377\342\342\337\377\345" + "\345\343\377\350\350\346\377\352\352\350\377\354\354\352\377\355\355" + "\354\377\355\355\354\377\354\354\353\377\353\353\351\377\350\350\346" + "\377\345\345\343\377\342\342\337\377\346\346\344\377\314\315\311\377" + "\213\215\212\226\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\377\2\215\217\211\200\247\250\244\302\330\330" + "\326\311\256\257\255\311\222\223\217\311\326\326\324\311\350\350\346" + "\311\337\337\333\311\331\331\325\311\326\326\323\311\326\326\324\311" + "\273\273\267\333\261\262\256\375\346\346\344\377\334\334\331\377\337" + "\337\334\377\342\342\337\377\345\345\342\377\347\347\344\377\350\350" + "\346\377\351\351\347\377\351\351\347\377\350\350\346\377\347\347\345" + "\377\345\345\342\377\342\342\340\377\340\340\335\377\344\344\342\377" + "\311\312\307\377\212\214\207\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\2\217\217\211\210\270\270\263\302" + "\366\366\365\311\347\347\346\311\316\316\314\311\256\257\253\311\221" + "\221\214\311\247\247\244\311\320\320\316\311\343\343\341\311\351\351" + "\347\311\350\350\346\311\310\310\304\325\241\243\240\374\347\347\345" + "\377\331\331\326\377\334\334\331\377\337\337\334\377\341\341\336\377" + "\343\343\340\377\344\344\342\377\345\345\343\377\345\345\343\377\344" + "\344\342\377\343\343\341\377\341\341\337\377\337\337\334\377\335\335" + "\331\377\346\346\343\377\272\273\270\371\211\211\204l\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\217\221\213r\270\270\264" + "\302\364\364\364\311\357\357\354\311\357\357\355\311\337\337\336\311" + "\316\316\314\311\274\274\274\311\242\242\241\311\224\224\222\311\216" + "\221\212\311\212\214\206\311\214\215\210\311\221\222\214\312\213\215" + "\210\375\346\346\344\377\330\330\324\377\331\331\325\377\333\333\330" + "\377\336\336\332\377\337\337\334\377\340\340\335\377\341\341\336\377" + "\341\341\336\377\340\340\335\377\337\337\334\377\336\336\333\377\334" + "\334\330\377\331\331\326\377\352\352\347\377\227\230\225\363\206\214" + "\206(\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213\213\206" + "7\237\241\233\300\364\364\362\311\354\354\351\311\354\354\353\311\357" + "\357\355\311\361\361\357\311\343\343\342\311\324\324\323\311\310\310" + "\310\311\300\300\300\311\271\271\271\311\270\270\270\311\272\272\272" + "\311\275\275\274\311\230\231\226\354\306\306\303\376\342\342\337\377" + "\326\326\322\377\330\330\324\377\332\332\326\377\333\333\330\377\334" + "\334\331\377\335\335\332\377\335\335\332\377\334\334\331\377\333\333" + "\330\377\332\332\326\377\330\330\324\377\336\336\333\377\330\330\325" + "\377\213\215\210\331\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\200\200\200\2\216\220\212\265\351\351\350\311\355\355\353\311\351" + "\351\350\311\354\354\353\311\357\357\355\311\361\361\357\311\364\364" + "\362\311\355\355\354\311\342\342\342\311\332\332\332\311\326\326\326" + "\311\324\324\324\311\325\325\325\311\331\331\330\311\303\303\302\321" + "\220\222\216\375\343\343\341\377\335\335\332\377\326\326\322\377\326" + "\326\322\377\327\327\323\377\330\330\324\377\331\331\325\377\331\331" + "\325\377\330\330\325\377\327\327\324\377\326\326\322\377\332\332\326" + "\377\347\347\345\377\231\232\226\367knkJ\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\211\214\205E\265\265\262\300\362\362\360\311" + "\350\350\346\311\351\351\350\311\354\354\351\311\357\357\355\311\360" + "\360\357\311\362\362\361\311\365\365\364\311\367\367\366\311\366\366" + "\365\311\362\362\362\311\360\360\360\311\362\362\362\311\360\360\357" + "\313\245\246\243\354\213\213\207\376\234\236\231\377\345\345\343\377" + "\340\340\335\377\326\326\322\377\326\326\322\377\326\326\322\377\326" + "\326\322\377\326\326\322\377\326\326\322\377\326\326\322\377\335\335" + "\331\377\351\351\346\377\255\257\253\377\207\211\205\374\200\202\177" + "\215\252\252\252\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\221" + "\214\236\341\342\341\311\351\351\351\311\347\347\346\311\351\351\347" + "\311\351\351\347\311\357\357\354\311\360\360\357\311\362\362\360\311" + "\364\364\364\311\366\366\365\311\367\367\366\311\367\367\367\311\371" + "\371\371\311\354\354\353\316\230\231\225\370\306\310\304\376\330\330" + "\327\377\246\247\245\377\226\227\224\377\332\333\327\377\350\350\346" + "\377\337\337\334\377\333\333\327\377\331\331\325\377\332\332\326\377" + "\336\336\333\377\346\346\344\377\341\341\336\377\242\244\240\377\236" + "\237\233\377\330\330\327\377\256\261\254\367\216\217\212\302\200\200" + "\200\12\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0fff\5\214\217\211\303\364\364\362\311" + "\346\346\343\311\347\347\344\311\336\336\333\311\351\351\350\311\355" + "\355\353\311\357\357\355\311\361\361\357\311\362\362\361\311\364\364" + "\364\311\365\365\364\311\366\366\366\311\350\351\346\317\230\231\224" + "\371\331\332\330\376\365\365\364\377\341\341\340\377\313\313\312\377" + "\252\253\251\377\217\221\213\377\245\247\243\377\314\315\312\377\336" + "\336\333\377\344\344\341\377\340\340\335\377\322\322\320\377\260\261" + "\256\377\216\220\212\377\245\245\242\377\315\315\313\377\346\346\344" + "\377\367\367\366\377\300\301\275\370\216\217\212\304\216\216\216\11\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\211\211\200\32\227\232\226\300\362\362\361\311\344" + "\344\341\311\344\344\342\311\310\310\307\311\351\351\350\311\354\354" + "\351\311\357\357\354\311\357\357\357\311\361\361\360\311\362\362\361" + "\311\364\364\362\311\360\360\360\312\232\234\230\367\332\332\330\376" + "\363\363\363\377\355\355\353\377\357\357\355\377\336\336\335\377\314" + "\314\313\377\273\273\273\377\243\243\242\377\225\227\223\377\220\222" + "\215\377\215\217\213\377\217\221\215\377\225\226\222\377\240\241\237" + "\377\273\273\272\377\315\315\314\377\337\337\336\377\357\357\356\377" + "\357\357\355\377\366\366\365\377\276\300\275\370\216\217\213\262\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\207\207\200\"\234\237\233\277\361\361\360\311\343\343" + "\341\311\306\306\305\311\333\333\331\311\351\351\347\311\351\351\351" + "\311\354\354\351\311\357\357\354\311\357\357\357\311\360\360\357\311" + "\361\361\360\311\264\265\261\350\303\303\301\375\364\364\362\377\353" + "\353\351\377\355\355\353\377\357\357\356\377\361\361\360\377\341\341" + "\340\377\324\324\323\377\310\310\310\377\300\300\277\377\274\274\274" + "\377\273\273\273\377\274\274\274\377\301\301\301\377\311\311\311\377" + "\325\325\324\377\343\343\342\377\362\362\360\377\357\357\356\377\355" + "\355\354\377\355\355\353\377\365\365\364\377\250\250\244\364\210\213" + "\206e\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\211\211\211\15\220\221\214\303\364\364\362\311\333\333" + "\331\311\270\270\265\311\346\346\343\311\347\347\346\311\351\351\347" + "\311\353\353\351\311\354\354\351\311\355\355\354\311\357\357\355\311" + "\336\336\336\320\233\234\227\374\362\362\361\377\352\352\350\377\353" + "\353\351\377\355\355\353\377\357\357\356\377\361\361\360\377\363\363" + "\362\377\355\355\354\377\343\343\342\377\334\334\333\377\330\330\330" + "\377\327\327\327\377\330\330\330\377\334\334\334\377\344\344\343\377" + "\357\357\356\377\364\364\363\377\362\362\360\377\357\357\356\377\355" + "\355\354\377\353\353\351\377\355\355\353\377\357\357\355\377\217\221" + "\214\357\217\217\200\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213\216\212\267\347\347\346\311\313" + "\313\312\311\312\312\310\311\344\344\342\311\346\346\343\311\347\347" + "\346\311\351\351\347\311\351\351\350\311\353\353\351\311\354\354\353" + "\311\254\255\247\354\325\326\324\376\356\356\354\377\350\350\346\377" + "\352\352\351\377\355\355\353\377\357\357\355\377\361\361\360\377\363" + "\363\362\377\365\365\364\377\367\367\366\377\367\367\366\377\364\364" + "\364\377\364\364\364\377\364\364\364\377\370\370\370\377\367\367\367" + "\377\365\365\364\377\363\363\362\377\361\361\360\377\357\357\356\377" + "\355\355\353\377\353\353\351\377\351\351\347\377\360\360\356\377\313" + "\314\311\371\214\216\213\212\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\214\214\207j\276\276\272\304" + "\330\330\326\311\341\341\335\311\343\343\341\311\344\344\342\311\346" + "\346\343\311\347\347\346\311\350\350\346\311\351\351\347\311\347\347" + "\346\312\215\217\213\375\361\362\360\377\347\347\345\377\350\350\346" + "\377\352\352\350\377\352\352\350\377\356\356\354\377\360\360\357\377" + "\362\362\361\377\364\364\363\377\366\366\365\377\367\367\367\377\370" + "\370\370\377\371\371\370\377\371\371\370\377\367\367\367\377\366\366" + "\365\377\364\364\363\377\362\362\361\377\361\361\357\377\356\356\355" + "\377\353\353\352\377\352\352\350\377\350\350\346\377\350\350\346\377" + "\361\361\357\377\214\216\211\362\231\231\231\5\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0NNC\27\212\213\207" + "\277\325\325\324\311\351\351\350\311\341\341\336\311\343\343\341\311" + "\344\344\341\311\346\346\343\311\346\346\344\311\347\347\346\311\316" + "\317\315\325\252\253\246\374\361\361\360\377\345\345\343\377\347\347" + "\345\377\326\326\324\377\353\353\351\377\355\355\354\377\357\357\356" + "\377\361\361\360\377\363\363\361\377\364\364\363\377\365\365\364\377" + "\366\366\365\377\367\367\366\377\366\366\366\377\366\366\365\377\364" + "\364\363\377\363\363\362\377\361\361\360\377\357\357\356\377\356\356" + "\354\377\354\354\352\377\352\352\350\377\350\350\345\377\346\346\343" + "\377\361\361\360\377\253\256\251\361\211\211\205C\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16^^[L\220" + "\220\214\303\344\344\342\311\357\357\355\311\347\347\346\311\344\344" + "\342\311\344\344\342\311\344\344\342\311\346\346\343\311\300\301\277" + "\333\271\271\266\375\356\356\355\377\344\344\342\377\332\332\330\377" + "\326\326\324\377\352\352\350\377\354\354\352\377\356\356\354\377\357" + "\357\356\377\361\361\360\377\362\362\361\377\363\363\362\377\364\364" + "\363\377\364\364\363\377\364\364\363\377\364\364\363\377\362\362\361" + "\377\361\361\360\377\360\360\356\377\356\356\355\377\354\354\353\377" + "\352\352\351\377\332\332\331\377\347\347\344\377\345\345\342\377\355" + "\355\353\377\310\310\306\374\210\212\206v\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\13\0\0\0\34UURT\211" + "\213\207\300\266\267\265\304\336\336\333\311\354\354\351\311\360\360" + "\357\311\364\364\364\311\365\365\364\311\306\306\303\336\274\276\272" + "\375\355\355\354\377\343\343\341\377\276\276\275\377\347\347\345\377" + "\351\351\347\377\353\353\351\377\354\354\353\377\356\356\354\377\357" + "\357\356\377\360\360\357\377\361\361\360\377\362\362\361\377\362\362" + "\361\377\362\362\361\377\361\361\360\377\361\361\357\377\357\357\356" + "\377\356\356\355\377\355\355\353\377\353\353\351\377\351\351\347\377" + "\336\336\333\377\317\317\315\377\344\344\341\377\352\352\350\377\325" + "\325\322\377\213\216\211\232\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\21\0\0\0\34\34\34\34-" + "ilgf\205\207\200\237\212\214\210\272\212\213\206\302\207\212\205\310" + "\210\212\205\311\210\212\205\327\251\253\247\374\360\360\356\377\315" + "\315\313\377\303\303\300\377\346\346\343\377\350\350\345\377\351\351" + "\347\377\353\353\351\377\354\354\352\377\355\355\354\377\356\356\355" + "\377\357\357\356\377\360\360\356\377\360\360\357\377\360\360\356\377" + "\357\357\356\377\356\356\355\377\356\356\354\377\354\354\353\377\353" + "\353\351\377\352\352\347\377\350\350\346\377\346\346\344\377\266\266" + "\264\377\327\327\324\377\352\352\350\377\320\320\316\377\214\216\210" + "\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\13\0\0\0\21\0\0\0\24\0\0\0\26\0\0\0\26" + "\0\0\0\26\0\0\0\26\0\0\0\26<<<&\213\215\211\370\360\360\357\377\272\272" + "\267\377\331\331\326\377\345\345\342\377\346\346\344\377\350\350\345" + "\377\351\351\347\377\352\352\350\377\353\353\352\377\354\354\353\377" + "\355\355\353\377\356\356\354\377\356\356\354\377\356\356\354\377\355" + "\355\353\377\354\354\353\377\354\354\352\377\352\352\351\377\351\351" + "\347\377\350\350\346\377\346\346\344\377\345\345\342\377\270\270\266" + "\377\265\265\263\377\355\355\353\377\273\274\267\366\210\213\206e\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\2\0\0\0\2\0\0\0\2\0\0" + "\0\2\0\0\0\2\0\0\0\2\214\215\211\272\316\317\314\376\323\323\321\377" + "\341\341\337\377\343\343\340\377\345\345\342\377\346\346\344\377\347" + "\347\345\377\350\350\346\377\351\351\347\377\352\352\350\377\353\353" + "\351\377\353\353\351\377\353\353\352\377\353\353\351\377\353\353\351" + "\377\352\352\350\377\352\352\347\377\351\351\346\377\347\347\345\377" + "\346\346\344\377\345\345\342\377\343\343\341\377\307\307\304\377\254" + "\254\252\377\350\350\346\377\217\221\215\366||u#\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0`d`8\207\210\205\367\342\342\341\377\350\350\346\377\341\341\337" + "\377\343\343\340\377\344\344\341\377\345\345\343\377\346\346\344\377" + "\347\347\345\377\350\350\346\377\351\351\347\377\351\351\347\377\351" + "\351\347\377\351\351\347\377\351\351\347\377\350\350\346\377\350\350" + "\345\377\347\347\344\377\346\346\343\377\344\344\342\377\343\343\340" + "\377\342\342\337\377\325\325\324\377\327\327\326\377\263\264\261\371" + "\202\203\177\261\0\0\0\21\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\26mmkz\227\231" + "\225\370\350\350\346\377\356\356\355\377\350\350\346\377\346\346\344" + "\377\346\346\344\377\345\345\344\377\346\346\344\377\347\347\345\377" + "\350\350\346\377\351\351\346\377\351\351\347\377\351\351\346\377\350" + "\350\346\377\350\350\346\377\347\347\345\377\347\347\345\377\347\347" + "\344\377\346\346\345\377\351\351\347\377\356\356\355\377\354\354\352" + "\377\257\260\256\373\207\210\203\341\36\36\36""3\0\0\0\24\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\22\0\0\0&_a]y\213\216\207\365\265\267\264\370\332" + "\332\330\377\346\346\345\377\354\354\352\377\362\362\361\377\361\361" + "\360\377\362\362\361\377\361\361\360\377\361\361\357\377\361\361\357" + "\377\361\361\357\377\360\360\357\377\360\360\357\377\360\360\357\377" + "\357\357\357\377\356\356\355\377\347\347\346\377\334\334\333\377\273" + "\274\272\374\216\220\212\370|}y\300\33\33\33A\0\0\0$\0\0\0\20\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\26\0\0\0%\34\34\34""7hhf}\203\204\177" + "\275\211\214\206\337\212\213\207\352\212\214\207\364\211\213\206\367" + "\211\213\206\367\211\213\206\367\211\213\206\367\211\213\206\367\211" + "\213\206\367\211\213\206\367\211\213\206\367\211\213\206\367\211\213" + "\206\367\212\214\207\362\212\213\206\342\205\210\203\315qro\223<<<L\0" + "\0\0-\0\0\0$\0\0\0\25\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2" + "\0\0\0\16\0\0\0\24\0\0\0\30\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0" + "\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0" + "\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\32\0\0\0\30\0\0\0\24" + "\0\0\0\15\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1" + "\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0" + "\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + }; diff --git a/sflphone-client-gnome/src/imwindow.c b/sflphone-client-gnome/src/imwindow.c index 60d99aed98bc2a12302b51535e23131a315f6948..4b33e9c278741403413f446bb1fcbfda754c078c 100644 --- a/sflphone-client-gnome/src/imwindow.c +++ b/sflphone-client-gnome/src/imwindow.c @@ -42,184 +42,189 @@ GtkWidget *im_window = NULL; GtkWidget *im_notebook = NULL; -static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) { - int pos_x, pos_y; +static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) +{ + int pos_x, pos_y; - eel_gconf_set_integer (CONF_IM_WINDOW_WIDTH, event->width); - eel_gconf_set_integer (CONF_IM_WINDOW_HEIGHT, event->height); + eel_gconf_set_integer (CONF_IM_WINDOW_WIDTH, event->width); + eel_gconf_set_integer (CONF_IM_WINDOW_HEIGHT, event->height); - gtk_window_get_position (GTK_WINDOW (im_window_get()), &pos_x, &pos_y); - eel_gconf_set_integer (CONF_IM_WINDOW_POSITION_X, pos_x); - eel_gconf_set_integer (CONF_IM_WINDOW_POSITION_Y, pos_y); + gtk_window_get_position (GTK_WINDOW (im_window_get()), &pos_x, &pos_y); + eel_gconf_set_integer (CONF_IM_WINDOW_POSITION_X, pos_x); + eel_gconf_set_integer (CONF_IM_WINDOW_POSITION_Y, pos_y); - return FALSE; + return FALSE; } /** * Minimize the main window. */ - static gboolean -on_delete(GtkWidget * widget UNUSED, gpointer data UNUSED) +static gboolean +on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED) { - /* Only hide the main window that contains all the instant messaging instances */ - gtk_widget_hide (GTK_WIDGET(im_window_get())); - return TRUE; + /* Only hide the main window that contains all the instant messaging instances */ + gtk_widget_hide (GTK_WIDGET (im_window_get())); + return TRUE; } - static void +static void on_switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer userdata) { - guint index = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); - g_print ("switch to %i- current = %i\n", page_num, index); + guint index = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); + g_print ("switch to %i- current = %i\n", page_num, index); } - static void +static void im_window_init() { - const char *window_title = "SFLphone IM Client"; - gchar *path; - GError *error = NULL; - gboolean ret; - int width, height, position_x, position_y; - - // Get configuration stored in gconf - width = eel_gconf_get_integer(CONF_IM_WINDOW_WIDTH); - if (width <= 0) - width = 400; - height = eel_gconf_get_integer(CONF_IM_WINDOW_HEIGHT); - if (height <= 0) - height = 500; - position_x = eel_gconf_get_integer(CONF_IM_WINDOW_POSITION_X); - position_y = eel_gconf_get_integer(CONF_IM_WINDOW_POSITION_Y); - - im_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width(GTK_CONTAINER(im_window), 0); - gtk_window_set_title(GTK_WINDOW(im_window), window_title); - gtk_window_set_default_size(GTK_WINDOW (im_window), width, height); - gtk_window_set_default_icon_from_file(LOGO, NULL); - gtk_window_set_position(GTK_WINDOW(im_window), GTK_WIN_POS_MOUSE); - - gtk_widget_set_name(im_window, "imwindow"); - - GtkWidget *im_vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/); - im_notebook = gtk_notebook_new (); - - gtk_container_add (GTK_CONTAINER (im_window), im_vbox); - gtk_box_pack_start (GTK_BOX (im_vbox), im_notebook, TRUE, TRUE, 0); - gtk_widget_show (im_notebook); - - g_signal_connect (G_OBJECT (im_window), "delete-event", G_CALLBACK (on_delete), NULL); - g_signal_connect_object (G_OBJECT (im_window), "configure-event", G_CALLBACK (window_configure_cb), NULL, 0); - g_signal_connect (G_OBJECT (im_notebook), "switch-page", G_CALLBACK (on_switch_page), NULL); - - /* make sure that everything is visible */ - gtk_widget_show_all (im_window); - - // Restore position according to the configuration stored in gconf - gtk_window_move (GTK_WINDOW (im_window), position_x, position_y); + const char *window_title = "SFLphone IM Client"; + gchar *path; + GError *error = NULL; + gboolean ret; + int width, height, position_x, position_y; + + // Get configuration stored in gconf + width = eel_gconf_get_integer (CONF_IM_WINDOW_WIDTH); + + if (width <= 0) + width = 400; + + height = eel_gconf_get_integer (CONF_IM_WINDOW_HEIGHT); + + if (height <= 0) + height = 500; + + position_x = eel_gconf_get_integer (CONF_IM_WINDOW_POSITION_X); + position_y = eel_gconf_get_integer (CONF_IM_WINDOW_POSITION_Y); + + im_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (im_window), 0); + gtk_window_set_title (GTK_WINDOW (im_window), window_title); + gtk_window_set_default_size (GTK_WINDOW (im_window), width, height); + gtk_window_set_default_icon_from_file (LOGO, NULL); + gtk_window_set_position (GTK_WINDOW (im_window), GTK_WIN_POS_MOUSE); + + gtk_widget_set_name (im_window, "imwindow"); + + GtkWidget *im_vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/); + im_notebook = gtk_notebook_new (); + + gtk_container_add (GTK_CONTAINER (im_window), im_vbox); + gtk_box_pack_start (GTK_BOX (im_vbox), im_notebook, TRUE, TRUE, 0); + gtk_widget_show (im_notebook); + + g_signal_connect (G_OBJECT (im_window), "delete-event", G_CALLBACK (on_delete), NULL); + g_signal_connect_object (G_OBJECT (im_window), "configure-event", G_CALLBACK (window_configure_cb), NULL, 0); + g_signal_connect (G_OBJECT (im_notebook), "switch-page", G_CALLBACK (on_switch_page), NULL); + + /* make sure that everything is visible */ + gtk_widget_show_all (im_window); + + // Restore position according to the configuration stored in gconf + gtk_window_move (GTK_WINDOW (im_window), position_x, position_y); } - GtkWidget * +GtkWidget * im_window_get() { - if (im_window == NULL) - im_window_init(); - return im_window; + if (im_window == NULL) + im_window_init(); + + return im_window; } - void +void im_window_show () { - gtk_widget_show (im_window_get ()); + gtk_widget_show (im_window_get ()); } - void +void im_window_add (GtkWidget *widget) { - if (im_window_get()) { - /* Add the new tab to the notebook */ - im_window_add_tab (widget); - - /* Show it all */ - gtk_widget_show_all (im_window); - } - else - error ("Could not create the main instant messaging window"); + if (im_window_get()) { + /* Add the new tab to the notebook */ + im_window_add_tab (widget); + + /* Show it all */ + gtk_widget_show_all (im_window); + } else + error ("Could not create the main instant messaging window"); } - static void +static void close_tab_cb (GtkButton *button, gpointer userdata) { - /* We want here to close the current tab */ - im_window_remove_tab (GTK_WIDGET (userdata)); + /* We want here to close the current tab */ + im_window_remove_tab (GTK_WIDGET (userdata)); - /* If no tabs are opened anymore, close the IM window */ - // gtk_widget_destroy (im_window); + /* If no tabs are opened anymore, close the IM window */ + // gtk_widget_destroy (im_window); } - void +void im_window_add_tab (GtkWidget *widget) -{ - /* Cast the paramater */ - IMWidget *im = IM_WIDGET(widget); - - /* Fetch the call */ - callable_obj_t *im_widget_call = calllist_get (current_calls, im->call_id); - - /* A container to include the tab label and the close button */ - GtkWidget *tab_Container = gtk_hbox_new (FALSE, 3); - GtkWidget *tab_Label = gtk_label_new (get_peer_information (im_widget_call)); - GtkWidget *tab_CloseButton = gtk_button_new (); - - /* Pack it all */ - gtk_button_set_relief (GTK_BUTTON(tab_CloseButton), GTK_RELIEF_NONE); - gtk_box_pack_start (GTK_BOX (tab_Container), tab_Label, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (tab_Container), tab_CloseButton, FALSE, FALSE, 0); - gtk_container_add(GTK_CONTAINER (tab_CloseButton), gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU)); - - /* Connect a signal to the close button on each tab, to be able to close the tabs individually */ - g_signal_connect (tab_CloseButton, "clicked", G_CALLBACK (close_tab_cb), widget); - - /* Show it */ - gtk_widget_show_all (tab_Container); - - /* Add the page to the notebook */ - gtk_notebook_append_page (GTK_NOTEBOOK (im_notebook), widget, tab_Container); - - /* TODO Switch to the newly opened tab. Still not working */ - guint tabIndex = gtk_notebook_page_num (GTK_NOTEBOOK (im_notebook), widget); - gtk_notebook_set_current_page (GTK_NOTEBOOK (im_notebook), tabIndex); - - /* Decide whether or not displaying the tabs of the notebook */ - im_window_hide_show_tabs (); +{ + /* Cast the paramater */ + IMWidget *im = IM_WIDGET (widget); + + /* Fetch the call */ + callable_obj_t *im_widget_call = calllist_get (current_calls, im->call_id); + + /* A container to include the tab label and the close button */ + GtkWidget *tab_Container = gtk_hbox_new (FALSE, 3); + GtkWidget *tab_Label = gtk_label_new (get_peer_information (im_widget_call)); + GtkWidget *tab_CloseButton = gtk_button_new (); + + /* Pack it all */ + gtk_button_set_relief (GTK_BUTTON (tab_CloseButton), GTK_RELIEF_NONE); + gtk_box_pack_start (GTK_BOX (tab_Container), tab_Label, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (tab_Container), tab_CloseButton, FALSE, FALSE, 0); + gtk_container_add (GTK_CONTAINER (tab_CloseButton), gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU)); + + /* Connect a signal to the close button on each tab, to be able to close the tabs individually */ + g_signal_connect (tab_CloseButton, "clicked", G_CALLBACK (close_tab_cb), widget); + + /* Show it */ + gtk_widget_show_all (tab_Container); + + /* Add the page to the notebook */ + gtk_notebook_append_page (GTK_NOTEBOOK (im_notebook), widget, tab_Container); + + /* TODO Switch to the newly opened tab. Still not working */ + guint tabIndex = gtk_notebook_page_num (GTK_NOTEBOOK (im_notebook), widget); + gtk_notebook_set_current_page (GTK_NOTEBOOK (im_notebook), tabIndex); + + /* Decide whether or not displaying the tabs of the notebook */ + im_window_hide_show_tabs (); } - void +void im_window_hide_show_tabs () { - /* If only one tab is open, do not display the tab, only the content */ - if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (im_notebook)) == 1) { - gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), FALSE); - } - else - gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), TRUE); + /* If only one tab is open, do not display the tab, only the content */ + if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (im_notebook)) == 1) { + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), FALSE); + } else + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), TRUE); } - void +void im_window_remove_tab (GtkWidget *widget) { - // Remove the widget from the window - - /* We want here to close the current tab */ + // Remove the widget from the window + + /* We want here to close the current tab */ guint index = gtk_notebook_page_num (GTK_NOTEBOOK (im_notebook), GTK_WIDGET (widget)); gtk_notebook_remove_page (GTK_NOTEBOOK (im_notebook), index); - /* Need to do some memory clean up, so that we could re-open an Im widget for this call later. */ - IMWidget *im = IM_WIDGET(widget); - callable_obj_t *call = calllist_get (current_calls, im->call_id); - if (call) - call->_im_widget = NULL; + /* Need to do some memory clean up, so that we could re-open an Im widget for this call later. */ + IMWidget *im = IM_WIDGET (widget); + callable_obj_t *call = calllist_get (current_calls, im->call_id); + + if (call) + call->_im_widget = NULL; - /* Decide whether or not displaying the tabs of the notebook */ - im_window_hide_show_tabs (); + /* Decide whether or not displaying the tabs of the notebook */ + im_window_hide_show_tabs (); } diff --git a/sflphone-client-gnome/src/imwindow.h b/sflphone-client-gnome/src/imwindow.h index c97ee2f14303da056a277900a179d9e6322eaf3e..028efc677a74d280d057d9c7ec4aac3c80d63107 100644 --- a/sflphone-client-gnome/src/imwindow.h +++ b/sflphone-client-gnome/src/imwindow.h @@ -51,7 +51,7 @@ GtkWidget *im_window_get(); /*! @function @abstract Add IM widget to the IM window */ -void im_window_add(GtkWidget *widget); +void im_window_add (GtkWidget *widget); /*! @function @abstract Remove IM widget from the IM window diff --git a/sflphone-client-gnome/src/main.c b/sflphone-client-gnome/src/main.c index 38cb5cd3f7a05b423116e4727294c168277a414d..b4cdb9a06eafbc52e23654431ac4ab911707b421 100644 --- a/sflphone-client-gnome/src/main.c +++ b/sflphone-client-gnome/src/main.c @@ -48,9 +48,8 @@ static void shutdown_logging () { - if (log4c_fini ()) - { - ERROR("log4c_fini() failed"); + if (log4c_fini ()) { + ERROR ("log4c_fini() failed"); } } @@ -60,98 +59,97 @@ shutdown_logging () static void startup_logging () { - log4c_init (); - if (log4c_load (DATA_DIR "/log4crc") == -1) - g_warning ("Cannot load log4j configuration file : %s", DATA_DIR "/log4crc"); + log4c_init (); - log4c_sfl_gtk_category = log4c_category_get ("org.sflphone.gtk"); + if (log4c_load (DATA_DIR "/log4crc") == -1) + g_warning ("Cannot load log4j configuration file : %s", DATA_DIR "/log4crc"); + + log4c_sfl_gtk_category = log4c_category_get ("org.sflphone.gtk"); } int main (int argc, char *argv[]) { - // Handle logging - int i; + // Handle logging + int i; - // Startup logging - startup_logging (); + // Startup logging + startup_logging (); - // Check arguments if debug mode is activated - for (i = 0; i < argc; i++) - if (g_strcmp0 (argv[i], "--debug") == 0) - log4c_category_set_priority (log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG); + // Check arguments if debug mode is activated + for (i = 0; i < argc; i++) + if (g_strcmp0 (argv[i], "--debug") == 0) + log4c_category_set_priority (log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG); - // Start GTK application + // Start GTK application - gtk_init (&argc, &argv); + gtk_init (&argc, &argv); - g_print ("%s %s\n", PACKAGE, VERSION); - g_print ("\nCopyright (c) 2005 2006 2007 2008 2009 2010 Savoir-faire Linux Inc.\n\n"); - g_print ("This is free software. You may redistribute copies of it under the terms of\n" \ - "the GNU General Public License Version 3 <http://www.gnu.org/licenses/gpl.html>.\n" \ - "There is NO WARRANTY, to the extent permitted by law.\n\n" \ - "Additional permission under GNU GPL version 3 section 7:\n\n" \ - "If you modify this program, or any covered work, by linking or\n" \ - "combining it with the OpenSSL project's OpenSSL library (or a\n" \ - "modified version of that library), containing parts covered by the\n" \ - "terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.\n" \ - "grants you additional permission to convey the resulting work.\n" \ - "Corresponding Source for a non-source form of such a combination\n" \ - "shall include the source code for the parts of OpenSSL used as well\n" \ - "as that of the covered work.\n\n"); + g_print ("%s %s\n", PACKAGE, VERSION); + g_print ("\nCopyright (c) 2005 2006 2007 2008 2009 2010 Savoir-faire Linux Inc.\n\n"); + g_print ("This is free software. You may redistribute copies of it under the terms of\n" \ + "the GNU General Public License Version 3 <http://www.gnu.org/licenses/gpl.html>.\n" \ + "There is NO WARRANTY, to the extent permitted by law.\n\n" \ + "Additional permission under GNU GPL version 3 section 7:\n\n" \ + "If you modify this program, or any covered work, by linking or\n" \ + "combining it with the OpenSSL project's OpenSSL library (or a\n" \ + "modified version of that library), containing parts covered by the\n" \ + "terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.\n" \ + "grants you additional permission to convey the resulting work.\n" \ + "Corresponding Source for a non-source form of such a combination\n" \ + "shall include the source code for the parts of OpenSSL used as well\n" \ + "as that of the covered work.\n\n"); - DEBUG("Logging Started"); + DEBUG ("Logging Started"); - srand (time (NULL)); + srand (time (NULL)); - // Internationalization - bindtextdomain ("sflphone-client-gnome", LOCALEDIR); - textdomain ("sflphone-client-gnome"); + // Internationalization + bindtextdomain ("sflphone-client-gnome", LOCALEDIR); + textdomain ("sflphone-client-gnome"); - // Initialises the GNOME libraries - gnome_program_init ("sflphone", VERSION, LIBGNOMEUI_MODULE, argc, argv, - GNOME_PROGRAM_STANDARD_PROPERTIES, - NULL) ; + // Initialises the GNOME libraries + gnome_program_init ("sflphone", VERSION, LIBGNOMEUI_MODULE, argc, argv, + GNOME_PROGRAM_STANDARD_PROPERTIES, + NULL) ; - if (sflphone_init ()) - { + if (sflphone_init ()) { - if (eel_gconf_get_integer (SHOW_STATUSICON)) - show_status_icon (); + if (eel_gconf_get_integer (SHOW_STATUSICON)) + show_status_icon (); - create_main_window (); + create_main_window (); - if (eel_gconf_get_integer (SHOW_STATUSICON) && eel_gconf_get_integer (START_HIDDEN)) - { - gtk_widget_hide (GTK_WIDGET( get_main_window() )); - set_minimized (TRUE); + if (eel_gconf_get_integer (SHOW_STATUSICON) && eel_gconf_get_integer (START_HIDDEN)) { + gtk_widget_hide (GTK_WIDGET (get_main_window())); + set_minimized (TRUE); } - status_bar_display_account (); + status_bar_display_account (); - // Load the history - sflphone_fill_history (); + // Load the history + sflphone_fill_history (); - // Get the active calls and conferences at startup - sflphone_fill_call_list (); - sflphone_fill_conference_list (); + // Get the active calls and conferences at startup + sflphone_fill_call_list (); + sflphone_fill_conference_list (); - // Update the GUI - update_actions (); + // Update the GUI + update_actions (); - shortcuts_initialize_bindings(); + shortcuts_initialize_bindings(); - /* start the main loop */ - gtk_main (); + /* start the main loop */ + gtk_main (); } - // Cleanly stop logging - shutdown_logging (); + // Cleanly stop logging + shutdown_logging (); - shortcuts_destroy_bindings(); + shortcuts_destroy_bindings(); - return 0; + return 0; } /** @mainpage SFLphone GTK+ Client Documentation diff --git a/sflphone-client-gnome/src/mainwindow.c b/sflphone-client-gnome/src/mainwindow.c index cf3ca817572c8c3fb16dfeaa2846c31a24459755..fab4abc95b8be025e16b099b65d1a3a45c4e103b 100644 --- a/sflphone-client-gnome/src/mainwindow.c +++ b/sflphone-client-gnome/src/mainwindow.c @@ -62,461 +62,447 @@ PidginScrollBook *embedded_error_notebook; /** * Handle main window resizing */ -static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) { +static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) +{ - int pos_x, pos_y; + int pos_x, pos_y; - eel_gconf_set_integer (CONF_MAIN_WINDOW_WIDTH, event->width); - eel_gconf_set_integer (CONF_MAIN_WINDOW_HEIGHT, event->height); + eel_gconf_set_integer (CONF_MAIN_WINDOW_WIDTH, event->width); + eel_gconf_set_integer (CONF_MAIN_WINDOW_HEIGHT, event->height); - gtk_window_get_position (GTK_WINDOW (window), &pos_x, &pos_y); - eel_gconf_set_integer (CONF_MAIN_WINDOW_POSITION_X, pos_x); - eel_gconf_set_integer (CONF_MAIN_WINDOW_POSITION_Y, pos_y); + gtk_window_get_position (GTK_WINDOW (window), &pos_x, &pos_y); + eel_gconf_set_integer (CONF_MAIN_WINDOW_POSITION_X, pos_x); + eel_gconf_set_integer (CONF_MAIN_WINDOW_POSITION_Y, pos_y); - return FALSE; + return FALSE; } /** * Minimize the main window. */ - static gboolean +static gboolean on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED) { - if (eel_gconf_get_integer (SHOW_STATUSICON)) { - gtk_widget_hide (GTK_WIDGET( get_main_window() )); - set_minimized (TRUE); - } - else { - sflphone_quit (); - } - return TRUE; + if (eel_gconf_get_integer (SHOW_STATUSICON)) { + gtk_widget_hide (GTK_WIDGET (get_main_window())); + set_minimized (TRUE); + } else { + sflphone_quit (); + } + + return TRUE; } /** Ask the user if he wants to hangup current calls */ - gboolean +gboolean main_window_ask_quit () { - guint count = calllist_get_size (current_calls); - GtkWidget * dialog; - gint response; - gchar * question; + guint count = calllist_get_size (current_calls); + GtkWidget * dialog; + gint response; + gchar * question; - if (count == 1) - { - question = _("There is one call in progress."); - } - else - { - question = _("There are calls in progress."); - } + if (count == 1) { + question = _ ("There is one call in progress."); + } else { + question = _ ("There are calls in progress."); + } - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window), - GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s\n%s", - question, _("Do you still want to quit?") ); + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (window), + GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s\n%s", + question, _ ("Do you still want to quit?")); - response = gtk_dialog_run (GTK_DIALOG (dialog)); + response = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); + gtk_widget_destroy (dialog); - return (response == GTK_RESPONSE_NO)? FALSE : TRUE ; + return (response == GTK_RESPONSE_NO) ? FALSE : TRUE ; } - static gboolean +static gboolean on_key_released (GtkWidget *widget, GdkEventKey *event, gpointer user_data UNUSED) { - DEBUG("On key released from Main Window : %s", gtk_widget_get_name(widget)); - - if (focus_is_on_searchbar == FALSE) - { - // If a modifier key is pressed, it's a shortcut, pass along - if (event->state & GDK_CONTROL_MASK || event->state & GDK_MOD1_MASK - || event->keyval == 60 || // < - event->keyval == 62 || // > - event->keyval == 34 || // " - event->keyval == 65289 || // tab - event->keyval == 65361 || // left arrow - event->keyval == 65363 || // right arrow - event->keyval >= 65470 || // F-keys - event->keyval == 32 // space - ) - return FALSE; - else - sflphone_keypad (event->keyval, event->string); - } - - return TRUE; + DEBUG ("On key released from Main Window : %s", gtk_widget_get_name (widget)); + + if (focus_is_on_searchbar == FALSE) { + // If a modifier key is pressed, it's a shortcut, pass along + if (event->state & GDK_CONTROL_MASK || event->state & GDK_MOD1_MASK + || event->keyval == 60 || // < + event->keyval == 62 || // > + event->keyval == 34 || // " + event->keyval == 65289 || // tab + event->keyval == 65361 || // left arrow + event->keyval == 65363 || // right arrow + event->keyval >= 65470 || // F-keys + event->keyval == 32 // space + ) + return FALSE; + else + sflphone_keypad (event->keyval, event->string); + } + + return TRUE; } - void +void focus_on_mainwindow_out () { - // gtk_widget_grab_focus(GTK_WIDGET(window)); + // gtk_widget_grab_focus(GTK_WIDGET(window)); } - void +void focus_on_mainwindow_in () { - // gtk_widget_grab_focus(GTK_WIDGET(window)); + // gtk_widget_grab_focus(GTK_WIDGET(window)); } - void +void create_main_window () { - GtkWidget *widget; - gchar *path; - GError *error = NULL; - gboolean ret; - const char *window_title = "SFLphone VoIP Client"; - int width, height, position_x, position_y; - - focus_is_on_calltree = FALSE; - focus_is_on_searchbar = FALSE; - - // Get configuration stored in gconf - width = eel_gconf_get_integer (CONF_MAIN_WINDOW_WIDTH); - height = eel_gconf_get_integer (CONF_MAIN_WINDOW_HEIGHT); - position_x = eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X); - position_y = eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); - gtk_window_set_title (GTK_WINDOW (window), window_title); - gtk_window_set_default_size (GTK_WINDOW (window), width, height); - gtk_window_set_default_icon_from_file (LOGO, - NULL); - gtk_window_set_position (GTK_WINDOW(window) , GTK_WIN_POS_MOUSE); - - /* Connect the destroy event of the window with our on_destroy function - * When the window is about to be destroyed we get a notificaiton and - * stop the main GTK loop - */ - g_signal_connect (G_OBJECT (window), "delete-event", - G_CALLBACK (on_delete), NULL); - - g_signal_connect (G_OBJECT (window), "key-release-event", - G_CALLBACK (on_key_released), NULL); + GtkWidget *widget; + gchar *path; + GError *error = NULL; + gboolean ret; + const char *window_title = "SFLphone VoIP Client"; + int width, height, position_x, position_y; + + focus_is_on_calltree = FALSE; + focus_is_on_searchbar = FALSE; + + // Get configuration stored in gconf + width = eel_gconf_get_integer (CONF_MAIN_WINDOW_WIDTH); + height = eel_gconf_get_integer (CONF_MAIN_WINDOW_HEIGHT); + position_x = eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X); + position_y = eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (window), 0); + gtk_window_set_title (GTK_WINDOW (window), window_title); + gtk_window_set_default_size (GTK_WINDOW (window), width, height); + gtk_window_set_default_icon_from_file (LOGO, + NULL); + gtk_window_set_position (GTK_WINDOW (window) , GTK_WIN_POS_MOUSE); + + /* Connect the destroy event of the window with our on_destroy function + * When the window is about to be destroyed we get a notificaiton and + * stop the main GTK loop + */ + g_signal_connect (G_OBJECT (window), "delete-event", + G_CALLBACK (on_delete), NULL); + + g_signal_connect (G_OBJECT (window), "key-release-event", + G_CALLBACK (on_key_released), NULL); g_signal_connect_after (G_OBJECT (window), "focus-in-event", - G_CALLBACK (focus_on_mainwindow_in), NULL); - - g_signal_connect_after (G_OBJECT (window), "focus-out-event", - G_CALLBACK (focus_on_mainwindow_out), NULL); - - g_signal_connect_object (G_OBJECT (window), "configure-event", - G_CALLBACK (window_configure_cb), NULL, 0); - - gtk_widget_set_name (window, "mainwindow"); - - ret = uimanager_new (&ui_manager); - if (!ret) - { - ERROR ("Could not load xml GUI\n"); - g_error_free (error); - exit (1); - } - - /* Create an accel group for window's shortcuts */ - gtk_window_add_accel_group (GTK_WINDOW(window), - gtk_ui_manager_get_accel_group (ui_manager)); - - vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/); - subvbox = gtk_vbox_new (FALSE /*homogeneous*/, 5 /*spacing*/); - - create_menus (ui_manager, &widget); - gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, - 0 /*padding*/); - - create_toolbar_actions (ui_manager, &widget); - // Do not override GNOME user settings - gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, - 0 /*padding*/); - - gtk_box_pack_start (GTK_BOX (vbox), current_calls->tree, TRUE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - - g_signal_connect_object (G_OBJECT (window), "configure-event", - G_CALLBACK (window_configure_cb), NULL, 0); - gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, - FALSE /*fill*/, 0 /*padding*/); - - embedded_error_notebook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new()); - gtk_box_pack_start (GTK_BOX(subvbox), GTK_WIDGET(embedded_error_notebook), - FALSE, FALSE, 0); - - if (SHOW_VOLUME) - { - speaker_control = create_slider ("speaker"); - gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (speaker_control); - mic_control = create_slider ("mic"); - gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (mic_control); - } - - - if (eel_gconf_get_boolean (CONF_SHOW_DIALPAD)){ - dialpad = create_dialpad(); - gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (dialpad); - } - - /* Status bar */ - statusBar = gtk_statusbar_new (); - gtk_box_pack_start (GTK_BOX (vbox), statusBar, FALSE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_container_add (GTK_CONTAINER (window), vbox); - - /* make sure that everything, window and label, are visible */ - gtk_widget_show_all (window); - - /* dont't show the history */ - gtk_widget_hide (history->tree); - - /* dont't show the contact list */ - gtk_widget_hide (contacts->tree); - - searchbar_init (history); - searchbar_init (contacts); - - /* don't show waiting layer */ - gtk_widget_hide (waitingLayer); - - // Configuration wizard - if (account_list_get_size () == 1) - { + G_CALLBACK (focus_on_mainwindow_in), NULL); + + g_signal_connect_after (G_OBJECT (window), "focus-out-event", + G_CALLBACK (focus_on_mainwindow_out), NULL); + + g_signal_connect_object (G_OBJECT (window), "configure-event", + G_CALLBACK (window_configure_cb), NULL, 0); + + gtk_widget_set_name (window, "mainwindow"); + + ret = uimanager_new (&ui_manager); + + if (!ret) { + ERROR ("Could not load xml GUI\n"); + g_error_free (error); + exit (1); + } + + /* Create an accel group for window's shortcuts */ + gtk_window_add_accel_group (GTK_WINDOW (window), + gtk_ui_manager_get_accel_group (ui_manager)); + + vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/); + subvbox = gtk_vbox_new (FALSE /*homogeneous*/, 5 /*spacing*/); + + create_menus (ui_manager, &widget); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, + 0 /*padding*/); + + create_toolbar_actions (ui_manager, &widget); + // Do not override GNOME user settings + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, + 0 /*padding*/); + + gtk_box_pack_start (GTK_BOX (vbox), current_calls->tree, TRUE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + + g_signal_connect_object (G_OBJECT (window), "configure-event", + G_CALLBACK (window_configure_cb), NULL, 0); + gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, + FALSE /*fill*/, 0 /*padding*/); + + embedded_error_notebook = PIDGIN_SCROLL_BOOK (pidgin_scroll_book_new()); + gtk_box_pack_start (GTK_BOX (subvbox), GTK_WIDGET (embedded_error_notebook), + FALSE, FALSE, 0); + + if (SHOW_VOLUME) { + speaker_control = create_slider ("speaker"); + gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (speaker_control); + mic_control = create_slider ("mic"); + gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (mic_control); + } + + + if (eel_gconf_get_boolean (CONF_SHOW_DIALPAD)) { + dialpad = create_dialpad(); + gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (dialpad); + } + + /* Status bar */ + statusBar = gtk_statusbar_new (); + gtk_box_pack_start (GTK_BOX (vbox), statusBar, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_container_add (GTK_CONTAINER (window), vbox); + + /* make sure that everything, window and label, are visible */ + gtk_widget_show_all (window); + + /* dont't show the history */ + gtk_widget_hide (history->tree); + + /* dont't show the contact list */ + gtk_widget_hide (contacts->tree); + + searchbar_init (history); + searchbar_init (contacts); + + /* don't show waiting layer */ + gtk_widget_hide (waitingLayer); + + // Configuration wizard + if (account_list_get_size () == 1) { #if GTK_CHECK_VERSION(2,10,0) - build_wizard (); + build_wizard (); #else - GtkWidget * dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_YES_NO, - "<b><big>Welcome to SFLphone!</big></b>\n\nThere are no VoIP accounts configured, would you like to edit the preferences now?"); + GtkWidget * dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_YES_NO, + "<b><big>Welcome to SFLphone!</big></b>\n\nThere are no VoIP accounts configured, would you like to edit the preferences now?"); + + int response = gtk_dialog_run (GTK_DIALOG (dialog)); - int response = gtk_dialog_run (GTK_DIALOG(dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); - gtk_widget_destroy (GTK_WIDGET(dialog)); + if (response == GTK_RESPONSE_YES) { + show_preferences_dialog(); + } - if (response == GTK_RESPONSE_YES) - { - show_preferences_dialog(); - } #endif - } + } - // Restore position according to the configuration stored in gconf - gtk_window_move (GTK_WINDOW (window), position_x, position_y); + // Restore position according to the configuration stored in gconf + gtk_window_move (GTK_WINDOW (window), position_x, position_y); } - GtkAccelGroup * +GtkAccelGroup * get_accel_group () { - return accelGroup; + return accelGroup; } - GtkWidget * +GtkWidget * get_main_window () { - return window; + return window; } - void +void main_window_message (GtkMessageType type, gchar * markup) { - GtkWidget * dialog = gtk_message_dialog_new_with_markup ( - GTK_WINDOW(get_main_window()), GTK_DIALOG_MODAL - | GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_CLOSE, NULL); + GtkWidget * dialog = gtk_message_dialog_new_with_markup ( + GTK_WINDOW (get_main_window()), GTK_DIALOG_MODAL + | GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_CLOSE, NULL); - gtk_window_set_title (GTK_WINDOW(dialog), _("SFLphone Error")); - gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG(dialog), markup); + gtk_window_set_title (GTK_WINDOW (dialog), _ ("SFLphone Error")); + gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), markup); - gtk_dialog_run (GTK_DIALOG(dialog)); - gtk_widget_destroy (GTK_WIDGET(dialog)); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); } - void +void main_window_error_message (gchar * markup) { - main_window_message (GTK_MESSAGE_ERROR, markup); + main_window_message (GTK_MESSAGE_ERROR, markup); } - void +void main_window_warning_message (gchar * markup) { - main_window_message (GTK_MESSAGE_WARNING, markup); + main_window_message (GTK_MESSAGE_WARNING, markup); } - void +void main_window_info_message (gchar * markup) { - main_window_message (GTK_MESSAGE_INFO, markup); + main_window_message (GTK_MESSAGE_INFO, markup); } - void +void main_window_dialpad (gboolean state) { - g_print ("main_window_dialpad\n"); - - if (state) - { - dialpad = create_dialpad (); - gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (dialpad); - } - else - { - gtk_container_remove (GTK_CONTAINER (subvbox), dialpad); - } + g_print ("main_window_dialpad\n"); + + if (state) { + dialpad = create_dialpad (); + gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (dialpad); + } else { + gtk_container_remove (GTK_CONTAINER (subvbox), dialpad); + } } - void +void main_window_volume_controls (gboolean state) { - if (state) - { - speaker_control = create_slider ("speaker"); - gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (speaker_control); - mic_control = create_slider ("mic"); - gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, - TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (mic_control); - } - else - { - gtk_container_remove (GTK_CONTAINER(subvbox), speaker_control); - gtk_container_remove (GTK_CONTAINER(subvbox), mic_control); - } + if (state) { + speaker_control = create_slider ("speaker"); + gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (speaker_control); + mic_control = create_slider ("mic"); + gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (mic_control); + } else { + gtk_container_remove (GTK_CONTAINER (subvbox), speaker_control); + gtk_container_remove (GTK_CONTAINER (subvbox), mic_control); + } } - void +void statusbar_push_message (const gchar * message, guint id) { - gtk_statusbar_push (GTK_STATUSBAR(statusBar), id, message); + gtk_statusbar_push (GTK_STATUSBAR (statusBar), id, message); } - void +void statusbar_pop_message (guint id) { - gtk_statusbar_pop (GTK_STATUSBAR(statusBar), id); + gtk_statusbar_pop (GTK_STATUSBAR (statusBar), id); } - static void +static void add_error_dialog (GtkWidget *dialog, callable_obj_t * call) { - gtk_container_add (GTK_CONTAINER(embedded_error_notebook), dialog); - call_add_error (call, dialog); + gtk_container_add (GTK_CONTAINER (embedded_error_notebook), dialog); + call_add_error (call, dialog); } - static void +static void destroy_error_dialog_cb (GtkObject *dialog, callable_obj_t * call) { - call_remove_error (call, dialog); + call_remove_error (call, dialog); } - void +void main_window_zrtp_not_supported (callable_obj_t * c) { - account_t* account_details = NULL; - gchar* warning_enabled = ""; - - account_details = account_list_get_by_id (c->_accountID); - if (account_details != NULL) - { - warning_enabled = g_hash_table_lookup (account_details->properties, - ACCOUNT_ZRTP_NOT_SUPP_WARNING); - DEBUG("Warning Enabled %s", warning_enabled); - } - else - { - DEBUG("Account is null callID %s", c->_callID); - GHashTable * properties = NULL; - sflphone_get_ip2ip_properties (&properties); - if (properties != NULL) - { - warning_enabled = g_hash_table_lookup (properties, - ACCOUNT_ZRTP_NOT_SUPP_WARNING); - } - } - - if (g_strcasecmp (warning_enabled, "true") == 0) - { - PidginMiniDialog *mini_dialog; - gchar *desc = g_markup_printf_escaped ( - _("ZRTP is not supported by peer %s\n"), c->_peer_number); - mini_dialog = pidgin_mini_dialog_new ( - _("Secure Communication Unavailable"), desc, - GTK_STOCK_DIALOG_WARNING); - pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL); - pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), - sflphone_hang_up, NULL); - - g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); - - add_error_dialog (GTK_WIDGET(mini_dialog), c); - } + account_t* account_details = NULL; + gchar* warning_enabled = ""; + + account_details = account_list_get_by_id (c->_accountID); + + if (account_details != NULL) { + warning_enabled = g_hash_table_lookup (account_details->properties, + ACCOUNT_ZRTP_NOT_SUPP_WARNING); + DEBUG ("Warning Enabled %s", warning_enabled); + } else { + DEBUG ("Account is null callID %s", c->_callID); + GHashTable * properties = NULL; + sflphone_get_ip2ip_properties (&properties); + + if (properties != NULL) { + warning_enabled = g_hash_table_lookup (properties, + ACCOUNT_ZRTP_NOT_SUPP_WARNING); + } + } + + if (g_strcasecmp (warning_enabled, "true") == 0) { + PidginMiniDialog *mini_dialog; + gchar *desc = g_markup_printf_escaped ( + _ ("ZRTP is not supported by peer %s\n"), c->_peer_number); + mini_dialog = pidgin_mini_dialog_new ( + _ ("Secure Communication Unavailable"), desc, + GTK_STOCK_DIALOG_WARNING); + pidgin_mini_dialog_add_button (mini_dialog, _ ("Continue"), NULL, NULL); + pidgin_mini_dialog_add_button (mini_dialog, _ ("Stop Call"), + sflphone_hang_up, NULL); + + g_signal_connect_after (mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); + + add_error_dialog (GTK_WIDGET (mini_dialog), c); + } } - void +void main_window_zrtp_negotiation_failed (const gchar* callID, const gchar* reason, - const gchar* severity) + const gchar* severity) { - gchar* peer_number = "(number unknown)"; - callable_obj_t * c = NULL; - c = calllist_get (current_calls, callID); - if (c != NULL) - { - peer_number = c->_peer_number; - } - - PidginMiniDialog *mini_dialog; - gchar - *desc = - g_markup_printf_escaped ( - _("A %s error forced the call with %s to fall under unencrypted mode.\nExact reason: %s\n"), - severity, peer_number, reason); - mini_dialog = pidgin_mini_dialog_new (_("ZRTP negotiation failed"), desc, - GTK_STOCK_DIALOG_WARNING); - pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL); - pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), sflphone_hang_up, - NULL); - - g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); - - add_error_dialog (GTK_WIDGET(mini_dialog), c); + gchar* peer_number = "(number unknown)"; + callable_obj_t * c = NULL; + c = calllist_get (current_calls, callID); + + if (c != NULL) { + peer_number = c->_peer_number; + } + + PidginMiniDialog *mini_dialog; + gchar + *desc = + g_markup_printf_escaped ( + _ ("A %s error forced the call with %s to fall under unencrypted mode.\nExact reason: %s\n"), + severity, peer_number, reason); + mini_dialog = pidgin_mini_dialog_new (_ ("ZRTP negotiation failed"), desc, + GTK_STOCK_DIALOG_WARNING); + pidgin_mini_dialog_add_button (mini_dialog, _ ("Continue"), NULL, NULL); + pidgin_mini_dialog_add_button (mini_dialog, _ ("Stop Call"), sflphone_hang_up, + NULL); + + g_signal_connect_after (mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); + + add_error_dialog (GTK_WIDGET (mini_dialog), c); } - void +void main_window_confirm_go_clear (callable_obj_t * c) { - PidginMiniDialog *mini_dialog; - gchar - *desc = - g_markup_printf_escaped ( - _("%s wants to stop using secure communication. Confirm will resume conversation without SRTP.\n"), - c->_peer_number); - mini_dialog = pidgin_mini_dialog_new (_("Confirm Go Clear"), desc, - GTK_STOCK_STOP); - pidgin_mini_dialog_add_button (mini_dialog, _("Confirm"), - (PidginMiniDialogCallback) sflphone_set_confirm_go_clear, NULL); - pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), sflphone_hang_up, - NULL); - - add_error_dialog (GTK_WIDGET(mini_dialog), c); + PidginMiniDialog *mini_dialog; + gchar + *desc = + g_markup_printf_escaped ( + _ ("%s wants to stop using secure communication. Confirm will resume conversation without SRTP.\n"), + c->_peer_number); + mini_dialog = pidgin_mini_dialog_new (_ ("Confirm Go Clear"), desc, + GTK_STOCK_STOP); + pidgin_mini_dialog_add_button (mini_dialog, _ ("Confirm"), + (PidginMiniDialogCallback) sflphone_set_confirm_go_clear, NULL); + pidgin_mini_dialog_add_button (mini_dialog, _ ("Stop Call"), sflphone_hang_up, + NULL); + + add_error_dialog (GTK_WIDGET (mini_dialog), c); } diff --git a/sflphone-client-gnome/src/mainwindow.h b/sflphone-client-gnome/src/mainwindow.h index db7007cd3c315733710fa8c4ab9c2ebf00ee8887..c54b9d95ea6dc7296091103821b99b5dfde7ac27 100644 --- a/sflphone-client-gnome/src/mainwindow.h +++ b/sflphone-client-gnome/src/mainwindow.h @@ -54,7 +54,7 @@ GtkWidget *waitingLayer; /** * Build the main window */ -void create_main_window ( ); +void create_main_window (); /** * Display a dialog window @@ -67,43 +67,43 @@ gboolean main_window_ask_quit() ; /** * Shows/Hides the dialpad on the mainwindow */ -void main_window_dialpad( gboolean state ); +void main_window_dialpad (gboolean state); /** * Shows/Hides the dialpad on the mainwindow */ -void main_window_volume_controls( gboolean state ); +void main_window_volume_controls (gboolean state); /** * Display an error message * @param markup The error message */ -void main_window_error_message(gchar * markup); +void main_window_error_message (gchar * markup); /** * Display a warning message * @param markup The warning message */ -void main_window_warning_message(gchar * markup); +void main_window_warning_message (gchar * markup); /** * Display an info message * @param markup The info message */ -void main_window_info_message(gchar * markup); +void main_window_info_message (gchar * markup); /** * Push a message on the statusbar stack * @param message The message to display * @param id The identifier of the message */ -void statusbar_push_message( const gchar* message , guint id ); +void statusbar_push_message (const gchar* message , guint id); /** * Pop a message from the statusbar stack * @param id The identifier of the message */ -void statusbar_pop_message( guint id ); +void statusbar_pop_message (guint id); //static gboolean //on_key_released (GtkWidget *widget, GdkEventKey *event, @@ -114,10 +114,10 @@ gboolean focus_is_on_calltree; gboolean focus_is_on_searchbar; -void main_window_zrtp_not_supported(callable_obj_t * c); +void main_window_zrtp_not_supported (callable_obj_t * c); -void main_window_zrtp_negotiation_failed(const gchar* callID, const gchar* reason, const gchar* severity); +void main_window_zrtp_negotiation_failed (const gchar* callID, const gchar* reason, const gchar* severity); -void main_window_confirm_go_clear(callable_obj_t * c); +void main_window_confirm_go_clear (callable_obj_t * c); #endif diff --git a/sflphone-client-gnome/src/reqaccount.c b/sflphone-client-gnome/src/reqaccount.c index dda30b8dc6b2e549bd081e1b3340d291ddc822e0..463298d563168494c6fc9904c155220abcd8bc9e 100644 --- a/sflphone-client-gnome/src/reqaccount.c +++ b/sflphone-client-gnome/src/reqaccount.c @@ -50,96 +50,108 @@ #include "reqaccount.h" -int req(char *host, int port, char *req, char *ret) { - - int s; - struct sockaddr_in servSockAddr; - struct hostent *servHostEnt; - long int length=0; - long int status=0; - int i=0; - FILE *f; - char buf[1024]; - - bzero(&servSockAddr, sizeof(servSockAddr)); - servHostEnt = gethostbyname(host); - if (servHostEnt == NULL) { - strcpy(ret, "gethostbyname"); - return -1; - } - bcopy((char *)servHostEnt->h_addr, (char *)&servSockAddr.sin_addr, servHostEnt->h_length); - servSockAddr.sin_port = htons(port); - servSockAddr.sin_family = AF_INET; - - if ((s = socket(AF_INET,SOCK_STREAM,0)) < 0) { - strcpy(ret, "socket"); - return -1; - } - - if(connect(s, (const struct sockaddr *) &servSockAddr, (socklen_t) sizeof(servSockAddr)) < 0 ) { - perror("foo"); - strcpy(ret, "connect"); - return -1; - } - - f = fdopen(s, "r+"); - - fprintf(f, "%s HTTP/1.1\r\n", req); - fprintf(f, "Host: %s\r\n", host); - fputs("User-Agent: SFLphone\r\n", f); - fputs("\r\n", f); - - while (strncmp(fgets(buf, sizeof(buf), f), "\r\n", 2)) { - const char *len_h = "content-length"; - const char *status_h = "HTTP/1.1"; - if (strncasecmp(buf, len_h, strlen(len_h)) == 0) - length = atoi(buf + strlen(len_h) + 1); - if (strncasecmp(buf, status_h, strlen(status_h)) == 0) - status = atoi(buf + strlen(status_h) + 1); - } - for (i = 0; i < length; i++) - ret[i] = fgetc(f); - - if (status != 200) { - sprintf(ret, "http error: %ld", status); - return -1; - } - - fclose(f); - shutdown(s, 2); - close(s); - return 0; +int req (char *host, int port, char *req, char *ret) +{ + + int s; + struct sockaddr_in servSockAddr; + struct hostent *servHostEnt; + long int length=0; + long int status=0; + int i=0; + FILE *f; + char buf[1024]; + + bzero (&servSockAddr, sizeof (servSockAddr)); + servHostEnt = gethostbyname (host); + + if (servHostEnt == NULL) { + strcpy (ret, "gethostbyname"); + return -1; + } + + bcopy ( (char *) servHostEnt->h_addr, (char *) &servSockAddr.sin_addr, servHostEnt->h_length); + servSockAddr.sin_port = htons (port); + servSockAddr.sin_family = AF_INET; + + if ( (s = socket (AF_INET,SOCK_STREAM,0)) < 0) { + strcpy (ret, "socket"); + return -1; + } + + if (connect (s, (const struct sockaddr *) &servSockAddr, (socklen_t) sizeof (servSockAddr)) < 0) { + perror ("foo"); + strcpy (ret, "connect"); + return -1; + } + + f = fdopen (s, "r+"); + + fprintf (f, "%s HTTP/1.1\r\n", req); + fprintf (f, "Host: %s\r\n", host); + fputs ("User-Agent: SFLphone\r\n", f); + fputs ("\r\n", f); + + while (strncmp (fgets (buf, sizeof (buf), f), "\r\n", 2)) { + const char *len_h = "content-length"; + const char *status_h = "HTTP/1.1"; + + if (strncasecmp (buf, len_h, strlen (len_h)) == 0) + length = atoi (buf + strlen (len_h) + 1); + + if (strncasecmp (buf, status_h, strlen (status_h)) == 0) + status = atoi (buf + strlen (status_h) + 1); + } + + for (i = 0; i < length; i++) + ret[i] = fgetc (f); + + if (status != 200) { + sprintf (ret, "http error: %ld", status); + return -1; + } + + fclose (f); + shutdown (s, 2); + close (s); + return 0; } -rest_account get_rest_account(char *host,char *email) { - char ret[4096]; - rest_account ra; - bzero(ret, sizeof(ret)); - DEBUG("HOST: %s", host); - strcpy(ret,"GET /rest/accountcreator?email="); - strcat(ret, email); - if (req(host, 80, ret, ret) != -1) { - strcpy(ra.user, strtok(ret, "\n")); - strcpy(ra.passwd, strtok(NULL, "\n"));\ - ra.success = 1; - } else { - ra.success = 0; - strcpy(ra.reason, ret); - } - puts(ret); - return ra; +rest_account get_rest_account (char *host,char *email) +{ + char ret[4096]; + rest_account ra; + bzero (ret, sizeof (ret)); + DEBUG ("HOST: %s", host); + strcpy (ret,"GET /rest/accountcreator?email="); + strcat (ret, email); + + if (req (host, 80, ret, ret) != -1) { + strcpy (ra.user, strtok (ret, "\n")); + strcpy (ra.passwd, strtok (NULL, "\n")); + \ + ra.success = 1; + } else { + ra.success = 0; + strcpy (ra.reason, ret); + } + + puts (ret); + return ra; } #ifdef BUILD_EXAMPLE -int main (void) { - rest_account acc = get_rest_account("sip.sflphone.org","email@email.com"); - if (acc.success) { - puts(acc.user); - puts(acc.passwd); - } else { - ERROR("FAILED: %s", acc.reason); - } +int main (void) +{ + rest_account acc = get_rest_account ("sip.sflphone.org","email@email.com"); + + if (acc.success) { + puts (acc.user); + puts (acc.passwd); + } else { + ERROR ("FAILED: %s", acc.reason); + } } #endif diff --git a/sflphone-client-gnome/src/reqaccount.h b/sflphone-client-gnome/src/reqaccount.h index 3a17154a4b07c7885f268dc56bf88604e39f4c0c..4bd9366eabb1d886ddd3025218ef464eda4fb363 100644 --- a/sflphone-client-gnome/src/reqaccount.h +++ b/sflphone-client-gnome/src/reqaccount.h @@ -29,10 +29,10 @@ */ typedef struct { - char success; - char reason[200]; - char user[200]; - char passwd[200]; + char success; + char reason[200]; + char user[200]; + char passwd[200]; } rest_account; -rest_account get_rest_account(char *host, char *email); +rest_account get_rest_account (char *host, char *email); diff --git a/sflphone-client-gnome/src/sflnotify.c b/sflphone-client-gnome/src/sflnotify.c index e728e5ab56c1bdf6d3da4b3613ffa2ae5c3c458e..fbbc5baa2405132ee1560dfc4df4a49f8cac970f 100644 --- a/sflphone-client-gnome/src/sflnotify.c +++ b/sflphone-client-gnome/src/sflnotify.c @@ -36,7 +36,7 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg { GnomeNotification *_notif; - if (eel_gconf_get_integer (NOTIFY_ALL)){ + if (eel_gconf_get_integer (NOTIFY_ALL)) { _notif = g_new0 (GnomeNotification, 1); @@ -47,11 +47,11 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg //_notif->icon = gdk_pixbuf_new_from_file_at_size (LOGO, 120, 120, NULL); _notif->icon = gdk_pixbuf_new_from_file (LOGO_SMALL, NULL); #if GTK_CHECK_VERSION(2,10,0) - notify_notification_attach_to_status_icon (_notif->notification , get_status_icon() ); + notify_notification_attach_to_status_icon (_notif->notification , get_status_icon()); #endif notify_notification_set_urgency (_notif->notification, urgency); - + if (_notif->icon != NULL) notify_notification_set_icon_from_pixbuf (_notif->notification, _notif->icon); else @@ -60,130 +60,130 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg notify_notification_set_timeout (_notif->notification, timeout); if (!notify_notification_show (_notif->notification, NULL)) { - ERROR("notify(), failed to send notification"); + ERROR ("notify(), failed to send notification"); } *notif = _notif; } } - void +void notify_incoming_message (const gchar *callID, const gchar *msg) { - gchar* text; - gchar* title; + gchar* text; + gchar* title; - title = g_markup_printf_escaped(_("%s says:"), callID); + title = g_markup_printf_escaped (_ ("%s says:"), callID); - create_new_gnome_notification (title, - msg, - NOTIFY_URGENCY_CRITICAL, - (g_strcasecmp(__TIMEOUT_MODE, "default") == 0 )? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, - &_gnome_notification); + create_new_gnome_notification (title, + msg, + NOTIFY_URGENCY_CRITICAL, + (g_strcasecmp (__TIMEOUT_MODE, "default") == 0) ? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, + &_gnome_notification); } - void +void notify_incoming_call (callable_obj_t* c) { - gchar* callerid; - gchar* title; + gchar* callerid; + gchar* title; - if (g_strcasecmp (c->_accountID,"") == 0) { - title = g_markup_printf_escaped ("IP-to-IP call"); - } - else { - title = g_markup_printf_escaped(_("%s account : %s") , - (gchar*)g_hash_table_lookup(account_list_get_by_id(c->_accountID)->properties , ACCOUNT_TYPE) , - (gchar*)g_hash_table_lookup(account_list_get_by_id(c->_accountID)->properties , ACCOUNT_ALIAS) ) ; - } - callerid = g_markup_printf_escaped(_("<i>From</i> %s"), c->_peer_number); + if (g_strcasecmp (c->_accountID,"") == 0) { + title = g_markup_printf_escaped ("IP-to-IP call"); + } else { + title = g_markup_printf_escaped (_ ("%s account : %s") , + (gchar*) g_hash_table_lookup (account_list_get_by_id (c->_accountID)->properties , ACCOUNT_TYPE) , + (gchar*) g_hash_table_lookup (account_list_get_by_id (c->_accountID)->properties , ACCOUNT_ALIAS)) ; + } + + callerid = g_markup_printf_escaped (_ ("<i>From</i> %s"), c->_peer_number); - create_new_gnome_notification (title, - callerid, - NOTIFY_URGENCY_CRITICAL, - (g_strcasecmp(__TIMEOUT_MODE, "default") == 0 )? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, - &_gnome_notification); + create_new_gnome_notification (title, + callerid, + NOTIFY_URGENCY_CRITICAL, + (g_strcasecmp (__TIMEOUT_MODE, "default") == 0) ? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, + &_gnome_notification); } - void +void notify_voice_mails (guint count, account_t* acc) { - // the account is different from NULL - gchar* title; - gchar* body; - - title = g_markup_printf_escaped(_("%s account : %s") , - (gchar*)g_hash_table_lookup(acc->properties , ACCOUNT_TYPE) , - (gchar*) g_hash_table_lookup(acc->properties , ACCOUNT_ALIAS) ) ; - body = g_markup_printf_escaped(n_("%d voice mail", "%d voice mails", count), count); - - create_new_gnome_notification (title, - body, - NOTIFY_URGENCY_LOW, - NOTIFY_EXPIRES_DEFAULT, - &_gnome_notification); + // the account is different from NULL + gchar* title; + gchar* body; + + title = g_markup_printf_escaped (_ ("%s account : %s") , + (gchar*) g_hash_table_lookup (acc->properties , ACCOUNT_TYPE) , + (gchar*) g_hash_table_lookup (acc->properties , ACCOUNT_ALIAS)) ; + body = g_markup_printf_escaped (n_ ("%d voice mail", "%d voice mails", count), count); + + create_new_gnome_notification (title, + body, + NOTIFY_URGENCY_LOW, + NOTIFY_EXPIRES_DEFAULT, + &_gnome_notification); } - void +void notify_current_account (account_t* acc) { - // the account is different from NULL - gchar* title; - gchar* body=""; + // the account is different from NULL + gchar* title; + gchar* body=""; - body = g_markup_printf_escaped(_("Calling with %s account <i>%s</i>") , - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE) , - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS)); + body = g_markup_printf_escaped (_ ("Calling with %s account <i>%s</i>") , + (gchar*) g_hash_table_lookup (acc->properties , ACCOUNT_TYPE) , + (gchar*) g_hash_table_lookup (acc->properties , ACCOUNT_ALIAS)); - title = g_markup_printf_escaped(_("Current account")); + title = g_markup_printf_escaped (_ ("Current account")); - create_new_gnome_notification (title, - body, - NOTIFY_URGENCY_NORMAL, - NOTIFY_EXPIRES_DEFAULT, - &_gnome_notification); + create_new_gnome_notification (title, + body, + NOTIFY_URGENCY_NORMAL, + NOTIFY_EXPIRES_DEFAULT, + &_gnome_notification); } - void +void notify_no_accounts () { gchar* title; gchar* body=""; - body = g_markup_printf_escaped(_("You have no accounts set up")); - title = g_markup_printf_escaped(_("Error")); + body = g_markup_printf_escaped (_ ("You have no accounts set up")); + title = g_markup_printf_escaped (_ ("Error")); create_new_gnome_notification (title, - body, - NOTIFY_URGENCY_CRITICAL, - NOTIFY_EXPIRES_DEFAULT, - &_gnome_notification); + body, + NOTIFY_URGENCY_CRITICAL, + NOTIFY_EXPIRES_DEFAULT, + &_gnome_notification); } - void +void notify_no_registered_accounts () { gchar* title; gchar* body=""; - body = g_markup_printf_escaped(_("You have no registered accounts")); - title = g_markup_printf_escaped(_("Error")); + body = g_markup_printf_escaped (_ ("You have no registered accounts")); + title = g_markup_printf_escaped (_ ("Error")); create_new_gnome_notification (title, - body, - NOTIFY_URGENCY_CRITICAL, - NOTIFY_EXPIRES_DEFAULT, - &_gnome_notification); + body, + NOTIFY_URGENCY_CRITICAL, + NOTIFY_EXPIRES_DEFAULT, + &_gnome_notification); } - void -stop_notification( void ) +void +stop_notification (void) { /* if( _gnome_notification != NULL ) @@ -203,67 +203,67 @@ stop_notification( void ) */ void free_notification (GnomeNotification *g) { - g_free(g->title); - g_free(g->body); - g_free(g); + g_free (g->title); + g_free (g->body); + g_free (g); } - void +void notify_secure_on (callable_obj_t* c) { - gchar* callerid; - gchar* title; - title = g_markup_printf_escaped ("Secure mode on."); - callerid = g_markup_printf_escaped(_("<i>With:</i> %s \nusing %s") , c->_peer_number, c->_srtp_cipher); - create_new_gnome_notification (title, - callerid, - NOTIFY_URGENCY_CRITICAL, - (g_strcasecmp(__TIMEOUT_MODE, "default") == 0 )? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, - &_gnome_notification); + gchar* callerid; + gchar* title; + title = g_markup_printf_escaped ("Secure mode on."); + callerid = g_markup_printf_escaped (_ ("<i>With:</i> %s \nusing %s") , c->_peer_number, c->_srtp_cipher); + create_new_gnome_notification (title, + callerid, + NOTIFY_URGENCY_CRITICAL, + (g_strcasecmp (__TIMEOUT_MODE, "default") == 0) ? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, + &_gnome_notification); } - void +void notify_zrtp_not_supported (callable_obj_t* c) { - gchar* callerid; - gchar* title; - title = g_markup_printf_escaped ("ZRTP Error."); - callerid = g_markup_printf_escaped(_("%s does not support ZRTP.") , c->_peer_number); - create_new_gnome_notification (title, - callerid, - NOTIFY_URGENCY_CRITICAL, - (g_strcasecmp(__TIMEOUT_MODE, "default") == 0 )? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, - &_gnome_notification); + gchar* callerid; + gchar* title; + title = g_markup_printf_escaped ("ZRTP Error."); + callerid = g_markup_printf_escaped (_ ("%s does not support ZRTP.") , c->_peer_number); + create_new_gnome_notification (title, + callerid, + NOTIFY_URGENCY_CRITICAL, + (g_strcasecmp (__TIMEOUT_MODE, "default") == 0) ? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, + &_gnome_notification); } - void +void notify_zrtp_negotiation_failed (callable_obj_t* c) { - gchar* callerid; - gchar* title; - title = g_markup_printf_escaped ("ZRTP Error."); - callerid = g_markup_printf_escaped(_("ZRTP negotiation failed with %s") , c->_peer_number); - create_new_gnome_notification (title, - callerid, - NOTIFY_URGENCY_CRITICAL, - (g_strcasecmp(__TIMEOUT_MODE, "default") == 0 )? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, - &_gnome_notification); + gchar* callerid; + gchar* title; + title = g_markup_printf_escaped ("ZRTP Error."); + callerid = g_markup_printf_escaped (_ ("ZRTP negotiation failed with %s") , c->_peer_number); + create_new_gnome_notification (title, + callerid, + NOTIFY_URGENCY_CRITICAL, + (g_strcasecmp (__TIMEOUT_MODE, "default") == 0) ? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, + &_gnome_notification); } - void +void notify_secure_off (callable_obj_t* c) { - gchar* callerid; - gchar* title; - title = g_markup_printf_escaped ("Secure mode is off."); - callerid = g_markup_printf_escaped(_("<i>With:</i> %s") , c->_peer_number); - create_new_gnome_notification (title, - callerid, - NOTIFY_URGENCY_CRITICAL, - (g_strcasecmp(__TIMEOUT_MODE, "default") == 0 )? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, - &_gnome_notification); + gchar* callerid; + gchar* title; + title = g_markup_printf_escaped ("Secure mode is off."); + callerid = g_markup_printf_escaped (_ ("<i>With:</i> %s") , c->_peer_number); + create_new_gnome_notification (title, + callerid, + NOTIFY_URGENCY_CRITICAL, + (g_strcasecmp (__TIMEOUT_MODE, "default") == 0) ? __TIMEOUT_TIME : NOTIFY_EXPIRES_NEVER, + &_gnome_notification); } diff --git a/sflphone-client-gnome/src/sflnotify.h b/sflphone-client-gnome/src/sflnotify.h index 8734abec03cd3ba19748ad9ff760697e102e2c4b..41fd603b50f14cb8f4a9e2b319dfbe7e96d83637 100644 --- a/sflphone-client-gnome/src/sflnotify.h +++ b/sflphone-client-gnome/src/sflnotify.h @@ -60,7 +60,7 @@ void free_notification (GnomeNotification *g); * A dialog box is attached to the status icon * @param c The incoming call */ -void notify_incoming_call( callable_obj_t* c); +void notify_incoming_call (callable_obj_t* c); /** * Notify an incoming text message @@ -75,28 +75,28 @@ void notify_incoming_message (const gchar *callID, const gchar *msg); * @param count The number of voice mails * @param acc The account that received the notification */ -void notify_voice_mails( guint count , account_t* acc ); +void notify_voice_mails (guint count , account_t* acc); /** * Notify the current account used to make calls with * @param acc The current account */ -void notify_current_account( account_t* acc ); +void notify_current_account (account_t* acc); /** * Notify that no accounts have been setup */ -void notify_no_accounts( ); +void notify_no_accounts(); /** * Notify that there is no registered account */ -void notify_no_registered_accounts( ); +void notify_no_registered_accounts(); /** * Stop and close the current notification if an action occured before the timeout */ -void stop_notification( void ); +void stop_notification (void); /** * Notify that the RTP session is secured @@ -111,7 +111,7 @@ void notify_secure_off (callable_obj_t* c); /** * Notify that the ZRTP negotiation failed */ - + void notify_zrtp_negotiation_failed (callable_obj_t* c); /** diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index 6f27125dc05cfb2c2700ff6befe9b500ac8b0ab3..bf613935076a3b5d5bad1f54116d9f4b6d0a6ee0 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -51,7 +51,7 @@ /** Locale */ #define _(STRING) gettext( STRING ) #define N_(STRING) (STRING) -#define c_(COMMENT,STRING) gettext(STRING) +#define c_(COMMENT,STRING) gettext(STRING) #define n_(SING,PLUR,COUNT) ngettext(SING,PLUR,COUNT) #define IP2IP "IP2IP" @@ -103,7 +103,7 @@ #define TLS_SERVER_NAME "TLS.serverName" #define TLS_VERIFY_SERVER "TLS.verifyServer" #define TLS_VERIFY_CLIENT "TLS.verifyClient" -#define TLS_REQUIRE_CLIENT_CERTIFICATE "TLS.requireClientCertificate" +#define TLS_REQUIRE_CLIENT_CERTIFICATE "TLS.requireClientCertificate" #define TLS_NEGOTIATION_TIMEOUT_SEC "TLS.negotiationTimeoutSec" #define TLS_NEGOTIATION_TIMEOUT_MSEC "TLS.negotiationTimemoutMsec" @@ -114,7 +114,7 @@ #define PUBLISHED_ADDRESS "Account.publishedAddress" #define REGISTRATION_STATUS "Status" -#define REGISTRATION_STATE_CODE "Registration.code" +#define REGISTRATION_STATE_CODE "Registration.code" #define REGISTRATION_STATE_DESCRIPTION "Registration.description" /** @@ -146,7 +146,7 @@ log4c_category_t* log4c_sfl_gtk_category; #define ALSA 0 #define PULSEAUDIO 1 - /** DTMF type */ +/** DTMF type */ #define OVERRTP "overrtp" #define SIPINFO "sipinfo" @@ -190,9 +190,9 @@ log4c_category_t* log4c_sfl_gtk_category; #define CONF_IM_WINDOW_POSITION_X CONF_PREFIX "/state/im_position_x" #define CONF_IM_WINDOW_POSITION_Y CONF_PREFIX "/state/im_position_y" /** Show/Hide the dialpad */ -#define CONF_SHOW_DIALPAD CONF_PREFIX "/state/dialpad" -#define SHOW_VOLUME_CONTROLS CONF_PREFIX "/state/volume_controls" -#define SHOW_STATUSICON CONF_PREFIX "/state/statusicon" +#define CONF_SHOW_DIALPAD CONF_PREFIX "/state/dialpad" +#define SHOW_VOLUME_CONTROLS CONF_PREFIX "/state/volume_controls" +#define SHOW_STATUSICON CONF_PREFIX "/state/statusicon" #define NOTIFY_ALL CONF_PREFIX "/state/notify_all" #define START_HIDDEN CONF_PREFIX "/state/start_hidden" #define POPUP_ON_CALL CONF_PREFIX "/state/popup" diff --git a/sflphone-client-gnome/src/shortcuts.c b/sflphone-client-gnome/src/shortcuts.c index 4ecb7cd47bde7bb23f2f793d999e7f2eea9a04c2..11e3889463a0356bad6556359b21ad37e9e2354e 100644 --- a/sflphone-client-gnome/src/shortcuts.c +++ b/sflphone-client-gnome/src/shortcuts.c @@ -56,88 +56,80 @@ static GHashTable* shortcutsMap; static void toggle_pick_up_hang_up_callback () { - callable_obj_t * selectedCall = calltab_get_selected_call (active_calltree); - conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); - - g_print("toggle_pick_up_hang_up_callback\n"); - - if (selectedCall) - { - switch (selectedCall->_state) - { - case CALL_STATE_INCOMING: - case CALL_STATE_TRANSFERT: - sflphone_pick_up (); - break; - case CALL_STATE_DIALING: - case CALL_STATE_HOLD: - case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: - case CALL_STATE_RINGING: - sflphone_hang_up (); - break; + callable_obj_t * selectedCall = calltab_get_selected_call (active_calltree); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); + + g_print ("toggle_pick_up_hang_up_callback\n"); + + if (selectedCall) { + switch (selectedCall->_state) { + case CALL_STATE_INCOMING: + case CALL_STATE_TRANSFERT: + sflphone_pick_up (); + break; + case CALL_STATE_DIALING: + case CALL_STATE_HOLD: + case CALL_STATE_CURRENT: + case CALL_STATE_RECORD: + case CALL_STATE_RINGING: + sflphone_hang_up (); + break; } - } - else if (selectedConf) - { - dbus_hang_up_conference (selectedConf); - } - else - sflphone_pick_up (); + } else if (selectedConf) { + dbus_hang_up_conference (selectedConf); + } else + sflphone_pick_up (); } static void pick_up_callback () { - sflphone_pick_up (); + sflphone_pick_up (); } static void hang_up_callback () { - sflphone_hang_up (); + sflphone_hang_up (); } static void toggle_hold_callback () { - callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); - conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); - - if (selectedCall) - { - switch (selectedCall->_state) - { - case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: - g_print("on hold\n"); - sflphone_on_hold(); - break; - case CALL_STATE_HOLD: - g_print("off hold\n"); - sflphone_off_hold(); - break; + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); + + if (selectedCall) { + switch (selectedCall->_state) { + case CALL_STATE_CURRENT: + case CALL_STATE_RECORD: + g_print ("on hold\n"); + sflphone_on_hold(); + break; + case CALL_STATE_HOLD: + g_print ("off hold\n"); + sflphone_off_hold(); + break; } - } - else if (selectedConf) - dbus_hold_conference (selectedConf); - else - ERROR("Should not happen"); + } else if (selectedConf) + dbus_hold_conference (selectedConf); + else + ERROR ("Should not happen"); } static void popup_window_callback () { - gtk_widget_hide (GTK_WIDGET(get_main_window())); - gtk_widget_show (GTK_WIDGET(get_main_window())); - gtk_window_move (GTK_WINDOW (get_main_window ()), - dbus_get_window_position_x (), dbus_get_window_position_y ()); + gtk_widget_hide (GTK_WIDGET (get_main_window())); + gtk_widget_show (GTK_WIDGET (get_main_window())); + gtk_window_move (GTK_WINDOW (get_main_window ()), + dbus_get_window_position_x (), dbus_get_window_position_y ()); } static void default_callback () { - ERROR("Missing shortcut callback"); + ERROR ("Missing shortcut callback"); } /* @@ -146,22 +138,22 @@ default_callback () static void* get_action_callback (const gchar* action) { - if (strcmp (action, "pick_up") == 0) - return pick_up_callback; + if (strcmp (action, "pick_up") == 0) + return pick_up_callback; - if (strcmp (action, "hang_up") == 0) - return hang_up_callback; + if (strcmp (action, "hang_up") == 0) + return hang_up_callback; - if (strcmp (action, "popup_window") == 0) - return popup_window_callback; + if (strcmp (action, "popup_window") == 0) + return popup_window_callback; - if (strcmp (action, "toggle_pick_up_hang_up") == 0) - return toggle_pick_up_hang_up_callback; + if (strcmp (action, "toggle_pick_up_hang_up") == 0) + return toggle_pick_up_hang_up_callback; - if (strcmp (action, "toggle_hold") == 0) - return toggle_hold_callback; + if (strcmp (action, "toggle_hold") == 0) + return toggle_hold_callback; - return default_callback; + return default_callback; } /* @@ -174,32 +166,29 @@ get_action_callback (const gchar* action) static void remove_bindings () { - GdkDisplay *display; - GdkScreen *screen; - GdkWindow *root; - - display = gdk_display_get_default (); - - int i = 0; - int j = 0; - while (accelerators_list[i].action != NULL) - { - if (accelerators_list[i].value != 0) - { - for (j = 0; j < gdk_display_get_n_screens (display); j++) - { - screen = gdk_display_get_screen (display, j); - - if (screen != NULL) - { - root = gdk_screen_get_root_window (screen); - ungrab_key (accelerators_list[i].value, root); - gdk_window_remove_filter (root, filter_keys, NULL); + GdkDisplay *display; + GdkScreen *screen; + GdkWindow *root; + + display = gdk_display_get_default (); + + int i = 0; + int j = 0; + + while (accelerators_list[i].action != NULL) { + if (accelerators_list[i].value != 0) { + for (j = 0; j < gdk_display_get_n_screens (display); j++) { + screen = gdk_display_get_screen (display, j); + + if (screen != NULL) { + root = gdk_screen_get_root_window (screen); + ungrab_key (accelerators_list[i].value, root); + gdk_window_remove_filter (root, filter_keys, NULL); } } } - i++; + i++; } } @@ -209,33 +198,30 @@ remove_bindings () static void create_bindings () { - GdkDisplay *display; - GdkScreen *screen; - GdkWindow *root; - - display = gdk_display_get_default (); - - int i = 0; - int j = 0; - while (accelerators_list[i].action != NULL) - { - if (accelerators_list[i].value != 0) - { - // updated GDK bindings - for (j = 0; j < gdk_display_get_n_screens (display); j++) - { - screen = gdk_display_get_screen (display, j); - - if (screen != NULL) - { - root = gdk_screen_get_root_window (screen); - grab_key (accelerators_list[i].value, root); - gdk_window_add_filter (root, filter_keys, NULL); + GdkDisplay *display; + GdkScreen *screen; + GdkWindow *root; + + display = gdk_display_get_default (); + + int i = 0; + int j = 0; + + while (accelerators_list[i].action != NULL) { + if (accelerators_list[i].value != 0) { + // updated GDK bindings + for (j = 0; j < gdk_display_get_n_screens (display); j++) { + screen = gdk_display_get_screen (display, j); + + if (screen != NULL) { + root = gdk_screen_get_root_window (screen); + grab_key (accelerators_list[i].value, root); + gdk_window_add_filter (root, filter_keys, NULL); } } } - i++; + i++; } } @@ -245,28 +231,27 @@ create_bindings () static void initialize_binding (const gchar* action, const guint code) { - //initialize_shortcuts_keys(); - int index = 0; - while (accelerators_list[index].action != NULL) - { - if (strcmp (action, accelerators_list[index].action) == 0) - { - break; + //initialize_shortcuts_keys(); + int index = 0; + + while (accelerators_list[index].action != NULL) { + if (strcmp (action, accelerators_list[index].action) == 0) { + break; } - index++; + + index++; } - if (accelerators_list[index].action == NULL) - { - ERROR("Should not happen: cannot find corresponding action"); - return; + if (accelerators_list[index].action == NULL) { + ERROR ("Should not happen: cannot find corresponding action"); + return; } - // update config value - accelerators_list[index].value = code; + // update config value + accelerators_list[index].value = code; - // update bindings - create_bindings (); + // update bindings + create_bindings (); } /* @@ -275,60 +260,60 @@ initialize_binding (const gchar* action, const guint code) static void initialize_accelerators_list () { - GList* shortcutsKeys = g_hash_table_get_keys (shortcutsMap); + GList* shortcutsKeys = g_hash_table_get_keys (shortcutsMap); + + accelerators_list = (Accelerator*) malloc ( + (g_list_length (shortcutsKeys) + 1) * sizeof (Accelerator)); - accelerators_list = (Accelerator*) malloc ( - (g_list_length (shortcutsKeys) + 1) * sizeof(Accelerator)); + GList* shortcutsKeysElement; + int index = 0; - GList* shortcutsKeysElement; - int index = 0; - for (shortcutsKeysElement = shortcutsKeys; shortcutsKeysElement; shortcutsKeysElement - = shortcutsKeysElement->next) - { - gchar* action = shortcutsKeysElement->data; + for (shortcutsKeysElement = shortcutsKeys; shortcutsKeysElement; shortcutsKeysElement + = shortcutsKeysElement->next) { + gchar* action = shortcutsKeysElement->data; - accelerators_list[index].action = g_strdup (action); - accelerators_list[index].callback = get_action_callback (action); - accelerators_list[index].mask = 0; - accelerators_list[index].value = 0; + accelerators_list[index].action = g_strdup (action); + accelerators_list[index].callback = get_action_callback (action); + accelerators_list[index].mask = 0; + accelerators_list[index].value = 0; - index++; + index++; } - // last element must be null - accelerators_list[index].action = 0; - accelerators_list[index].callback = 0; - accelerators_list[index].mask = 0; - accelerators_list[index].value = 0; + // last element must be null + accelerators_list[index].action = 0; + accelerators_list[index].callback = 0; + accelerators_list[index].mask = 0; + accelerators_list[index].value = 0; } static void update_bindings_data (const guint index, const guint code) { - // we need to be sure this code is not already affected - // to another action - int i = 0; - while (accelerators_list[i].action != NULL) - { - if (accelerators_list[i].value == code) - { - // disable old binding - accelerators_list[i].value = 0; - - // update config table - g_hash_table_replace (shortcutsMap, g_strdup ( - accelerators_list[i].action), GINT_TO_POINTER (0)); + // we need to be sure this code is not already affected + // to another action + int i = 0; + + while (accelerators_list[i].action != NULL) { + if (accelerators_list[i].value == code) { + // disable old binding + accelerators_list[i].value = 0; + + // update config table + g_hash_table_replace (shortcutsMap, g_strdup ( + accelerators_list[i].action), GINT_TO_POINTER (0)); } - i++; + + i++; } - // store new value - accelerators_list[index].value = code; + // store new value + accelerators_list[index].value = code; - // update value in hashtable (used for dbus calls) - g_hash_table_replace (shortcutsMap, - g_strdup (accelerators_list[index].action), GINT_TO_POINTER ( - accelerators_list[index].value)); + // update value in hashtable (used for dbus calls) + g_hash_table_replace (shortcutsMap, + g_strdup (accelerators_list[index].action), GINT_TO_POINTER ( + accelerators_list[index].value)); } /* @@ -341,17 +326,17 @@ update_bindings_data (const guint index, const guint code) void shortcuts_update_bindings (const guint index, const guint code) { - // first remove all existing bindings - remove_bindings (); + // first remove all existing bindings + remove_bindings (); - // update data - update_bindings_data (index, code); + // update data + update_bindings_data (index, code); - // recreate all bindings - create_bindings (); + // recreate all bindings + create_bindings (); - // update configuration - dbus_set_shortcuts (shortcutsMap); + // update configuration + dbus_set_shortcuts (shortcutsMap); } /* @@ -360,22 +345,23 @@ shortcuts_update_bindings (const guint index, const guint code) void shortcuts_initialize_bindings () { - // get shortcuts stored in config through dbus - shortcutsMap = dbus_get_shortcuts (); - - // initialize list of keys - initialize_accelerators_list (); - - // iterate through keys to initialize bindings - GList* shortcutsKeys = g_hash_table_get_keys (shortcutsMap); - GList* shortcutsKeysElement; - for (shortcutsKeysElement = shortcutsKeys; shortcutsKeysElement; shortcutsKeysElement - = shortcutsKeysElement->next) - { - gchar* key = shortcutsKeysElement->data; - int shortcut = (size_t) g_hash_table_lookup (shortcutsMap, key); - if (shortcut != 0) - initialize_binding (key, shortcut); + // get shortcuts stored in config through dbus + shortcutsMap = dbus_get_shortcuts (); + + // initialize list of keys + initialize_accelerators_list (); + + // iterate through keys to initialize bindings + GList* shortcutsKeys = g_hash_table_get_keys (shortcutsMap); + GList* shortcutsKeysElement; + + for (shortcutsKeysElement = shortcutsKeys; shortcutsKeysElement; shortcutsKeysElement + = shortcutsKeysElement->next) { + gchar* key = shortcutsKeysElement->data; + int shortcut = (size_t) g_hash_table_lookup (shortcutsMap, key); + + if (shortcut != 0) + initialize_binding (key, shortcut); } } @@ -385,23 +371,24 @@ shortcuts_initialize_bindings () void shortcuts_destroy_bindings () { - // remove bindings - remove_bindings (); - - // free pointers - int index = 0; - while (accelerators_list[index].action != NULL) - { - g_free (accelerators_list[index].action); - index++; + // remove bindings + remove_bindings (); + + // free pointers + int index = 0; + + while (accelerators_list[index].action != NULL) { + g_free (accelerators_list[index].action); + index++; } - free (accelerators_list); + + free (accelerators_list); } Accelerator* shortcuts_get_list () { - return accelerators_list; + return accelerators_list; } /* @@ -414,36 +401,36 @@ shortcuts_get_list () static GdkFilterReturn filter_keys (GdkXEvent *xevent, GdkEvent *event, gpointer data) { - XEvent *xev; - XKeyEvent *key; + XEvent *xev; + XKeyEvent *key; - xev = (XEvent *) xevent; - if (xev->type != KeyPress) - { - return GDK_FILTER_CONTINUE; + xev = (XEvent *) xevent; + + if (xev->type != KeyPress) { + return GDK_FILTER_CONTINUE; } - key = (XKeyEvent *) xevent; + key = (XKeyEvent *) xevent; + + // try to find corresponding action + int i = 0; - // try to find corresponding action - int i = 0; - while (accelerators_list[i].action != NULL) - { - if (accelerators_list[i].value == key->keycode) - { - DEBUG("catched key for action: %s (%d)", accelerators_list[i].action, - accelerators_list[i].value); + while (accelerators_list[i].action != NULL) { + if (accelerators_list[i].value == key->keycode) { + DEBUG ("catched key for action: %s (%d)", accelerators_list[i].action, + accelerators_list[i].value); - // call associated callback function - accelerators_list[i].callback (); + // call associated callback function + accelerators_list[i].callback (); - return GDK_FILTER_REMOVE; + return GDK_FILTER_REMOVE; } - i++; + + i++; } - DEBUG("Should not be reached :(\n"); - return GDK_FILTER_CONTINUE; + DEBUG ("Should not be reached :(\n"); + return GDK_FILTER_CONTINUE; } /* @@ -452,25 +439,25 @@ filter_keys (GdkXEvent *xevent, GdkEvent *event, gpointer data) static void ungrab_key (int key_code, GdkWindow *root) { - gdk_error_trap_push (); - - XUngrabKey (GDK_DISPLAY(), key_code, 0, GDK_WINDOW_XID(root)); - XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask, GDK_WINDOW_XID(root)); - XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask, GDK_WINDOW_XID(root)); - XUngrabKey (GDK_DISPLAY(), key_code, LockMask, GDK_WINDOW_XID(root)); - XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask, - GDK_WINDOW_XID(root)); - XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | LockMask, - GDK_WINDOW_XID(root)); - XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask | LockMask, - GDK_WINDOW_XID(root)); - XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask | LockMask, - GDK_WINDOW_XID(root)); - - gdk_flush (); - if (gdk_error_trap_pop ()) - { - ERROR("Error ungrabbing key"); + gdk_error_trap_push (); + + XUngrabKey (GDK_DISPLAY(), key_code, 0, GDK_WINDOW_XID (root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask, GDK_WINDOW_XID (root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask, GDK_WINDOW_XID (root)); + XUngrabKey (GDK_DISPLAY(), key_code, LockMask, GDK_WINDOW_XID (root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask, + GDK_WINDOW_XID (root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | LockMask, + GDK_WINDOW_XID (root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask | LockMask, + GDK_WINDOW_XID (root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask | LockMask, + GDK_WINDOW_XID (root)); + + gdk_flush (); + + if (gdk_error_trap_pop ()) { + ERROR ("Error ungrabbing key"); } } @@ -481,28 +468,28 @@ static void grab_key (int key_code, GdkWindow *root) { - gdk_error_trap_push (); - - XGrabKey (GDK_DISPLAY(), key_code, 0, GDK_WINDOW_XID(root), True, - GrabModeAsync, GrabModeAsync); - XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask, GDK_WINDOW_XID(root), True, - GrabModeAsync, GrabModeAsync); - XGrabKey (GDK_DISPLAY(), key_code, Mod5Mask, GDK_WINDOW_XID(root), True, - GrabModeAsync, GrabModeAsync); - XGrabKey (GDK_DISPLAY(), key_code, LockMask, GDK_WINDOW_XID(root), True, - GrabModeAsync, GrabModeAsync); - XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask, GDK_WINDOW_XID(root), - True, GrabModeAsync, GrabModeAsync); - XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | LockMask, GDK_WINDOW_XID(root), - True, GrabModeAsync, GrabModeAsync); - XGrabKey (GDK_DISPLAY(), key_code, Mod5Mask | LockMask, GDK_WINDOW_XID(root), - True, GrabModeAsync, GrabModeAsync); - XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask | LockMask, - GDK_WINDOW_XID(root), True, GrabModeAsync, GrabModeAsync); - - gdk_flush (); - if (gdk_error_trap_pop ()) - { - ERROR("Error grabbing key"); + gdk_error_trap_push (); + + XGrabKey (GDK_DISPLAY(), key_code, 0, GDK_WINDOW_XID (root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask, GDK_WINDOW_XID (root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod5Mask, GDK_WINDOW_XID (root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, LockMask, GDK_WINDOW_XID (root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask, GDK_WINDOW_XID (root), + True, GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | LockMask, GDK_WINDOW_XID (root), + True, GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod5Mask | LockMask, GDK_WINDOW_XID (root), + True, GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask | LockMask, + GDK_WINDOW_XID (root), True, GrabModeAsync, GrabModeAsync); + + gdk_flush (); + + if (gdk_error_trap_pop ()) { + ERROR ("Error grabbing key"); } } diff --git a/sflphone-client-gnome/src/shortcuts.h b/sflphone-client-gnome/src/shortcuts.h index 47f8fec550dc48ba8ad083994b1e17c78f9810a2..fda7f8940a23749bdbe94ef4b393556a4e2cef85 100644 --- a/sflphone-client-gnome/src/shortcuts.h +++ b/sflphone-client-gnome/src/shortcuts.h @@ -31,13 +31,12 @@ #ifndef SHORTCUTS_H_ #define SHORTCUTS_H_ -typedef struct -{ - gchar *action; - GdkModifierType mask; - guint value; - void - (*callback) (void); +typedef struct { + gchar *action; + GdkModifierType mask; + guint value; + void + (*callback) (void); } Accelerator; static void diff --git a/sflphone-client-gnome/src/sliders.c b/sflphone-client-gnome/src/sliders.c index 65e393c8e787ed1ccb7a22d4377d41d9fd730da3..45ac5645790a7865587ad244b0203bfd6d0fdb75 100644 --- a/sflphone-client-gnome/src/sliders.c +++ b/sflphone-client-gnome/src/sliders.c @@ -40,16 +40,16 @@ GtkWidget * button[2]; // icons GtkWidget * images[2][4]; enum device_t { - SPEAKER = 0, - MIKE, - DEVICE_COUNT + SPEAKER = 0, + MIKE, + DEVICE_COUNT } ; enum volume_t { - MUTED = 0, - VOL25, - VOL50, - VOL75 + MUTED = 0, + VOL25, + VOL50, + VOL75 } ; guint toggledConnId[2]; // The button toggled signal connection ID @@ -58,137 +58,139 @@ guint movedConnId[2]; // The slider_moved signal connection ID void update_icons (int dev) { - float val = gtk_range_get_value(GTK_RANGE(slider[dev])); - if(button[dev]) - { - int icon = MUTED; - if(val == 0) - icon = MUTED; - else if( val < 0.33) - icon = VOL25; - else if( val < 0.66) - icon = VOL50; - else if( val <= 1) - icon = VOL75; - gtk_button_set_image(GTK_BUTTON(button[dev]), GTK_WIDGET(images[dev][icon])); - } + float val = gtk_range_get_value (GTK_RANGE (slider[dev])); + + if (button[dev]) { + int icon = MUTED; + + if (val == 0) + icon = MUTED; + else if (val < 0.33) + icon = VOL25; + else if (val < 0.66) + icon = VOL50; + else if (val <= 1) + icon = VOL75; + + gtk_button_set_image (GTK_BUTTON (button[dev]), GTK_WIDGET (images[dev][icon])); + } } void -slider_moved(GtkRange* range, gchar* device) +slider_moved (GtkRange* range, gchar* device) { - gdouble value = gtk_range_get_value(range); - DEBUG("Volume changed for %s: %f ", device, value); - dbus_set_volume(device, value); - if(strcmp(device, "speaker") == 0) - update_icons(SPEAKER); - else - update_icons(MIKE); + gdouble value = gtk_range_get_value (range); + DEBUG ("Volume changed for %s: %f ", device, value); + dbus_set_volume (device, value); + + if (strcmp (device, "speaker") == 0) + update_icons (SPEAKER); + else + update_icons (MIKE); } static void -mute_cb( GtkWidget *widget, gchar* device ) +mute_cb (GtkWidget *widget, gchar* device) { - int dev; - if(strcmp(device, "speaker") == 0) - dev = SPEAKER; - else - dev = MIKE; - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) - { // Save value - DEBUG("Save"); - value[dev] = gtk_range_get_value(GTK_RANGE(slider[dev])); - dbus_set_volume(device, 0); - } - else - { //Restore value - DEBUG("Restore"); - dbus_set_volume(device, value[dev]); - } - update_icons (dev); + int dev; + + if (strcmp (device, "speaker") == 0) + dev = SPEAKER; + else + dev = MIKE; + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { // Save value + DEBUG ("Save"); + value[dev] = gtk_range_get_value (GTK_RANGE (slider[dev])); + dbus_set_volume (device, 0); + } else { //Restore value + DEBUG ("Restore"); + dbus_set_volume (device, value[dev]); + } + + update_icons (dev); } void -set_slider(const gchar * device, gdouble newval) +set_slider (const gchar * device, gdouble newval) { - int dev; - if(strcmp(device, "speaker") == 0) - dev = SPEAKER; - else - dev = MIKE; + int dev; - gtk_signal_handler_block(GTK_OBJECT(slider[dev]), movedConnId[dev]); - gtk_range_set_value(GTK_RANGE(slider[dev]), newval); - gtk_signal_handler_unblock(slider[dev], movedConnId[dev]); + if (strcmp (device, "speaker") == 0) + dev = SPEAKER; + else + dev = MIKE; - gtk_signal_handler_block(GTK_OBJECT(button[dev]),toggledConnId[dev]); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button[dev]), (newval == 0 ? TRUE: FALSE)); - gtk_signal_handler_unblock(button[dev], toggledConnId[dev]); + gtk_signal_handler_block (GTK_OBJECT (slider[dev]), movedConnId[dev]); + gtk_range_set_value (GTK_RANGE (slider[dev]), newval); + gtk_signal_handler_unblock (slider[dev], movedConnId[dev]); - update_icons (dev); + gtk_signal_handler_block (GTK_OBJECT (button[dev]),toggledConnId[dev]); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button[dev]), (newval == 0 ? TRUE: FALSE)); + gtk_signal_handler_unblock (button[dev], toggledConnId[dev]); + + update_icons (dev); } /** Generates the speaker slider and mute button */ GtkWidget * -create_slider(const gchar * device) +create_slider (const gchar * device) { - // Increment the references count for the images - // When the image is removed from a button, if the ref count = 0, then it is destroyed - // which we don't want ;) - - GtkWidget * ret; - int dev=0; - - if(strcmp(device, "speaker") == 0) - { - dev = SPEAKER; - images[SPEAKER][MUTED] = gtk_image_new_from_file( ICONS_DIR "/speaker.svg"); - images[SPEAKER][VOL25] = gtk_image_new_from_file( ICONS_DIR "/speaker_25.svg"); - images[SPEAKER][VOL50] = gtk_image_new_from_file( ICONS_DIR "/speaker_50.svg"); - images[SPEAKER][VOL75] = gtk_image_new_from_file( ICONS_DIR "/speaker_75.svg"); - g_object_ref(images[SPEAKER][MUTED]); - g_object_ref(images[SPEAKER][VOL25]); - g_object_ref(images[SPEAKER][VOL50]); - g_object_ref(images[SPEAKER][VOL75]); - } - else if (strcmp(device, "mic") == 0) - { - dev = MIKE; - images[MIKE][MUTED] = gtk_image_new_from_file( ICONS_DIR "/mic.svg"); - images[MIKE][VOL25] = gtk_image_new_from_file( ICONS_DIR "/mic_25.svg"); - images[MIKE][VOL50] = gtk_image_new_from_file( ICONS_DIR "/mic_50.svg"); - images[MIKE][VOL75] = gtk_image_new_from_file( ICONS_DIR "/mic_75.svg"); - g_object_ref(images[MIKE][MUTED]); - g_object_ref(images[MIKE][VOL25]); - g_object_ref(images[MIKE][VOL50]); - g_object_ref(images[MIKE][VOL75]); - } - - ret = gtk_hbox_new ( FALSE /*homogeneous*/, 5 /*spacing*/); - gtk_container_set_border_width (GTK_CONTAINER(ret), 5); - + // Increment the references count for the images + // When the image is removed from a button, if the ref count = 0, then it is destroyed + // which we don't want ;) + + GtkWidget * ret; + int dev=0; + + if (strcmp (device, "speaker") == 0) { + dev = SPEAKER; + images[SPEAKER][MUTED] = gtk_image_new_from_file (ICONS_DIR "/speaker.svg"); + images[SPEAKER][VOL25] = gtk_image_new_from_file (ICONS_DIR "/speaker_25.svg"); + images[SPEAKER][VOL50] = gtk_image_new_from_file (ICONS_DIR "/speaker_50.svg"); + images[SPEAKER][VOL75] = gtk_image_new_from_file (ICONS_DIR "/speaker_75.svg"); + g_object_ref (images[SPEAKER][MUTED]); + g_object_ref (images[SPEAKER][VOL25]); + g_object_ref (images[SPEAKER][VOL50]); + g_object_ref (images[SPEAKER][VOL75]); + } else if (strcmp (device, "mic") == 0) { + dev = MIKE; + images[MIKE][MUTED] = gtk_image_new_from_file (ICONS_DIR "/mic.svg"); + images[MIKE][VOL25] = gtk_image_new_from_file (ICONS_DIR "/mic_25.svg"); + images[MIKE][VOL50] = gtk_image_new_from_file (ICONS_DIR "/mic_50.svg"); + images[MIKE][VOL75] = gtk_image_new_from_file (ICONS_DIR "/mic_75.svg"); + g_object_ref (images[MIKE][MUTED]); + g_object_ref (images[MIKE][VOL25]); + g_object_ref (images[MIKE][VOL50]); + g_object_ref (images[MIKE][VOL75]); + } + + ret = gtk_hbox_new (FALSE /*homogeneous*/, 5 /*spacing*/); + gtk_container_set_border_width (GTK_CONTAINER (ret), 5); + #if GTK_CHECK_VERSION(2,12,0) - if( strcmp( device , "speaker") == 0 ) - gtk_widget_set_tooltip_text( GTK_WIDGET( ret ), _("Speakers volume")); - else - gtk_widget_set_tooltip_text( GTK_WIDGET( ret ), _("Mic volume")); + + if (strcmp (device , "speaker") == 0) + gtk_widget_set_tooltip_text (GTK_WIDGET (ret), _ ("Speakers volume")); + else + gtk_widget_set_tooltip_text (GTK_WIDGET (ret), _ ("Mic volume")); + #endif - button[dev] = gtk_toggle_button_new(); - gtk_box_pack_start (GTK_BOX (ret), button[dev], FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - toggledConnId[dev] = g_signal_connect (G_OBJECT (button[dev]), "toggled", - G_CALLBACK (mute_cb), (gpointer)device); + button[dev] = gtk_toggle_button_new(); + gtk_box_pack_start (GTK_BOX (ret), button[dev], FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); + toggledConnId[dev] = g_signal_connect (G_OBJECT (button[dev]), "toggled", + G_CALLBACK (mute_cb), (gpointer) device); - slider[dev] = gtk_hscale_new_with_range(0, 1, 0.05); - gtk_scale_set_draw_value(GTK_SCALE(slider[dev]), FALSE); - //gtk_range_set_update_policy(GTK_RANGE(slider), GTK_UPDATE_DELAYED); - movedConnId[dev] = g_signal_connect (G_OBJECT (slider[dev]), "value_changed", - G_CALLBACK (slider_moved), (gpointer)device); - gtk_box_pack_start (GTK_BOX (ret), slider[dev], TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); + slider[dev] = gtk_hscale_new_with_range (0, 1, 0.05); + gtk_scale_set_draw_value (GTK_SCALE (slider[dev]), FALSE); + //gtk_range_set_update_policy(GTK_RANGE(slider), GTK_UPDATE_DELAYED); + movedConnId[dev] = g_signal_connect (G_OBJECT (slider[dev]), "value_changed", + G_CALLBACK (slider_moved), (gpointer) device); + gtk_box_pack_start (GTK_BOX (ret), slider[dev], TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - set_slider(device, dbus_get_volume(device)); + set_slider (device, dbus_get_volume (device)); - return ret; + return ret; } diff --git a/sflphone-client-gnome/src/sliders.h b/sflphone-client-gnome/src/sliders.h index 531a1b22bd9a435e967c270efb39704fd02c7c15..574af9104d14befe50634bc620c39a0aff3fff31 100644 --- a/sflphone-client-gnome/src/sliders.h +++ b/sflphone-client-gnome/src/sliders.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __SLIDERS_H__ #define __SLIDERS_H__ @@ -41,16 +41,16 @@ * @param device Mic or speaker * @return GtkWidget* The slider */ -GtkWidget * create_slider(const gchar * device); +GtkWidget * create_slider (const gchar * device); -/** +/** * This function updates the sliders without sending the value to the server. * This behavior prevents an infinite loop when receiving an updated volume from * the server. * @param device The device slider to update {speaker, mic} * @param value The value to set [0, 1.0] */ -void set_slider(const gchar * device, gdouble value); +void set_slider (const gchar * device, gdouble value); -#endif +#endif diff --git a/sflphone-client-gnome/src/statusicon.c b/sflphone-client-gnome/src/statusicon.c index 72511091f05e8591ce022a2b64984329715c2dd3..93348e1e5d068c101da36cef8280f5d6f2b09942 100644 --- a/sflphone-client-gnome/src/statusicon.c +++ b/sflphone-client-gnome/src/statusicon.c @@ -2,17 +2,17 @@ * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -41,147 +41,143 @@ GtkWidget *show_menu_item, *hangup_menu_item; gboolean __minimized = MINIMIZED; void -popup_main_window(void) -{ - if (__POPUP_WINDOW) - { - gtk_widget_show(get_main_window()); - gtk_window_move(GTK_WINDOW (get_main_window ()), - dbus_get_window_position_x(), dbus_get_window_position_y()); - set_minimized(FALSE); +popup_main_window (void) +{ + if (__POPUP_WINDOW) { + gtk_widget_show (get_main_window()); + gtk_window_move (GTK_WINDOW (get_main_window ()), + dbus_get_window_position_x(), dbus_get_window_position_y()); + set_minimized (FALSE); } } void show_status_hangup_icon() { - if (__POPUP_WINDOW) - { - gtk_widget_show (get_main_window ()); - gtk_window_move (GTK_WINDOW (get_main_window ()), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y)); - set_minimized (FALSE); - } + if (__POPUP_WINDOW) { + gtk_widget_show (get_main_window ()); + gtk_window_move (GTK_WINDOW (get_main_window ()), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y)); + set_minimized (FALSE); + } } void hide_status_hangup_icon() { - if (status) { - DEBUG("Hide Hangup in Systray"); - gtk_widget_hide(GTK_WIDGET(hangup_menu_item)); - } + if (status) { + DEBUG ("Hide Hangup in Systray"); + gtk_widget_hide (GTK_WIDGET (hangup_menu_item)); + } } void -status_quit(void * foo UNUSED) +status_quit (void * foo UNUSED) { - sflphone_quit(); + sflphone_quit(); } void status_hangup() { - sflphone_hang_up(); + sflphone_hang_up(); } void status_icon_unminimize() { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (show_menu_item), TRUE); } gboolean main_widget_minimized() { - return __minimized; + return __minimized; } void -show_hide(void) -{ - if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))) - { - gtk_widget_show(GTK_WIDGET(get_main_window())); - gtk_window_move (GTK_WINDOW (get_main_window ()), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y)); - set_minimized( !MINIMIZED ); - } - else - { - gtk_widget_hide(GTK_WIDGET(get_main_window())); - set_minimized( MINIMIZED ); - } +show_hide (void) +{ + if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (show_menu_item))) { + gtk_widget_show (GTK_WIDGET (get_main_window())); + gtk_window_move (GTK_WINDOW (get_main_window ()), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y)); + set_minimized (!MINIMIZED); + } else { + gtk_widget_hide (GTK_WIDGET (get_main_window())); + set_minimized (MINIMIZED); + } } void -status_click(GtkStatusIcon *status_icon UNUSED, void * foo UNUSED) +status_click (GtkStatusIcon *status_icon UNUSED, void * foo UNUSED) { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), - !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (show_menu_item), + !gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (show_menu_item))); } void -menu(GtkStatusIcon *status_icon, guint button, guint activate_time, - GtkWidget * menu) +menu (GtkStatusIcon *status_icon, guint button, guint activate_time, + GtkWidget * menu) { - gtk_menu_popup(GTK_MENU(menu), NULL, NULL, gtk_status_icon_position_menu, - status_icon, button, activate_time); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, gtk_status_icon_position_menu, + status_icon, button, activate_time); } GtkWidget* create_menu() { - GtkWidget * menu; - GtkWidget * menu_items; - GtkWidget * image; + GtkWidget * menu; + GtkWidget * menu_items; + GtkWidget * image; - menu = gtk_menu_new(); + menu = gtk_menu_new(); - show_menu_item - = gtk_check_menu_item_new_with_mnemonic(_("_Show main window")); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), show_menu_item); - g_signal_connect(G_OBJECT (show_menu_item), "toggled", - G_CALLBACK (show_hide), - NULL); + show_menu_item + = gtk_check_menu_item_new_with_mnemonic (_ ("_Show main window")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (show_menu_item), TRUE); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), show_menu_item); + g_signal_connect (G_OBJECT (show_menu_item), "toggled", + G_CALLBACK (show_hide), + NULL); - hangup_menu_item = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); - image = gtk_image_new_from_file(ICONS_DIR "/icon_hangup.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(hangup_menu_item), image); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), hangup_menu_item); - g_signal_connect(G_OBJECT (hangup_menu_item), "activate", - G_CALLBACK (status_hangup), - NULL); + hangup_menu_item = gtk_image_menu_item_new_with_mnemonic (_ ("_Hang up")); + image = gtk_image_new_from_file (ICONS_DIR "/icon_hangup.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (hangup_menu_item), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), hangup_menu_item); + g_signal_connect (G_OBJECT (hangup_menu_item), "activate", + G_CALLBACK (status_hangup), + NULL); - menu_items = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, - get_accel_group()); - g_signal_connect_swapped (G_OBJECT (menu_items), "activate", - G_CALLBACK (status_quit), - NULL); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + menu_items = gtk_image_menu_item_new_from_stock (GTK_STOCK_QUIT, + get_accel_group()); + g_signal_connect_swapped (G_OBJECT (menu_items), "activate", + G_CALLBACK (status_quit), + NULL); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show_all(menu); + gtk_widget_show_all (menu); - return menu; + return menu; } void show_status_icon() { - status = gtk_status_icon_new_from_file(LOGO); - g_signal_connect (G_OBJECT (status), "activate", - G_CALLBACK (status_click), - NULL); - g_signal_connect (G_OBJECT (status), "popup-menu", - G_CALLBACK (menu), - create_menu()); + status = gtk_status_icon_new_from_file (LOGO); + g_signal_connect (G_OBJECT (status), "activate", + G_CALLBACK (status_click), + NULL); + g_signal_connect (G_OBJECT (status), "popup-menu", + G_CALLBACK (menu), + create_menu()); - statusicon_set_tooltip(); + statusicon_set_tooltip(); } -void hide_status_icon (void) { +void hide_status_icon (void) +{ g_object_unref (status); status = NULL; @@ -191,52 +187,52 @@ void hide_status_icon (void) { void statusicon_set_tooltip() { - int count; - gchar *tip; + int count; + gchar *tip; - if(status) { + if (status) { - // Add a tooltip to the system tray icon - count = account_list_get_registered_accounts(); - tip = g_markup_printf_escaped("%s - %s", _("SFLphone"), - g_markup_printf_escaped(n_("%i active account", "%i active accounts", count), count)); - gtk_status_icon_set_tooltip(status, tip); - g_free(tip); + // Add a tooltip to the system tray icon + count = account_list_get_registered_accounts(); + tip = g_markup_printf_escaped ("%s - %s", _ ("SFLphone"), + g_markup_printf_escaped (n_ ("%i active account", "%i active accounts", count), count)); + gtk_status_icon_set_tooltip (status, tip); + g_free (tip); - } + } } void -status_tray_icon_blink(gboolean active) +status_tray_icon_blink (gboolean active) { - if (status) { - // Set a different icon to notify of an event - active ? gtk_status_icon_set_from_file(status, LOGO_NOTIF) - : gtk_status_icon_set_from_file(status, LOGO); - } + if (status) { + // Set a different icon to notify of an event + active ? gtk_status_icon_set_from_file (status, LOGO_NOTIF) + : gtk_status_icon_set_from_file (status, LOGO); + } } void -status_tray_icon_online(gboolean online) +status_tray_icon_online (gboolean online) { - if (status) { - // Set a different icon to notify of an event - online ? gtk_status_icon_set_from_file(status, LOGO) - : gtk_status_icon_set_from_file(status, LOGO_OFFLINE); - } + if (status) { + // Set a different icon to notify of an event + online ? gtk_status_icon_set_from_file (status, LOGO) + : gtk_status_icon_set_from_file (status, LOGO_OFFLINE); + } } GtkStatusIcon* -get_status_icon(void) +get_status_icon (void) { - return status; + return status; } void -set_minimized(gboolean state) +set_minimized (gboolean state) { - __minimized = state; - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), !state); + __minimized = state; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (show_menu_item), !state); } #endif diff --git a/sflphone-client-gnome/src/statusicon.h b/sflphone-client-gnome/src/statusicon.h index ad9303d360ade39150b5b4dcbccc34ecdcb2c714..1245ced88e335f9ed4414056a417e7c7cf5268c4 100644 --- a/sflphone-client-gnome/src/statusicon.h +++ b/sflphone-client-gnome/src/statusicon.h @@ -2,17 +2,17 @@ * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -28,7 +28,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ - + #ifndef __STATUSICON_H__ #define __STATUSICON_H__ @@ -36,7 +36,7 @@ #include <gtk/gtk.h> #include <sflphone_const.h> -/** +/** * @file statusicon.h * @brief The status icon in the system tray. */ @@ -58,18 +58,18 @@ void show_status_icon (); void hide_status_icon (); /** - * Set the menu active - */ + * Set the menu active + */ void status_icon_unminimize(); /** - * Show hangup icon + * Show hangup icon */ void show_status_hangup_icon(); /** - * Show hangup icon + * Show hangup icon */ void hide_status_hangup_icon(); @@ -87,20 +87,20 @@ gboolean main_widget_minimized(); * @param state TRUE if the main window is minimized * FALSE otherwise */ -void set_minimized( gboolean state ); +void set_minimized (gboolean state); /** * Make the system tray icon blink on incoming call * @return active TRUE to make it blink * FALSE to make it stop */ -void status_tray_icon_blink( gboolean active ); +void status_tray_icon_blink (gboolean active); /** * Accessor * @return GtkStatusIcon* The status icon */ -GtkStatusIcon* get_status_icon( void ); +GtkStatusIcon* get_status_icon (void); /** * Attach a tooltip to the status icon diff --git a/sflphone-client-gnome/src/toolbar.c b/sflphone-client-gnome/src/toolbar.c index 1a26642eb7e44af5eda079ce1503252462b36c89..af5966c063ca1d6bcb8a148e30494405c24e2548 100644 --- a/sflphone-client-gnome/src/toolbar.c +++ b/sflphone-client-gnome/src/toolbar.c @@ -32,64 +32,60 @@ #include <contacts/addressbook.h> - static void -call_mailbox( GtkWidget* widget UNUSED, gpointer data UNUSED) +static void +call_mailbox (GtkWidget* widget UNUSED, gpointer data UNUSED) { account_t* current; callable_obj_t *mailbox_call; gchar *to, *from, *account_id; current = account_list_get_current (); - if( current == NULL ) // Should not happens + + if (current == NULL) // Should not happens return; - to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); + to = g_strdup (g_hash_table_lookup (current->properties, ACCOUNT_MAILBOX)); account_id = g_strdup (current->accountID); - create_new_call (CALL, CALL_STATE_DIALING, "", account_id, _("Voicemail"), to, &mailbox_call); - DEBUG("TO : %s" , mailbox_call->_peer_number); - calllist_add( current_calls , mailbox_call ); - calltree_add_call( current_calls, mailbox_call, NULL); + create_new_call (CALL, CALL_STATE_DIALING, "", account_id, _ ("Voicemail"), to, &mailbox_call); + DEBUG ("TO : %s" , mailbox_call->_peer_number); + calllist_add (current_calls , mailbox_call); + calltree_add_call (current_calls, mailbox_call, NULL); update_actions(); - sflphone_place_call( mailbox_call ); - calltree_display(current_calls); + sflphone_place_call (mailbox_call); + calltree_display (current_calls); } /** * Make a call */ - static void -call_button( GtkWidget *widget UNUSED, gpointer data UNUSED) +static void +call_button (GtkWidget *widget UNUSED, gpointer data UNUSED) { - DEBUG("------ call_button -----"); + DEBUG ("------ call_button -----"); callable_obj_t * selectedCall; callable_obj_t* new_call; - selectedCall = calltab_get_selected_call(active_calltree); + selectedCall = calltab_get_selected_call (active_calltree); - if(calllist_get_size(current_calls)>0) + if (calllist_get_size (current_calls) >0) sflphone_pick_up(); - else if(calllist_get_size(active_calltree) > 0){ - if( selectedCall) - { + else if (calllist_get_size (active_calltree) > 0) { + if (selectedCall) { create_new_call (CALL, CALL_STATE_DIALING, "", "", "", selectedCall->_peer_number, &new_call); - calllist_add(current_calls, new_call); - calltree_add_call(current_calls, new_call, NULL); - sflphone_place_call(new_call); + calllist_add (current_calls, new_call); + calltree_add_call (current_calls, new_call, NULL); + sflphone_place_call (new_call); calltree_display (current_calls); - } - else - { + } else { sflphone_new_call(); - calltree_display(current_calls); + calltree_display (current_calls); } - } - else - { + } else { sflphone_new_call(); - calltree_display(current_calls); + calltree_display (current_calls); } } diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index cda32a7df8ba028d0ec32aea34ed56ba73bd0dc7..35c9628bc831440c4e660d2b84c5dedd285cbeef 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -69,1516 +69,1450 @@ GtkAction * imAction; GtkWidget * editable_num; GtkDialog * edit_dialog; -enum -{ - CALLTREE_CALLS, CALLTREE_HISTORY, CALLTREE_CONTACTS +enum { + CALLTREE_CALLS, CALLTREE_HISTORY, CALLTREE_CONTACTS }; - static gboolean -is_inserted(GtkWidget* button, GtkWidget *current_toolbar) +static gboolean +is_inserted (GtkWidget* button, GtkWidget *current_toolbar) { - return (GTK_WIDGET (button)->parent == GTK_WIDGET (current_toolbar)); + return (GTK_WIDGET (button)->parent == GTK_WIDGET (current_toolbar)); } - void +void update_actions() { - DEBUG("Update action"); - - gtk_action_set_sensitive(GTK_ACTION (newCallAction), TRUE); - gtk_action_set_sensitive(GTK_ACTION (pickUpAction), FALSE); - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), FALSE); - gtk_action_set_sensitive(GTK_ACTION (imAction), FALSE); - - g_object_ref(hangUpWidget); - g_object_ref(recordWidget); - g_object_ref(holdToolbar); - g_object_ref(offHoldToolbar); - g_object_ref(contactButton); - g_object_ref(historyButton); - g_object_ref(transferToolbar); - g_object_ref(voicemailToolbar); - g_object_ref(imToolbar); - - if (is_inserted(GTK_WIDGET(hangUpWidget), GTK_WIDGET (toolbar))) - { - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (hangUpWidget)); - } - - if (is_inserted(GTK_WIDGET(recordWidget), GTK_WIDGET (toolbar))) - { - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (recordWidget)); - } - - if (is_inserted(GTK_WIDGET(transferToolbar), GTK_WIDGET (toolbar))) - { - gtk_container_remove(GTK_CONTAINER (toolbar), - GTK_WIDGET (transferToolbar)); - } - - if (is_inserted(GTK_WIDGET(historyButton), GTK_WIDGET (toolbar))) - { - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (historyButton)); - } - - if (is_inserted(GTK_WIDGET(contactButton), GTK_WIDGET (toolbar))) - { - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (contactButton)); - } - - if (is_inserted(GTK_WIDGET (voicemailToolbar), GTK_WIDGET (toolbar))) - { - gtk_container_remove(GTK_CONTAINER (toolbar), - GTK_WIDGET (voicemailToolbar)); - } - - if (is_inserted(GTK_WIDGET (imToolbar), GTK_WIDGET (toolbar))) - { - gtk_container_remove(GTK_CONTAINER (toolbar), - GTK_WIDGET (imToolbar)); - } - - gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET (offHoldToolbar), FALSE); - gtk_action_set_sensitive(GTK_ACTION (recordAction), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET (recordWidget), FALSE); - gtk_action_set_sensitive(GTK_ACTION (copyAction), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(contactButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(historyButton), FALSE); - gtk_widget_set_tooltip_text(GTK_WIDGET (contactButton), - _("No address book selected")); - - if (is_inserted(GTK_WIDGET (holdToolbar), GTK_WIDGET (toolbar))) - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (holdToolbar)); - if (is_inserted(GTK_WIDGET (offHoldToolbar), GTK_WIDGET (toolbar))) - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (offHoldToolbar)); - - if (is_inserted(GTK_WIDGET (newCallWidget), GTK_WIDGET (toolbar))) - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); - if (is_inserted(GTK_WIDGET (pickUpWidget), GTK_WIDGET (toolbar))) - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (pickUpWidget)); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (newCallWidget), 0); - - - if (eel_gconf_get_integer (HISTORY_ENABLED)) { - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (historyButton), -1); - gtk_widget_set_sensitive(GTK_WIDGET(historyButton), TRUE); - } - // If addressbook support has been enabled and all addressbooks are loaded, display the icon - if (addressbook_is_enabled() && addressbook_is_ready()) - { - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (contactButton), - -1); - // Make the icon clickable only if at least one address book is active - if (addressbook_is_active()) - { - gtk_widget_set_sensitive(GTK_WIDGET(contactButton), TRUE); - gtk_widget_set_tooltip_text(GTK_WIDGET (contactButton), - _("Address book")); - } - } - - callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree); - conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree); - - if (selectedCall) - { - // update icon in systray - show_status_hangup_icon(); - - gtk_action_set_sensitive(GTK_ACTION (copyAction), TRUE); - - switch (selectedCall->_state) - { - case CALL_STATE_INCOMING: - // Make the button toolbar clickable - gtk_action_set_sensitive(GTK_ACTION (pickUpAction), TRUE); - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - // Replace the dial button with the hangup button - g_object_ref(newCallWidget); - gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET(newCallWidget)); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), - 0); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - break; - case CALL_STATE_HOLD: - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (offHoldToolbar), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (newCallWidget), TRUE); - // Replace the hold button with the off-hold button - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), - GTK_TOOL_ITEM (offHoldToolbar), 2); - break; - case CALL_STATE_RINGING: - gtk_action_set_sensitive(GTK_ACTION (pickUpAction), TRUE); - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - break; - case CALL_STATE_DIALING: - gtk_action_set_sensitive(GTK_ACTION(pickUpAction), TRUE); - if (active_calltree == current_calls) - gtk_action_set_sensitive(GTK_ACTION(hangUpAction), TRUE); - //gtk_action_set_sensitive( GTK_ACTION(newCallMenu),TRUE); - g_object_ref(newCallWidget); - gtk_container_remove(GTK_CONTAINER (toolbar), - GTK_WIDGET (newCallWidget)); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), - 0); - if (active_calltree == current_calls) - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), - GTK_TOOL_ITEM (hangUpWidget), 1); - break; - case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (transferToolbar), TRUE); - gtk_action_set_sensitive(GTK_ACTION (recordAction), TRUE); - gtk_action_set_sensitive(GTK_ACTION (imAction), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), - 2); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), - GTK_TOOL_ITEM (transferToolbar), 3); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (recordWidget), - 4); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (imToolbar), - 5); - gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); - gtk_toggle_tool_button_set_active( - GTK_TOGGLE_TOOL_BUTTON (transferToolbar), FALSE); - gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); - - break; - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - gtk_action_set_sensitive(GTK_ACTION(hangUpAction), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - break; - case CALL_STATE_TRANSFERT: - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), - GTK_TOOL_ITEM (transferToolbar), 2); - gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); - gtk_toggle_tool_button_set_active( - GTK_TOGGLE_TOOL_BUTTON (transferToolbar), TRUE); - gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (transferToolbar), TRUE); - break; - default: - WARN("Should not happen in update_actions()!") - ; - break; - } - } - else if (selectedConf) - { - - // update icon in systray - show_status_hangup_icon(); - - switch (selectedConf->_state) - { - - case CONFERENCE_STATE_ACTIVE_ATACHED: - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), - 2); - break; - - case CONFERENCE_STATE_ACTIVE_DETACHED: - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), - 2); - break; - - case CONFERENCE_STATE_RECORD: - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), - 2); - break; - - case CONFERENCE_STATE_HOLD: - gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET (offHoldToolbar), TRUE); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), - 1); - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), - GTK_TOOL_ITEM (offHoldToolbar), 2); - break; - - default: - WARN("Should not happen in update_action()!") - ; - break; - - } - } - - else - { - - // update icon in systray - hide_status_hangup_icon(); - - if (account_list_get_size() > 0 && current_account_has_mailbox()) - { - gtk_toolbar_insert(GTK_TOOLBAR (toolbar), - GTK_TOOL_ITEM (voicemailToolbar), -2); - update_voicemail_status(); - } - } + DEBUG ("Update action"); + + gtk_action_set_sensitive (GTK_ACTION (newCallAction), TRUE); + gtk_action_set_sensitive (GTK_ACTION (pickUpAction), FALSE); + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), FALSE); + gtk_action_set_sensitive (GTK_ACTION (imAction), FALSE); + + g_object_ref (hangUpWidget); + g_object_ref (recordWidget); + g_object_ref (holdToolbar); + g_object_ref (offHoldToolbar); + g_object_ref (contactButton); + g_object_ref (historyButton); + g_object_ref (transferToolbar); + g_object_ref (voicemailToolbar); + g_object_ref (imToolbar); + + if (is_inserted (GTK_WIDGET (hangUpWidget), GTK_WIDGET (toolbar))) { + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (hangUpWidget)); + } + + if (is_inserted (GTK_WIDGET (recordWidget), GTK_WIDGET (toolbar))) { + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (recordWidget)); + } + + if (is_inserted (GTK_WIDGET (transferToolbar), GTK_WIDGET (toolbar))) { + gtk_container_remove (GTK_CONTAINER (toolbar), + GTK_WIDGET (transferToolbar)); + } + + if (is_inserted (GTK_WIDGET (historyButton), GTK_WIDGET (toolbar))) { + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (historyButton)); + } + + if (is_inserted (GTK_WIDGET (contactButton), GTK_WIDGET (toolbar))) { + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (contactButton)); + } + + if (is_inserted (GTK_WIDGET (voicemailToolbar), GTK_WIDGET (toolbar))) { + gtk_container_remove (GTK_CONTAINER (toolbar), + GTK_WIDGET (voicemailToolbar)); + } + + if (is_inserted (GTK_WIDGET (imToolbar), GTK_WIDGET (toolbar))) { + gtk_container_remove (GTK_CONTAINER (toolbar), + GTK_WIDGET (imToolbar)); + } + + gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), FALSE); + gtk_action_set_sensitive (GTK_ACTION (recordAction), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (recordWidget), FALSE); + gtk_action_set_sensitive (GTK_ACTION (copyAction), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (contactButton), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (historyButton), FALSE); + gtk_widget_set_tooltip_text (GTK_WIDGET (contactButton), + _ ("No address book selected")); + + if (is_inserted (GTK_WIDGET (holdToolbar), GTK_WIDGET (toolbar))) + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (holdToolbar)); + + if (is_inserted (GTK_WIDGET (offHoldToolbar), GTK_WIDGET (toolbar))) + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (offHoldToolbar)); + + if (is_inserted (GTK_WIDGET (newCallWidget), GTK_WIDGET (toolbar))) + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); + + if (is_inserted (GTK_WIDGET (pickUpWidget), GTK_WIDGET (toolbar))) + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (pickUpWidget)); + + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (newCallWidget), 0); + + + if (eel_gconf_get_integer (HISTORY_ENABLED)) { + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (historyButton), -1); + gtk_widget_set_sensitive (GTK_WIDGET (historyButton), TRUE); + } + + // If addressbook support has been enabled and all addressbooks are loaded, display the icon + if (addressbook_is_enabled() && addressbook_is_ready()) { + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (contactButton), + -1); + + // Make the icon clickable only if at least one address book is active + if (addressbook_is_active()) { + gtk_widget_set_sensitive (GTK_WIDGET (contactButton), TRUE); + gtk_widget_set_tooltip_text (GTK_WIDGET (contactButton), + _ ("Address book")); + } + } + + callable_obj_t * selectedCall = calltab_get_selected_call (active_calltree); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); + + if (selectedCall) { + // update icon in systray + show_status_hangup_icon(); + + gtk_action_set_sensitive (GTK_ACTION (copyAction), TRUE); + + switch (selectedCall->_state) { + case CALL_STATE_INCOMING: + // Make the button toolbar clickable + gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE); + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + // Replace the dial button with the hangup button + g_object_ref (newCallWidget); + gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), + 0); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + break; + case CALL_STATE_HOLD: + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (newCallWidget), TRUE); + // Replace the hold button with the off-hold button + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (offHoldToolbar), 2); + break; + case CALL_STATE_RINGING: + gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE); + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + break; + case CALL_STATE_DIALING: + gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE); + + if (active_calltree == current_calls) + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + + //gtk_action_set_sensitive( GTK_ACTION(newCallMenu),TRUE); + g_object_ref (newCallWidget); + gtk_container_remove (GTK_CONTAINER (toolbar), + GTK_WIDGET (newCallWidget)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), + 0); + + if (active_calltree == current_calls) + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (hangUpWidget), 1); + + break; + case CALL_STATE_CURRENT: + case CALL_STATE_RECORD: + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (transferToolbar), TRUE); + gtk_action_set_sensitive (GTK_ACTION (recordAction), TRUE); + gtk_action_set_sensitive (GTK_ACTION (imAction), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (transferToolbar), 3); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (recordWidget), + 4); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (imToolbar), + 5); + gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); + gtk_toggle_tool_button_set_active ( + GTK_TOGGLE_TOOL_BUTTON (transferToolbar), FALSE); + gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); + + break; + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + break; + case CALL_STATE_TRANSFERT: + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (transferToolbar), 2); + gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); + gtk_toggle_tool_button_set_active ( + GTK_TOGGLE_TOOL_BUTTON (transferToolbar), TRUE); + gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (transferToolbar), TRUE); + break; + default: + WARN ("Should not happen in update_actions()!") + ; + break; + } + } else if (selectedConf) { + + // update icon in systray + show_status_hangup_icon(); + + switch (selectedConf->_state) { + + case CONFERENCE_STATE_ACTIVE_ATACHED: + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + break; + + case CONFERENCE_STATE_ACTIVE_DETACHED: + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + break; + + case CONFERENCE_STATE_RECORD: + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + break; + + case CONFERENCE_STATE_HOLD: + gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (offHoldToolbar), 2); + break; + + default: + WARN ("Should not happen in update_action()!") + ; + break; + + } + } + + else { + + // update icon in systray + hide_status_hangup_icon(); + + if (account_list_get_size() > 0 && current_account_has_mailbox()) { + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (voicemailToolbar), -2); + update_voicemail_status(); + } + } } - void -update_voicemail_status(void) +void +update_voicemail_status (void) { - gchar *messages = ""; - messages = g_markup_printf_escaped(_("Voicemail (%i)"), - current_account_get_message_number()); - (current_account_has_new_message()) ? gtk_tool_button_set_icon_name( - GTK_TOOL_BUTTON (voicemailToolbar), "mail-message-new") - : gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (voicemailToolbar), - "mail-read"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON (voicemailToolbar), messages); - g_free(messages); + gchar *messages = ""; + messages = g_markup_printf_escaped (_ ("Voicemail (%i)"), + current_account_get_message_number()); + (current_account_has_new_message()) ? gtk_tool_button_set_icon_name ( + GTK_TOOL_BUTTON (voicemailToolbar), "mail-message-new") + : gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (voicemailToolbar), + "mail-read"); + gtk_tool_button_set_label (GTK_TOOL_BUTTON (voicemailToolbar), messages); + g_free (messages); } - static void -volume_bar_cb(GtkToggleAction *togglemenuitem, gpointer user_data) +static void +volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) { - gboolean toggled = gtk_toggle_action_get_active(togglemenuitem); - if (toggled == SHOW_VOLUME) - return; - main_window_volume_controls(toggled); - if (toggled || SHOW_VOLUME) - eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, toggled); + gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); + + if (toggled == SHOW_VOLUME) + return; + + main_window_volume_controls (toggled); + + if (toggled || SHOW_VOLUME) + eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, toggled); } - static void -dialpad_bar_cb(GtkToggleAction *togglemenuitem, gpointer user_data) +static void +dialpad_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) { - gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); - gboolean conf_dialpad = eel_gconf_get_boolean (CONF_SHOW_DIALPAD); - if (toggled == conf_dialpad) - return; - main_window_dialpad (toggled); - if (toggled || conf_dialpad) - eel_gconf_set_boolean (CONF_SHOW_DIALPAD, toggled); //dbus_set_dialpad (toggled); + gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); + gboolean conf_dialpad = eel_gconf_get_boolean (CONF_SHOW_DIALPAD); + + if (toggled == conf_dialpad) + return; + + main_window_dialpad (toggled); + + if (toggled || conf_dialpad) + eel_gconf_set_boolean (CONF_SHOW_DIALPAD, toggled); //dbus_set_dialpad (toggled); } - static void -help_contents_cb(GtkAction *action) +static void +help_contents_cb (GtkAction *action) { - GError *error = NULL; + GError *error = NULL; - gnome_help_display("sflphone.xml", NULL, &error); - if (error != NULL) { - g_warning("%s", error->message); - g_error_free(error); - } + gnome_help_display ("sflphone.xml", NULL, &error); + + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + } } - static void -help_about(void * foo UNUSED) +static void +help_about (void * foo UNUSED) { - gchar - *authors[] = - { - "Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>", - "Jean-Philippe Barrette-LaPierre", - "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", - "Julien Bonjean <julien.bonjean@savoirfairelinux.com>", - "Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>", - "Laurielle Lea", - "Yun Liu <yun.liu@savoirfairelinux.com>", - "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", - "Yan Morin <yan.morin@savoirfairelinux.com>", - "Jérôme Oufella <jerome.oufella@savoirfairelinux.com>", - "Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>", - "Alexandre Savard <alexandre.savard@savoirfairelinux.com>", NULL }; - gchar *artists[] = - { "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", - "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", NULL }; - - gtk_show_about_dialog(GTK_WINDOW(get_main_window()), "artists", artists, - "authors", authors, "comments", - _("SFLphone is a VoIP client compatible with SIP and IAX2 protocols."), - "copyright", "Copyright © 2004-2009 Savoir-faire Linux Inc.", "name", - PACKAGE, "title", _("About SFLphone"), "version", VERSION, "website", - "http://www.sflphone.org", NULL); + gchar + *authors[] = { + "Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>", + "Jean-Philippe Barrette-LaPierre", + "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", + "Julien Bonjean <julien.bonjean@savoirfairelinux.com>", + "Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>", + "Laurielle Lea", + "Yun Liu <yun.liu@savoirfairelinux.com>", + "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", + "Yan Morin <yan.morin@savoirfairelinux.com>", + "Jérôme Oufella <jerome.oufella@savoirfairelinux.com>", + "Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>", + "Alexandre Savard <alexandre.savard@savoirfairelinux.com>", NULL + }; + gchar *artists[] = { "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", + "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", NULL + }; + + gtk_show_about_dialog (GTK_WINDOW (get_main_window()), "artists", artists, + "authors", authors, "comments", + _ ("SFLphone is a VoIP client compatible with SIP and IAX2 protocols."), + "copyright", "Copyright © 2004-2009 Savoir-faire Linux Inc.", "name", + PACKAGE, "title", _ ("About SFLphone"), "version", VERSION, "website", + "http://www.sflphone.org", NULL); } /* ----------------------------------------------------------------- */ - static void -call_new_call(void * foo UNUSED) +static void +call_new_call (void * foo UNUSED) { - sflphone_new_call(); + sflphone_new_call(); } - static void -call_quit(void * foo UNUSED) +static void +call_quit (void * foo UNUSED) { - sflphone_quit(); + sflphone_quit(); } - static void -call_minimize(void * foo UNUSED) +static void +call_minimize (void * foo UNUSED) { - if (eel_gconf_get_integer (SHOW_STATUSICON)) { - gtk_widget_hide(GTK_WIDGET( get_main_window() )); - set_minimized(TRUE); - } - else { - sflphone_quit (); - } + if (eel_gconf_get_integer (SHOW_STATUSICON)) { + gtk_widget_hide (GTK_WIDGET (get_main_window())); + set_minimized (TRUE); + } else { + sflphone_quit (); + } } - static void -switch_account(GtkWidget* item, gpointer data UNUSED) +static void +switch_account (GtkWidget* item, gpointer data UNUSED) { - account_t* acc = g_object_get_data(G_OBJECT(item), "account"); - DEBUG("%s" , acc->accountID); - account_list_set_current(acc); - status_bar_display_account(); + account_t* acc = g_object_get_data (G_OBJECT (item), "account"); + DEBUG ("%s" , acc->accountID); + account_list_set_current (acc); + status_bar_display_account(); } - static void -call_hold(void* foo UNUSED) +static void +call_hold (void* foo UNUSED) { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - conference_obj_t * selectedConf = calltab_get_selected_conf(); - - if (selectedCall) - { - if (selectedCall->_state == CALL_STATE_HOLD) - { - sflphone_off_hold(); - } - else - { - sflphone_on_hold(); - } - } - else if (selectedConf) - { - - switch (selectedConf->_state) - { - - case CONFERENCE_STATE_HOLD: - { - selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; - sflphone_conference_off_hold(selectedConf); - } - break; - - case CONFERENCE_STATE_ACTIVE_ATACHED: - case CONFERENCE_STATE_ACTIVE_DETACHED: - { - selectedConf->_state = CONFERENCE_STATE_HOLD; - sflphone_conference_on_hold(selectedConf); - } - break; - default: - break; - } - - } + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf(); + + if (selectedCall) { + if (selectedCall->_state == CALL_STATE_HOLD) { + sflphone_off_hold(); + } else { + sflphone_on_hold(); + } + } else if (selectedConf) { + + switch (selectedConf->_state) { + + case CONFERENCE_STATE_HOLD: { + selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; + sflphone_conference_off_hold (selectedConf); + } + break; + + case CONFERENCE_STATE_ACTIVE_ATACHED: + case CONFERENCE_STATE_ACTIVE_DETACHED: { + selectedConf->_state = CONFERENCE_STATE_HOLD; + sflphone_conference_on_hold (selectedConf); + } + break; + default: + break; + } + + } } - static void +static void call_im (void* foo UNUSED) { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - - if (selectedCall) { - im_widget_display (&selectedCall); - } - else { - warn ("Sorry. Instant messaging is not allowed outside a call\n"); - } + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + + if (selectedCall) { + im_widget_display (&selectedCall); + } else { + warn ("Sorry. Instant messaging is not allowed outside a call\n"); + } } - static void -conference_hold(void* foo UNUSED) +static void +conference_hold (void* foo UNUSED) { - conference_obj_t * selectedConf = calltab_get_selected_conf(); - - switch (selectedConf->_state) - { - case CONFERENCE_STATE_HOLD: - { - selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; - sflphone_conference_off_hold(selectedConf); - } - break; - - case CONFERENCE_STATE_ACTIVE_ATACHED: - case CONFERENCE_STATE_ACTIVE_DETACHED: - { - selectedConf->_state = CONFERENCE_STATE_HOLD; - sflphone_conference_on_hold(selectedConf); - } - break; - default: - break; - } + conference_obj_t * selectedConf = calltab_get_selected_conf(); + + switch (selectedConf->_state) { + case CONFERENCE_STATE_HOLD: { + selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; + sflphone_conference_off_hold (selectedConf); + } + break; + + case CONFERENCE_STATE_ACTIVE_ATACHED: + case CONFERENCE_STATE_ACTIVE_DETACHED: { + selectedConf->_state = CONFERENCE_STATE_HOLD; + sflphone_conference_on_hold (selectedConf); + } + break; + default: + break; + } } - static void -call_pick_up(void * foo UNUSED) +static void +call_pick_up (void * foo UNUSED) { - DEBUG("------ call_button -----"); - callable_obj_t * selectedCall; - callable_obj_t* new_call; - - selectedCall = calltab_get_selected_call(active_calltree); - - if (calllist_get_size(current_calls) > 0) - sflphone_pick_up(); - - else if (calllist_get_size(active_calltree) > 0) - { - if (selectedCall) - { - create_new_call(CALL, CALL_STATE_DIALING, "", "", "", - selectedCall->_peer_number, &new_call); - - calllist_add(current_calls, new_call); - calltree_add_call(current_calls, new_call, NULL); - sflphone_place_call(new_call); - calltree_display(current_calls); - } - else - { - sflphone_new_call(); - calltree_display(current_calls); - } - } - else - { - sflphone_new_call(); - calltree_display(current_calls); - } + DEBUG ("------ call_button -----"); + callable_obj_t * selectedCall; + callable_obj_t* new_call; + + selectedCall = calltab_get_selected_call (active_calltree); + + if (calllist_get_size (current_calls) > 0) + sflphone_pick_up(); + + else if (calllist_get_size (active_calltree) > 0) { + if (selectedCall) { + create_new_call (CALL, CALL_STATE_DIALING, "", "", "", + selectedCall->_peer_number, &new_call); + + calllist_add (current_calls, new_call); + calltree_add_call (current_calls, new_call, NULL); + sflphone_place_call (new_call); + calltree_display (current_calls); + } else { + sflphone_new_call(); + calltree_display (current_calls); + } + } else { + sflphone_new_call(); + calltree_display (current_calls); + } } - static void -call_hang_up(void) +static void +call_hang_up (void) { - /* - * [#3020] Restore the record toggle button - * We set it to FALSE, as when we hang up a call, the recording is stopped. - */ - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (recordWidget), FALSE); + /* + * [#3020] Restore the record toggle button + * We set it to FALSE, as when we hang up a call, the recording is stopped. + */ + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (recordWidget), FALSE); - sflphone_hang_up(); + sflphone_hang_up(); } - static void -conference_hang_up(void) +static void +conference_hang_up (void) { - sflphone_conference_hang_up(); + sflphone_conference_hang_up(); } - static void -call_record(void) +static void +call_record (void) { - sflphone_rec_call(); + sflphone_rec_call(); } - static void -call_configuration_assistant(void * foo UNUSED) +static void +call_configuration_assistant (void * foo UNUSED) { #if GTK_CHECK_VERSION(2,10,0) - build_wizard(); + build_wizard(); #endif } - static void -remove_from_history(void * foo UNUSED) +static void +remove_from_history (void * foo UNUSED) { - callable_obj_t* c = calltab_get_selected_call(history); - if (c) - { - DEBUG("Remove the call from the history"); - calllist_remove_from_history(c); - } + callable_obj_t* c = calltab_get_selected_call (history); + + if (c) { + DEBUG ("Remove the call from the history"); + calllist_remove_from_history (c); + } } - static void -call_back(void * foo UNUSED) +static void +call_back (void * foo UNUSED) { - callable_obj_t *selected_call, *new_call; + callable_obj_t *selected_call, *new_call; - selected_call = calltab_get_selected_call(active_calltree); + selected_call = calltab_get_selected_call (active_calltree); - if (selected_call) - { - create_new_call(CALL, CALL_STATE_DIALING, "", "", - selected_call->_peer_name, selected_call->_peer_number, &new_call); + if (selected_call) { + create_new_call (CALL, CALL_STATE_DIALING, "", "", + selected_call->_peer_name, selected_call->_peer_number, &new_call); - calllist_add(current_calls, new_call); - calltree_add_call(current_calls, new_call, NULL); - sflphone_place_call(new_call); - calltree_display(current_calls); - } + calllist_add (current_calls, new_call); + calltree_add_call (current_calls, new_call, NULL); + sflphone_place_call (new_call); + calltree_display (current_calls); + } } - static void -edit_preferences(void * foo UNUSED) +static void +edit_preferences (void * foo UNUSED) { - show_preferences_dialog(); + show_preferences_dialog(); } - static void -edit_accounts(void * foo UNUSED) +static void +edit_accounts (void * foo UNUSED) { - show_account_list_config_dialog(); + show_account_list_config_dialog(); } // The menu Edit/Copy should copy the current selected call's number - static void -edit_copy(void * foo UNUSED) +static void +edit_copy (void * foo UNUSED) { - GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - gchar * no = NULL; - - if (selectedCall) - { - switch (selectedCall->_state) - { - case CALL_STATE_TRANSFERT: - case CALL_STATE_DIALING: - case CALL_STATE_RINGING: - no = selectedCall->_peer_number; - break; - case CALL_STATE_CURRENT: - case CALL_STATE_HOLD: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - case CALL_STATE_INCOMING: - default: - no = selectedCall->_peer_number; - break; - } - DEBUG("Clipboard number: %s\n", no); - gtk_clipboard_set_text(clip, no, strlen(no)); - } + GtkClipboard* clip = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + gchar * no = NULL; + + if (selectedCall) { + switch (selectedCall->_state) { + case CALL_STATE_TRANSFERT: + case CALL_STATE_DIALING: + case CALL_STATE_RINGING: + no = selectedCall->_peer_number; + break; + case CALL_STATE_CURRENT: + case CALL_STATE_HOLD: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + case CALL_STATE_INCOMING: + default: + no = selectedCall->_peer_number; + break; + } + + DEBUG ("Clipboard number: %s\n", no); + gtk_clipboard_set_text (clip, no, strlen (no)); + } } // The menu Edit/Paste should paste the clipboard into the current selected call - static void -edit_paste(void * foo UNUSED) +static void +edit_paste (void * foo UNUSED) { - GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - gchar * no = gtk_clipboard_wait_for_text(clip); - - if (no && selectedCall) - { - switch (selectedCall->_state) - { - case CALL_STATE_TRANSFERT: - case CALL_STATE_DIALING: - // Add the text to the number - { - gchar * before; - before = selectedCall->_peer_number; - DEBUG("TO: %s\n", before); - selectedCall->_peer_number = g_strconcat(before, no, NULL); - - if (selectedCall->_state == CALL_STATE_DIALING) - { - selectedCall->_peer_info = g_strconcat("\"\" <", - selectedCall->_peer_number, ">", NULL); - } - calltree_update_call(current_calls, selectedCall, NULL); - } - break; - case CALL_STATE_RINGING: - case CALL_STATE_INCOMING: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - case CALL_STATE_HOLD: - { // Create a new call to hold the new text - selectedCall = sflphone_new_call(); - - gchar * before = selectedCall->_peer_number; - selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, - no, NULL); - DEBUG("TO: %s", selectedCall->_peer_number); - - selectedCall->_peer_info = g_strconcat("\"\" <", - selectedCall->_peer_number, ">", NULL); - - calltree_update_call(current_calls, selectedCall, NULL); - } - break; - case CALL_STATE_CURRENT: - default: - { - unsigned int i; - for (i = 0; i < strlen(no); i++) - { - gchar * oneNo = g_strndup(&no[i], 1); - DEBUG("<%s>", oneNo); - dbus_play_dtmf(oneNo); - - gchar * temp = g_strconcat(selectedCall->_peer_number, oneNo, - NULL); - selectedCall->_peer_info = get_peer_info(temp, - selectedCall->_peer_name); - // g_free(temp); - calltree_update_call(current_calls, selectedCall, NULL); - - } - } - break; - } - - } - else // There is no current call, create one - { - selectedCall = sflphone_new_call(); - - gchar * before = selectedCall->_peer_number; - selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, no, - NULL); - g_free(before); - DEBUG("TO: %s", selectedCall->_peer_number); - - g_free(selectedCall->_peer_info); - selectedCall->_peer_info = g_strconcat("\"\" <", - selectedCall->_peer_number, ">", NULL); - calltree_update_call(current_calls, selectedCall, NULL); - } + GtkClipboard* clip = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + gchar * no = gtk_clipboard_wait_for_text (clip); + + if (no && selectedCall) { + switch (selectedCall->_state) { + case CALL_STATE_TRANSFERT: + case CALL_STATE_DIALING: + // Add the text to the number + { + gchar * before; + before = selectedCall->_peer_number; + DEBUG ("TO: %s\n", before); + selectedCall->_peer_number = g_strconcat (before, no, NULL); + + if (selectedCall->_state == CALL_STATE_DIALING) { + selectedCall->_peer_info = g_strconcat ("\"\" <", + selectedCall->_peer_number, ">", NULL); + } + + calltree_update_call (current_calls, selectedCall, NULL); + } + break; + case CALL_STATE_RINGING: + case CALL_STATE_INCOMING: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + case CALL_STATE_HOLD: { // Create a new call to hold the new text + selectedCall = sflphone_new_call(); + + gchar * before = selectedCall->_peer_number; + selectedCall->_peer_number = g_strconcat (selectedCall->_peer_number, + no, NULL); + DEBUG ("TO: %s", selectedCall->_peer_number); + + selectedCall->_peer_info = g_strconcat ("\"\" <", + selectedCall->_peer_number, ">", NULL); + + calltree_update_call (current_calls, selectedCall, NULL); + } + break; + case CALL_STATE_CURRENT: + default: { + unsigned int i; + + for (i = 0; i < strlen (no); i++) { + gchar * oneNo = g_strndup (&no[i], 1); + DEBUG ("<%s>", oneNo); + dbus_play_dtmf (oneNo); + + gchar * temp = g_strconcat (selectedCall->_peer_number, oneNo, + NULL); + selectedCall->_peer_info = get_peer_info (temp, + selectedCall->_peer_name); + // g_free(temp); + calltree_update_call (current_calls, selectedCall, NULL); + + } + } + break; + } + + } else { // There is no current call, create one + selectedCall = sflphone_new_call(); + + gchar * before = selectedCall->_peer_number; + selectedCall->_peer_number = g_strconcat (selectedCall->_peer_number, no, + NULL); + g_free (before); + DEBUG ("TO: %s", selectedCall->_peer_number); + + g_free (selectedCall->_peer_info); + selectedCall->_peer_info = g_strconcat ("\"\" <", + selectedCall->_peer_number, ">", NULL); + calltree_update_call (current_calls, selectedCall, NULL); + } } - static void -clear_history(void) +static void +clear_history (void) { - if (calllist_get_size(history) != 0) - { - calllist_clean_history(); - } + if (calllist_get_size (history) != 0) { + calllist_clean_history(); + } } /** * Transfert the line */ - static void +static void call_transfer_cb() { - gboolean active = gtk_toggle_tool_button_get_active( - GTK_TOGGLE_TOOL_BUTTON (transferToolbar)); - active ? sflphone_set_transfert() : sflphone_unset_transfert(); + gboolean active = gtk_toggle_tool_button_get_active ( + GTK_TOGGLE_TOOL_BUTTON (transferToolbar)); + active ? sflphone_set_transfert() : sflphone_unset_transfert(); } - static void -call_mailbox_cb(void) +static void +call_mailbox_cb (void) { - account_t* current; - callable_obj_t *mailbox_call; - gchar *to, *from, *account_id; - - current = account_list_get_current(); - if (current == NULL) // Should not happens - return; - - to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); - account_id = g_strdup(current->accountID); - - create_new_call(CALL, CALL_STATE_DIALING, "", account_id, _("Voicemail"), to, - &mailbox_call); - DEBUG("TO : %s" , mailbox_call->_peer_number); - calllist_add(current_calls, mailbox_call); - calltree_add_call(current_calls, mailbox_call, NULL); - update_actions(); - sflphone_place_call(mailbox_call); - calltree_display(current_calls); + account_t* current; + callable_obj_t *mailbox_call; + gchar *to, *from, *account_id; + + current = account_list_get_current(); + + if (current == NULL) // Should not happens + return; + + to = g_strdup (g_hash_table_lookup (current->properties, ACCOUNT_MAILBOX)); + account_id = g_strdup (current->accountID); + + create_new_call (CALL, CALL_STATE_DIALING, "", account_id, _ ("Voicemail"), to, + &mailbox_call); + DEBUG ("TO : %s" , mailbox_call->_peer_number); + calllist_add (current_calls, mailbox_call); + calltree_add_call (current_calls, mailbox_call, NULL); + update_actions(); + sflphone_place_call (mailbox_call); + calltree_display (current_calls); } - static void -toggle_history_cb(GtkToggleAction *action, gpointer user_data) +static void +toggle_history_cb (GtkToggleAction *action, gpointer user_data) { - gboolean toggle; - toggle = gtk_toggle_action_get_active(action); - (toggle) ? calltree_display(history) : calltree_display(current_calls); + gboolean toggle; + toggle = gtk_toggle_action_get_active (action); + (toggle) ? calltree_display (history) : calltree_display (current_calls); } - static void -toggle_addressbook_cb(GtkToggleAction *action, gpointer user_data) +static void +toggle_addressbook_cb (GtkToggleAction *action, gpointer user_data) { - gboolean toggle; - toggle = gtk_toggle_action_get_active(action); - (toggle) ? calltree_display(contacts) : calltree_display(current_calls); + gboolean toggle; + toggle = gtk_toggle_action_get_active (action); + (toggle) ? calltree_display (contacts) : calltree_display (current_calls); } -static const GtkActionEntry menu_entries[] = -{ +static const GtkActionEntry menu_entries[] = { + + // Call Menu + { "Call", NULL, N_ ("Call") }, + { "NewCall", GTK_STOCK_DIAL, N_ ("_New call"), "<control>N", + N_ ("Place a new call"), G_CALLBACK (call_new_call) }, + { "PickUp", GTK_STOCK_PICKUP, N_ ("_Pick up"), NULL, + N_ ("Answer the call"), G_CALLBACK (call_pick_up) }, + { "HangUp", GTK_STOCK_HANGUP, N_ ("_Hang up"), "<control>S", + N_ ("Finish the call"), G_CALLBACK (call_hang_up) }, + { "OnHold", GTK_STOCK_ONHOLD, N_ ("O_n hold"), "<control>P", + N_ ("Place the call on hold"), G_CALLBACK (call_hold) }, + { "OffHold", GTK_STOCK_OFFHOLD, N_ ("O_ff hold"), "<control>P", + N_ ("Place the call off hold"), G_CALLBACK (call_hold) }, + { "InstantMessaging", GTK_STOCK_IM, N_ ("Send _message"), "<control>M", + N_ ("Send message"), G_CALLBACK (call_im) }, + { "AccountAssistant", NULL, N_ ("Configuration _Assistant"), NULL, + N_ ("Run the configuration assistant"), + G_CALLBACK (call_configuration_assistant) }, + { "Voicemail", "mail-read", N_ ("Voicemail"), NULL, + N_ ("Call your voicemail"), G_CALLBACK (call_mailbox_cb) }, + { "Close", GTK_STOCK_CLOSE, N_ ("_Close"), "<control>W", + N_ ("Minimize to system tray"), G_CALLBACK (call_minimize) }, + { "Quit", GTK_STOCK_CLOSE, N_ ("_Quit"), "<control>Q", + N_ ("Quit the program"), G_CALLBACK (call_quit) }, + + // Edit Menu + { "Edit", NULL, N_ ("_Edit") }, + { "Copy", GTK_STOCK_COPY, N_ ("_Copy"), "<control>C", + N_ ("Copy the selection"), G_CALLBACK (edit_copy) }, + { "Paste", GTK_STOCK_PASTE, N_ ("_Paste"), "<control>V", + N_ ("Paste the clipboard"), G_CALLBACK (edit_paste) }, + { "ClearHistory", GTK_STOCK_CLEAR, N_ ("Clear _history"), NULL, + N_ ("Clear the call history"), G_CALLBACK (clear_history) }, + { "Accounts", NULL, N_ ("_Accounts"), NULL, N_ ("Edit your accounts"), + G_CALLBACK (edit_accounts) }, + { "Preferences", GTK_STOCK_PREFERENCES, N_ ("_Preferences"), NULL, + N_ ("Change your preferences"), G_CALLBACK (edit_preferences) }, + + // View Menu + { "View", NULL, N_ ("_View") }, + + // Help menu + { "Help", NULL, N_ ("_Help") }, + { "HelpContents", GTK_STOCK_HELP, N_ ("Contents"), "F1", + N_ ("Open the manual"), G_CALLBACK (help_contents_cb) }, + { "About", GTK_STOCK_ABOUT, NULL, NULL, N_ ("About this application"), + G_CALLBACK (help_about) } + +}; - // Call Menu - { "Call", NULL, N_("Call") }, - { "NewCall", GTK_STOCK_DIAL, N_("_New call"), "<control>N", - N_("Place a new call"), G_CALLBACK (call_new_call) }, - { "PickUp", GTK_STOCK_PICKUP, N_("_Pick up"), NULL, - N_("Answer the call"), G_CALLBACK (call_pick_up) }, - { "HangUp", GTK_STOCK_HANGUP, N_("_Hang up"), "<control>S", - N_("Finish the call"), G_CALLBACK (call_hang_up) }, - { "OnHold", GTK_STOCK_ONHOLD, N_("O_n hold"), "<control>P", - N_("Place the call on hold"), G_CALLBACK (call_hold) }, - { "OffHold", GTK_STOCK_OFFHOLD, N_("O_ff hold"), "<control>P", - N_("Place the call off hold"), G_CALLBACK (call_hold) }, - { "InstantMessaging", GTK_STOCK_IM, N_("Send _message"), "<control>M", - N_("Send message"), G_CALLBACK (call_im) }, - { "AccountAssistant", NULL, N_("Configuration _Assistant"), NULL, - N_("Run the configuration assistant"), - G_CALLBACK (call_configuration_assistant) }, - { "Voicemail", "mail-read", N_("Voicemail"), NULL, - N_("Call your voicemail"), G_CALLBACK (call_mailbox_cb) }, - { "Close", GTK_STOCK_CLOSE, N_("_Close"), "<control>W", - N_("Minimize to system tray"), G_CALLBACK (call_minimize) }, - { "Quit", GTK_STOCK_CLOSE, N_("_Quit"), "<control>Q", - N_("Quit the program"), G_CALLBACK (call_quit) }, - - // Edit Menu - { "Edit", NULL, N_("_Edit") }, - { "Copy", GTK_STOCK_COPY, N_("_Copy"), "<control>C", - N_("Copy the selection"), G_CALLBACK (edit_copy) }, - { "Paste", GTK_STOCK_PASTE, N_("_Paste"), "<control>V", - N_("Paste the clipboard"), G_CALLBACK (edit_paste) }, - { "ClearHistory", GTK_STOCK_CLEAR, N_("Clear _history"), NULL, - N_("Clear the call history"), G_CALLBACK (clear_history) }, - { "Accounts", NULL, N_("_Accounts"), NULL, N_("Edit your accounts"), - G_CALLBACK (edit_accounts) }, - { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL, - N_("Change your preferences"), G_CALLBACK (edit_preferences) }, - - // View Menu - { "View", NULL, N_("_View") }, - - // Help menu - { "Help", NULL, N_("_Help") }, - { "HelpContents", GTK_STOCK_HELP, N_("Contents"), "F1", - N_("Open the manual"), G_CALLBACK (help_contents_cb) }, - { "About", GTK_STOCK_ABOUT, NULL, NULL, N_("About this application"), - G_CALLBACK (help_about) } +static const GtkToggleActionEntry toggle_menu_entries[] = { + + { "Transfer", GTK_STOCK_TRANSFER, N_ ("_Transfer"), "<control>T", + N_ ("Transfer the call"), NULL }, //G_CALLBACK (call_transfer_cb) }, + { "Record", GTK_STOCK_MEDIA_RECORD, N_ ("_Record"), "<control>R", + N_ ("Record the current conversation"), NULL }, // G_CALLBACK (call_record) }, + { "Toolbar", NULL, N_ ("_Show toolbar"), "<control>T", + N_ ("Show the toolbar"), NULL }, + { "Dialpad", NULL, N_ ("_Dialpad"), "<control>D", + N_ ("Show the dialpad"), G_CALLBACK (dialpad_bar_cb) }, + { "VolumeControls", NULL, N_ ("_Volume controls"), "<control>V", + N_ ("Show the volume controls"), G_CALLBACK (volume_bar_cb) }, + { "History", "appointment-soon", N_ ("_History"), NULL, + N_ ("Calls history"), G_CALLBACK (toggle_history_cb), FALSE }, + { "Addressbook", GTK_STOCK_ADDRESSBOOK, N_ ("_Address book"), NULL, + N_ ("Address book"), G_CALLBACK (toggle_addressbook_cb), FALSE } }; -static const GtkToggleActionEntry toggle_menu_entries[] = +gboolean +uimanager_new (GtkUIManager **_ui_manager) { - { "Transfer", GTK_STOCK_TRANSFER, N_("_Transfer"), "<control>T", - N_("Transfer the call"), NULL }, //G_CALLBACK (call_transfer_cb) }, -{ "Record", GTK_STOCK_MEDIA_RECORD, N_("_Record"), "<control>R", - N_("Record the current conversation"), NULL }, // G_CALLBACK (call_record) }, -{ "Toolbar", NULL, N_("_Show toolbar"), "<control>T", - N_("Show the toolbar"), NULL }, -{ "Dialpad", NULL, N_("_Dialpad"), "<control>D", - N_("Show the dialpad"), G_CALLBACK (dialpad_bar_cb) }, -{ "VolumeControls", NULL, N_("_Volume controls"), "<control>V", - N_("Show the volume controls"), G_CALLBACK (volume_bar_cb) }, -{ "History", "appointment-soon", N_("_History"), NULL, - N_("Calls history"), G_CALLBACK (toggle_history_cb), FALSE }, -{ "Addressbook", GTK_STOCK_ADDRESSBOOK, N_("_Address book"), NULL, - N_("Address book"), G_CALLBACK (toggle_addressbook_cb), FALSE } - - }; - - gboolean -uimanager_new(GtkUIManager **_ui_manager) -{ + GtkUIManager *ui_manager; + GtkActionGroup *action_group; + GtkWidget *window; + gchar *path; + GError *error = NULL; + + window = get_main_window(); + ui_manager = gtk_ui_manager_new(); + + /* Create an accel group for window's shortcuts */ + path = g_build_filename (SFLPHONE_UIDIR_UNINSTALLED, "./ui.xml", NULL); + + if (g_file_test (path, G_FILE_TEST_EXISTS)) { + gtk_ui_manager_add_ui_from_file (ui_manager, path, &error); + + if (error != NULL) { + g_error_free (error); + return FALSE; + } + + g_free (path); + } else { + path = g_build_filename (SFLPHONE_UIDIR, "./ui.xml", NULL); - GtkUIManager *ui_manager; - GtkActionGroup *action_group; - GtkWidget *window; - gchar *path; - GError *error = NULL; - - window = get_main_window(); - ui_manager = gtk_ui_manager_new(); - - /* Create an accel group for window's shortcuts */ - path = g_build_filename(SFLPHONE_UIDIR_UNINSTALLED, "./ui.xml", NULL); - if (g_file_test(path, G_FILE_TEST_EXISTS)) - { - gtk_ui_manager_add_ui_from_file(ui_manager, path, &error); - - if (error != NULL) - { - g_error_free(error); - return FALSE; - } - g_free(path); - } - else - { - path = g_build_filename(SFLPHONE_UIDIR, "./ui.xml", NULL); - if (g_file_test(path, G_FILE_TEST_EXISTS)) - { - gtk_ui_manager_add_ui_from_file(ui_manager, path, &error); - - if (error != NULL) - { - g_error_free(error); - return FALSE; - } - g_free(path); - } - else - return FALSE; - } - action_group = gtk_action_group_new("SFLphoneWindowActions"); - // To translate label and tooltip entries - gtk_action_group_set_translation_domain(action_group, "sflphone-client-gnome"); - gtk_action_group_add_actions(action_group, menu_entries, - G_N_ELEMENTS (menu_entries), window); - gtk_action_group_add_toggle_actions(action_group, toggle_menu_entries, - G_N_ELEMENTS (toggle_menu_entries), window); - //gtk_action_group_add_radio_actions (action_group, radio_menu_entries, G_N_ELEMENTS (radio_menu_entries), CALLTREE_CALLS, G_CALLBACK (calltree_switch_cb), window); - gtk_ui_manager_insert_action_group(ui_manager, action_group, 0); - - *_ui_manager = ui_manager; - - return TRUE; + if (g_file_test (path, G_FILE_TEST_EXISTS)) { + gtk_ui_manager_add_ui_from_file (ui_manager, path, &error); + + if (error != NULL) { + g_error_free (error); + return FALSE; + } + + g_free (path); + } else + return FALSE; + } + + action_group = gtk_action_group_new ("SFLphoneWindowActions"); + // To translate label and tooltip entries + gtk_action_group_set_translation_domain (action_group, "sflphone-client-gnome"); + gtk_action_group_add_actions (action_group, menu_entries, + G_N_ELEMENTS (menu_entries), window); + gtk_action_group_add_toggle_actions (action_group, toggle_menu_entries, + G_N_ELEMENTS (toggle_menu_entries), window); + //gtk_action_group_add_radio_actions (action_group, radio_menu_entries, G_N_ELEMENTS (radio_menu_entries), CALLTREE_CALLS, G_CALLBACK (calltree_switch_cb), window); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + + *_ui_manager = ui_manager; + + return TRUE; } - static void -edit_number_cb(GtkWidget *widget UNUSED, gpointer user_data) +static void +edit_number_cb (GtkWidget *widget UNUSED, gpointer user_data) { - show_edit_number((callable_obj_t*) user_data); + show_edit_number ( (callable_obj_t*) user_data); } - void -add_registered_accounts_to_menu(GtkWidget *menu) +void +add_registered_accounts_to_menu (GtkWidget *menu) { - GtkWidget *menu_items; - unsigned int i; - account_t* acc, *current; - gchar* alias; - - menu_items = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show(menu_items); - - for (i = 0; i < account_list_get_size(); i++) - { - acc = account_list_get_nth(i); - // Display only the registered accounts - if (g_strcasecmp(account_state_name(acc->state), account_state_name( - ACCOUNT_STATE_REGISTERED)) == 0) - { - alias = g_strconcat(g_hash_table_lookup(acc->properties, - ACCOUNT_ALIAS), " - ", g_hash_table_lookup(acc->properties, - ACCOUNT_TYPE), NULL); - menu_items = gtk_check_menu_item_new_with_mnemonic(alias); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_object_set_data(G_OBJECT( menu_items ), "account", acc); - g_free(alias); - current = account_list_get_current(); - if (current) - { - gtk_check_menu_item_set_active( - GTK_CHECK_MENU_ITEM(menu_items), - (g_strcasecmp(acc->accountID, current->accountID) == 0) ? TRUE - : FALSE); - } - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (switch_account), - NULL); - gtk_widget_show(menu_items); - } // fi - } + GtkWidget *menu_items; + unsigned int i; + account_t* acc, *current; + gchar* alias; + + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show (menu_items); + + for (i = 0; i < account_list_get_size(); i++) { + acc = account_list_get_nth (i); + + // Display only the registered accounts + if (g_strcasecmp (account_state_name (acc->state), account_state_name ( + ACCOUNT_STATE_REGISTERED)) == 0) { + alias = g_strconcat (g_hash_table_lookup (acc->properties, + ACCOUNT_ALIAS), " - ", g_hash_table_lookup (acc->properties, + ACCOUNT_TYPE), NULL); + menu_items = gtk_check_menu_item_new_with_mnemonic (alias); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_object_set_data (G_OBJECT (menu_items), "account", acc); + g_free (alias); + current = account_list_get_current(); + + if (current) { + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (menu_items), + (g_strcasecmp (acc->accountID, current->accountID) == 0) ? TRUE + : FALSE); + } + + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (switch_account), + NULL); + gtk_widget_show (menu_items); + } // fi + } } - void -show_popup_menu(GtkWidget *my_widget, GdkEventButton *event) +void +show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) { - // TODO update the selection to make sure the call under the mouse is the call selected - - // call type boolean - gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = - FALSE, detach = FALSE; - gboolean accounts = FALSE; - gboolean im = FALSE; - - // conference type boolean - gboolean hangup_conf = FALSE, hold_conf = FALSE; - - callable_obj_t * selectedCall; - conference_obj_t * selectedConf; - - if (calltab_get_selected_type(current_calls) == A_CALL) - { - DEBUG("MENUS: SELECTED A CALL"); - selectedCall = calltab_get_selected_call(current_calls); - - if (selectedCall) - { - copy = TRUE; - switch (selectedCall->_state) - { - case CALL_STATE_INCOMING: - pickup = TRUE; - hangup = TRUE; - detach = TRUE; - break; - case CALL_STATE_HOLD: - hangup = TRUE; - hold = TRUE; - detach = TRUE; - break; - case CALL_STATE_RINGING: - hangup = TRUE; - detach = TRUE; - break; - case CALL_STATE_DIALING: - pickup = TRUE; - hangup = TRUE; - accounts = TRUE; - break; - case CALL_STATE_RECORD: - case CALL_STATE_CURRENT: - hangup = TRUE; - hold = TRUE; - record = TRUE; - detach = TRUE; - im = TRUE; - break; - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - hangup = TRUE; - break; - default: - WARN("Should not happen in show_popup_menu for calls!") - ; - break; - } - } - } - else - { - DEBUG("MENUS: SELECTED A CONF"); - selectedConf = calltab_get_selected_conf(); - - if (selectedConf) - { - switch (selectedConf->_state) - { - case CONFERENCE_STATE_ACTIVE_ATACHED: - hangup_conf = TRUE; - hold_conf = TRUE; - break; - case CONFERENCE_STATE_ACTIVE_DETACHED: - break; - case CONFERENCE_STATE_HOLD: - hangup_conf = TRUE; - hold_conf = TRUE; - break; - default: - WARN("Should not happen in show_popup_menu for conferences!") - ; - break; - } - } - - } - - GtkWidget *menu; - GtkWidget *image; - int button, event_time; - GtkWidget * menu_items; - - menu = gtk_menu_new(); - //g_signal_connect (menu, "deactivate", - // G_CALLBACK (gtk_widget_destroy), NULL); - if (calltab_get_selected_type(current_calls) == A_CALL) - { - DEBUG("BUILD CALL MENU"); - - if (copy) - { - menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_COPY, - get_accel_group()); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (edit_copy), - NULL); - gtk_widget_show(menu_items); - } - - menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_PASTE, - get_accel_group()); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (edit_paste), - NULL); - gtk_widget_show(menu_items); - - if (pickup || hangup || hold) - { - menu_items = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show(menu_items); - } - - if (pickup) - { - - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Pick up")); - image = gtk_image_new_from_file(ICONS_DIR "/icon_accept.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (call_pick_up), - NULL); - gtk_widget_show(menu_items); - } - - if (hangup) - { - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); - image = gtk_image_new_from_file(ICONS_DIR "/icon_hangup.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (call_hang_up), - NULL); - gtk_widget_show(menu_items); - } - - if (hold) - { - menu_items = gtk_check_menu_item_new_with_mnemonic(_("On _Hold")); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), - (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); - g_signal_connect(G_OBJECT (menu_items), "activate", - G_CALLBACK (call_hold), - NULL); - gtk_widget_show(menu_items); - } - - if (record) - { - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Record")); - image = gtk_image_new_from_stock(GTK_STOCK_MEDIA_RECORD, - GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (call_record), - NULL); - gtk_widget_show(menu_items); - } - - if (im) - { - menu_items = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show(menu_items); - - menu_items = gtk_image_menu_item_new_with_mnemonic(_("Send _message")); - image = gtk_image_new_from_stock(GTK_STOCK_IM, GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (call_im), - NULL); - gtk_widget_show(menu_items); - } - - } - else - { - DEBUG("BUILD CONFERENCE MENU"); - - if (hangup_conf) - { - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); - image = gtk_image_new_from_file(ICONS_DIR "/icon_hangup.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (conference_hang_up), - NULL); - gtk_widget_show(menu_items); - } - - if (hold_conf) - { - menu_items = gtk_check_menu_item_new_with_mnemonic(_("On _Hold")); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), - (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); - g_signal_connect(G_OBJECT (menu_items), "activate", - G_CALLBACK (conference_hold), - NULL); - gtk_widget_show(menu_items); - } - } - - if (accounts) - { - add_registered_accounts_to_menu(menu); - } - - if (event) - { - button = event->button; - event_time = event->time; - } - else - { - button = 0; - event_time = gtk_get_current_event_time(); - } - - gtk_menu_attach_to_widget(GTK_MENU (menu), my_widget, NULL); - gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); + // TODO update the selection to make sure the call under the mouse is the call selected + + // call type boolean + gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = + FALSE, detach = FALSE; + gboolean accounts = FALSE; + gboolean im = FALSE; + + // conference type boolean + gboolean hangup_conf = FALSE, hold_conf = FALSE; + + callable_obj_t * selectedCall; + conference_obj_t * selectedConf; + + if (calltab_get_selected_type (current_calls) == A_CALL) { + DEBUG ("MENUS: SELECTED A CALL"); + selectedCall = calltab_get_selected_call (current_calls); + + if (selectedCall) { + copy = TRUE; + + switch (selectedCall->_state) { + case CALL_STATE_INCOMING: + pickup = TRUE; + hangup = TRUE; + detach = TRUE; + break; + case CALL_STATE_HOLD: + hangup = TRUE; + hold = TRUE; + detach = TRUE; + break; + case CALL_STATE_RINGING: + hangup = TRUE; + detach = TRUE; + break; + case CALL_STATE_DIALING: + pickup = TRUE; + hangup = TRUE; + accounts = TRUE; + break; + case CALL_STATE_RECORD: + case CALL_STATE_CURRENT: + hangup = TRUE; + hold = TRUE; + record = TRUE; + detach = TRUE; + im = TRUE; + break; + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + hangup = TRUE; + break; + default: + WARN ("Should not happen in show_popup_menu for calls!") + ; + break; + } + } + } else { + DEBUG ("MENUS: SELECTED A CONF"); + selectedConf = calltab_get_selected_conf(); + + if (selectedConf) { + switch (selectedConf->_state) { + case CONFERENCE_STATE_ACTIVE_ATACHED: + hangup_conf = TRUE; + hold_conf = TRUE; + break; + case CONFERENCE_STATE_ACTIVE_DETACHED: + break; + case CONFERENCE_STATE_HOLD: + hangup_conf = TRUE; + hold_conf = TRUE; + break; + default: + WARN ("Should not happen in show_popup_menu for conferences!") + ; + break; + } + } + + } + + GtkWidget *menu; + GtkWidget *image; + int button, event_time; + GtkWidget * menu_items; + + menu = gtk_menu_new(); + + //g_signal_connect (menu, "deactivate", + // G_CALLBACK (gtk_widget_destroy), NULL); + if (calltab_get_selected_type (current_calls) == A_CALL) { + DEBUG ("BUILD CALL MENU"); + + if (copy) { + menu_items = gtk_image_menu_item_new_from_stock (GTK_STOCK_COPY, + get_accel_group()); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (edit_copy), + NULL); + gtk_widget_show (menu_items); + } + + menu_items = gtk_image_menu_item_new_from_stock (GTK_STOCK_PASTE, + get_accel_group()); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (edit_paste), + NULL); + gtk_widget_show (menu_items); + + if (pickup || hangup || hold) { + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show (menu_items); + } + + if (pickup) { + + menu_items = gtk_image_menu_item_new_with_mnemonic (_ ("_Pick up")); + image = gtk_image_new_from_file (ICONS_DIR "/icon_accept.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_items), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_pick_up), + NULL); + gtk_widget_show (menu_items); + } + + if (hangup) { + menu_items = gtk_image_menu_item_new_with_mnemonic (_ ("_Hang up")); + image = gtk_image_new_from_file (ICONS_DIR "/icon_hangup.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_items), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_hang_up), + NULL); + gtk_widget_show (menu_items); + } + + if (hold) { + menu_items = gtk_check_menu_item_new_with_mnemonic (_ ("On _Hold")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_items), + (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_hold), + NULL); + gtk_widget_show (menu_items); + } + + if (record) { + menu_items = gtk_image_menu_item_new_with_mnemonic (_ ("_Record")); + image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_RECORD, + GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_items), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_record), + NULL); + gtk_widget_show (menu_items); + } + + if (im) { + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show (menu_items); + + menu_items = gtk_image_menu_item_new_with_mnemonic (_ ("Send _message")); + image = gtk_image_new_from_stock (GTK_STOCK_IM, GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_items), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_im), + NULL); + gtk_widget_show (menu_items); + } + + } else { + DEBUG ("BUILD CONFERENCE MENU"); + + if (hangup_conf) { + menu_items = gtk_image_menu_item_new_with_mnemonic (_ ("_Hang up")); + image = gtk_image_new_from_file (ICONS_DIR "/icon_hangup.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_items), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (conference_hang_up), + NULL); + gtk_widget_show (menu_items); + } + + if (hold_conf) { + menu_items = gtk_check_menu_item_new_with_mnemonic (_ ("On _Hold")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_items), + (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (conference_hold), + NULL); + gtk_widget_show (menu_items); + } + } + + if (accounts) { + add_registered_accounts_to_menu (menu); + } + + if (event) { + button = event->button; + event_time = event->time; + } else { + button = 0; + event_time = gtk_get_current_event_time(); + } + + gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } - void -show_popup_menu_history(GtkWidget *my_widget, GdkEventButton *event) +void +show_popup_menu_history (GtkWidget *my_widget, GdkEventButton *event) { - gboolean pickup = FALSE; - gboolean remove = FALSE; - gboolean edit = FALSE; - gboolean accounts = FALSE; - - callable_obj_t * selectedCall = calltab_get_selected_call(history); - if (selectedCall) - { - remove = TRUE; - pickup = TRUE; - edit = TRUE; - accounts = TRUE; - } - - GtkWidget *menu; - GtkWidget *image; - int button, event_time; - GtkWidget * menu_items; - - menu = gtk_menu_new(); - //g_signal_connect (menu, "deactivate", - // G_CALLBACK (gtk_widget_destroy), NULL); - - if (pickup) - { - - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Call back")); - image = gtk_image_new_from_file(ICONS_DIR "/icon_accept.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM ( menu_items ), image); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); - gtk_widget_show(menu_items); - } - - menu_items = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show(menu_items); - - if (edit) - { - menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_EDIT, - get_accel_group()); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); - gtk_widget_show(menu_items); - } - - if (remove) - { - menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_DELETE, - get_accel_group()); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", G_CALLBACK (remove_from_history), NULL); - gtk_widget_show(menu_items); - } - - if (accounts) - { - add_registered_accounts_to_menu(menu); - } - - if (event) - { - button = event->button; - event_time = event->time; - } - else - { - button = 0; - event_time = gtk_get_current_event_time(); - } - - gtk_menu_attach_to_widget(GTK_MENU (menu), my_widget, NULL); - gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); + gboolean pickup = FALSE; + gboolean remove = FALSE; + gboolean edit = FALSE; + gboolean accounts = FALSE; + + callable_obj_t * selectedCall = calltab_get_selected_call (history); + + if (selectedCall) { + remove = TRUE; + pickup = TRUE; + edit = TRUE; + accounts = TRUE; + } + + GtkWidget *menu; + GtkWidget *image; + int button, event_time; + GtkWidget * menu_items; + + menu = gtk_menu_new(); + //g_signal_connect (menu, "deactivate", + // G_CALLBACK (gtk_widget_destroy), NULL); + + if (pickup) { + + menu_items = gtk_image_menu_item_new_with_mnemonic (_ ("_Call back")); + image = gtk_image_new_from_file (ICONS_DIR "/icon_accept.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_items), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); + gtk_widget_show (menu_items); + } + + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show (menu_items); + + if (edit) { + menu_items = gtk_image_menu_item_new_from_stock (GTK_STOCK_EDIT, + get_accel_group()); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); + gtk_widget_show (menu_items); + } + + if (remove) { + menu_items = gtk_image_menu_item_new_from_stock (GTK_STOCK_DELETE, + get_accel_group()); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", G_CALLBACK (remove_from_history), NULL); + gtk_widget_show (menu_items); + } + + if (accounts) { + add_registered_accounts_to_menu (menu); + } + + if (event) { + button = event->button; + event_time = event->time; + } else { + button = 0; + event_time = gtk_get_current_event_time(); + } + + gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } - void -show_popup_menu_contacts(GtkWidget *my_widget, GdkEventButton *event) +void +show_popup_menu_contacts (GtkWidget *my_widget, GdkEventButton *event) { - gboolean pickup = FALSE; - gboolean accounts = FALSE; - gboolean edit = FALSE; - - callable_obj_t * selectedCall = calltab_get_selected_call(contacts); - if (selectedCall) - { - pickup = TRUE; - accounts = TRUE; - edit = TRUE; - } - - GtkWidget *menu; - GtkWidget *image; - int button, event_time; - GtkWidget * menu_items; - - menu = gtk_menu_new(); - //g_signal_connect (menu, "deactivate", - // G_CALLBACK (gtk_widget_destroy), NULL); - - if (pickup) - { - - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_New call")); - image = gtk_image_new_from_file(ICONS_DIR "/icon_accept.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM ( menu_items ), image); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); - gtk_widget_show(menu_items); - } - - if (edit) - { - menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_EDIT, - get_accel_group()); - gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); - gtk_widget_show(menu_items); - } - - if (accounts) - { - add_registered_accounts_to_menu(menu); - } - - if (event) - { - button = event->button; - event_time = event->time; - } - else - { - button = 0; - event_time = gtk_get_current_event_time(); - } - - gtk_menu_attach_to_widget(GTK_MENU (menu), my_widget, NULL); - gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); + gboolean pickup = FALSE; + gboolean accounts = FALSE; + gboolean edit = FALSE; + + callable_obj_t * selectedCall = calltab_get_selected_call (contacts); + + if (selectedCall) { + pickup = TRUE; + accounts = TRUE; + edit = TRUE; + } + + GtkWidget *menu; + GtkWidget *image; + int button, event_time; + GtkWidget * menu_items; + + menu = gtk_menu_new(); + //g_signal_connect (menu, "deactivate", + // G_CALLBACK (gtk_widget_destroy), NULL); + + if (pickup) { + + menu_items = gtk_image_menu_item_new_with_mnemonic (_ ("_New call")); + image = gtk_image_new_from_file (ICONS_DIR "/icon_accept.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_items), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); + gtk_widget_show (menu_items); + } + + if (edit) { + menu_items = gtk_image_menu_item_new_from_stock (GTK_STOCK_EDIT, + get_accel_group()); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); + gtk_widget_show (menu_items); + } + + if (accounts) { + add_registered_accounts_to_menu (menu); + } + + if (event) { + button = event->button; + event_time = event->time; + } else { + button = 0; + event_time = gtk_get_current_event_time(); + } + + gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } - static void -ok_cb(GtkWidget *widget UNUSED, gpointer userdata) +static void +ok_cb (GtkWidget *widget UNUSED, gpointer userdata) { - gchar *new_number; - callable_obj_t *modified_call, *original; + gchar *new_number; + callable_obj_t *modified_call, *original; - // Change the number of the selected call before calling - new_number = (gchar*) gtk_entry_get_text(GTK_ENTRY (editable_num)); - original = (callable_obj_t*) userdata; + // Change the number of the selected call before calling + new_number = (gchar*) gtk_entry_get_text (GTK_ENTRY (editable_num)); + original = (callable_obj_t*) userdata; - // Create the new call - create_new_call(CALL, CALL_STATE_DIALING, "", g_strdup(original->_accountID), - original->_peer_name, g_strdup(new_number), &modified_call); + // Create the new call + create_new_call (CALL, CALL_STATE_DIALING, "", g_strdup (original->_accountID), + original->_peer_name, g_strdup (new_number), &modified_call); - // Update the internal data structure and the GUI - calllist_add(current_calls, modified_call); - calltree_add_call(current_calls, modified_call, NULL); - sflphone_place_call(modified_call); - calltree_display(current_calls); + // Update the internal data structure and the GUI + calllist_add (current_calls, modified_call); + calltree_add_call (current_calls, modified_call, NULL); + sflphone_place_call (modified_call); + calltree_display (current_calls); - // Close the contextual menu - gtk_widget_destroy(GTK_WIDGET (edit_dialog)); + // Close the contextual menu + gtk_widget_destroy (GTK_WIDGET (edit_dialog)); } - static void -on_delete(GtkWidget * widget) +static void +on_delete (GtkWidget * widget) { - gtk_widget_destroy(widget); + gtk_widget_destroy (widget); } - void -show_edit_number(callable_obj_t *call) +void +show_edit_number (callable_obj_t *call) { - GtkWidget *ok, *hbox, *image; - GdkPixbuf *pixbuf; + GtkWidget *ok, *hbox, *image; + GdkPixbuf *pixbuf; - edit_dialog = GTK_DIALOG (gtk_dialog_new()); + edit_dialog = GTK_DIALOG (gtk_dialog_new()); - // Set window properties - gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 300, 20); - gtk_window_set_title(GTK_WINDOW(edit_dialog), _("Edit phone number")); - gtk_window_set_resizable(GTK_WINDOW (edit_dialog), FALSE); + // Set window properties + gtk_window_set_default_size (GTK_WINDOW (edit_dialog), 300, 20); + gtk_window_set_title (GTK_WINDOW (edit_dialog), _ ("Edit phone number")); + gtk_window_set_resizable (GTK_WINDOW (edit_dialog), FALSE); - g_signal_connect (G_OBJECT (edit_dialog), "delete-event", G_CALLBACK (on_delete), NULL); + g_signal_connect (G_OBJECT (edit_dialog), "delete-event", G_CALLBACK (on_delete), NULL); - hbox = gtk_hbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX (edit_dialog->vbox), hbox, TRUE, TRUE, 0); + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (edit_dialog->vbox), hbox, TRUE, TRUE, 0); - // Set the number to be edited - editable_num = gtk_entry_new(); + // Set the number to be edited + editable_num = gtk_entry_new(); #if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(editable_num), - _("Edit the phone number before making a call")); + gtk_widget_set_tooltip_text (GTK_WIDGET (editable_num), + _ ("Edit the phone number before making a call")); #endif - if (call) - gtk_entry_set_text(GTK_ENTRY(editable_num), g_strdup(call->_peer_number)); - else - ERROR ("This a bug, the call should be defined. menus.c line 1051"); - gtk_box_pack_start(GTK_BOX (hbox), editable_num, TRUE, TRUE, 0); + if (call) + gtk_entry_set_text (GTK_ENTRY (editable_num), g_strdup (call->_peer_number)); + else + ERROR ("This a bug, the call should be defined. menus.c line 1051"); + + gtk_box_pack_start (GTK_BOX (hbox), editable_num, TRUE, TRUE, 0); - // Set a custom image for the button - pixbuf = gdk_pixbuf_new_from_file_at_scale(ICONS_DIR "/outgoing.svg", 32, 32, - TRUE, NULL); - image = gtk_image_new_from_pixbuf(pixbuf); - ok = gtk_button_new(); - gtk_button_set_image(GTK_BUTTON (ok), image); - gtk_box_pack_start(GTK_BOX (hbox), ok, TRUE, TRUE, 0); - g_signal_connect(G_OBJECT (ok), "clicked", G_CALLBACK (ok_cb), call); + // Set a custom image for the button + pixbuf = gdk_pixbuf_new_from_file_at_scale (ICONS_DIR "/outgoing.svg", 32, 32, + TRUE, NULL); + image = gtk_image_new_from_pixbuf (pixbuf); + ok = gtk_button_new(); + gtk_button_set_image (GTK_BUTTON (ok), image); + gtk_box_pack_start (GTK_BOX (hbox), ok, TRUE, TRUE, 0); + g_signal_connect (G_OBJECT (ok), "clicked", G_CALLBACK (ok_cb), call); - gtk_widget_show_all(edit_dialog->vbox); + gtk_widget_show_all (edit_dialog->vbox); - gtk_dialog_run(edit_dialog); + gtk_dialog_run (edit_dialog); } - GtkWidget* +GtkWidget* create_waiting_icon() { - GtkWidget * waiting_icon; - waiting_icon = gtk_image_menu_item_new_with_label(""); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(waiting_icon), - gtk_image_new_from_animation(gdk_pixbuf_animation_new_from_file( - ICONS_DIR "/wait-on.gif", NULL))); - gtk_menu_item_set_right_justified(GTK_MENU_ITEM(waiting_icon), TRUE); - - return waiting_icon; + GtkWidget * waiting_icon; + waiting_icon = gtk_image_menu_item_new_with_label (""); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (waiting_icon), + gtk_image_new_from_animation (gdk_pixbuf_animation_new_from_file ( + ICONS_DIR "/wait-on.gif", NULL))); + gtk_menu_item_set_right_justified (GTK_MENU_ITEM (waiting_icon), TRUE); + + return waiting_icon; } - void -create_menus(GtkUIManager *ui_manager, GtkWidget **widget) +void +create_menus (GtkUIManager *ui_manager, GtkWidget **widget) { - GtkWidget * menu_bar; + GtkWidget * menu_bar; - menu_bar = gtk_ui_manager_get_widget (ui_manager, "/MenuBar"); - pickUpAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/PickUp"); - newCallAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/NewCall"); - hangUpAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/HangUp"); - holdMenu = gtk_ui_manager_get_widget (ui_manager, "/MenuBar/CallMenu/OnHoldMenu"); - recordAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/Record"); - imAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/InstantMessaging"); - copyAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Copy"); - pasteAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Paste"); - volumeToggle = gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls"); + menu_bar = gtk_ui_manager_get_widget (ui_manager, "/MenuBar"); + pickUpAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/PickUp"); + newCallAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/NewCall"); + hangUpAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/HangUp"); + holdMenu = gtk_ui_manager_get_widget (ui_manager, "/MenuBar/CallMenu/OnHoldMenu"); + recordAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/Record"); + imAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/InstantMessaging"); + copyAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Copy"); + pasteAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Paste"); + volumeToggle = gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls"); - // Set the toggle buttons - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), eel_gconf_get_boolean (CONF_SHOW_DIALPAD)); - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), (gboolean) SHOW_VOLUME); + // Set the toggle buttons + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), eel_gconf_get_boolean (CONF_SHOW_DIALPAD)); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), (gboolean) SHOW_VOLUME); - gtk_action_set_sensitive (GTK_ACTION (volumeToggle), SHOW_ALSA_CONF); + gtk_action_set_sensitive (GTK_ACTION (volumeToggle), SHOW_ALSA_CONF); - // Disable it right now - gtk_action_set_sensitive (GTK_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Toolbar")), FALSE); + // Disable it right now + gtk_action_set_sensitive (GTK_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Toolbar")), FALSE); - /* Add the loading icon at the right of the toolbar. It is used for addressbook searches. */ - waitingLayer = create_waiting_icon (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer); + /* Add the loading icon at the right of the toolbar. It is used for addressbook searches. */ + waitingLayer = create_waiting_icon (); + gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer); - *widget = menu_bar; + *widget = menu_bar; } - void -create_toolbar_actions(GtkUIManager *ui_manager, GtkWidget **widget) +void +create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget) { - toolbar = gtk_ui_manager_get_widget(ui_manager, "/ToolbarActions"); - - holdToolbar = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/OnHoldToolbar"); - offHoldToolbar = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/OffHoldToolbar"); - transferToolbar = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/TransferToolbar"); - voicemailAction = gtk_ui_manager_get_action(ui_manager, - "/ToolbarActions/Voicemail"); - voicemailToolbar = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/VoicemailToolbar"); - newCallWidget = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/NewCallToolbar"); - pickUpWidget = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/PickUpToolbar"); - hangUpWidget = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/HangUpToolbar"); - recordWidget = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/RecordToolbar"); - imToolbar = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/InstantMessagingToolbar"); - historyButton = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/HistoryToolbar"); - contactButton = gtk_ui_manager_get_widget(ui_manager, - "/ToolbarActions/AddressbookToolbar"); - - // Set the handler ID for the transfer - transfertButtonConnId - = g_signal_connect (G_OBJECT (transferToolbar), "toggled", G_CALLBACK (call_transfer_cb), NULL); - recordButtonConnId - = g_signal_connect (G_OBJECT (recordWidget), "toggled", G_CALLBACK (call_record), NULL); - active_calltree = current_calls; - - *widget = toolbar; + toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions"); + + holdToolbar = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/OnHoldToolbar"); + offHoldToolbar = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/OffHoldToolbar"); + transferToolbar = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/TransferToolbar"); + voicemailAction = gtk_ui_manager_get_action (ui_manager, + "/ToolbarActions/Voicemail"); + voicemailToolbar = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/VoicemailToolbar"); + newCallWidget = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/NewCallToolbar"); + pickUpWidget = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/PickUpToolbar"); + hangUpWidget = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/HangUpToolbar"); + recordWidget = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/RecordToolbar"); + imToolbar = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/InstantMessagingToolbar"); + historyButton = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/HistoryToolbar"); + contactButton = gtk_ui_manager_get_widget (ui_manager, + "/ToolbarActions/AddressbookToolbar"); + + // Set the handler ID for the transfer + transfertButtonConnId + = g_signal_connect (G_OBJECT (transferToolbar), "toggled", G_CALLBACK (call_transfer_cb), NULL); + recordButtonConnId + = g_signal_connect (G_OBJECT (recordWidget), "toggled", G_CALLBACK (call_record), NULL); + active_calltree = current_calls; + + *widget = toolbar; } diff --git a/sflphone-client-gnome/src/widget/gtkscrollbook.c b/sflphone-client-gnome/src/widget/gtkscrollbook.c index 9e9a9f12fd814720012728bed3a0730cb10e8c6f..18023bb6e1350d1e1379cb560a97f044696a5ddf 100644 --- a/sflphone-client-gnome/src/widget/gtkscrollbook.c +++ b/sflphone-client-gnome/src/widget/gtkscrollbook.c @@ -30,287 +30,293 @@ static void pidgin_scroll_book_init (PidginScrollBook *scroll_book); static void pidgin_scroll_book_class_init (PidginScrollBookClass *klass); static void pidgin_scroll_book_forall (GtkContainer *c, - gboolean include_internals, - GtkCallback callback, - gpointer user_data); + gboolean include_internals, + GtkCallback callback, + gpointer user_data); GType pidgin_scroll_book_get_type (void) { - static GType scroll_book_type = 0; - - if (!scroll_book_type) - { - static const GTypeInfo scroll_book_info = - { - sizeof (PidginScrollBookClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) pidgin_scroll_book_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PidginScrollBook), - 0, - (GInstanceInitFunc) pidgin_scroll_book_init, - NULL /* value_table */ - }; - - scroll_book_type = g_type_register_static(GTK_TYPE_VBOX, - "PidginScrollBook", - &scroll_book_info, - 0); - } - - return scroll_book_type; + static GType scroll_book_type = 0; + + if (!scroll_book_type) { + static const GTypeInfo scroll_book_info = { + sizeof (PidginScrollBookClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) pidgin_scroll_book_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PidginScrollBook), + 0, + (GInstanceInitFunc) pidgin_scroll_book_init, + NULL /* value_table */ + }; + + scroll_book_type = g_type_register_static (GTK_TYPE_VBOX, + "PidginScrollBook", + &scroll_book_info, + 0); + } + + return scroll_book_type; } static gboolean -scroll_left_cb(PidginScrollBook *scroll_book) +scroll_left_cb (PidginScrollBook *scroll_book) { - int index; - index = gtk_notebook_get_current_page(GTK_NOTEBOOK(scroll_book->notebook)); + int index; + index = gtk_notebook_get_current_page (GTK_NOTEBOOK (scroll_book->notebook)); - if (index > 0) - gtk_notebook_set_current_page(GTK_NOTEBOOK(scroll_book->notebook), index - 1); - return TRUE; + if (index > 0) + gtk_notebook_set_current_page (GTK_NOTEBOOK (scroll_book->notebook), index - 1); + + return TRUE; } static gboolean -scroll_right_cb(PidginScrollBook *scroll_book) +scroll_right_cb (PidginScrollBook *scroll_book) { - int index, count; - index = gtk_notebook_get_current_page(GTK_NOTEBOOK(scroll_book->notebook)); + int index, count; + index = gtk_notebook_get_current_page (GTK_NOTEBOOK (scroll_book->notebook)); #if GTK_CHECK_VERSION(2,2,0) - count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(scroll_book->notebook)); + count = gtk_notebook_get_n_pages (GTK_NOTEBOOK (scroll_book->notebook)); #else - count = g_list_length(GTK_NOTEBOOK(scroll_book->notebook)->children); + count = g_list_length (GTK_NOTEBOOK (scroll_book->notebook)->children); #endif - if (index + 1 < count) - gtk_notebook_set_current_page(GTK_NOTEBOOK(scroll_book->notebook), index + 1); - return TRUE; + if (index + 1 < count) + gtk_notebook_set_current_page (GTK_NOTEBOOK (scroll_book->notebook), index + 1); + + return TRUE; } static void -refresh_scroll_box(PidginScrollBook *scroll_book, int index, int count) +refresh_scroll_box (PidginScrollBook *scroll_book, int index, int count) { - char *label; - - gtk_widget_show_all(GTK_WIDGET(scroll_book)); - if (count < 1) - gtk_widget_hide_all(scroll_book->hbox); - else { - gtk_widget_show_all(scroll_book->hbox); - if (count == 1) { - gtk_widget_hide(scroll_book->label); - gtk_widget_hide(scroll_book->left_arrow); - gtk_widget_hide(scroll_book->right_arrow); - } - } - - label = g_strdup_printf("<span size='smaller' weight='bold'>(%d/%d)</span>", index+1, count); - gtk_label_set_markup(GTK_LABEL(scroll_book->label), label); - g_free(label); - - if (index == 0) - gtk_widget_set_sensitive(scroll_book->left_arrow, FALSE); - else - gtk_widget_set_sensitive(scroll_book->left_arrow, TRUE); - - - if (index + 1 == count) - gtk_widget_set_sensitive(scroll_book->right_arrow, FALSE); - else - gtk_widget_set_sensitive(scroll_book->right_arrow, TRUE); + char *label; + + gtk_widget_show_all (GTK_WIDGET (scroll_book)); + + if (count < 1) + gtk_widget_hide_all (scroll_book->hbox); + else { + gtk_widget_show_all (scroll_book->hbox); + + if (count == 1) { + gtk_widget_hide (scroll_book->label); + gtk_widget_hide (scroll_book->left_arrow); + gtk_widget_hide (scroll_book->right_arrow); + } + } + + label = g_strdup_printf ("<span size='smaller' weight='bold'>(%d/%d)</span>", index+1, count); + gtk_label_set_markup (GTK_LABEL (scroll_book->label), label); + g_free (label); + + if (index == 0) + gtk_widget_set_sensitive (scroll_book->left_arrow, FALSE); + else + gtk_widget_set_sensitive (scroll_book->left_arrow, TRUE); + + + if (index + 1 == count) + gtk_widget_set_sensitive (scroll_book->right_arrow, FALSE); + else + gtk_widget_set_sensitive (scroll_book->right_arrow, TRUE); } static void -page_count_change_cb(PidginScrollBook *scroll_book) +page_count_change_cb (PidginScrollBook *scroll_book) { - int count; - int index = gtk_notebook_get_current_page(GTK_NOTEBOOK(scroll_book->notebook)); + int count; + int index = gtk_notebook_get_current_page (GTK_NOTEBOOK (scroll_book->notebook)); #if GTK_CHECK_VERSION(2,2,0) - count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(scroll_book->notebook)); + count = gtk_notebook_get_n_pages (GTK_NOTEBOOK (scroll_book->notebook)); #else - count = g_list_length(GTK_NOTEBOOK(scroll_book->notebook)->children); + count = g_list_length (GTK_NOTEBOOK (scroll_book->notebook)->children); #endif - refresh_scroll_box(scroll_book, index, count); + refresh_scroll_box (scroll_book, index, count); } static gboolean -scroll_close_cb(PidginScrollBook *scroll_book) +scroll_close_cb (PidginScrollBook *scroll_book) { - gtk_widget_destroy(gtk_notebook_get_nth_page(GTK_NOTEBOOK(scroll_book->notebook), gtk_notebook_get_current_page(GTK_NOTEBOOK(scroll_book->notebook)))); - return FALSE; + gtk_widget_destroy (gtk_notebook_get_nth_page (GTK_NOTEBOOK (scroll_book->notebook), gtk_notebook_get_current_page (GTK_NOTEBOOK (scroll_book->notebook)))); + return FALSE; } static void -switch_page_cb(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, PidginScrollBook *scroll_book) +switch_page_cb (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, PidginScrollBook *scroll_book) { - int count; + int count; #if GTK_CHECK_VERSION(2,2,0) - count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(scroll_book->notebook)); + count = gtk_notebook_get_n_pages (GTK_NOTEBOOK (scroll_book->notebook)); #else - count = g_list_length(GTK_NOTEBOOK(scroll_book->notebook)->children); + count = g_list_length (GTK_NOTEBOOK (scroll_book->notebook)->children); #endif - refresh_scroll_box(scroll_book, page_num, count); + refresh_scroll_box (scroll_book, page_num, count); } static void -pidgin_scroll_book_add(GtkContainer *container, GtkWidget *widget) +pidgin_scroll_book_add (GtkContainer *container, GtkWidget *widget) { - PidginScrollBook *scroll_book; + PidginScrollBook *scroll_book; - g_return_if_fail(GTK_IS_WIDGET (widget)); - g_return_if_fail (widget->parent == NULL); + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (widget->parent == NULL); - scroll_book = PIDGIN_SCROLL_BOOK(container); - scroll_book->children = g_list_append(scroll_book->children, widget); - gtk_widget_show(widget); - gtk_notebook_append_page(GTK_NOTEBOOK(scroll_book->notebook), widget, NULL); - page_count_change_cb(PIDGIN_SCROLL_BOOK(container)); + scroll_book = PIDGIN_SCROLL_BOOK (container); + scroll_book->children = g_list_append (scroll_book->children, widget); + gtk_widget_show (widget); + gtk_notebook_append_page (GTK_NOTEBOOK (scroll_book->notebook), widget, NULL); + page_count_change_cb (PIDGIN_SCROLL_BOOK (container)); } static void -pidgin_scroll_book_remove(GtkContainer *container, GtkWidget *widget) +pidgin_scroll_book_remove (GtkContainer *container, GtkWidget *widget) { - int page; - PidginScrollBook *scroll_book; - g_return_if_fail(GTK_IS_WIDGET(widget)); - - scroll_book = PIDGIN_SCROLL_BOOK(container); - scroll_book->children = g_list_remove(scroll_book->children, widget); - /* gtk_widget_unparent(widget); */ - - page = gtk_notebook_page_num(GTK_NOTEBOOK(PIDGIN_SCROLL_BOOK(container)->notebook), widget); - if (page >= 0) { - gtk_notebook_remove_page(GTK_NOTEBOOK(PIDGIN_SCROLL_BOOK(container)->notebook), page); - } + int page; + PidginScrollBook *scroll_book; + g_return_if_fail (GTK_IS_WIDGET (widget)); + + scroll_book = PIDGIN_SCROLL_BOOK (container); + scroll_book->children = g_list_remove (scroll_book->children, widget); + /* gtk_widget_unparent(widget); */ + + page = gtk_notebook_page_num (GTK_NOTEBOOK (PIDGIN_SCROLL_BOOK (container)->notebook), widget); + + if (page >= 0) { + gtk_notebook_remove_page (GTK_NOTEBOOK (PIDGIN_SCROLL_BOOK (container)->notebook), page); + } } static void -pidgin_scroll_book_forall(GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data) +pidgin_scroll_book_forall (GtkContainer *container, + gboolean include_internals, + GtkCallback callback, + gpointer callback_data) { #if 0 - GList *children; + GList *children; #endif - PidginScrollBook *scroll_book; + PidginScrollBook *scroll_book; - g_return_if_fail(GTK_IS_CONTAINER(container)); + g_return_if_fail (GTK_IS_CONTAINER (container)); - scroll_book = PIDGIN_SCROLL_BOOK(container); + scroll_book = PIDGIN_SCROLL_BOOK (container); - if (include_internals) { - (*callback)(scroll_book->hbox, callback_data); - (*callback)(scroll_book->notebook, callback_data); - } + if (include_internals) { + (*callback) (scroll_book->hbox, callback_data); + (*callback) (scroll_book->notebook, callback_data); + } #if 0 - children = scroll_book->children; - - while (children) { - GtkWidget *child; - child = children->data; - children = children->next; - (*callback)(child, callback_data); - } + children = scroll_book->children; + + while (children) { + GtkWidget *child; + child = children->data; + children = children->next; + (*callback) (child, callback_data); + } + #endif } static void pidgin_scroll_book_class_init (PidginScrollBookClass *klass) { - GtkContainerClass *container_class = (GtkContainerClass*)klass; + GtkContainerClass *container_class = (GtkContainerClass*) klass; - container_class->add = pidgin_scroll_book_add; - container_class->remove = pidgin_scroll_book_remove; - container_class->forall = pidgin_scroll_book_forall; + container_class->add = pidgin_scroll_book_add; + container_class->remove = pidgin_scroll_book_remove; + container_class->forall = pidgin_scroll_book_forall; } static gboolean -close_button_left_cb(GtkWidget *widget, GdkEventCrossing *event, GtkLabel *label) +close_button_left_cb (GtkWidget *widget, GdkEventCrossing *event, GtkLabel *label) { - static GdkCursor *ptr = NULL; - if (ptr == NULL) { - ptr = gdk_cursor_new(GDK_LEFT_PTR); - } - - gtk_label_set_markup(label, "×"); - gdk_window_set_cursor(event->window, ptr); - return FALSE; + static GdkCursor *ptr = NULL; + + if (ptr == NULL) { + ptr = gdk_cursor_new (GDK_LEFT_PTR); + } + + gtk_label_set_markup (label, "×"); + gdk_window_set_cursor (event->window, ptr); + return FALSE; } static gboolean -close_button_entered_cb(GtkWidget *widget, GdkEventCrossing *event, GtkLabel *label) +close_button_entered_cb (GtkWidget *widget, GdkEventCrossing *event, GtkLabel *label) { - static GdkCursor *hand = NULL; - if (hand == NULL) { - hand = gdk_cursor_new(GDK_HAND2); - } - - gtk_label_set_markup(label, "<u>×</u>"); - gdk_window_set_cursor(event->window, hand); - return FALSE; + static GdkCursor *hand = NULL; + + if (hand == NULL) { + hand = gdk_cursor_new (GDK_HAND2); + } + + gtk_label_set_markup (label, "<u>×</u>"); + gdk_window_set_cursor (event->window, hand); + return FALSE; } static void pidgin_scroll_book_init (PidginScrollBook *scroll_book) { - GtkWidget *eb; - GtkWidget *close_button; + GtkWidget *eb; + GtkWidget *close_button; - scroll_book->hbox = gtk_hbox_new(FALSE, 0); + scroll_book->hbox = gtk_hbox_new (FALSE, 0); - /* Close */ - eb = gtk_event_box_new(); - gtk_box_pack_end(GTK_BOX(scroll_book->hbox), eb, FALSE, FALSE, 0); + /* Close */ + eb = gtk_event_box_new(); + gtk_box_pack_end (GTK_BOX (scroll_book->hbox), eb, FALSE, FALSE, 0); #if GTK_CHECK_VERSION(2,4,0) - gtk_event_box_set_visible_window(GTK_EVENT_BOX(eb), FALSE); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); #endif - gtk_widget_set_events(eb, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); - close_button = gtk_label_new("×"); - g_signal_connect(G_OBJECT(eb), "enter-notify-event", G_CALLBACK(close_button_entered_cb), close_button); - g_signal_connect(G_OBJECT(eb), "leave-notify-event", G_CALLBACK(close_button_left_cb), close_button); - gtk_container_add(GTK_CONTAINER(eb), close_button); - g_signal_connect_swapped(G_OBJECT(eb), "button-press-event", G_CALLBACK(scroll_close_cb), scroll_book); - - /* Right arrow */ - eb = gtk_event_box_new(); - gtk_box_pack_end(GTK_BOX(scroll_book->hbox), eb, FALSE, FALSE, 0); - scroll_book->right_arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE); - gtk_container_add(GTK_CONTAINER(eb), scroll_book->right_arrow); - g_signal_connect_swapped(G_OBJECT(eb), "button-press-event", G_CALLBACK(scroll_right_cb), scroll_book); - - /* Count */ - scroll_book->label = gtk_label_new(NULL); - gtk_box_pack_end(GTK_BOX(scroll_book->hbox), scroll_book->label, FALSE, FALSE, 0); - - /* Left arrow */ - eb = gtk_event_box_new(); - gtk_box_pack_end(GTK_BOX(scroll_book->hbox), eb, FALSE, FALSE, 0); - scroll_book->left_arrow = gtk_arrow_new(GTK_ARROW_LEFT, GTK_SHADOW_NONE); - gtk_container_add(GTK_CONTAINER(eb), scroll_book->left_arrow); - g_signal_connect_swapped(G_OBJECT(eb), "button-press-event", G_CALLBACK(scroll_left_cb), scroll_book); - - gtk_box_pack_start(GTK_BOX(scroll_book), scroll_book->hbox, FALSE, FALSE, 0); - - scroll_book->notebook = gtk_notebook_new(); - gtk_notebook_set_show_tabs(GTK_NOTEBOOK(scroll_book->notebook), FALSE); - gtk_notebook_set_show_border(GTK_NOTEBOOK(scroll_book->notebook), FALSE); - - gtk_box_pack_start(GTK_BOX(scroll_book), scroll_book->notebook, TRUE, TRUE, 0); - - g_signal_connect_swapped(G_OBJECT(scroll_book->notebook), "remove", G_CALLBACK(page_count_change_cb), scroll_book); - g_signal_connect(G_OBJECT(scroll_book->notebook), "switch-page", G_CALLBACK(switch_page_cb), scroll_book); - gtk_widget_show_all(scroll_book->notebook); + gtk_widget_set_events (eb, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); + close_button = gtk_label_new ("×"); + g_signal_connect (G_OBJECT (eb), "enter-notify-event", G_CALLBACK (close_button_entered_cb), close_button); + g_signal_connect (G_OBJECT (eb), "leave-notify-event", G_CALLBACK (close_button_left_cb), close_button); + gtk_container_add (GTK_CONTAINER (eb), close_button); + g_signal_connect_swapped (G_OBJECT (eb), "button-press-event", G_CALLBACK (scroll_close_cb), scroll_book); + + /* Right arrow */ + eb = gtk_event_box_new(); + gtk_box_pack_end (GTK_BOX (scroll_book->hbox), eb, FALSE, FALSE, 0); + scroll_book->right_arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE); + gtk_container_add (GTK_CONTAINER (eb), scroll_book->right_arrow); + g_signal_connect_swapped (G_OBJECT (eb), "button-press-event", G_CALLBACK (scroll_right_cb), scroll_book); + + /* Count */ + scroll_book->label = gtk_label_new (NULL); + gtk_box_pack_end (GTK_BOX (scroll_book->hbox), scroll_book->label, FALSE, FALSE, 0); + + /* Left arrow */ + eb = gtk_event_box_new(); + gtk_box_pack_end (GTK_BOX (scroll_book->hbox), eb, FALSE, FALSE, 0); + scroll_book->left_arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE); + gtk_container_add (GTK_CONTAINER (eb), scroll_book->left_arrow); + g_signal_connect_swapped (G_OBJECT (eb), "button-press-event", G_CALLBACK (scroll_left_cb), scroll_book); + + gtk_box_pack_start (GTK_BOX (scroll_book), scroll_book->hbox, FALSE, FALSE, 0); + + scroll_book->notebook = gtk_notebook_new(); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (scroll_book->notebook), FALSE); + gtk_notebook_set_show_border (GTK_NOTEBOOK (scroll_book->notebook), FALSE); + + gtk_box_pack_start (GTK_BOX (scroll_book), scroll_book->notebook, TRUE, TRUE, 0); + + g_signal_connect_swapped (G_OBJECT (scroll_book->notebook), "remove", G_CALLBACK (page_count_change_cb), scroll_book); + g_signal_connect (G_OBJECT (scroll_book->notebook), "switch-page", G_CALLBACK (switch_page_cb), scroll_book); + gtk_widget_show_all (scroll_book->notebook); } GtkWidget * pidgin_scroll_book_new() { - return g_object_new(PIDGIN_TYPE_SCROLL_BOOK, NULL); + return g_object_new (PIDGIN_TYPE_SCROLL_BOOK, NULL); } diff --git a/sflphone-client-gnome/src/widget/gtkscrollbook.h b/sflphone-client-gnome/src/widget/gtkscrollbook.h index 859488c14510f4487fe64296ce5301b516cf9536..a012f7825923bb04a5ccf5a8e39eebfac2729627 100644 --- a/sflphone-client-gnome/src/widget/gtkscrollbook.h +++ b/sflphone-client-gnome/src/widget/gtkscrollbook.h @@ -41,39 +41,37 @@ G_BEGIN_DECLS typedef struct _PidginScrollBook PidginScrollBook; typedef struct _PidginScrollBookClass PidginScrollBookClass; -struct _PidginScrollBook -{ - GtkVBox parent_instance; - - GtkWidget *notebook; - GtkWidget *hbox; - GtkWidget *label; - GtkWidget *left_arrow; - GtkWidget *right_arrow; - GList *children; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); +struct _PidginScrollBook { + GtkVBox parent_instance; + + GtkWidget *notebook; + GtkWidget *hbox; + GtkWidget *label; + GtkWidget *left_arrow; + GtkWidget *right_arrow; + GList *children; + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); }; -struct _PidginScrollBookClass -{ - GtkContainerClass parent_class; +struct _PidginScrollBookClass { + GtkContainerClass parent_class; - /* Padding for future expansion */ - void (*_gtk_reserved0) (void); - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); + /* Padding for future expansion */ + void (*_gtk_reserved0) (void); + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); }; -GType pidgin_scroll_book_get_type (void) G_GNUC_CONST; -GtkWidget *pidgin_scroll_book_new (void); +GType pidgin_scroll_book_get_type (void) G_GNUC_CONST; +GtkWidget *pidgin_scroll_book_new (void); G_END_DECLS diff --git a/sflphone-client-gnome/src/widget/imwidget.c b/sflphone-client-gnome/src/widget/imwidget.c index 85fd5717e64e2c148e2b96886eeaa29d48f4f617..b41b699a8abb9df0b95fddb5c20d56fe7d52850b 100644 --- a/sflphone-client-gnome/src/widget/imwidget.c +++ b/sflphone-client-gnome/src/widget/imwidget.c @@ -35,318 +35,316 @@ #define WEBKIT_DIR "file://" DATA_DIR "/webkit/" - void +void im_widget_add_message (IMWidget *im, const gchar *from, const gchar *message, gint level) { - if (im) { + if (im) { - /* Compute the date the message was sent */ - gchar *msgtime = im_widget_add_message_time (); + /* Compute the date the message was sent */ + gchar *msgtime = im_widget_add_message_time (); - /* Check for the message level */ - gchar *css_class = (level == MESSAGE_LEVEL_ERROR ) ? "error" : ""; + /* Check for the message level */ + gchar *css_class = (level == MESSAGE_LEVEL_ERROR) ? "error" : ""; - /* Prepare and execute the Javascript code */ - gchar *script = g_strdup_printf("add_message('%s', '%s', '%s', '%s');", message, from, css_class, msgtime); - webkit_web_view_execute_script (WEBKIT_WEB_VIEW(im->web_view), script); + /* Prepare and execute the Javascript code */ + gchar *script = g_strdup_printf ("add_message('%s', '%s', '%s', '%s');", message, from, css_class, msgtime); + webkit_web_view_execute_script (WEBKIT_WEB_VIEW (im->web_view), script); - /* Cleanup */ - g_free(script); + /* Cleanup */ + g_free (script); - } + } } static gboolean -web_view_nav_requested_cb( - WebKitWebView *web_view, - WebKitWebFrame *frame, - WebKitNetworkRequest *request, - WebKitWebNavigationAction *navigation_action, - WebKitWebPolicyDecision *policy_decision, - gpointer user_data) +web_view_nav_requested_cb ( + WebKitWebView *web_view, + WebKitWebFrame *frame, + WebKitNetworkRequest *request, + WebKitWebNavigationAction *navigation_action, + WebKitWebPolicyDecision *policy_decision, + gpointer user_data) { - const gchar *uri = webkit_network_request_get_uri(request); - - /* Always allow files we are serving ourselves. */ - if (!strncmp(uri, WEBKIT_DIR, sizeof(WEBKIT_DIR) - 1)) { - webkit_web_policy_decision_use (policy_decision); - } else { - /* Running a system command to open the URL in the user's default browser */ - gchar *cmd = g_strdup_printf("x-www-browser %s", uri); - system (cmd); - webkit_web_policy_decision_ignore (policy_decision); - g_free (cmd); - } - return TRUE; + const gchar *uri = webkit_network_request_get_uri (request); + + /* Always allow files we are serving ourselves. */ + if (!strncmp (uri, WEBKIT_DIR, sizeof (WEBKIT_DIR) - 1)) { + webkit_web_policy_decision_use (policy_decision); + } else { + /* Running a system command to open the URL in the user's default browser */ + gchar *cmd = g_strdup_printf ("x-www-browser %s", uri); + system (cmd); + webkit_web_policy_decision_ignore (policy_decision); + g_free (cmd); + } + + return TRUE; } - static gboolean +static gboolean on_Textview_changed (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { - GtkTextIter start, end; - /* Get all the text in the buffer */ - IMWidget *im = user_data; - callable_obj_t *im_widget_call = calllist_get (current_calls, im->call_id); + GtkTextIter start, end; + /* Get all the text in the buffer */ + IMWidget *im = user_data; + callable_obj_t *im_widget_call = calllist_get (current_calls, im->call_id); + + /* If the call has been hungup, it is not anymore in the current_calls calltab */ + if (!im_widget_call) { + /* So try the history tab */ + im_widget_call = calllist_get (history, im->call_id); + } - /* If the call has been hungup, it is not anymore in the current_calls calltab */ - if (!im_widget_call) - { - /* So try the history tab */ - im_widget_call = calllist_get (history, im->call_id); - } + /* Fetch the text entered in the GtkTextView */ + GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (im->textarea)); - /* Fetch the text entered in the GtkTextView */ - GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (im->textarea)); + /* Catch the keyboard events */ + if (event->type == GDK_KEY_PRESS) { - /* Catch the keyboard events */ - if (event->type == GDK_KEY_PRESS){ + switch (event->keyval) { + case GDK_Return: - switch (event->keyval) - { - case GDK_Return: + /* We want to send the message on pressing ENTER */ + if (gtk_text_buffer_get_char_count (buffer) != 0) { + /* Fetch the string text */ + gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (buffer), &start, &end); + gchar *message = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); - /* We want to send the message on pressing ENTER */ - if (gtk_text_buffer_get_char_count (buffer) != 0 ) - { - /* Fetch the string text */ - gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (buffer), &start, &end); - gchar *message = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); + /* Display our own message in the chat window */ + im_widget_add_message (im, "Me", message, MESSAGE_LEVEL_NORMAL); - /* Display our own message in the chat window */ - im_widget_add_message (im, "Me", message, MESSAGE_LEVEL_NORMAL); + /* Send the message to the peer */ + im_widget_send_message (im_widget_call, message); - /* Send the message to the peer */ - im_widget_send_message (im_widget_call, message); + /* Empty the buffer */ + gtk_text_buffer_delete (GTK_TEXT_BUFFER (buffer), &start, &end); - /* Empty the buffer */ - gtk_text_buffer_delete (GTK_TEXT_BUFFER (buffer), &start, &end); + } - } - return TRUE; - } - } + return TRUE; + } + } - return FALSE; + return FALSE; } - gchar* -im_widget_add_message_time () +gchar* +im_widget_add_message_time () { - time_t now; - unsigned char str[100]; + time_t now; + unsigned char str[100]; - /* Compute the current time */ - (void) time (&now); - struct tm* ptr; - ptr = localtime (&now); + /* Compute the current time */ + (void) time (&now); + struct tm* ptr; + ptr = localtime (&now); - /* Get the time of the message. Format: HH:MM::SS */ - strftime ((char *)str, 100, "%R", (const struct tm *)ptr); - gchar *res = g_strdup (str); + /* Get the time of the message. Format: HH:MM::SS */ + strftime ( (char *) str, 100, "%R", (const struct tm *) ptr); + gchar *res = g_strdup (str); - /* Return the new value */ - return res; + /* Return the new value */ + return res; } - void +void im_widget_send_message (callable_obj_t *call, const gchar *message) { - /* First check if the call is in CURRENT state, otherwise it could not be sent */ - if (call) { - if (call->_type == CALL && (call->_state == CALL_STATE_CURRENT || call->_state == CALL_STATE_HOLD)) - { - /* Ship the message through D-Bus */ - dbus_send_text_message (call->_callID, message); - } - else { - /* Display an error message */ - im_widget_add_message (IM_WIDGET (call->_im_widget), "sflphoned", "Oups, something went wrong! Unable to send text messages outside a call.", MESSAGE_LEVEL_ERROR); - } - } + /* First check if the call is in CURRENT state, otherwise it could not be sent */ + if (call) { + if (call->_type == CALL && (call->_state == CALL_STATE_CURRENT || call->_state == CALL_STATE_HOLD)) { + /* Ship the message through D-Bus */ + dbus_send_text_message (call->_callID, message); + } else { + /* Display an error message */ + im_widget_add_message (IM_WIDGET (call->_im_widget), "sflphoned", "Oups, something went wrong! Unable to send text messages outside a call.", MESSAGE_LEVEL_ERROR); + } + } } - static void -im_widget_class_init(IMWidgetClass *klass) +static void +im_widget_class_init (IMWidgetClass *klass) { } - static void +static void im_widget_init (IMWidget *im) { - /* A text view to enable users to enter text */ - im->textarea = gtk_text_view_new (); - - /* The webkit widget to display the message */ - im->web_view = webkit_web_view_new(); - GtkWidget *textscrollwin = gtk_scrolled_window_new (NULL, NULL); - GtkWidget *webscrollwin = gtk_scrolled_window_new (NULL, NULL); - im->info_bar = gtk_info_bar_new (); - - /* A bar with the entry text and the button to send the message */ - GtkWidget *hbox = gtk_hbox_new (FALSE, 10); - gtk_text_view_set_editable(GTK_TEXT_VIEW(im->textarea), TRUE); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(textscrollwin), GTK_POLICY_NEVER, GTK_POLICY_NEVER); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(webscrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_widget_set_size_request(GTK_WIDGET (textscrollwin), -1, 20); - gtk_widget_set_size_request(GTK_WIDGET (im->textarea), -1, 20); - - gtk_container_add (GTK_CONTAINER (textscrollwin), im->textarea); - gtk_container_add (GTK_CONTAINER (webscrollwin), im->web_view); - gtk_container_add (GTK_CONTAINER (hbox), textscrollwin); - gtk_box_pack_start (GTK_BOX(im), im->info_bar, FALSE, FALSE, 2); - gtk_box_pack_start (GTK_BOX(im), webscrollwin, TRUE, TRUE, 5); - gtk_box_pack_end (GTK_BOX(im), hbox, FALSE, FALSE, 2); - g_signal_connect (im->web_view, "navigation-policy-decision-requested", G_CALLBACK (web_view_nav_requested_cb), NULL); - g_signal_connect(im->textarea, "key-press-event", G_CALLBACK (on_Textview_changed), im); - - im->web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW(im->web_view)); - im->js_context = webkit_web_frame_get_global_context (im->web_frame); - im->js_global = JSContextGetGlobalObject (im->js_context); - webkit_web_view_load_uri (WEBKIT_WEB_VIEW(im->web_view), "file://" DATA_DIR "/webkit/im/im.html"); + /* A text view to enable users to enter text */ + im->textarea = gtk_text_view_new (); + + /* The webkit widget to display the message */ + im->web_view = webkit_web_view_new(); + GtkWidget *textscrollwin = gtk_scrolled_window_new (NULL, NULL); + GtkWidget *webscrollwin = gtk_scrolled_window_new (NULL, NULL); + im->info_bar = gtk_info_bar_new (); + + /* A bar with the entry text and the button to send the message */ + GtkWidget *hbox = gtk_hbox_new (FALSE, 10); + gtk_text_view_set_editable (GTK_TEXT_VIEW (im->textarea), TRUE); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (textscrollwin), GTK_POLICY_NEVER, GTK_POLICY_NEVER); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (webscrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_widget_set_size_request (GTK_WIDGET (textscrollwin), -1, 20); + gtk_widget_set_size_request (GTK_WIDGET (im->textarea), -1, 20); + + gtk_container_add (GTK_CONTAINER (textscrollwin), im->textarea); + gtk_container_add (GTK_CONTAINER (webscrollwin), im->web_view); + gtk_container_add (GTK_CONTAINER (hbox), textscrollwin); + gtk_box_pack_start (GTK_BOX (im), im->info_bar, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (im), webscrollwin, TRUE, TRUE, 5); + gtk_box_pack_end (GTK_BOX (im), hbox, FALSE, FALSE, 2); + g_signal_connect (im->web_view, "navigation-policy-decision-requested", G_CALLBACK (web_view_nav_requested_cb), NULL); + g_signal_connect (im->textarea, "key-press-event", G_CALLBACK (on_Textview_changed), im); + + im->web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (im->web_view)); + im->js_context = webkit_web_frame_get_global_context (im->web_frame); + im->js_global = JSContextGetGlobalObject (im->js_context); + webkit_web_view_load_uri (WEBKIT_WEB_VIEW (im->web_view), "file://" DATA_DIR "/webkit/im/im.html"); } - GtkWidget * +GtkWidget * im_widget_new() { - return GTK_WIDGET (g_object_new (IM_WIDGET_TYPE, NULL)); + return GTK_WIDGET (g_object_new (IM_WIDGET_TYPE, NULL)); } - GType -im_widget_get_type(void) +GType +im_widget_get_type (void) { - static GType im_widget_type = 0; - - if (!im_widget_type) { - static const GTypeInfo im_widget_info = { - sizeof (IMWidgetClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) im_widget_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (IMWidget), - 0, - (GInstanceInitFunc) im_widget_init, - NULL /* value_table */ - }; - - im_widget_type = g_type_register_static( - GTK_TYPE_VBOX, - "IMWidget", - &im_widget_info, - 0); - } - - return im_widget_type; + static GType im_widget_type = 0; + + if (!im_widget_type) { + static const GTypeInfo im_widget_info = { + sizeof (IMWidgetClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) im_widget_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (IMWidget), + 0, + (GInstanceInitFunc) im_widget_init, + NULL /* value_table */ + }; + + im_widget_type = g_type_register_static ( + GTK_TYPE_VBOX, + "IMWidget", + &im_widget_info, + 0); + } + + return im_widget_type; } - void -im_widget_display (callable_obj_t **call) +void +im_widget_display (callable_obj_t **call) { - /* Work with a copy of the object */ - callable_obj_t *tmp = *call; + /* Work with a copy of the object */ + callable_obj_t *tmp = *call; - /* Use the widget for this specific call, if exists */ - if (tmp) { - IMWidget *im = IM_WIDGET (tmp->_im_widget); + /* Use the widget for this specific call, if exists */ + if (tmp) { + IMWidget *im = IM_WIDGET (tmp->_im_widget); - if (!im) { - DEBUG ("creating the im widget for this call\n"); - /* Create the im object */ - im = IM_WIDGET (im_widget_new ()); + if (!im) { + DEBUG ("creating the im widget for this call\n"); + /* Create the im object */ + im = IM_WIDGET (im_widget_new ()); - /* Keep a reference on this object in the call struct */ - tmp->_im_widget = im; - *call = tmp; + /* Keep a reference on this object in the call struct */ + tmp->_im_widget = im; + *call = tmp; - /* Update the widget with some useful call information: ie the call ID */ - im->call_id = tmp->_callID; + /* Update the widget with some useful call information: ie the call ID */ + im->call_id = tmp->_callID; - /* Create the GtkInfoBar, used to display call information, and status of the IM widget */ - im_widget_infobar (im); + /* Create the GtkInfoBar, used to display call information, and status of the IM widget */ + im_widget_infobar (im); - /* Add it to the main instant messaging window */ - im_window_add (im); - } - else { - DEBUG ("im widget exists for this call\n"); - im_window_show (); - } - } + /* Add it to the main instant messaging window */ + im_window_add (im); + } else { + DEBUG ("im widget exists for this call\n"); + im_window_show (); + } + } } - void -im_widget_infobar (IMWidget *im) +void +im_widget_infobar (IMWidget *im) { - /* Fetch the GTKInfoBar of this very IM Widget */ - GtkWidget *infobar = im->info_bar; - GtkWidget *content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar)); + /* Fetch the GTKInfoBar of this very IM Widget */ + GtkWidget *infobar = im->info_bar; + GtkWidget *content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar)); - /* Fetch call information */ - callable_obj_t *im_widget_call = calllist_get (current_calls, im->call_id); + /* Fetch call information */ + callable_obj_t *im_widget_call = calllist_get (current_calls, im->call_id); - /* Create the label widgets with the call information saved in the IM Widget struct */ - gchar *msg1 = g_strdup_printf ("Calling %s %s", im_widget_call->_peer_number, im_widget_call->_peer_name); - GtkWidget *call_label = gtk_label_new (msg1); - im->info_state = call_state_image_widget (im_widget_call->_state); - /* Add a nice icon from our own icon factory */ - GtkWidget *logoUser = gtk_image_new_from_stock (GTK_STOCK_USER, GTK_ICON_SIZE_LARGE_TOOLBAR); + /* Create the label widgets with the call information saved in the IM Widget struct */ + gchar *msg1 = g_strdup_printf ("Calling %s %s", im_widget_call->_peer_number, im_widget_call->_peer_name); + GtkWidget *call_label = gtk_label_new (msg1); + im->info_state = call_state_image_widget (im_widget_call->_state); + /* Add a nice icon from our own icon factory */ + GtkWidget *logoUser = gtk_image_new_from_stock (GTK_STOCK_USER, GTK_ICON_SIZE_LARGE_TOOLBAR); - /* Pack it all */ - gtk_container_add (GTK_CONTAINER (content_area), logoUser); - gtk_container_add (GTK_CONTAINER (content_area), call_label); - gtk_container_add (GTK_CONTAINER (content_area), im->info_state); + /* Pack it all */ + gtk_container_add (GTK_CONTAINER (content_area), logoUser); + gtk_container_add (GTK_CONTAINER (content_area), call_label); + gtk_container_add (GTK_CONTAINER (content_area), im->info_state); - /* Message level by default: INFO */ - gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_INFO); + /* Message level by default: INFO */ + gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_INFO); - /* Show the info bar */ - gtk_widget_show (infobar); + /* Show the info bar */ + gtk_widget_show (infobar); - /* Clean up */ - free (msg1); + /* Clean up */ + free (msg1); } GtkWidget* -call_state_image_widget (call_state_t state) { +call_state_image_widget (call_state_t state) +{ + + GtkWidget *image; - GtkWidget *image; + switch (state) { + case CALL_STATE_CURRENT: + image = gtk_image_new_from_stock (GTK_STOCK_IM, GTK_ICON_SIZE_LARGE_TOOLBAR); + break; + default: + image = gtk_image_new_from_stock (GTK_STOCK_FAIL, GTK_ICON_SIZE_LARGE_TOOLBAR); + break; - switch (state) { - case CALL_STATE_CURRENT: - image = gtk_image_new_from_stock (GTK_STOCK_IM, GTK_ICON_SIZE_LARGE_TOOLBAR); - break; - default: - image = gtk_image_new_from_stock (GTK_STOCK_FAIL, GTK_ICON_SIZE_LARGE_TOOLBAR); - break; + } - } - return image; + return image; } - void -im_widget_update_state (IMWidget *im, gboolean active) +void +im_widget_update_state (IMWidget *im, gboolean active) { - /* if active = true, it means that we are the call is in current state, so sflphone can send text messages */ - if (active) { - gtk_widget_set_sensitive (im->info_state, TRUE); - gtk_info_bar_set_message_type (GTK_INFO_BAR (im->info_bar), - GTK_MESSAGE_INFO); - } - /* if active = false, the call is over, we can't send text messages anymore */ - else { - gtk_widget_set_sensitive (im->info_state, FALSE); - gtk_info_bar_set_message_type (GTK_INFO_BAR (im->info_bar), - GTK_MESSAGE_WARNING); - gtk_widget_set_tooltip_text (im->info_state, "Call has terminated"); - } + /* if active = true, it means that we are the call is in current state, so sflphone can send text messages */ + if (active) { + gtk_widget_set_sensitive (im->info_state, TRUE); + gtk_info_bar_set_message_type (GTK_INFO_BAR (im->info_bar), + GTK_MESSAGE_INFO); + } + /* if active = false, the call is over, we can't send text messages anymore */ + else { + gtk_widget_set_sensitive (im->info_state, FALSE); + gtk_info_bar_set_message_type (GTK_INFO_BAR (im->info_bar), + GTK_MESSAGE_WARNING); + gtk_widget_set_tooltip_text (im->info_state, "Call has terminated"); + } } diff --git a/sflphone-client-gnome/src/widget/imwidget.h b/sflphone-client-gnome/src/widget/imwidget.h index f8c1660ffecb653f7375a15021df2da9d732071f..c260190c9201717d58f174a683367c438a748932 100644 --- a/sflphone-client-gnome/src/widget/imwidget.h +++ b/sflphone-client-gnome/src/widget/imwidget.h @@ -46,27 +46,27 @@ G_BEGIN_DECLS #define MESSAGE_LEVEL_NORMAL 0 #define MESSAGE_LEVEL_WARNING 1 -#define MESSAGE_LEVEL_ERROR 2 +#define MESSAGE_LEVEL_ERROR 2 typedef struct _IMWidget IMWidget; typedef struct _IMWidgetClass IMWidgetClass; struct _IMWidget { - GtkVBox parent_instance; - - /* Private */ - GtkWidget *textarea; - GtkWidget *web_view; - GtkWidget *info_bar; - GtkWidget *info_state; - gchar *call_id; - WebKitWebFrame *web_frame; // Our web frame - JSGlobalContextRef js_context; // The frame's global JS context - JSObjectRef js_global; // The frame's global context JS object + GtkVBox parent_instance; + + /* Private */ + GtkWidget *textarea; + GtkWidget *web_view; + GtkWidget *info_bar; + GtkWidget *info_state; + gchar *call_id; + WebKitWebFrame *web_frame; // Our web frame + JSGlobalContextRef js_context; // The frame's global JS context + JSObjectRef js_global; // The frame's global context JS object }; struct _IMWidgetClass { - GtkContainerClass parent_class; + GtkContainerClass parent_class; }; @@ -76,11 +76,11 @@ struct _IMWidgetClass { */ void im_widget_display (callable_obj_t**); -GType im_widget_get_type(void) G_GNUC_CONST; -GtkWidget *im_widget_new(void); +GType im_widget_get_type (void) G_GNUC_CONST; +GtkWidget *im_widget_new (void); /*! @function -@abstract Add a new message in the webkit view +@abstract Add a new message in the webkit view @param The IMWidget @param The sender of the message @param The message to be send @@ -94,7 +94,7 @@ gchar* im_widget_add_message_time (); /*! @function @abstract Build the GtkInfoBar used to display call information and IM Widget status -@param The IM Widget +@param The IM Widget */ void im_widget_infobar (IMWidget *im); diff --git a/sflphone-client-gnome/src/widget/minidialog.c b/sflphone-client-gnome/src/widget/minidialog.c index 2d2a8d05600229319a74ef9a0421d426cdbe98d1..ad003a5a9a00abef22f03d2b1ba2807cc6d5d2b7 100644 --- a/sflphone-client-gnome/src/widget/minidialog.c +++ b/sflphone-client-gnome/src/widget/minidialog.c @@ -32,7 +32,7 @@ #define HIG_BOX_SPACE 6 #define LABEL_WIDTH 200 -static void pidgin_mini_dialog_init (PidginMiniDialog *self); +static void pidgin_mini_dialog_init (PidginMiniDialog *self); static void pidgin_mini_dialog_class_init (PidginMiniDialogClass *klass); static gpointer pidgin_mini_dialog_parent_class = NULL; @@ -40,318 +40,313 @@ static gpointer pidgin_mini_dialog_parent_class = NULL; static void pidgin_mini_dialog_class_intern_init (gpointer klass) { - pidgin_mini_dialog_parent_class = g_type_class_peek_parent (klass); - pidgin_mini_dialog_class_init ((PidginMiniDialogClass*) klass); + pidgin_mini_dialog_parent_class = g_type_class_peek_parent (klass); + pidgin_mini_dialog_class_init ( (PidginMiniDialogClass*) klass); } GType pidgin_mini_dialog_get_type (void) { - static GType g_define_type_id = 0; - if (g_define_type_id == 0) - { - static const GTypeInfo g_define_type_info = { - sizeof (PidginMiniDialogClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pidgin_mini_dialog_class_intern_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (PidginMiniDialog), - 0, /* n_preallocs */ - (GInstanceInitFunc) pidgin_mini_dialog_init, - NULL, - }; - g_define_type_id = g_type_register_static (GTK_TYPE_VBOX, - "PidginMiniDialog", &g_define_type_info, 0); - } - return g_define_type_id; + static GType g_define_type_id = 0; + + if (g_define_type_id == 0) { + static const GTypeInfo g_define_type_info = { + sizeof (PidginMiniDialogClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pidgin_mini_dialog_class_intern_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (PidginMiniDialog), + 0, /* n_preallocs */ + (GInstanceInitFunc) pidgin_mini_dialog_init, + NULL, + }; + g_define_type_id = g_type_register_static (GTK_TYPE_VBOX, + "PidginMiniDialog", &g_define_type_info, 0); + } + + return g_define_type_id; } -enum -{ - PROP_TITLE = 1, - PROP_DESCRIPTION, - PROP_ICON_NAME, +enum { + PROP_TITLE = 1, + PROP_DESCRIPTION, + PROP_ICON_NAME, - LAST_PROPERTY + LAST_PROPERTY } HazeConnectionProperties; -typedef struct _PidginMiniDialogPrivate -{ - GtkImage *icon; - GtkBox *title_box; - GtkLabel *title; - GtkLabel *desc; - GtkBox *buttons; +typedef struct _PidginMiniDialogPrivate { + GtkImage *icon; + GtkBox *title_box; + GtkLabel *title; + GtkLabel *desc; + GtkBox *buttons; - guint idle_destroy_cb_id; + guint idle_destroy_cb_id; } PidginMiniDialogPrivate; #define PIDGIN_MINI_DIALOG_GET_PRIVATE(dialog) \ ((PidginMiniDialogPrivate *) ((dialog)->priv)) PidginMiniDialog * -pidgin_mini_dialog_new(const gchar *title, - const gchar *description, - const gchar *icon_name) +pidgin_mini_dialog_new (const gchar *title, + const gchar *description, + const gchar *icon_name) { - PidginMiniDialog *mini_dialog = g_object_new(PIDGIN_TYPE_MINI_DIALOG, - "title", title, - "description", description, - "icon-name", icon_name, - NULL); + PidginMiniDialog *mini_dialog = g_object_new (PIDGIN_TYPE_MINI_DIALOG, + "title", title, + "description", description, + "icon-name", icon_name, + NULL); - return mini_dialog; + return mini_dialog; } void -pidgin_mini_dialog_set_title(PidginMiniDialog *mini_dialog, - const char *title) +pidgin_mini_dialog_set_title (PidginMiniDialog *mini_dialog, + const char *title) { - g_object_set(G_OBJECT(mini_dialog), "title", title, NULL); + g_object_set (G_OBJECT (mini_dialog), "title", title, NULL); } void -pidgin_mini_dialog_set_description(PidginMiniDialog *mini_dialog, - const char *description) +pidgin_mini_dialog_set_description (PidginMiniDialog *mini_dialog, + const char *description) { - g_object_set(G_OBJECT(mini_dialog), "description", description, NULL); + g_object_set (G_OBJECT (mini_dialog), "description", description, NULL); } void -pidgin_mini_dialog_set_icon_name(PidginMiniDialog *mini_dialog, - const char *icon_name) +pidgin_mini_dialog_set_icon_name (PidginMiniDialog *mini_dialog, + const char *icon_name) { - g_object_set(G_OBJECT(mini_dialog), "icon_name", icon_name, NULL); + g_object_set (G_OBJECT (mini_dialog), "icon_name", icon_name, NULL); } -struct _mini_dialog_button_clicked_cb_data -{ - PidginMiniDialog *mini_dialog; - PidginMiniDialogCallback callback; - gpointer user_data; +struct _mini_dialog_button_clicked_cb_data { + PidginMiniDialog *mini_dialog; + PidginMiniDialogCallback callback; + gpointer user_data; }; guint -pidgin_mini_dialog_get_num_children(PidginMiniDialog *mini_dialog) +pidgin_mini_dialog_get_num_children (PidginMiniDialog *mini_dialog) { - return g_list_length(mini_dialog->contents->children); + return g_list_length (mini_dialog->contents->children); } static gboolean -idle_destroy_cb(GtkWidget *mini_dialog) +idle_destroy_cb (GtkWidget *mini_dialog) { - gtk_widget_destroy(mini_dialog); - return FALSE; + gtk_widget_destroy (mini_dialog); + return FALSE; } static void -mini_dialog_button_clicked_cb(GtkButton *button, - gpointer user_data) +mini_dialog_button_clicked_cb (GtkButton *button, + gpointer user_data) { - struct _mini_dialog_button_clicked_cb_data *data = user_data; - PidginMiniDialogPrivate *priv = - PIDGIN_MINI_DIALOG_GET_PRIVATE(data->mini_dialog); + struct _mini_dialog_button_clicked_cb_data *data = user_data; + PidginMiniDialogPrivate *priv = + PIDGIN_MINI_DIALOG_GET_PRIVATE (data->mini_dialog); - /* Set up the destruction callback before calling the clicked callback, - * so that if the mini-dialog gets destroyed during the clicked callback - * the idle_destroy_cb is correctly removed by _finalize. - */ - priv->idle_destroy_cb_id = - g_idle_add((GSourceFunc) idle_destroy_cb, data->mini_dialog); + /* Set up the destruction callback before calling the clicked callback, + * so that if the mini-dialog gets destroyed during the clicked callback + * the idle_destroy_cb is correctly removed by _finalize. + */ + priv->idle_destroy_cb_id = + g_idle_add ( (GSourceFunc) idle_destroy_cb, data->mini_dialog); - if (data->callback != NULL) - data->callback(data->mini_dialog, button, data->user_data); + if (data->callback != NULL) + data->callback (data->mini_dialog, button, data->user_data); } static void -mini_dialog_button_destroy_cb(GtkButton *button, - gpointer user_data) +mini_dialog_button_destroy_cb (GtkButton *button, + gpointer user_data) { - struct _mini_dialog_button_clicked_cb_data *data = user_data; - g_free(data); + struct _mini_dialog_button_clicked_cb_data *data = user_data; + g_free (data); } void -pidgin_mini_dialog_add_button(PidginMiniDialog *self, - const char *text, - PidginMiniDialogCallback clicked_cb, - gpointer user_data) +pidgin_mini_dialog_add_button (PidginMiniDialog *self, + const char *text, + PidginMiniDialogCallback clicked_cb, + gpointer user_data) { - PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self); - struct _mini_dialog_button_clicked_cb_data *callback_data - = g_new0(struct _mini_dialog_button_clicked_cb_data, 1); - GtkWidget *button = gtk_button_new(); - GtkWidget *label = gtk_label_new(NULL); - char *button_text = - g_strdup_printf("<span size=\"smaller\">%s</span>", text); - - gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), button_text); - g_free(button_text); - - callback_data->mini_dialog = self; - callback_data->callback = clicked_cb; - callback_data->user_data = user_data; - g_signal_connect(G_OBJECT(button), "clicked", - (GCallback) mini_dialog_button_clicked_cb, callback_data); - g_signal_connect(G_OBJECT(button), "destroy", - (GCallback) mini_dialog_button_destroy_cb, callback_data); - - gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5); - gtk_container_add(GTK_CONTAINER(button), label); - - gtk_box_pack_end(GTK_BOX(priv->buttons), button, FALSE, FALSE, - 0); - gtk_widget_show_all(GTK_WIDGET(button)); + PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE (self); + struct _mini_dialog_button_clicked_cb_data *callback_data + = g_new0 (struct _mini_dialog_button_clicked_cb_data, 1); + GtkWidget *button = gtk_button_new(); + GtkWidget *label = gtk_label_new (NULL); + char *button_text = + g_strdup_printf ("<span size=\"smaller\">%s</span>", text); + + gtk_label_set_markup_with_mnemonic (GTK_LABEL (label), button_text); + g_free (button_text); + + callback_data->mini_dialog = self; + callback_data->callback = clicked_cb; + callback_data->user_data = user_data; + g_signal_connect (G_OBJECT (button), "clicked", + (GCallback) mini_dialog_button_clicked_cb, callback_data); + g_signal_connect (G_OBJECT (button), "destroy", + (GCallback) mini_dialog_button_destroy_cb, callback_data); + + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); + gtk_container_add (GTK_CONTAINER (button), label); + + gtk_box_pack_end (GTK_BOX (priv->buttons), button, FALSE, FALSE, + 0); + gtk_widget_show_all (GTK_WIDGET (button)); } static void -pidgin_mini_dialog_get_property(GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) +pidgin_mini_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { - PidginMiniDialog *self = PIDGIN_MINI_DIALOG(object); - PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self); - - switch (property_id) { - case PROP_TITLE: - g_value_set_string(value, gtk_label_get_text(priv->title)); - break; - case PROP_DESCRIPTION: - g_value_set_string(value, gtk_label_get_text(priv->desc)); - break; - case PROP_ICON_NAME: - { - gchar *icon_name = NULL; - GtkIconSize size; - gtk_image_get_stock(priv->icon, &icon_name, &size); - g_value_set_string(value, icon_name); - break; - } - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + PidginMiniDialog *self = PIDGIN_MINI_DIALOG (object); + PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE (self); + + switch (property_id) { + case PROP_TITLE: + g_value_set_string (value, gtk_label_get_text (priv->title)); + break; + case PROP_DESCRIPTION: + g_value_set_string (value, gtk_label_get_text (priv->desc)); + break; + case PROP_ICON_NAME: { + gchar *icon_name = NULL; + GtkIconSize size; + gtk_image_get_stock (priv->icon, &icon_name, &size); + g_value_set_string (value, icon_name); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void -mini_dialog_set_title(PidginMiniDialog *self, - const char *title) +mini_dialog_set_title (PidginMiniDialog *self, + const char *title) { - PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self); + PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE (self); - char *title_esc = g_markup_escape_text(title, -1); - char *title_markup = g_strdup_printf( - "<span weight=\"bold\" size=\"smaller\">%s</span>", - title_esc ? title_esc : ""); + char *title_esc = g_markup_escape_text (title, -1); + char *title_markup = g_strdup_printf ( + "<span weight=\"bold\" size=\"smaller\">%s</span>", + title_esc ? title_esc : ""); - gtk_label_set_markup(priv->title, title_markup); + gtk_label_set_markup (priv->title, title_markup); - g_free(title_esc); - g_free(title_markup); + g_free (title_esc); + g_free (title_markup); } static void -mini_dialog_set_description(PidginMiniDialog *self, - const char *description) +mini_dialog_set_description (PidginMiniDialog *self, + const char *description) { - PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self); - if(description) - { - char *desc_esc = g_markup_escape_text(description, -1); - char *desc_markup = g_strdup_printf( - "<span size=\"smaller\">%s</span>", desc_esc); - - gtk_label_set_markup(priv->desc, desc_markup); - - g_free(desc_esc); - g_free(desc_markup); - - gtk_widget_show(GTK_WIDGET(priv->desc)); - g_object_set(G_OBJECT(priv->desc), "no-show-all", FALSE, NULL); - } - else - { - gtk_label_set_text(priv->desc, NULL); - gtk_widget_hide(GTK_WIDGET(priv->desc)); - /* make calling show_all() on the minidialog not affect desc - * even though it's packed inside it. - */ - g_object_set(G_OBJECT(priv->desc), "no-show-all", TRUE, NULL); - } + PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE (self); + + if (description) { + char *desc_esc = g_markup_escape_text (description, -1); + char *desc_markup = g_strdup_printf ( + "<span size=\"smaller\">%s</span>", desc_esc); + + gtk_label_set_markup (priv->desc, desc_markup); + + g_free (desc_esc); + g_free (desc_markup); + + gtk_widget_show (GTK_WIDGET (priv->desc)); + g_object_set (G_OBJECT (priv->desc), "no-show-all", FALSE, NULL); + } else { + gtk_label_set_text (priv->desc, NULL); + gtk_widget_hide (GTK_WIDGET (priv->desc)); + /* make calling show_all() on the minidialog not affect desc + * even though it's packed inside it. + */ + g_object_set (G_OBJECT (priv->desc), "no-show-all", TRUE, NULL); + } } static void -pidgin_mini_dialog_set_property(GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) +pidgin_mini_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { - PidginMiniDialog *self = PIDGIN_MINI_DIALOG(object); - PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self); - - switch (property_id) { - case PROP_TITLE: - mini_dialog_set_title(self, g_value_get_string(value)); - break; - case PROP_DESCRIPTION: - mini_dialog_set_description(self, g_value_get_string(value)); - break; - case PROP_ICON_NAME: - gtk_image_set_from_stock(priv->icon, g_value_get_string(value), - GTK_ICON_SIZE_BUTTON); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + PidginMiniDialog *self = PIDGIN_MINI_DIALOG (object); + PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE (self); + + switch (property_id) { + case PROP_TITLE: + mini_dialog_set_title (self, g_value_get_string (value)); + break; + case PROP_DESCRIPTION: + mini_dialog_set_description (self, g_value_get_string (value)); + break; + case PROP_ICON_NAME: + gtk_image_set_from_stock (priv->icon, g_value_get_string (value), + GTK_ICON_SIZE_BUTTON); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void -pidgin_mini_dialog_finalize(GObject *object) +pidgin_mini_dialog_finalize (GObject *object) { - PidginMiniDialog *self = PIDGIN_MINI_DIALOG(object); - PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self); + PidginMiniDialog *self = PIDGIN_MINI_DIALOG (object); + PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE (self); - if (priv->idle_destroy_cb_id) - g_source_remove(priv->idle_destroy_cb_id); + if (priv->idle_destroy_cb_id) + g_source_remove (priv->idle_destroy_cb_id); - g_free(priv); - self->priv = NULL; + g_free (priv); + self->priv = NULL; - G_OBJECT_CLASS (pidgin_mini_dialog_parent_class)->finalize (object); + G_OBJECT_CLASS (pidgin_mini_dialog_parent_class)->finalize (object); } static void -pidgin_mini_dialog_class_init(PidginMiniDialogClass *klass) +pidgin_mini_dialog_class_init (PidginMiniDialogClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS(klass); - GParamSpec *param_spec; - - object_class->get_property = pidgin_mini_dialog_get_property; - object_class->set_property = pidgin_mini_dialog_set_property; - object_class->finalize = pidgin_mini_dialog_finalize; - - param_spec = g_param_spec_string("title", "title", - "String specifying the mini-dialog's title", NULL, - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | - G_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_TITLE, param_spec); - - param_spec = g_param_spec_string("description", "description", - "Description text for the mini-dialog, if desired", NULL, - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | - G_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_DESCRIPTION, param_spec); - - param_spec = g_param_spec_string("icon-name", "icon-name", - "String specifying the Gtk stock name of the dialog's icon", - NULL, - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | - G_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_ICON_NAME, param_spec); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GParamSpec *param_spec; + + object_class->get_property = pidgin_mini_dialog_get_property; + object_class->set_property = pidgin_mini_dialog_set_property; + object_class->finalize = pidgin_mini_dialog_finalize; + + param_spec = g_param_spec_string ("title", "title", + "String specifying the mini-dialog's title", NULL, + G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_TITLE, param_spec); + + param_spec = g_param_spec_string ("description", "description", + "Description text for the mini-dialog, if desired", NULL, + G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_DESCRIPTION, param_spec); + + param_spec = g_param_spec_string ("icon-name", "icon-name", + "String specifying the Gtk stock name of the dialog's icon", + NULL, + G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_ICON_NAME, param_spec); } /* 16 is the width of the icon, due to PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL */ @@ -362,62 +357,62 @@ pidgin_mini_dialog_class_init(PidginMiniDialogClass *klass) (PIDGIN_PREFS_ROOT "/blist/width") static void -blist_width_changed_cb(const char *name, - gconstpointer val, - gpointer data) +blist_width_changed_cb (const char *name, + gconstpointer val, + gpointer data) { - PidginMiniDialog *self = PIDGIN_MINI_DIALOG(data); - PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self); - guint blist_width = GPOINTER_TO_INT(val); - guint label_width = LABEL_WIDTH; + PidginMiniDialog *self = PIDGIN_MINI_DIALOG (data); + PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE (self); + guint blist_width = GPOINTER_TO_INT (val); + guint label_width = LABEL_WIDTH; - gtk_widget_set_size_request(GTK_WIDGET(priv->title), label_width, -1); - gtk_widget_set_size_request(GTK_WIDGET(priv->desc), label_width, -1); + gtk_widget_set_size_request (GTK_WIDGET (priv->title), label_width, -1); + gtk_widget_set_size_request (GTK_WIDGET (priv->desc), label_width, -1); } static void -pidgin_mini_dialog_init(PidginMiniDialog *self) +pidgin_mini_dialog_init (PidginMiniDialog *self) { - GtkBox *self_box = GTK_BOX(self); - guint label_width = LABEL_WIDTH; + GtkBox *self_box = GTK_BOX (self); + guint label_width = LABEL_WIDTH; - PidginMiniDialogPrivate *priv = g_new0(PidginMiniDialogPrivate, 1); - self->priv = priv; + PidginMiniDialogPrivate *priv = g_new0 (PidginMiniDialogPrivate, 1); + self->priv = priv; - gtk_container_set_border_width(GTK_CONTAINER(self), HIG_BOX_SPACE); + gtk_container_set_border_width (GTK_CONTAINER (self), HIG_BOX_SPACE); - priv->title_box = GTK_BOX(gtk_hbox_new(FALSE, HIG_BOX_SPACE)); + priv->title_box = GTK_BOX (gtk_hbox_new (FALSE, HIG_BOX_SPACE)); - priv->icon = GTK_IMAGE(gtk_image_new()); - gtk_misc_set_alignment(GTK_MISC(priv->icon), 0, 0); + priv->icon = GTK_IMAGE (gtk_image_new()); + gtk_misc_set_alignment (GTK_MISC (priv->icon), 0, 0); - priv->title = GTK_LABEL(gtk_label_new(NULL)); - gtk_widget_set_size_request(GTK_WIDGET(priv->title), label_width, -1); - gtk_label_set_line_wrap(priv->title, TRUE); - gtk_label_set_selectable(priv->title, TRUE); - gtk_misc_set_alignment(GTK_MISC(priv->title), 0, 0); + priv->title = GTK_LABEL (gtk_label_new (NULL)); + gtk_widget_set_size_request (GTK_WIDGET (priv->title), label_width, -1); + gtk_label_set_line_wrap (priv->title, TRUE); + gtk_label_set_selectable (priv->title, TRUE); + gtk_misc_set_alignment (GTK_MISC (priv->title), 0, 0); - gtk_box_pack_start(priv->title_box, GTK_WIDGET(priv->icon), FALSE, FALSE, 0); - gtk_box_pack_start(priv->title_box, GTK_WIDGET(priv->title), TRUE, TRUE, 0); + gtk_box_pack_start (priv->title_box, GTK_WIDGET (priv->icon), FALSE, FALSE, 0); + gtk_box_pack_start (priv->title_box, GTK_WIDGET (priv->title), TRUE, TRUE, 0); - priv->desc = GTK_LABEL(gtk_label_new(NULL)); - gtk_widget_set_size_request(GTK_WIDGET(priv->desc), label_width, -1); - gtk_label_set_line_wrap(priv->desc, TRUE); - gtk_misc_set_alignment(GTK_MISC(priv->desc), 0, 0); - gtk_label_set_selectable(priv->desc, TRUE); - /* make calling show_all() on the minidialog not affect desc even though - * it's packed inside it. - */ - g_object_set(G_OBJECT(priv->desc), "no-show-all", TRUE, NULL); + priv->desc = GTK_LABEL (gtk_label_new (NULL)); + gtk_widget_set_size_request (GTK_WIDGET (priv->desc), label_width, -1); + gtk_label_set_line_wrap (priv->desc, TRUE); + gtk_misc_set_alignment (GTK_MISC (priv->desc), 0, 0); + gtk_label_set_selectable (priv->desc, TRUE); + /* make calling show_all() on the minidialog not affect desc even though + * it's packed inside it. + */ + g_object_set (G_OBJECT (priv->desc), "no-show-all", TRUE, NULL); - self->contents = GTK_BOX(gtk_vbox_new(FALSE, 0)); + self->contents = GTK_BOX (gtk_vbox_new (FALSE, 0)); - priv->buttons = GTK_BOX(gtk_hbox_new(FALSE, 0)); + priv->buttons = GTK_BOX (gtk_hbox_new (FALSE, 0)); - gtk_box_pack_start(self_box, GTK_WIDGET(priv->title_box), FALSE, FALSE, 0); - gtk_box_pack_start(self_box, GTK_WIDGET(priv->desc), FALSE, FALSE, 0); - gtk_box_pack_start(self_box, GTK_WIDGET(self->contents), TRUE, TRUE, 0); - gtk_box_pack_start(self_box, GTK_WIDGET(priv->buttons), FALSE, FALSE, 0); + gtk_box_pack_start (self_box, GTK_WIDGET (priv->title_box), FALSE, FALSE, 0); + gtk_box_pack_start (self_box, GTK_WIDGET (priv->desc), FALSE, FALSE, 0); + gtk_box_pack_start (self_box, GTK_WIDGET (self->contents), TRUE, TRUE, 0); + gtk_box_pack_start (self_box, GTK_WIDGET (priv->buttons), FALSE, FALSE, 0); - gtk_widget_show_all(GTK_WIDGET(self)); + gtk_widget_show_all (GTK_WIDGET (self)); } diff --git a/sflphone-client-gnome/src/widget/minidialog.h b/sflphone-client-gnome/src/widget/minidialog.h index 2b5e6a4d1c57b53e7561bd9d00fa19ee8569e3bc..55d83d9c0c93547bd8349b07b1d73f36c7e96ce2 100644 --- a/sflphone-client-gnome/src/widget/minidialog.h +++ b/sflphone-client-gnome/src/widget/minidialog.h @@ -77,23 +77,23 @@ G_BEGIN_DECLS * </dl> */ typedef struct { - GtkVBox parent; + GtkVBox parent; - /** A GtkVBox into which extra widgets for the dialog should be packed. - */ - GtkBox *contents; + /** A GtkVBox into which extra widgets for the dialog should be packed. + */ + GtkBox *contents; - gpointer priv; + gpointer priv; } PidginMiniDialog; /** The class of #PidginMiniDialog objects. */ typedef struct { - GtkBoxClass parent_class; + GtkBoxClass parent_class; - void (*_purple_reserved1) (void); - void (*_purple_reserved2) (void); - void (*_purple_reserved3) (void); - void (*_purple_reserved4) (void); + void (*_purple_reserved1) (void); + void (*_purple_reserved2) (void); + void (*_purple_reserved3) (void); + void (*_purple_reserved4) (void); } PidginMiniDialogClass; /** The type of a callback triggered by a button in a mini-dialog being pressed. @@ -103,8 +103,8 @@ typedef struct { * pidgin_mini_dialog_add_button() when the button was * created. */ -typedef void (*PidginMiniDialogCallback)(PidginMiniDialog *mini_dialog, - GtkButton *button, gpointer user_data); +typedef void (*PidginMiniDialogCallback) (PidginMiniDialog *mini_dialog, + GtkButton *button, gpointer user_data); /** Get the GType of #PidginMiniDialog. */ GType pidgin_mini_dialog_get_type (void); @@ -113,30 +113,30 @@ GType pidgin_mini_dialog_get_type (void); * with @c g_object_new() then setting each property yourself. * @return a new #PidginMiniDialog. */ -PidginMiniDialog *pidgin_mini_dialog_new(const gchar *title, - const gchar *description, const gchar *icon_name); +PidginMiniDialog *pidgin_mini_dialog_new (const gchar *title, + const gchar *description, const gchar *icon_name); /** Shortcut for setting a mini-dialog's title via GObject properties. * @param mini_dialog a mini-dialog * @param title the new title for @a mini_dialog */ -void pidgin_mini_dialog_set_title(PidginMiniDialog *mini_dialog, - const char *title); +void pidgin_mini_dialog_set_title (PidginMiniDialog *mini_dialog, + const char *title); /** Shortcut for setting a mini-dialog's description via GObject properties. * @param mini_dialog a mini-dialog * @param description the new description for @a mini_dialog, or @c NULL to * hide the description widget. */ -void pidgin_mini_dialog_set_description(PidginMiniDialog *mini_dialog, - const char *description); +void pidgin_mini_dialog_set_description (PidginMiniDialog *mini_dialog, + const char *description); /** Shortcut for setting a mini-dialog's icon via GObject properties. * @param mini_dialog a mini-dialog * @param icon_name the Gtk stock ID of an icon, or @c NULL for no icon. */ -void pidgin_mini_dialog_set_icon_name(PidginMiniDialog *mini_dialog, - const char *icon_name); +void pidgin_mini_dialog_set_icon_name (PidginMiniDialog *mini_dialog, + const char *icon_name); /** Adds a new button to a mini-dialog, and attaches the supplied callback to * its <tt>clicked</tt> signal. After a button is clicked, the dialog is @@ -147,15 +147,15 @@ void pidgin_mini_dialog_set_icon_name(PidginMiniDialog *mini_dialog, * @param user_data arbitrary data to pass to @a clicked_cb when it is * called. */ -void pidgin_mini_dialog_add_button(PidginMiniDialog *mini_dialog, - const char *text, PidginMiniDialogCallback clicked_cb, - gpointer user_data); +void pidgin_mini_dialog_add_button (PidginMiniDialog *mini_dialog, + const char *text, PidginMiniDialogCallback clicked_cb, + gpointer user_data); /** Gets the number of widgets packed into PidginMiniDialog.contents. * @param mini_dialog a mini-dialog * @return the number of widgets in @a mini_dialog->contents. */ -guint pidgin_mini_dialog_get_num_children(PidginMiniDialog *mini_dialog); +guint pidgin_mini_dialog_get_num_children (PidginMiniDialog *mini_dialog); G_END_DECLS diff --git a/sflphone-client-gnome/src/widget/webwidget.c b/sflphone-client-gnome/src/widget/webwidget.c index ae6dbf5fe2a019d02ce64f6b5a84badcebb27b69..e07d2b2f4a02f913c094861833329349ddae7846 100644 --- a/sflphone-client-gnome/src/widget/webwidget.c +++ b/sflphone-client-gnome/src/widget/webwidget.c @@ -31,36 +31,36 @@ #include <JavaScriptCore/JavaScript.h> -static void im_widget_init(IMWidget *im); -static void im_widget_class_init(IMWidgetClass *klass); +static void im_widget_init (IMWidget *im); +static void im_widget_class_init (IMWidgetClass *klass); GType im_widget_get_type (void) { - static GType im_widget_type = 0; + static GType im_widget_type = 0; - if (!im_widget_type) { - static const GTypeInfo im_widget_info = { - sizeof (IMWidgetClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) im_widget_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (IMWidget), - 0, - (GInstanceInitFunc) im_widget_init, - NULL /* value_table */ - }; + if (!im_widget_type) { + static const GTypeInfo im_widget_info = { + sizeof (IMWidgetClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) im_widget_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (IMWidget), + 0, + (GInstanceInitFunc) im_widget_init, + NULL /* value_table */ + }; - im_widget_type = g_type_register_static( - WEBKIT_TYPE_WEB_VIEW, - "IMWidget", - &im_widget_info, - 0); - } + im_widget_type = g_type_register_static ( + WEBKIT_TYPE_WEB_VIEW, + "IMWidget", + &im_widget_info, + 0); + } - return im_widget_type; + return im_widget_type; } static void @@ -71,17 +71,17 @@ im_widget_class_init (IMWidgetClass *klass) static void im_widget_init (IMWidget *im) { - /* Load our initial webpage on startup */ - webkit_web_view_open(WEBKIT_WEB_VIEW(im), "file://" DATA_DIR "/webkit/im.html"); + /* Load our initial webpage on startup */ + webkit_web_view_open (WEBKIT_WEB_VIEW (im), "file://" DATA_DIR "/webkit/im.html"); - /* Instantiate our local webkit related variables */ - im->web_frame = webkit_web_view_get_main_frame(WEBKIT_WEB_VIEW(im)); - im->js_context = webkit_web_frame_get_global_context(im->web_frame); - im->js_global = JSContextGetGlobalObject(im->js_context); + /* Instantiate our local webkit related variables */ + im->web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (im)); + im->js_context = webkit_web_frame_get_global_context (im->web_frame); + im->js_global = JSContextGetGlobalObject (im->js_context); } GtkWidget * im_widget_new() { - return GTK_WIDGET(g_object_new(IM_WIDGET_TYPE, NULL)); + return GTK_WIDGET (g_object_new (IM_WIDGET_TYPE, NULL)); } diff --git a/sflphone-client-gnome/src/widget/webwidget.h b/sflphone-client-gnome/src/widget/webwidget.h index d6fbb0987c1db5eadf52eaad10c22db4a88058b0..88def03efda834e998b414a2249723f99646f298 100644 --- a/sflphone-client-gnome/src/widget/webwidget.h +++ b/sflphone-client-gnome/src/widget/webwidget.h @@ -47,21 +47,21 @@ typedef struct _WebWidget WebWidget; typedef struct _WebWidgetClass WebWidgetClass; struct _WebWidget { - WebKitWebView parent_instance; + WebKitWebView parent_instance; - /* Private */ - WebKitWebFrame *web_frame; // Our web frame - JSGlobalContextRef js_context; // The frame's global JS context - JSObjectRef js_global; // The frame's global context JS object + /* Private */ + WebKitWebFrame *web_frame; // Our web frame + JSGlobalContextRef js_context; // The frame's global JS context + JSObjectRef js_global; // The frame's global context JS object }; struct _WebWidgetClass { - WebKitWebViewClass parent_class; + WebKitWebViewClass parent_class; }; -GType im_widget_get_type (void) G_GNUC_CONST; -GtkWidget *im_widget_new (void); +GType im_widget_get_type (void) G_GNUC_CONST; +GtkWidget *im_widget_new (void); G_END_DECLS