+ SMS.row_i = 0;
+ g_slist_foreach (phoneMonitor.sms.messages, InsertInboxElement, (gpointer) NULL);
+
+ gtk_clist_sort (GTK_CLIST (SMS.smsClist));
+ gtk_clist_thaw (GTK_CLIST (SMS.smsClist));
+}
+
+
+static void InsertOutboxElement (gpointer d, gpointer userData)
+{
+ GSM_SMSMessage *data = (GSM_SMSMessage *) d;
+ MessagePointers *msgPtrs;
+
+ if (data->Type == GST_MO)
+ {
+ gchar *row[4];
+
+ if (data->Status)
+ row[0] = g_strdup (_("sent"));
+ else
+ row[0] = g_strdup (_("unsent"));
+
+ row[1] = g_strdup (""); /* time */
+
+ row[2] = GUI_GetName (data->Destination);
+ if (row[2] == NULL)
+ row[2] = data->Destination;
+
+ row[3] = data->MessageText;
+
+ gtk_clist_append( GTK_CLIST (SMS.smsClist), row);
+ msgPtrs = (MessagePointers *) g_malloc (sizeof (MessagePointers));
+ msgPtrs->count = msgPtrs->number = 1;
+ msgPtrs->validity = data->Validity;
+ msgPtrs->class = data->Class;
+ msgPtrs->sender[0]='\0';
+ strcpy (msgPtrs->destination, data->Destination);
+ msgPtrs->msgPtr = (gint *) g_malloc (sizeof (gint));
+ *(msgPtrs->msgPtr) = data->MessageNumber;
+ gtk_clist_set_row_data_full (GTK_CLIST (SMS.smsClist), SMS.row_i++,
+ msgPtrs, DestroyMsgPtrs);