r2933 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Thu Sep 6 16:04:44 CEST 2007
Author: thomas
Date: 2007-09-06 16:04:43 +0200 (Thu, 06 Sep 2007)
New Revision: 2933
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
Log:
* src/moko-dialer.c: (on_keypad_dial_clicked): Inform user if dialer is busy
or network is not registered when attempting to dial
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-09-06 13:32:19 UTC (rev 2932)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-09-06 14:04:43 UTC (rev 2933)
@@ -1,5 +1,10 @@
2007-09-06 Thomas Wood <thomas at openedhand.com>
+ * src/moko-dialer.c: (on_keypad_dial_clicked): Inform user if dialer is busy
+ or network is not registered when attempting to dial
+
+2007-09-06 Thomas Wood <thomas at openedhand.com>
+
* src/moko-dialer.c: (moko_dialer_class_init), (moko_dialer_init):
- Add support for displaying GError messages
- Handle new GError in moko_gsmd_connection_set_antenna_power ()
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c 2007-09-06 13:32:19 UTC (rev 2932)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c 2007-09-06 14:04:43 UTC (rev 2933)
@@ -226,19 +226,57 @@
const gchar *number,
MokoDialer *dialer)
{
+ GtkWidget *dlg;
MokoDialerPrivate *priv;
MokoContactEntry *entry = NULL;
g_return_if_fail (MOKO_IS_DIALER (dialer));
priv = dialer->priv;
+
+ /* check current dialer state */
if (0 || priv->status != DIALER_STATUS_NORMAL)
{
+ gchar *strings[] = {
+ "Normal",
+ "Incoming Call",
+ "Dialing",
+ "Outgoing Call"
+ };
+ dlg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ "Cannot dial when dialer is busy.\nCurrent status = %s", strings[priv->status]);
+ gtk_dialog_run (GTK_DIALOG (dlg));
+ gtk_widget_destroy (dlg);
+
g_warning ("Cannot dial when dialer is busy: %d\n", priv->status);
+
return;
}
priv->status = DIALER_STATUS_DIALING;
+ /* check for network connection */
+ if (priv->registered != MOKO_GSMD_CONNECTION_NETREG_HOME
+ || priv->registered != MOKO_GSMD_CONNECTION_NETREG_ROAMING)
+ {
+ gchar *strings[] = {
+ "No Status",
+ "Home network registered",
+ "Waiting for network registration",
+ "Network registration denied",
+ "",
+ "Roaming network reigstered"
+ };
+
+ dlg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ "Not connected to network.\nCurrent status = %s ", strings[priv->registered]);
+ gtk_dialog_run (GTK_DIALOG (dlg));
+ gtk_widget_destroy (dlg);
+
+ /* no point continuing if we're not connected to a network! */
+ priv->status = DIALER_STATUS_NORMAL;
+ return;
+ }
+
entry = moko_contacts_lookup (moko_contacts_get_default (), number);
/* Prepare a voice journal entry */
More information about the commitlog
mailing list