r3477 - in trunk/src/target/OM-2007.2/applications/openmoko-messages2: . src
chris at sita.openmoko.org
chris at sita.openmoko.org
Thu Nov 22 15:06:51 CET 2007
Author: chris
Date: 2007-11-22 15:06:50 +0100 (Thu, 22 Nov 2007)
New Revision: 3477
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c
Log:
* src/sms-compose.c: (send_clicked_cb):
Check if message is NULL, only switch page back on successful send and
empty text entry after sending text
Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog 2007-11-22 12:55:16 UTC (rev 3476)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog 2007-11-22 14:06:50 UTC (rev 3477)
@@ -1,5 +1,11 @@
2007-11-22 Chris Lord <chris at openedhand.com>
+ * src/sms-compose.c: (send_clicked_cb):
+ Check if message is NULL, only switch page back on successful send and
+ empty text entry after sending text
+
+2007-11-22 Chris Lord <chris at openedhand.com>
+
* Makefile.am:
* configure.ac:
* data/Makefile.am:
Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c 2007-11-22 12:55:16 UTC (rev 3476)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c 2007-11-22 14:06:50 UTC (rev 3477)
@@ -168,7 +168,7 @@
message = gtk_text_buffer_get_text (
buffer, &start, &end, FALSE);
- if (message[0] != '\0') {
+ if (message && (message[0] != '\0')) {
g_debug ("Sending message '%s' to %s", message, number);
if (!dbus_g_proxy_call (data->sms_proxy, "Send", &error,
G_TYPE_STRING, number, G_TYPE_STRING, message,
@@ -177,6 +177,12 @@
g_warning ("Error sending message: %s",
error->message);
g_error_free (error);
+ } else {
+ /* Switch page back on successful send */
+ gtk_text_buffer_set_text (buffer, "", -1);
+ gtk_notebook_set_current_page (
+ GTK_NOTEBOOK (data->notebook),
+ SMS_PAGE_NOTES);
}
} else {
/* TODO: Error dialog for empty message */
@@ -188,9 +194,6 @@
}
g_object_unref (contact);
-
- gtk_notebook_set_current_page (
- GTK_NOTEBOOK (data->notebook), SMS_PAGE_NOTES);
}
GtkWidget *
More information about the commitlog
mailing list