Implemented copy & paste when writing messages (from the khorben-phone branch)

This commit is contained in:
Pierre Pronchery 2011-02-01 22:26:45 +00:00
parent ae1913bab4
commit 2003d7952b
4 changed files with 104 additions and 33 deletions

View File

@ -7,7 +7,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-01-14 20:48+0100\n" "POT-Creation-Date: 2011-02-01 23:22+0100\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: French\n" "Language-Team: French\n"
@ -205,6 +205,11 @@ msgid ""
" -r\tDelay between two tries to open and settle with the modem (ms)\n" " -r\tDelay between two tries to open and settle with the modem (ms)\n"
" -F\tEnable hardware flow control (RTS/CTS)\n" " -F\tEnable hardware flow control (RTS/CTS)\n"
msgstr "" msgstr ""
"Usage: phone [-b débit][-d noeud][-r délai][-F]\n"
" -b\tDébit à utiliser pour communiquer avec le modem\n"
" -d\tChemin vers le noeud d'accès au modem\n"
" -r\tDélai entre deux tentatives d'accès au modem (ms)\n"
" -F\tActiver le contrôle de flux matériel (RTS/CTS)\n"
#: ../src/phone.c:388 #: ../src/phone.c:388
msgid "Initializing..." msgid "Initializing..."
@ -373,11 +378,11 @@ msgstr "Paramètres du téléphone"
#: ../src/phone.c:2228 #: ../src/phone.c:2228
msgid "Phone device:" msgid "Phone device:"
msgstr "" msgstr "Noeud d'accès:"
#: ../src/phone.c:2230 #: ../src/phone.c:2230
msgid "Set the phone device" msgid "Set the phone device"
msgstr "" msgstr "Définir le noeud d'accès"
#: ../src/phone.c:2235 #: ../src/phone.c:2235
msgid "Enable flow control" msgid "Enable flow control"
@ -395,112 +400,112 @@ msgstr "Envoyer"
msgid "Attach" msgid "Attach"
msgstr "Attacher" msgstr "Attacher"
#: ../src/phone.c:2521 #: ../src/phone.c:2540
#, 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:2522 #: ../src/phone.c:2541
msgid "s" msgid "s"
msgstr "s" msgstr "s"
#: ../src/phone.c:2551 #: ../src/phone.c:2608
msgid "Sending message..." msgid "Sending message..."
msgstr "Envoi du message..." msgstr "Envoi du message..."
#: ../src/phone.c:2578 #: ../src/phone.c:2635
msgid "Outgoing" msgid "Outgoing"
msgstr "Sortant" msgstr "Sortant"
#: ../src/phone.c:2741 #: ../src/phone.c:2798
msgid "Operation in progress..." msgid "Operation in progress..."
msgstr "Opération en cours..." msgstr "Opération en cours..."
#: ../src/phone.c:2769 ../src/phone.c:2774 #: ../src/phone.c:2826 ../src/phone.c:2831
msgid "Question" msgid "Question"
msgstr "Question" msgstr "Question"
#: ../src/phone.c:2794 ../src/phone.c:2799 #: ../src/phone.c:2851 ../src/phone.c:2856
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../src/phone.c:2847 ../src/phone.c:2852 #: ../src/phone.c:2904 ../src/phone.c:2909
msgid "Information" msgid "Information"
msgstr "Information" msgstr "Information"
#: ../src/phone.c:2931 #: ../src/phone.c:2988
msgid "Unknown" msgid "Unknown"
msgstr "Inconnu" msgstr "Inconnu"
#: ../src/phone.c:2934 #: ../src/phone.c:2991
msgid "Registering..." msgid "Registering..."
msgstr "Enregistrement..." msgstr "Enregistrement..."
#: ../src/phone.c:2937 #: ../src/phone.c:2994
msgid "Denied" msgid "Denied"
msgstr "Refusé" msgstr "Refusé"
#: ../src/phone.c:2942 #: ../src/phone.c:2999
msgid "SIM check..." msgid "SIM check..."
msgstr "Vérification SIM..." msgstr "Vérification SIM..."
#: ../src/phone.c:2948 #: ../src/phone.c:3005
msgid "SIM ready..." msgid "SIM ready..."
msgstr "SIM prête..." msgstr "SIM prête..."
#: ../src/phone.c:3005 #: ../src/phone.c:3062
msgid "Name: " msgid "Name: "
msgstr "Nom: " msgstr "Nom: "
#: ../src/phone.c:3013 #: ../src/phone.c:3070
msgid "Number: " msgid "Number: "
msgstr "Numéro: " msgstr "Numéro: "
#: ../src/phone.c:3028 #: ../src/phone.c:3085
msgid "New contact" msgid "New contact"
msgstr "Nouveau contact" msgstr "Nouveau contact"
#: ../src/phone.c:3030 #: ../src/phone.c:3087
msgid "Edit contact: " msgid "Edit contact: "
msgstr "Modifier contact: " msgstr "Modifier contact: "
#: ../src/phone.c:3057 #: ../src/phone.c:3114
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:3062 #: ../src/phone.c:3119
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:3165 #: ../src/phone.c:3222
msgid "New message received" msgid "New message received"
msgstr "Nouveau message reçu" msgstr "Nouveau message reçu"
#: ../src/phone.c:3181 #: ../src/phone.c:3238
msgid "Message sent" msgid "Message sent"
msgstr "Message envoyé" msgstr "Message envoyé"
#: ../src/phone.c:3214 #: ../src/phone.c:3271
msgid "SIM PIN is valid" msgid "SIM PIN is valid"
msgstr "Code SIM PIN valide" msgstr "Code SIM PIN valide"
#: ../src/phone.c:3266 #: ../src/phone.c:3323
msgid "Could not request new message indications" msgid "Could not request new message indications"
msgstr "Impossible d'obtenir des notifications de nouveaux messages" msgstr "Impossible d'obtenir des notifications de nouveaux messages"
#: ../src/phone.c:3277 #: ../src/phone.c:3334
msgid "Could not send message" msgid "Could not send message"
msgstr "Le message n'a pas pu être envoyé" msgstr "Le message n'a pas pu être envoyé"
#: ../src/phone.c:3285 #: ../src/phone.c:3342
msgid "Wrong SIM PIN code" msgid "Wrong SIM PIN code"
msgstr "Code SIM PIN erroné" msgstr "Code SIM PIN erroné"
#: ../src/phone.c:3321 #: ../src/phone.c:3378
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:3336 #: ../src/phone.c:3393
msgid "Message deleted" msgid "Message deleted"
msgstr "Message supprimé" msgstr "Message supprimé"

View File

@ -439,21 +439,27 @@ void on_phone_write_changed(gpointer data)
/* on_phone_write_copy */ /* on_phone_write_copy */
void on_phone_write_copy(gpointer data) void on_phone_write_copy(gpointer data)
{ {
/* FIXME implement */ Phone * phone = data;
phone_write_copy(phone);
} }
/* on_phone_write_cut */ /* on_phone_write_cut */
void on_phone_write_cut(gpointer data) void on_phone_write_cut(gpointer data)
{ {
/* FIXME implement */ Phone * phone = data;
phone_write_cut(phone);
} }
/* on_phone_write_paste */ /* on_phone_write_paste */
void on_phone_write_paste(gpointer data) void on_phone_write_paste(gpointer data)
{ {
/* FIXME implement */ Phone * phone = data;
phone_write_paste(phone);
} }

View File

@ -2489,6 +2489,25 @@ void phone_unload_all(Phone * phone)
/* write */ /* write */
/* phone_write_copy */
void phone_write_copy(Phone * phone)
{
GtkTextBuffer * buffer;
GtkClipboard * clipboard;
if(gtk_window_get_focus(GTK_WINDOW(phone->wr_window))
== phone->wr_entry)
{
gtk_editable_copy_clipboard(GTK_EDITABLE(phone->wr_entry));
return;
}
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(phone->wr_view));
clipboard = gtk_widget_get_clipboard(phone->wr_view,
GDK_SELECTION_CLIPBOARD);
gtk_text_buffer_copy_clipboard(buffer, clipboard);
}
/* phone_write_count_buffer */ /* phone_write_count_buffer */
void phone_write_count_buffer(Phone * phone) void phone_write_count_buffer(Phone * phone)
{ {
@ -2524,6 +2543,44 @@ void phone_write_count_buffer(Phone * phone)
} }
/* phone_write_cut */
void phone_write_cut(Phone * phone)
{
GtkTextBuffer * buffer;
GtkClipboard * clipboard;
if(gtk_window_get_focus(GTK_WINDOW(phone->wr_window))
== phone->wr_entry)
{
gtk_editable_cut_clipboard(GTK_EDITABLE(phone->wr_entry));
return;
}
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(phone->wr_view));
clipboard = gtk_widget_get_clipboard(phone->wr_view,
GDK_SELECTION_CLIPBOARD);
gtk_text_buffer_cut_clipboard(buffer, clipboard, TRUE);
}
/* phone_write_paste */
void phone_write_paste(Phone * phone)
{
GtkTextBuffer * buffer;
GtkClipboard * clipboard;
if(gtk_window_get_focus(GTK_WINDOW(phone->wr_window))
== phone->wr_entry)
{
gtk_editable_paste_clipboard(GTK_EDITABLE(phone->wr_entry));
return;
}
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(phone->wr_view));
clipboard = gtk_widget_get_clipboard(phone->wr_view,
GDK_SELECTION_CLIPBOARD);
gtk_text_buffer_paste_clipboard(buffer, clipboard, NULL, TRUE);
}
/* phone_write_send */ /* phone_write_send */
void phone_write_send(Phone * phone) void phone_write_send(Phone * phone)
{ {

View File

@ -104,7 +104,10 @@ void phone_read_reply(Phone * phone);
void phone_settings_open_selected(Phone * phone); void phone_settings_open_selected(Phone * phone);
/* write */ /* write */
void phone_write_copy(Phone * phone);
void phone_write_count_buffer(Phone * phone); void phone_write_count_buffer(Phone * phone);
void phone_write_cut(Phone * phone);
void phone_write_paste(Phone * phone);
void phone_write_send(Phone * phone); void phone_write_send(Phone * phone);
#endif /* !PHONE_SRC_PHONE_H */ #endif /* !PHONE_SRC_PHONE_H */