Changeset 2384

Show
Ignore:
Timestamp:
07/04/07 17:36:17
Author:
pvanhoof
Message:

Dealing with the first connection status

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r2383 r2384  
     12007-07-04  Philip Van Hoof  <pvanhoof@gnome.org> 
     2 
     3        * Dealing with the first connection status of the device instance 
     4 
    152007-07-04  Murray Cumming  <murrayc@murrayc.com> 
    26 
  • trunk/docs/devel/reference/tmpl/tny-device.sgml

    r2332 r2384  
    2121<!-- ##### STRUCT TnyDevice ##### --> 
    2222<para> 
    23  
    2423</para> 
    2524 
  • trunk/libtinymail-camel/tny-camel-send-queue.c

    r2370 r2384  
    686686tny_camel_send_queue_flush (TnyCamelSendQueue *self) 
    687687{ 
    688         TnyCamelSendQueuePriv *priv; 
    689  
    690688        g_return_if_fail (TNY_IS_CAMEL_SEND_QUEUE(self)); 
    691  
    692         priv = TNY_CAMEL_SEND_QUEUE_GET_PRIVATE (self); 
    693  
    694         g_mutex_lock (priv->todo_lock); 
    695         { 
    696                 TnyFolder *outbox; 
    697                 TnyList *headers = tny_simple_list_new (); 
    698  
    699                 outbox = tny_send_queue_get_outbox (TNY_SEND_QUEUE (self)); 
    700                 if (outbox) 
    701                 { 
    702                         /* TODO handle and report errors here */ 
    703                         tny_folder_get_headers (outbox, headers, TRUE, NULL); 
    704                         priv->total = tny_list_get_length (headers); 
    705                         g_object_unref (G_OBJECT (headers)); 
    706  
    707                         if (priv->total >= 1) 
    708                                 create_worker (TNY_SEND_QUEUE (self)); 
    709  
    710                         g_object_unref (G_OBJECT (outbox)); 
    711                 } 
    712         } 
    713         g_mutex_unlock (priv->todo_lock); 
     689        create_worker (TNY_SEND_QUEUE (self)); 
    714690} 
    715691 
  • trunk/libtinymail-camel/tny-session-camel.c

    r2374 r2384  
    596596*/ 
    597597 
     598static gboolean 
     599after_one_second (gpointer data) 
     600{ 
     601        TnySessionCamel *self = data; 
     602        TnySessionCamelPriv *priv = self->priv; 
     603 
     604        if (priv->device && TNY_IS_DEVICE (priv->device) && tny_device_is_online (priv->device)) 
     605                connection_changed (priv->device, TRUE, self); 
     606 
     607        camel_object_unref (self); 
     608 
     609        return FALSE; 
     610} 
     611 
    598612/** 
    599613 * tny_session_camel_set_device: 
     
    625639                priv->prev_constat = TRUE; 
    626640                connection_changed (device, FALSE, self); 
    627  
    628         } 
     641        } else { 
     642                priv->prev_constat = FALSE; 
     643                camel_object_ref (self); 
     644                g_timeout_add (1000, after_one_second, self); 
     645        } 
     646 
    629647        return; 
    630648} 
  • trunk/libtinymail-gnome-desktop/tny-gnome-device.c

    r2299 r2384  
    186186        return; 
    187187} 
     188 
    188189 
    189190 
  • trunk/libtinymail-gpe/tny-gpe-device.c

    r2054 r2384  
    127127        return; 
    128128} 
    129  
    130129 
    131130 
  • trunk/libtinymail-maemo/tny-maemo-device.c

    r2054 r2384  
    115115 
    116116 
    117  
    118117/** 
    119118 * tny_maemo_device_new: 
     
    125124{ 
    126125        TnyMaemoDevice *self = g_object_new (TNY_TYPE_MAEMO_DEVICE, NULL); 
     126 
    127127 
    128128        return TNY_DEVICE (self); 
  • trunk/libtinymail-olpc/tny-olpc-device.c

    r2044 r2384  
    129129        return; 
    130130} 
    131  
    132131 
    133132 
  • trunk/libtinymail/tny-device.c

    r2335 r2384  
    192192 * while the status is forced with tny_device_force_online() or  
    193193 * tny_device_force_offline(). 
     194 * 
     195 * Implementors must make sure that the emissions of this signal always  
     196 * happen in the mainloop. 
    194197 */ 
    195198                tny_device_signals[TNY_DEVICE_CONNECTION_CHANGED] = 
  • trunk/tests/c-demo/tny-demoui-summary-view.c

    r2301 r2384  
    193193 
    194194 
     195static GtkWidget *rem_dialog = NULL; 
     196 
    195197typedef struct 
    196198{ 
     
    220222 
    221223        gtk_widget_destroy (GTK_WIDGET (dialog)); 
     224        rem_dialog = NULL; 
     225 
    222226        g_slice_free (OnResponseInfo, info); 
    223227} 
     
    231235                        err->message, tny_header_get_subject (header)); 
    232236                OnResponseInfo *info = g_slice_new (OnResponseInfo); 
    233                 GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, 
    234                         GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO, str); 
    235                 g_free (str); 
    236                 info->self = g_object_ref (user_data); 
    237                 info->header = g_object_ref (header); 
    238                 g_signal_connect (G_OBJECT (dialog), "response", 
    239                         G_CALLBACK (on_response), info); 
    240                 gtk_widget_show_all (dialog); 
     237 
     238                if (!rem_dialog) 
     239                { 
     240                        rem_dialog = gtk_message_dialog_new (NULL, 0, 
     241                                GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO, str); 
     242                        g_free (str); 
     243                        info->self = g_object_ref (user_data); 
     244                        info->header = g_object_ref (header); 
     245                        g_signal_connect (G_OBJECT (rem_dialog), "response", 
     246                                G_CALLBACK (on_response), info); 
     247                        gtk_widget_show_all (rem_dialog); 
     248                } 
    241249        } 
    242250        return;