Changeset 3323


Ignore:
Timestamp:
11/01/07 17:48:28 (6 years ago)
Author:
thomas
Message:
  • src/phone-kit/moko-dialer.c: (moko_dialer_class_init),

(dialer_display_error), (moko_dialer_init): Reimplement dial out function

Location:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog

    r3322 r3323  
     12007-11-01  Thomas Wood  <thomas@openedhand.com> 
     2 
     3        * src/phone-kit/moko-dialer.c: (moko_dialer_class_init), 
     4        (dialer_display_error), (moko_dialer_init): Reimplement dial out function 
     5 
    162007-11-01  Thomas Wood  <thomas@openedhand.com> 
    27 
  • trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer.c

    r3314 r3323  
    9797moko_dialer_dial (MokoDialer *dialer, const gchar *number, GError *error) 
    9898{ 
    99   MokoDialerPrivate *priv; 
     99  GtkWidget *dlg; 
     100  MokoDialerPrivate *priv; 
     101  MokoContactEntry *entry = NULL; 
    100102 
    101103  g_return_val_if_fail (MOKO_IS_DIALER (dialer), FALSE); 
     
    103105  priv = dialer->priv; 
    104106 
    105   /* FIXME: Dial the number! */ 
     107  g_debug ("Received dial request: %s", number); 
     108 
     109  /* check current dialer state */ 
     110  if (0 || priv->status != DIALER_STATUS_NORMAL) 
     111  { 
     112    gchar *strings[] = { 
     113      "Normal", 
     114      "Incoming Call", 
     115      "Dialing", 
     116      "Outgoing Call" 
     117    }; 
     118    dlg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, 
     119        "Cannot dial when dialer is busy.\nCurrent status = %s", strings[priv->status]); 
     120    gtk_dialog_run (GTK_DIALOG (dlg)); 
     121    gtk_widget_destroy (dlg); 
     122 
     123    g_warning ("Cannot dial when dialer is busy: %d\n", priv->status); 
     124 
     125    return; 
     126  } 
     127  priv->status = DIALER_STATUS_DIALING; 
     128 
     129  /* check for network connection */ 
     130  if (priv->registered != MOKO_GSMD_CONNECTION_NETREG_HOME 
     131      && priv->registered != MOKO_GSMD_CONNECTION_NETREG_ROAMING 
     132      && priv->registered != MOKO_GSMD_CONNECTION_NETREG_DENIED) 
     133  { 
     134    gchar *strings[] = { 
     135      "None", 
     136      "Home network registered", 
     137      "Waiting for network registration", 
     138      "Network registration denied", 
     139      "", 
     140      "Roaming network registered" 
     141    }; 
     142 
     143    dlg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, 
     144        "Not connected to network.\nCurrent status = %s ", strings[priv->registered]); 
     145    gtk_dialog_run (GTK_DIALOG (dlg)); 
     146    gtk_widget_destroy (dlg); 
     147 
     148    /* no point continuing if we're not connected to a network! */ 
     149    priv->status = DIALER_STATUS_NORMAL; 
     150    return; 
     151  } 
     152 
     153  entry = moko_contacts_lookup (moko_contacts_get_default (), number); 
     154 
     155  /* Prepare a voice journal entry */ 
     156  if (priv->journal) 
     157  { 
     158    priv->entry = moko_journal_entry_new (VOICE_JOURNAL_ENTRY); 
     159    priv->time = moko_time_new_today (); 
     160    moko_journal_entry_set_direction (priv->entry, DIRECTION_IN); 
     161    moko_journal_entry_set_dtstart (priv->entry, priv->time); 
     162    moko_journal_entry_set_source (priv->entry, "Openmoko Dialer"); 
     163    moko_journal_voice_info_set_distant_number (priv->entry, number); 
     164    if (entry && entry->contact->uid) 
     165      moko_journal_entry_set_contact_uid (priv->entry, entry->contact->uid); 
     166  } 
     167  moko_talking_outgoing_call (MOKO_TALKING (priv->talking), number, entry); 
     168 
     169 
    106170 
    107171  return TRUE; 
     
    594658dialer_display_error (GError *err) 
    595659{ 
    596   GtkWidget *dlg; 
     660  /* GtkWidget *dlg; */ 
    597661 
    598662  if (!err) 
    599663    return; 
    600  
     664  /* 
    601665  dlg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "Dialer: %s", err->message); 
    602666  gtk_dialog_run (GTK_DIALOG (dlg)); 
    603667  gtk_widget_destroy (dlg); 
     668  */ 
     669  g_warning (err->message); 
    604670} 
    605671 
Note: See TracChangeset for help on using the changeset viewer.