Ironing bugs out
This commit is contained in:
parent
0a1136f569
commit
5c1abb94e2
@ -54,7 +54,6 @@ typedef enum _PhoneEventType
|
||||
PHONE_EVENT_TYPE_OFFLINE,
|
||||
PHONE_EVENT_TYPE_ONLINE,
|
||||
PHONE_EVENT_TYPE_RESUME,
|
||||
PHONE_EVENT_TYPE_SET_VOLUME,
|
||||
PHONE_EVENT_TYPE_SMS_RECEIVING, /* char const *, GSMEncoding *,
|
||||
char **, size_t * */
|
||||
PHONE_EVENT_TYPE_SMS_SENDING, /* char const *, GSMEncoding *,
|
||||
@ -66,7 +65,9 @@ typedef enum _PhoneEventType
|
||||
PHONE_EVENT_TYPE_STOPPING,
|
||||
PHONE_EVENT_TYPE_SUSPEND,
|
||||
PHONE_EVENT_TYPE_VIBRATOR_OFF,
|
||||
PHONE_EVENT_TYPE_VIBRATOR_ON
|
||||
PHONE_EVENT_TYPE_VIBRATOR_ON,
|
||||
PHONE_EVENT_TYPE_VOLUME_GET,
|
||||
PHONE_EVENT_TYPE_VOLUME_SET
|
||||
} PhoneEventType;
|
||||
|
||||
typedef union _PhoneEvent
|
||||
@ -80,12 +81,12 @@ typedef union _PhoneEvent
|
||||
ModemEvent * event;
|
||||
} modem_event;
|
||||
|
||||
/* PHONE_EVENT_TYPE_VOLUME_SET */
|
||||
/* PHONE_EVENT_TYPE_VOLUME_GET, PHONE_EVENT_TYPE_VOLUME_SET */
|
||||
struct
|
||||
{
|
||||
PhoneEventType type;
|
||||
double level;
|
||||
} volume_set;
|
||||
} volume_get, volume_set;
|
||||
} PhoneEvent;
|
||||
|
||||
typedef enum _PhoneMessage
|
||||
|
134
po/fr.po
134
po/fr.po
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Phone 0.0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-08-21 03:06+0200\n"
|
||||
"POT-Creation-Date: 2011-08-21 15:59+0200\n"
|
||||
"PO-Revision-Date: 2010-04-24 02:07+0200\n"
|
||||
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
|
||||
"Language-Team: DeforaOS development (French) <devel-fr@lists.defora.org>\n"
|
||||
@ -47,11 +47,11 @@ msgstr "Brouillons"
|
||||
msgid "Trash"
|
||||
msgstr "Corbeille"
|
||||
|
||||
#: ../src/phone.c:509 ../src/phone.c:2511
|
||||
#: ../src/phone.c:509 ../src/phone.c:2522
|
||||
msgid "System preferences"
|
||||
msgstr "Préférences système"
|
||||
|
||||
#: ../src/phone.c:520 ../src/phone.c:1940
|
||||
#: ../src/phone.c:520 ../src/phone.c:1951
|
||||
msgid "Plug-ins"
|
||||
msgstr "Greffons"
|
||||
|
||||
@ -72,260 +72,260 @@ msgstr "Supprimer ce message?"
|
||||
msgid "Deleting message..."
|
||||
msgstr "Suppression du message..."
|
||||
|
||||
#: ../src/phone.c:1326
|
||||
#: ../src/phone.c:1335
|
||||
msgid "Unknown contact"
|
||||
msgstr "Contact inconnu"
|
||||
|
||||
#: ../src/phone.c:1333
|
||||
#: ../src/phone.c:1342
|
||||
msgid "Unknown number"
|
||||
msgstr "Numéro inconnu"
|
||||
|
||||
#: ../src/phone.c:1345
|
||||
#: ../src/phone.c:1354
|
||||
msgid "In conversation"
|
||||
msgstr "En conversation"
|
||||
|
||||
#: ../src/phone.c:1356
|
||||
#: ../src/phone.c:1365
|
||||
msgid "Incoming call"
|
||||
msgstr "Appel entrant"
|
||||
|
||||
#: ../src/phone.c:1366
|
||||
#: ../src/phone.c:1375
|
||||
msgid "Outgoing call"
|
||||
msgstr "Appel sortant"
|
||||
|
||||
#: ../src/phone.c:1377
|
||||
#: ../src/phone.c:1386
|
||||
msgid "Call finished"
|
||||
msgstr "Appel terminé"
|
||||
|
||||
#: ../src/phone.c:1407
|
||||
#: ../src/phone.c:1418
|
||||
msgid "_Answer"
|
||||
msgstr "_Répondre"
|
||||
|
||||
#: ../src/phone.c:1412
|
||||
#: ../src/phone.c:1423
|
||||
msgid "_Hangup"
|
||||
msgstr "Ra_ccrocher"
|
||||
|
||||
#: ../src/phone.c:1417
|
||||
#: ../src/phone.c:1428
|
||||
msgid "_Reject"
|
||||
msgstr "Re_jeter"
|
||||
|
||||
#: ../src/phone.c:1437
|
||||
#: ../src/phone.c:1448
|
||||
msgid "Loudspeaker"
|
||||
msgstr "Haut-parleur"
|
||||
|
||||
#: ../src/phone.c:1445
|
||||
#: ../src/phone.c:1456
|
||||
msgid "Mute microphone"
|
||||
msgstr "Couper le microphone"
|
||||
|
||||
#: ../src/phone.c:1487
|
||||
#: ../src/phone.c:1498
|
||||
#, c-format
|
||||
msgid "Enter %s"
|
||||
msgstr "Entrer %s"
|
||||
|
||||
#: ../src/phone.c:1530
|
||||
#: ../src/phone.c:1541
|
||||
msgid "Enter"
|
||||
msgstr "Entrer"
|
||||
|
||||
#: ../src/phone.c:1532
|
||||
#: ../src/phone.c:1543
|
||||
msgid "Skip"
|
||||
msgstr "Ignorer"
|
||||
|
||||
#: ../src/phone.c:1560
|
||||
#: ../src/phone.c:1571
|
||||
msgid "Contacts"
|
||||
msgstr "Contacts"
|
||||
|
||||
#: ../src/phone.c:1566 ../src/phone.c:1685 ../src/phone.c:1721
|
||||
#: ../src/phone.c:1836 ../src/phone.c:2192
|
||||
#: ../src/phone.c:1577 ../src/phone.c:1696 ../src/phone.c:1732
|
||||
#: ../src/phone.c:1847 ../src/phone.c:2203
|
||||
msgid "Call"
|
||||
msgstr "Appeler"
|
||||
|
||||
#: ../src/phone.c:1572
|
||||
#: ../src/phone.c:1583
|
||||
msgid "Write"
|
||||
msgstr "Écrire"
|
||||
|
||||
#: ../src/phone.c:1614 ../src/phone.c:1971 ../src/phone.c:2303
|
||||
#: ../src/phone.c:1625 ../src/phone.c:1982 ../src/phone.c:2314
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#: ../src/phone.c:1660
|
||||
#: ../src/phone.c:1671
|
||||
msgid "Dialer"
|
||||
msgstr "Composer"
|
||||
|
||||
#: ../src/phone.c:1687
|
||||
#: ../src/phone.c:1698
|
||||
msgid "Hang up"
|
||||
msgstr "Raccrocher"
|
||||
|
||||
#: ../src/phone.c:1715
|
||||
#: ../src/phone.c:1726
|
||||
msgid "Phone logs"
|
||||
msgstr "Journal d'appels"
|
||||
|
||||
#: ../src/phone.c:1727
|
||||
#: ../src/phone.c:1738
|
||||
msgid "Message"
|
||||
msgstr "Message"
|
||||
|
||||
#: ../src/phone.c:1758
|
||||
#: ../src/phone.c:1769
|
||||
msgid "Direction"
|
||||
msgstr "Direction"
|
||||
|
||||
#: ../src/phone.c:1763 ../src/phone.c:1882
|
||||
#: ../src/phone.c:1774 ../src/phone.c:1893
|
||||
msgid "To/From"
|
||||
msgstr "Vers/De"
|
||||
|
||||
#: ../src/phone.c:1769 ../src/phone.c:1890
|
||||
#: ../src/phone.c:1780 ../src/phone.c:1901
|
||||
msgid "Date"
|
||||
msgstr "Date"
|
||||
|
||||
#: ../src/phone.c:1830
|
||||
#: ../src/phone.c:1841
|
||||
msgid "Messages"
|
||||
msgstr "Messages"
|
||||
|
||||
#: ../src/phone.c:1841
|
||||
#: ../src/phone.c:1852
|
||||
msgid "New message"
|
||||
msgstr "Nouveau message"
|
||||
|
||||
#: ../src/phone.c:1847 ../src/phone.c:2198
|
||||
#: ../src/phone.c:1858 ../src/phone.c:2209
|
||||
msgid "Reply"
|
||||
msgstr "Répondre"
|
||||
|
||||
#: ../src/phone.c:1959
|
||||
#: ../src/phone.c:1970
|
||||
msgid "Enabled"
|
||||
msgstr "Activé"
|
||||
|
||||
#: ../src/phone.c:2186
|
||||
#: ../src/phone.c:2197
|
||||
msgid "Read message"
|
||||
msgstr "Lire le message"
|
||||
|
||||
#: ../src/phone.c:2204
|
||||
#: ../src/phone.c:2215
|
||||
msgid "Forward"
|
||||
msgstr "Transmettre"
|
||||
|
||||
#: ../src/phone.c:2278
|
||||
#: ../src/phone.c:2289
|
||||
msgid "Phone settings"
|
||||
msgstr "Paramètres du téléphone"
|
||||
|
||||
#: ../src/phone.c:2355
|
||||
#: ../src/phone.c:2366
|
||||
msgid "missed calls"
|
||||
msgstr "appels manqués"
|
||||
|
||||
#: ../src/phone.c:2355
|
||||
#: ../src/phone.c:2366
|
||||
msgid "missed call"
|
||||
msgstr "appel manqué"
|
||||
|
||||
#: ../src/phone.c:2364
|
||||
#: ../src/phone.c:2375
|
||||
msgid "new messages"
|
||||
msgstr "nouveaux messages"
|
||||
|
||||
#: ../src/phone.c:2365
|
||||
#: ../src/phone.c:2376
|
||||
msgid "new message"
|
||||
msgstr "nouveau message"
|
||||
|
||||
#: ../src/phone.c:2383 ../src/phone.c:3288 ../src/phone.c:3292
|
||||
#: ../src/phone.c:2394 ../src/phone.c:3299 ../src/phone.c:3303
|
||||
msgid "Information"
|
||||
msgstr "Information"
|
||||
|
||||
#: ../src/phone.c:2393
|
||||
#: ../src/phone.c:2404
|
||||
msgid "Status"
|
||||
msgstr "État"
|
||||
|
||||
#: ../src/phone.c:2417
|
||||
#: ../src/phone.c:2428
|
||||
msgid "_View"
|
||||
msgstr "_Vue"
|
||||
|
||||
#: ../src/phone.c:2436
|
||||
#: ../src/phone.c:2447
|
||||
msgid "_Read"
|
||||
msgstr "_Lire"
|
||||
|
||||
#: ../src/phone.c:2537
|
||||
#: ../src/phone.c:2548
|
||||
msgid "Open file..."
|
||||
msgstr "Ouvrir fichier..."
|
||||
|
||||
#: ../src/phone.c:2723
|
||||
#: ../src/phone.c:2734
|
||||
msgid "Write message"
|
||||
msgstr "Écrire un message"
|
||||
|
||||
#: ../src/phone.c:2729
|
||||
#: ../src/phone.c:2740
|
||||
msgid "Send"
|
||||
msgstr "Envoyer"
|
||||
|
||||
#: ../src/phone.c:2735
|
||||
#: ../src/phone.c:2746
|
||||
msgid "Attach"
|
||||
msgstr "Joindre"
|
||||
|
||||
#: ../src/phone.c:2851
|
||||
#: ../src/phone.c:2862
|
||||
msgid "Attach file..."
|
||||
msgstr "Joindre un fichier..."
|
||||
|
||||
#: ../src/phone.c:2922
|
||||
#: ../src/phone.c:2933
|
||||
#, c-format
|
||||
msgid "%d message%s, %d/%d characters"
|
||||
msgstr "%d message%s, %d/%d caractères"
|
||||
|
||||
#: ../src/phone.c:2923
|
||||
#: ../src/phone.c:2934
|
||||
msgid "s"
|
||||
msgstr "s"
|
||||
|
||||
#: ../src/phone.c:2987
|
||||
#: ../src/phone.c:2998
|
||||
msgid "Sending message..."
|
||||
msgstr "Envoi du message..."
|
||||
|
||||
#: ../src/phone.c:3016
|
||||
#: ../src/phone.c:3027
|
||||
msgid "Outgoing"
|
||||
msgstr "Sortant"
|
||||
|
||||
#: ../src/phone.c:3202
|
||||
#: ../src/phone.c:3213
|
||||
msgid "Operation in progress..."
|
||||
msgstr "Opération en cours..."
|
||||
|
||||
#: ../src/phone.c:3240 ../src/phone.c:3244
|
||||
#: ../src/phone.c:3251 ../src/phone.c:3255
|
||||
msgid "Question"
|
||||
msgstr "Question"
|
||||
|
||||
#: ../src/phone.c:3264 ../src/phone.c:3268
|
||||
#: ../src/phone.c:3275 ../src/phone.c:3279
|
||||
msgid "Error"
|
||||
msgstr "Erreur"
|
||||
|
||||
#: ../src/phone.c:3494
|
||||
#: ../src/phone.c:3505
|
||||
msgid "Name: "
|
||||
msgstr "Nom: "
|
||||
|
||||
#: ../src/phone.c:3503
|
||||
#: ../src/phone.c:3514
|
||||
msgid "Number: "
|
||||
msgstr "Numéro: "
|
||||
|
||||
#: ../src/phone.c:3519
|
||||
#: ../src/phone.c:3530
|
||||
msgid "New contact"
|
||||
msgstr "Nouveau contact"
|
||||
|
||||
#: ../src/phone.c:3521
|
||||
#: ../src/phone.c:3532
|
||||
msgid "Edit contact: "
|
||||
msgstr "Modifier contact: "
|
||||
|
||||
#: ../src/phone.c:3548
|
||||
#: ../src/phone.c:3559
|
||||
msgid "The name cannot be empty"
|
||||
msgstr "Le nom ne peut être vide"
|
||||
|
||||
#: ../src/phone.c:3553
|
||||
#: ../src/phone.c:3564
|
||||
msgid "The number cannot be empty"
|
||||
msgstr "Le numéro ne peut être vide"
|
||||
|
||||
#: ../src/phone.c:3689
|
||||
#: ../src/phone.c:3700
|
||||
msgid "Message sent"
|
||||
msgstr "Message envoyé"
|
||||
|
||||
#: ../src/phone.c:3725
|
||||
#: ../src/phone.c:3736
|
||||
#, c-format
|
||||
msgid "Wrong %s"
|
||||
msgstr "Mauvais %s"
|
||||
|
||||
#: ../src/phone.c:3732
|
||||
#: ../src/phone.c:3743
|
||||
#, c-format
|
||||
msgid "%s is valid"
|
||||
msgstr "%s valide"
|
||||
|
||||
#: ../src/phone.c:3795
|
||||
#: ../src/phone.c:3806
|
||||
msgid "Raw data (not shown)"
|
||||
msgstr "Données brutes (non affichées)"
|
||||
|
||||
#: ../src/phone.c:3828
|
||||
#: ../src/phone.c:3839
|
||||
msgid "Message deleted"
|
||||
msgstr "Message effacé"
|
||||
|
||||
|
@ -33,6 +33,7 @@ typedef struct _Debug
|
||||
/* widgets */
|
||||
GtkWidget * window;
|
||||
GtkWidget * status;
|
||||
GtkWidget * operator;
|
||||
GtkWidget * number;
|
||||
GtkWidget * folder;
|
||||
GtkWidget * message;
|
||||
@ -57,6 +58,7 @@ static void _debug_set_status(ModemPlugin * modem, char const * status);
|
||||
/* callbacks */
|
||||
static gboolean _debug_on_closex(gpointer data);
|
||||
static void _debug_on_message_send(gpointer data);
|
||||
static void _debug_on_operator_set(gpointer data);
|
||||
|
||||
|
||||
/* public */
|
||||
@ -112,9 +114,20 @@ static int _debug_init(ModemPlugin * modem)
|
||||
gtk_misc_set_alignment(GTK_MISC(debug->status), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), debug->status, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
|
||||
/* operator */
|
||||
hbox = gtk_hbox_new(FALSE, 4);
|
||||
widget = gtk_label_new("Operator: ");
|
||||
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
|
||||
gtk_size_group_add_widget(group, widget);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
||||
debug->operator = gtk_entry_new();
|
||||
g_signal_connect_swapped(debug->operator, "activate", G_CALLBACK(
|
||||
_debug_on_operator_set), modem);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), debug->operator, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
|
||||
/* message */
|
||||
hbox = gtk_hbox_new(FALSE, 4);
|
||||
widget = gtk_label_new("Number:");
|
||||
widget = gtk_label_new("Number: ");
|
||||
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
|
||||
gtk_size_group_add_widget(group, widget);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
||||
@ -122,7 +135,7 @@ static int _debug_init(ModemPlugin * modem)
|
||||
gtk_box_pack_start(GTK_BOX(hbox), debug->number, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
|
||||
hbox = gtk_hbox_new(FALSE, 4);
|
||||
widget = gtk_label_new("Folder:");
|
||||
widget = gtk_label_new("Folder: ");
|
||||
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
|
||||
gtk_size_group_add_widget(group, widget);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
||||
@ -276,7 +289,7 @@ static gboolean _debug_on_closex(gpointer data)
|
||||
Debug * debug = modem->priv;
|
||||
|
||||
gtk_widget_hide(debug->window);
|
||||
/* FIXME tell the application we're closing */
|
||||
gtk_main_quit();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -309,3 +322,20 @@ static void _debug_on_message_send(gpointer data)
|
||||
modem->helper->event(modem->helper->modem, &debug->event_message);
|
||||
g_free(content);
|
||||
}
|
||||
|
||||
|
||||
/* debug_on_operator_set */
|
||||
static void _debug_on_operator_set(gpointer data)
|
||||
{
|
||||
ModemPlugin * modem = data;
|
||||
Debug * debug = modem->priv;
|
||||
ModemEvent event;
|
||||
char const * p;
|
||||
|
||||
memset(&event, 0, sizeof(event));
|
||||
p = gtk_entry_get_text(GTK_ENTRY(debug->operator));
|
||||
event.type = MODEM_EVENT_TYPE_REGISTRATION;
|
||||
event.registration.status = MODEM_REGISTRATION_STATUS_REGISTERED;
|
||||
event.registration._operator = p;
|
||||
modem->helper->event(modem->helper->modem, &event);
|
||||
}
|
||||
|
@ -1127,7 +1127,7 @@ static void _hayes_set_mode(ModemPlugin * modem, HayesMode mode)
|
||||
event = &hayes->events[MODEM_EVENT_TYPE_REGISTRATION];
|
||||
free(hayes->registration_media);
|
||||
hayes->registration_media = NULL;
|
||||
event->registration.media = hayes->registration_media;
|
||||
event->registration.media = NULL;
|
||||
/* reset modem */
|
||||
_hayes_reset(modem);
|
||||
break;
|
||||
|
19
src/phone.c
19
src/phone.c
@ -632,7 +632,7 @@ void phone_call_set_volume(Phone * phone, gdouble volume)
|
||||
PhoneEvent event;
|
||||
|
||||
memset(&event, 0, sizeof(event));
|
||||
event.type = PHONE_EVENT_TYPE_SET_VOLUME;
|
||||
event.type = PHONE_EVENT_TYPE_VOLUME_SET;
|
||||
event.volume_set.level = volume;
|
||||
phone_event(phone, &event);
|
||||
}
|
||||
@ -1301,6 +1301,7 @@ void phone_show_call(Phone * phone, gboolean show, ...)
|
||||
PhoneCall call;
|
||||
char const * name = NULL;
|
||||
char const * number = NULL;
|
||||
PhoneEvent event;
|
||||
|
||||
if(show == FALSE)
|
||||
{
|
||||
@ -1319,6 +1320,14 @@ void phone_show_call(Phone * phone, gboolean show, ...)
|
||||
if(phone->ca_window == NULL)
|
||||
_show_call_window(phone);
|
||||
phone_show_dialer(phone, FALSE);
|
||||
/* get the current volume */
|
||||
memset(&event, 0, sizeof(event));
|
||||
event.type = PHONE_EVENT_TYPE_VOLUME_GET;
|
||||
event.volume_get.level = gtk_range_get_value(GTK_RANGE(
|
||||
phone->ca_volume));
|
||||
if(phone_event(phone, &event) == 0)
|
||||
gtk_range_set_value(GTK_RANGE(phone->ca_volume),
|
||||
event.volume_get.level);
|
||||
if(name != NULL)
|
||||
{
|
||||
if(name[0] == '\0')
|
||||
@ -1394,6 +1403,8 @@ static void _show_call_window(Phone * phone)
|
||||
#if GTK_CHECK_VERSION(2, 6, 0)
|
||||
gtk_window_set_icon_name(GTK_WINDOW(phone->ca_window), "call-start");
|
||||
#endif
|
||||
g_signal_connect(phone->ca_window, "delete-event", G_CALLBACK(
|
||||
on_phone_closex), NULL);
|
||||
vbox = gtk_vbox_new(FALSE, 4);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
|
||||
/* party */
|
||||
@ -1429,8 +1440,8 @@ static void _show_call_window(Phone * phone)
|
||||
"audio-volume-muted", GTK_ICON_SIZE_BUTTON);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), phone->ca_image, FALSE, TRUE, 0);
|
||||
phone->ca_volume = gtk_hscale_new_with_range(0.0, 1.0, 0.02);
|
||||
g_signal_connect(G_OBJECT(phone->ca_volume), "value-changed",
|
||||
G_CALLBACK(on_phone_call_volume), phone);
|
||||
g_signal_connect(phone->ca_volume, "value-changed", G_CALLBACK(
|
||||
on_phone_call_volume), phone);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), phone->ca_volume, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
|
||||
/* speaker mode */
|
||||
@ -2433,7 +2444,7 @@ static void _show_status_window(Phone * phone)
|
||||
gtk_misc_set_alignment(GTK_MISC(phone->st_lmessages), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(phone->st_messages_box), phone->st_lmessages,
|
||||
TRUE, TRUE, 0);
|
||||
widget = _phone_create_button("stock_inbox", _("_Read"));
|
||||
widget = _phone_create_button("phone-inbox", _("_Read"));
|
||||
gtk_size_group_add_widget(group2, widget);
|
||||
g_signal_connect_swapped(G_OBJECT(widget), "clicked", G_CALLBACK(
|
||||
_status_on_messages_read), phone);
|
||||
|
@ -73,7 +73,7 @@ openmoko.so: $(openmoko_OBJS)
|
||||
|
||||
oss_OBJS = oss.o
|
||||
oss_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
|
||||
oss_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
||||
oss_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -lossaudio
|
||||
|
||||
oss.so: $(oss_OBJS)
|
||||
$(LD) -o oss.so $(oss_OBJS) $(oss_LDFLAGS)
|
||||
@ -168,6 +168,8 @@ install: $(TARGETS)
|
||||
$(MKDIR) $(DESTDIR)$(LIBDIR)/Phone/plugins
|
||||
$(INSTALL) -m 0644 -- openmoko.so $(DESTDIR)$(LIBDIR)/Phone/plugins/openmoko.so
|
||||
$(MKDIR) $(DESTDIR)$(LIBDIR)/Phone/plugins
|
||||
$(INSTALL) -m 0644 -- oss.so $(DESTDIR)$(LIBDIR)/Phone/plugins/oss.so
|
||||
$(MKDIR) $(DESTDIR)$(LIBDIR)/Phone/plugins
|
||||
$(INSTALL) -m 0644 -- panel.so $(DESTDIR)$(LIBDIR)/Phone/plugins/panel.so
|
||||
$(MKDIR) $(DESTDIR)$(LIBDIR)/Phone/plugins
|
||||
$(INSTALL) -m 0644 -- profiles.so $(DESTDIR)$(LIBDIR)/Phone/plugins/profiles.so
|
||||
@ -185,6 +187,7 @@ uninstall:
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/Phone/plugins/locker.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/Phone/plugins/n900.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/Phone/plugins/openmoko.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/Phone/plugins/oss.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/Phone/plugins/panel.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/Phone/plugins/profiles.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/Phone/plugins/smscrypt.so
|
||||
|
@ -67,7 +67,6 @@ static DebugPhoneEvents _debug_phone_events[] =
|
||||
{ PHONE_EVENT_TYPE_OFFLINE, "OFFLINE" },
|
||||
{ PHONE_EVENT_TYPE_ONLINE, "ONLINE" },
|
||||
{ PHONE_EVENT_TYPE_RESUME, "RESUME" },
|
||||
{ PHONE_EVENT_TYPE_SET_VOLUME, "SET_VOLUME" },
|
||||
{ PHONE_EVENT_TYPE_SMS_RECEIVING, "SMS_RECEIVING" },
|
||||
{ PHONE_EVENT_TYPE_SMS_SENDING, "SMS_SENDING" },
|
||||
{ PHONE_EVENT_TYPE_SMS_SENT, "SMS_SENT" },
|
||||
@ -77,6 +76,8 @@ static DebugPhoneEvents _debug_phone_events[] =
|
||||
{ PHONE_EVENT_TYPE_SUSPEND, "SUSPEND" },
|
||||
{ PHONE_EVENT_TYPE_VIBRATOR_OFF, "VIBRATOR_OFF" },
|
||||
{ PHONE_EVENT_TYPE_VIBRATOR_ON, "VIBRATOR_ON" },
|
||||
{ PHONE_EVENT_TYPE_VOLUME_GET, "VOLUME_GET" },
|
||||
{ PHONE_EVENT_TYPE_VOLUME_SET, "VOLUME_SET" },
|
||||
{ 0, NULL },
|
||||
};
|
||||
|
||||
|
@ -172,17 +172,6 @@ static int _openmoko_event(PhonePlugin * plugin, PhoneEvent * event)
|
||||
_openmoko_queue(plugin, "AT%CNIV=1");
|
||||
#endif
|
||||
break;
|
||||
#if 0
|
||||
case PHONE_EVENT_GET_VOLUME:
|
||||
va_start(ap, event);
|
||||
plevel = va_arg(ap, gdouble *);
|
||||
va_end(ap);
|
||||
_event_volume_get(plugin, plevel);
|
||||
break;
|
||||
#endif
|
||||
case PHONE_EVENT_TYPE_SET_VOLUME:
|
||||
_event_volume_set(plugin, event->volume_set.level);
|
||||
break;
|
||||
case PHONE_EVENT_TYPE_SPEAKER_ON:
|
||||
/* XXX assumes there's an ongoing call */
|
||||
_event_mixer_set(plugin, "gsmspeakerout.state");
|
||||
@ -215,6 +204,12 @@ static int _openmoko_event(PhonePlugin * plugin, PhoneEvent * event)
|
||||
case PHONE_EVENT_TYPE_VIBRATOR_ON:
|
||||
_event_vibrator(plugin, TRUE);
|
||||
break;
|
||||
case PHONE_EVENT_TYPE_VOLUME_GET:
|
||||
_event_volume_get(plugin, &event->volume_get.level);
|
||||
break;
|
||||
case PHONE_EVENT_TYPE_VOLUME_SET:
|
||||
_event_volume_set(plugin, event->volume_set.level);
|
||||
break;
|
||||
default: /* not relevant */
|
||||
break;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ static void _oss_settings(PhonePlugin * plugin);
|
||||
PhonePlugin plugin =
|
||||
{
|
||||
NULL,
|
||||
"Audio settings",
|
||||
"OSS audio",
|
||||
"audio-x-generic",
|
||||
_oss_init,
|
||||
_oss_destroy,
|
||||
@ -106,6 +106,7 @@ static int _oss_destroy(PhonePlugin * plugin)
|
||||
|
||||
/* oss_event */
|
||||
static int _event_modem_event(PhonePlugin * plugin, ModemEvent * event);
|
||||
static int _event_volume_get(PhonePlugin * plugin, gdouble * level);
|
||||
static int _event_volume_set(PhonePlugin * plugin, gdouble level);
|
||||
|
||||
static int _oss_event(PhonePlugin * plugin, PhoneEvent * event)
|
||||
@ -115,7 +116,10 @@ static int _oss_event(PhonePlugin * plugin, PhoneEvent * event)
|
||||
case PHONE_EVENT_TYPE_MODEM_EVENT:
|
||||
return _event_modem_event(plugin,
|
||||
event->modem_event.event);
|
||||
case PHONE_EVENT_TYPE_SET_VOLUME:
|
||||
case PHONE_EVENT_TYPE_VOLUME_GET:
|
||||
return _event_volume_get(plugin,
|
||||
&event->volume_get.level);
|
||||
case PHONE_EVENT_TYPE_VOLUME_SET:
|
||||
return _event_volume_set(plugin,
|
||||
event->volume_set.level);
|
||||
default: /* not relevant */
|
||||
@ -147,6 +151,26 @@ static int _event_modem_event(PhonePlugin * plugin, ModemEvent * event)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _event_volume_get(PhonePlugin * plugin, gdouble * level)
|
||||
{
|
||||
int ret = 0;
|
||||
OSS * oss = plugin->priv;
|
||||
int v;
|
||||
char buf[256];
|
||||
|
||||
if(oss->fd < 0)
|
||||
return 1;
|
||||
if(ioctl(oss->fd, MIXER_READ(SOUND_MIXER_VOLUME), &v) < 0)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s: %s", "MIXER_READ", strerror(
|
||||
errno));
|
||||
ret |= plugin->helper->error(plugin->helper->phone, buf, 0);
|
||||
}
|
||||
*level = (((v & 0xff00) >> 8) + (v & 0xff)) / 2;
|
||||
*level /= 100;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int _event_volume_set(PhonePlugin * plugin, gdouble level)
|
||||
{
|
||||
int ret = 0;
|
||||
@ -217,6 +241,7 @@ static void _oss_settings(PhonePlugin * plugin)
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
/* device */
|
||||
widget = gtk_label_new("Mixer device:");
|
||||
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
|
||||
widget = gtk_file_chooser_button_new("Set the mixer device",
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN);
|
||||
|
@ -68,7 +68,8 @@ depends=../../include/Phone.h
|
||||
[oss]
|
||||
type=plugin
|
||||
sources=oss.c
|
||||
#ldflags=-lossaudio
|
||||
ldflags=-lossaudio
|
||||
install=$(LIBDIR)/Phone/plugins
|
||||
|
||||
[oss.c]
|
||||
depends=../../include/Phone.h
|
||||
|
@ -168,6 +168,7 @@ static void _systray_on_popup_menu(GtkStatusIcon * icon, guint button,
|
||||
GtkWidget * menu;
|
||||
GtkWidget * menuitem;
|
||||
GtkWidget * hbox;
|
||||
GtkWidget * image;
|
||||
GtkWidget * label;
|
||||
struct
|
||||
{
|
||||
@ -184,7 +185,7 @@ static void _systray_on_popup_menu(GtkStatusIcon * icon, guint button,
|
||||
{ "stock_mail-compose", "_Write a message",
|
||||
_popup_menu_on_show_write },
|
||||
{ NULL, NULL, NULL },
|
||||
{ "gtk-preferences", "_Settings",
|
||||
{ "gtk-preferences", "_Preferences",
|
||||
_popup_menu_on_show_settings },
|
||||
{ NULL, NULL, NULL },
|
||||
{ "gtk-media-play-ltr", "_Resume telephony",
|
||||
@ -206,9 +207,9 @@ static void _systray_on_popup_menu(GtkStatusIcon * icon, guint button,
|
||||
continue;
|
||||
}
|
||||
hbox = gtk_hbox_new(FALSE, 4);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), gtk_image_new_from_icon_name(
|
||||
items[i].icon, GTK_ICON_SIZE_MENU),
|
||||
FALSE, FALSE, 0);
|
||||
image = gtk_image_new_from_icon_name(items[i].icon,
|
||||
GTK_ICON_SIZE_MENU),
|
||||
gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, TRUE, 0);
|
||||
label = gtk_label_new_with_mnemonic(items[i].name);
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user