Adding support for contact deletion

This commit is contained in:
Pierre Pronchery 2011-08-21 00:43:35 +00:00
parent e9da2f8904
commit af22de5f89
6 changed files with 145 additions and 82 deletions

View File

@ -70,10 +70,12 @@ typedef enum _ModemCallType
typedef enum _ModemContactStatus typedef enum _ModemContactStatus
{ {
MODEM_CONTACT_STATUS_OFFLINE = 0, MODEM_CONTACT_STATUS_OFFLINE = 0,
MODEM_CONTACT_STATUS_ONLINE,
MODEM_CONTACT_STATUS_AWAY, MODEM_CONTACT_STATUS_AWAY,
MODEM_CONTACT_STATUS_IDLE MODEM_CONTACT_STATUS_IDLE,
MODEM_CONTACT_STATUS_ONLINE
} ModemContactStatus; } ModemContactStatus;
# define MODEM_CONTACT_STATUS_LAST MODEM_CONTACT_STATUS_ONLINE
# define MODEM_CONTACT_STATUS_COUNT (MODEM_CONTACT_STATUS_LAST + 1)
typedef enum _ModemMessageEncoding typedef enum _ModemMessageEncoding
{ {
@ -331,6 +333,15 @@ typedef union _ModemRequest
unsigned int id; unsigned int id;
} contact, contact_delete; } contact, contact_delete;
/* MODEM_REQUEST_CONTACT_NEW */
struct
{
ModemRequestType type;
unsigned int id;
char const * name;
char const * number;
} contact_new;
/* MODEM_REQUEST_MESSAGE, MODEM_REQUEST_MESSAGE_DELETE */ /* MODEM_REQUEST_MESSAGE, MODEM_REQUEST_MESSAGE_DELETE */
struct struct
{ {

152
po/fr.po
View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Phone 0.0.0\n" "Project-Id-Version: Phone 0.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-21 02:10+0200\n" "POT-Creation-Date: 2011-08-21 02:42+0200\n"
"PO-Revision-Date: 2010-04-24 02:07+0200\n" "PO-Revision-Date: 2010-04-24 02:07+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n" "Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: DeforaOS development (French) <devel-fr@lists.defora.org>\n" "Language-Team: DeforaOS development (French) <devel-fr@lists.defora.org>\n"
@ -27,305 +27,305 @@ msgstr ""
" -m\tNom du greffon modem à charger\n" " -m\tNom du greffon modem à charger\n"
" -r\tDélai entre deux tentatives d'accès au modem (ms)\n" " -r\tDélai entre deux tentatives d'accès au modem (ms)\n"
#: ../src/phone.c:333 #: ../src/phone.c:336
msgid "All" msgid "All"
msgstr "Tous" msgstr "Tous"
#: ../src/phone.c:334 #: ../src/phone.c:337
msgid "Inbox" msgid "Inbox"
msgstr "Reçus" msgstr "Reçus"
#: ../src/phone.c:335 #: ../src/phone.c:338
msgid "Sent" msgid "Sent"
msgstr "Envoyés" msgstr "Envoyés"
#: ../src/phone.c:336 #: ../src/phone.c:339
msgid "Drafts" msgid "Drafts"
msgstr "Brouillons" msgstr "Brouillons"
#: ../src/phone.c:337 #: ../src/phone.c:340
msgid "Trash" msgid "Trash"
msgstr "Corbeille" msgstr "Corbeille"
#: ../src/phone.c:490 ../src/phone.c:2476 #: ../src/phone.c:508 ../src/phone.c:2506
msgid "System preferences" msgid "System preferences"
msgstr "Préférences système" msgstr "Préférences système"
#: ../src/phone.c:501 ../src/phone.c:1905 #: ../src/phone.c:519 ../src/phone.c:1935
msgid "Plug-ins" msgid "Plug-ins"
msgstr "Greffons" msgstr "Greffons"
#: ../src/phone.c:666 #: ../src/phone.c:684
#, c-format #, c-format
msgid "Checking %s..." msgid "Checking %s..."
msgstr "Vérification %s..." msgstr "Vérification %s..."
#: ../src/phone.c:729 #: ../src/phone.c:747
msgid "Delete this contact?" msgid "Delete this contact?"
msgstr "Supprimer ce contact?" msgstr "Supprimer ce contact?"
#: ../src/phone.c:1031 ../src/phone.c:1197 #: ../src/phone.c:1053 ../src/phone.c:1219
msgid "Delete this message?" msgid "Delete this message?"
msgstr "Supprimer ce message?" msgstr "Supprimer ce message?"
#: ../src/phone.c:1037 ../src/phone.c:1202 #: ../src/phone.c:1059 ../src/phone.c:1224
msgid "Deleting message..." msgid "Deleting message..."
msgstr "Suppression du message..." msgstr "Suppression du message..."
#: ../src/phone.c:1299 #: ../src/phone.c:1321
msgid "Unknown contact" msgid "Unknown contact"
msgstr "Contact inconnu" msgstr "Contact inconnu"
#: ../src/phone.c:1306 #: ../src/phone.c:1328
msgid "Unknown number" msgid "Unknown number"
msgstr "Numéro inconnu" msgstr "Numéro inconnu"
#: ../src/phone.c:1318 #: ../src/phone.c:1340
msgid "In conversation" msgid "In conversation"
msgstr "En conversation" msgstr "En conversation"
#: ../src/phone.c:1329 #: ../src/phone.c:1351
msgid "Incoming call" msgid "Incoming call"
msgstr "Appel entrant" msgstr "Appel entrant"
#: ../src/phone.c:1339 #: ../src/phone.c:1361
msgid "Outgoing call" msgid "Outgoing call"
msgstr "Appel sortant" msgstr "Appel sortant"
#: ../src/phone.c:1350 #: ../src/phone.c:1372
msgid "Call finished" msgid "Call finished"
msgstr "Appel terminé" msgstr "Appel terminé"
#: ../src/phone.c:1380 #: ../src/phone.c:1402
msgid "_Answer" msgid "_Answer"
msgstr "_Répondre" msgstr "_Répondre"
#: ../src/phone.c:1385 #: ../src/phone.c:1407
msgid "_Hangup" msgid "_Hangup"
msgstr "Ra_ccrocher" msgstr "Ra_ccrocher"
#: ../src/phone.c:1390 #: ../src/phone.c:1412
msgid "_Reject" msgid "_Reject"
msgstr "Re_jeter" msgstr "Re_jeter"
#: ../src/phone.c:1410 #: ../src/phone.c:1432
msgid "Loudspeaker" msgid "Loudspeaker"
msgstr "Haut-parleur" msgstr "Haut-parleur"
#: ../src/phone.c:1418 #: ../src/phone.c:1440
msgid "Mute microphone" msgid "Mute microphone"
msgstr "Couper le microphone" msgstr "Couper le microphone"
#: ../src/phone.c:1460 #: ../src/phone.c:1482
#, c-format #, c-format
msgid "Enter %s" msgid "Enter %s"
msgstr "Entrer %s" msgstr "Entrer %s"
#: ../src/phone.c:1503 #: ../src/phone.c:1525
msgid "Enter" msgid "Enter"
msgstr "Entrer" msgstr "Entrer"
#: ../src/phone.c:1505 #: ../src/phone.c:1527
msgid "Skip" msgid "Skip"
msgstr "Ignorer" msgstr "Ignorer"
#: ../src/phone.c:1533 #: ../src/phone.c:1555
msgid "Contacts" msgid "Contacts"
msgstr "Contacts" msgstr "Contacts"
#: ../src/phone.c:1539 ../src/phone.c:1650 ../src/phone.c:1686 #: ../src/phone.c:1561 ../src/phone.c:1680 ../src/phone.c:1716
#: ../src/phone.c:1801 ../src/phone.c:2157 #: ../src/phone.c:1831 ../src/phone.c:2187
msgid "Call" msgid "Call"
msgstr "Appeler" msgstr "Appeler"
#: ../src/phone.c:1545 #: ../src/phone.c:1567
msgid "Write" msgid "Write"
msgstr "Écrire" msgstr "Écrire"
#: ../src/phone.c:1579 ../src/phone.c:1936 ../src/phone.c:2268 #: ../src/phone.c:1609 ../src/phone.c:1966 ../src/phone.c:2298
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: ../src/phone.c:1625 #: ../src/phone.c:1655
msgid "Dialer" msgid "Dialer"
msgstr "Composer" msgstr "Composer"
#: ../src/phone.c:1652 #: ../src/phone.c:1682
msgid "Hang up" msgid "Hang up"
msgstr "Raccrocher" msgstr "Raccrocher"
#: ../src/phone.c:1680 #: ../src/phone.c:1710
msgid "Phone logs" msgid "Phone logs"
msgstr "Journal d'appels" msgstr "Journal d'appels"
#: ../src/phone.c:1692 #: ../src/phone.c:1722
msgid "Message" msgid "Message"
msgstr "Message" msgstr "Message"
#: ../src/phone.c:1723 #: ../src/phone.c:1753
msgid "Direction" msgid "Direction"
msgstr "Direction" msgstr "Direction"
#: ../src/phone.c:1728 ../src/phone.c:1847 #: ../src/phone.c:1758 ../src/phone.c:1877
msgid "To/From" msgid "To/From"
msgstr "Vers/De" msgstr "Vers/De"
#: ../src/phone.c:1734 ../src/phone.c:1855 #: ../src/phone.c:1764 ../src/phone.c:1885
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
#: ../src/phone.c:1795 #: ../src/phone.c:1825
msgid "Messages" msgid "Messages"
msgstr "Messages" msgstr "Messages"
#: ../src/phone.c:1806 #: ../src/phone.c:1836
msgid "New message" msgid "New message"
msgstr "Nouveau message" msgstr "Nouveau message"
#: ../src/phone.c:1812 ../src/phone.c:2163 #: ../src/phone.c:1842 ../src/phone.c:2193
msgid "Reply" msgid "Reply"
msgstr "Répondre" msgstr "Répondre"
#: ../src/phone.c:1924 #: ../src/phone.c:1954
msgid "Enabled" msgid "Enabled"
msgstr "Activé" msgstr "Activé"
#: ../src/phone.c:2151 #: ../src/phone.c:2181
msgid "Read message" msgid "Read message"
msgstr "Lire le message" msgstr "Lire le message"
#: ../src/phone.c:2169 #: ../src/phone.c:2199
msgid "Forward" msgid "Forward"
msgstr "Transmettre" msgstr "Transmettre"
#: ../src/phone.c:2243 #: ../src/phone.c:2273
msgid "Phone settings" msgid "Phone settings"
msgstr "Paramètres du téléphone" msgstr "Paramètres du téléphone"
#: ../src/phone.c:2320 #: ../src/phone.c:2350
msgid "missed calls" msgid "missed calls"
msgstr "appels manqués" msgstr "appels manqués"
#: ../src/phone.c:2320 #: ../src/phone.c:2350
msgid "missed call" msgid "missed call"
msgstr "appel manqué" msgstr "appel manqué"
#: ../src/phone.c:2329 #: ../src/phone.c:2359
msgid "new messages" msgid "new messages"
msgstr "nouveaux messages" msgstr "nouveaux messages"
#: ../src/phone.c:2330 #: ../src/phone.c:2360
msgid "new message" msgid "new message"
msgstr "nouveau message" msgstr "nouveau message"
#: ../src/phone.c:2348 ../src/phone.c:3253 ../src/phone.c:3257 #: ../src/phone.c:2378 ../src/phone.c:3283 ../src/phone.c:3287
msgid "Information" msgid "Information"
msgstr "Information" msgstr "Information"
#: ../src/phone.c:2358 #: ../src/phone.c:2388
msgid "Status" msgid "Status"
msgstr "État" msgstr "État"
#: ../src/phone.c:2382 #: ../src/phone.c:2412
msgid "_View" msgid "_View"
msgstr "_Vue" msgstr "_Vue"
#: ../src/phone.c:2401 #: ../src/phone.c:2431
msgid "_Read" msgid "_Read"
msgstr "_Lire" msgstr "_Lire"
#: ../src/phone.c:2502 #: ../src/phone.c:2532
msgid "Open file..." msgid "Open file..."
msgstr "Ouvrir fichier..." msgstr "Ouvrir fichier..."
#: ../src/phone.c:2688 #: ../src/phone.c:2718
msgid "Write message" msgid "Write message"
msgstr "Écrire un message" msgstr "Écrire un message"
#: ../src/phone.c:2694 #: ../src/phone.c:2724
msgid "Send" msgid "Send"
msgstr "Envoyer" msgstr "Envoyer"
#: ../src/phone.c:2700 #: ../src/phone.c:2730
msgid "Attach" msgid "Attach"
msgstr "Joindre" msgstr "Joindre"
#: ../src/phone.c:2816 #: ../src/phone.c:2846
msgid "Attach file..." msgid "Attach file..."
msgstr "Joindre un fichier..." msgstr "Joindre un fichier..."
#: ../src/phone.c:2887 #: ../src/phone.c:2917
#, c-format #, c-format
msgid "%d message%s, %d/%d characters" msgid "%d message%s, %d/%d characters"
msgstr "%d message%s, %d/%d caractères" msgstr "%d message%s, %d/%d caractères"
#: ../src/phone.c:2888 #: ../src/phone.c:2918
msgid "s" msgid "s"
msgstr "s" msgstr "s"
#: ../src/phone.c:2952 #: ../src/phone.c:2982
msgid "Sending message..." msgid "Sending message..."
msgstr "Envoi du message..." msgstr "Envoi du message..."
#: ../src/phone.c:2981 #: ../src/phone.c:3011
msgid "Outgoing" msgid "Outgoing"
msgstr "Sortant" msgstr "Sortant"
#: ../src/phone.c:3167 #: ../src/phone.c:3197
msgid "Operation in progress..." msgid "Operation in progress..."
msgstr "Opération en cours..." msgstr "Opération en cours..."
#: ../src/phone.c:3205 ../src/phone.c:3209 #: ../src/phone.c:3235 ../src/phone.c:3239
msgid "Question" msgid "Question"
msgstr "Question" msgstr "Question"
#: ../src/phone.c:3229 ../src/phone.c:3233 #: ../src/phone.c:3259 ../src/phone.c:3263
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../src/phone.c:3459 #: ../src/phone.c:3489
msgid "Name: " msgid "Name: "
msgstr "Nom: " msgstr "Nom: "
#: ../src/phone.c:3468 #: ../src/phone.c:3498
msgid "Number: " msgid "Number: "
msgstr "Numéro: " msgstr "Numéro: "
#: ../src/phone.c:3484 #: ../src/phone.c:3514
msgid "New contact" msgid "New contact"
msgstr "Nouveau contact" msgstr "Nouveau contact"
#: ../src/phone.c:3486 #: ../src/phone.c:3516
msgid "Edit contact: " msgid "Edit contact: "
msgstr "Modifier contact: " msgstr "Modifier contact: "
#: ../src/phone.c:3513 #: ../src/phone.c:3543
msgid "The name cannot be empty" msgid "The name cannot be empty"
msgstr "Le nom ne peut être vide" msgstr "Le nom ne peut être vide"
#: ../src/phone.c:3518 #: ../src/phone.c:3548
msgid "The number cannot be empty" msgid "The number cannot be empty"
msgstr "Le numéro ne peut être vide" msgstr "Le numéro ne peut être vide"
#: ../src/phone.c:3653 #: ../src/phone.c:3684
msgid "Message sent" msgid "Message sent"
msgstr "Message envoyé" msgstr "Message envoyé"
#: ../src/phone.c:3689 #: ../src/phone.c:3720
#, c-format #, c-format
msgid "Wrong %s" msgid "Wrong %s"
msgstr "Mauvais %s" msgstr "Mauvais %s"
#: ../src/phone.c:3696 #: ../src/phone.c:3727
#, c-format #, c-format
msgid "%s is valid" msgid "%s is valid"
msgstr "%s valide" msgstr "%s valide"
#: ../src/phone.c:3759 #: ../src/phone.c:3790
msgid "Raw data (not shown)" msgid "Raw data (not shown)"
msgstr "Données brutes (non affichées)" msgstr "Données brutes (non affichées)"
#: ../src/phone.c:3792 #: ../src/phone.c:3823
msgid "Message deleted" msgid "Message deleted"
msgstr "Message effacé" msgstr "Message effacé"

View File

@ -204,6 +204,11 @@ int modem_request_type(Modem * modem, ModemRequestType type, ...)
case MODEM_REQUEST_CONTACT: case MODEM_REQUEST_CONTACT:
request.contact.id = va_arg(ap, unsigned int); request.contact.id = va_arg(ap, unsigned int);
break; break;
case MODEM_REQUEST_CONTACT_NEW:
request.contact_new.id = va_arg(ap, unsigned int);
request.contact_new.name = va_arg(ap, char const *);
request.contact_new.number = va_arg(ap, char const *);
break;
case MODEM_REQUEST_CONTACT_DELETE: case MODEM_REQUEST_CONTACT_DELETE:
request.contact_delete.id = va_arg(ap, unsigned int); request.contact_delete.id = va_arg(ap, unsigned int);
break; break;

View File

@ -38,6 +38,7 @@ typedef struct _Debug
GtkWidget * message; GtkWidget * message;
/* events */ /* events */
ModemEvent event_contact;
ModemEvent event_message; ModemEvent event_message;
} Debug; } Debug;
@ -91,6 +92,7 @@ static int _debug_init(ModemPlugin * modem)
return -1; return -1;
modem->priv = debug; modem->priv = debug;
debug->source = 0; debug->source = 0;
memset(&debug->event_contact, 0, sizeof(debug->event_contact));
memset(&debug->event_message, 0, sizeof(debug->event_message)); memset(&debug->event_message, 0, sizeof(debug->event_message));
/* window */ /* window */
debug->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); debug->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@ -219,6 +221,8 @@ static gboolean _stop_on_idle(gpointer data)
/* debug_request */ /* debug_request */
static int _debug_request(ModemPlugin * modem, ModemRequest * request) static int _debug_request(ModemPlugin * modem, ModemRequest * request)
{ {
ModemPluginHelper * helper = modem->helper;
Debug * debug = modem->priv;
ModemEvent event; ModemEvent event;
if(request == NULL) if(request == NULL)
@ -226,10 +230,21 @@ static int _debug_request(ModemPlugin * modem, ModemRequest * request)
memset(&event, 0, sizeof(event)); memset(&event, 0, sizeof(event));
switch(request->type) switch(request->type)
{ {
case MODEM_REQUEST_CONTACT_NEW:
debug->event_contact.type = MODEM_EVENT_TYPE_CONTACT;
debug->event_contact.contact.id++;
debug->event_contact.contact.status
= rand() % MODEM_CONTACT_STATUS_COUNT;
debug->event_contact.contact.name
= request->contact_new.name;
debug->event_contact.contact.number
= request->contact_new.number;
helper->event(helper->modem, &debug->event_contact);
break;
case MODEM_REQUEST_MESSAGE_DELETE: case MODEM_REQUEST_MESSAGE_DELETE:
event.type = MODEM_EVENT_TYPE_MESSAGE_DELETED; event.type = MODEM_EVENT_TYPE_MESSAGE_DELETED;
event.message_deleted.id = request->message_delete.id; event.message_deleted.id = request->message_delete.id;
modem->helper->event(modem->helper->modem, &event); helper->event(helper->modem, &event);
break; break;
default: default:
break; break;

View File

@ -68,6 +68,8 @@ typedef enum _PhoneCallType
typedef enum _PhoneContactColumn typedef enum _PhoneContactColumn
{ {
PHONE_CONTACT_COLUMN_ID = 0, PHONE_CONTACT_COLUMN_ID = 0,
PHONE_CONTACT_COLUMN_STATUS,
PHONE_CONTACT_COLUMN_STATUS_DISPLAY,
PHONE_CONTACT_COLUMN_NAME, PHONE_CONTACT_COLUMN_NAME,
PHONE_CONTACT_COLUMN_NUMBER PHONE_CONTACT_COLUMN_NUMBER
} PhoneContactColumn; } PhoneContactColumn;
@ -182,6 +184,7 @@ struct _Phone
GtkWidget * co_window; GtkWidget * co_window;
GtkListStore * co_store; GtkListStore * co_store;
GtkWidget * co_view; GtkWidget * co_view;
GdkPixbuf * co_status[MODEM_CONTACT_STATUS_COUNT];
/* dialog */ /* dialog */
int co_index; int co_index;
GtkWidget * co_dialog; GtkWidget * co_dialog;
@ -350,6 +353,7 @@ Phone * phone_new(char const * plugin, int retry)
{ {
Phone * phone; Phone * phone;
char const * p; char const * p;
GtkIconTheme * icontheme;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: %s(%d)\n", __func__, retry); fprintf(stderr, "DEBUG: %s(%d)\n", __func__, retry);
@ -395,7 +399,21 @@ Phone * phone_new(char const * plugin, int retry)
phone->en_progress = NULL; phone->en_progress = NULL;
phone->co_window = NULL; phone->co_window = NULL;
phone->co_store = gtk_list_store_new(PHONE_CONTACT_COLUMN_COUNT, phone->co_store = gtk_list_store_new(PHONE_CONTACT_COLUMN_COUNT,
G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_PIXBUF,
G_TYPE_STRING, G_TYPE_STRING);
icontheme = gtk_icon_theme_get_default();
phone->co_status[MODEM_CONTACT_STATUS_AWAY]
= gtk_icon_theme_load_icon(icontheme, "user-away", 24,
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
phone->co_status[MODEM_CONTACT_STATUS_IDLE]
= gtk_icon_theme_load_icon(icontheme, "user-idle", 24,
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
phone->co_status[MODEM_CONTACT_STATUS_OFFLINE]
= gtk_icon_theme_load_icon(icontheme, "user-offline", 24,
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
phone->co_status[MODEM_CONTACT_STATUS_ONLINE]
= gtk_icon_theme_load_icon(icontheme, "user-online", 24,
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
phone->co_dialog = NULL; phone->co_dialog = NULL;
phone->di_window = NULL; phone->di_window = NULL;
phone->lo_window = NULL; phone->lo_window = NULL;
@ -766,7 +784,8 @@ void phone_contacts_new(Phone * phone)
/* phone_contacts_set */ /* phone_contacts_set */
void phone_contacts_set(Phone * phone, unsigned int index, char const * name, void phone_contacts_set(Phone * phone, unsigned int index,
ModemContactStatus status, char const * name,
char const * number) char const * number)
{ {
GtkTreeModel * model = GTK_TREE_MODEL(phone->co_store); GtkTreeModel * model = GTK_TREE_MODEL(phone->co_store);
@ -790,6 +809,9 @@ void phone_contacts_set(Phone * phone, unsigned int index, char const * name,
gtk_list_store_append(phone->co_store, &iter); gtk_list_store_append(phone->co_store, &iter);
gtk_list_store_set(phone->co_store, &iter, gtk_list_store_set(phone->co_store, &iter,
PHONE_CONTACT_COLUMN_ID, index, PHONE_CONTACT_COLUMN_ID, index,
PHONE_CONTACT_COLUMN_STATUS, status,
PHONE_CONTACT_COLUMN_STATUS_DISPLAY,
phone->co_status[status],
PHONE_CONTACT_COLUMN_NAME, name, PHONE_CONTACT_COLUMN_NAME, name,
PHONE_CONTACT_COLUMN_NUMBER, number, -1); PHONE_CONTACT_COLUMN_NUMBER, number, -1);
} }
@ -1575,6 +1597,14 @@ void phone_show_contacts(Phone * phone, gboolean show)
FALSE); FALSE);
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(phone->co_view), gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(phone->co_view),
TRUE); TRUE);
renderer = gtk_cell_renderer_pixbuf_new();
column = gtk_tree_view_column_new_with_attributes(NULL,
renderer, "pixbuf",
PHONE_CONTACT_COLUMN_STATUS_DISPLAY, NULL);
gtk_tree_view_column_set_sort_column_id(column,
PHONE_CONTACT_COLUMN_STATUS);
gtk_tree_view_append_column(GTK_TREE_VIEW(phone->co_view),
column);
renderer = gtk_cell_renderer_text_new(); renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Name"), column = gtk_tree_view_column_new_with_attributes(_("Name"),
renderer, "text", PHONE_CONTACT_COLUMN_NAME, renderer, "text", PHONE_CONTACT_COLUMN_NAME,
@ -3637,6 +3667,7 @@ static void _phone_modem_event(void * priv, ModemEvent * event)
break; break;
case MODEM_EVENT_TYPE_CONTACT: case MODEM_EVENT_TYPE_CONTACT:
phone_contacts_set(phone, event->contact.id, phone_contacts_set(phone, event->contact.id,
event->contact.status,
event->contact.name, event->contact.name,
event->contact.number); event->contact.number);
break; break;

View File

@ -49,7 +49,8 @@ void phone_contacts_call_selected(Phone * phone);
void phone_contacts_delete_selected(Phone * phone); void phone_contacts_delete_selected(Phone * phone);
void phone_contacts_edit_selected(Phone * phone); void phone_contacts_edit_selected(Phone * phone);
void phone_contacts_new(Phone * phone); void phone_contacts_new(Phone * phone);
void phone_contacts_set(Phone * phone, unsigned int index, char const * name, void phone_contacts_set(Phone * phone, unsigned int index,
ModemContactStatus status, char const * name,
char const * number); char const * number);
void phone_contacts_write_selected(Phone * phone); void phone_contacts_write_selected(Phone * phone);