Changeset 3658


Ignore:
Timestamp:
12/17/07 13:11:35 (5 years ago)
Author:
chris
Message:
  • src/sms-contacts.c: (delete_all_added_cb), (delete_all_progress_cb), (delete_all_clicked_cb): Implement delete-all functionality in the contacts view
  • src/sms.h: Remove unused variable
Location:
trunk/src/target/OM-2007.2/applications/openmoko-messages2
Files:
3 edited

Legend:

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

    r3653 r3658  
     12007-12-17  Chris Lord  <chris@openedhand.com> 
     2 
     3        * src/sms-contacts.c: (delete_all_added_cb), 
     4        (delete_all_progress_cb), (delete_all_clicked_cb): 
     5        Implement delete-all functionality in the contacts view 
     6 
     7        * src/sms.h: 
     8        Remove unused variable 
     9 
    1102007-12-14  Chris Lord  <chris@openedhand.com> 
    211 
  • trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-contacts.c

    r3653 r3658  
    254254 
    255255static void 
     256delete_all_added_cb (JanaStoreView *store_view, GList *components, 
     257                     SmsData *data) 
     258{ 
     259        for (; components; components = components->next) { 
     260                JanaComponent *comp = JANA_COMPONENT (components->data); 
     261                jana_store_remove_component ( 
     262                        jana_store_view_get_store (store_view), comp); 
     263        } 
     264} 
     265 
     266static void 
     267delete_all_progress_cb (JanaStoreView *store_view, gint percent, 
     268                        SmsData *data) 
     269{ 
     270        if (percent == 100) g_object_unref (store_view); 
     271} 
     272 
     273static void 
    256274delete_all_clicked_cb (GtkToolButton *button, SmsData *data) 
    257275{ 
     276        JanaStoreView *notes_view; 
     277        GtkWidget *dialog; 
     278        gint response; 
     279 
    258280        if (hidden) return; 
     281         
     282        dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (data->window), 
     283                GTK_DIALOG_MODAL, 
     284                GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, 
     285                "Delete <b>all</b> messages?"); 
     286        gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, 
     287                GTK_RESPONSE_CANCEL, GTK_STOCK_DELETE, GTK_RESPONSE_YES, NULL); 
     288         
     289        response = gtk_dialog_run (GTK_DIALOG (dialog)); 
     290        gtk_widget_destroy (dialog); 
     291        if (response != GTK_RESPONSE_YES) return; 
     292         
     293        /* Delete all messages */ 
     294        notes_view = jana_store_get_view (data->notes); 
     295        g_signal_connect (notes_view, "added", 
     296                G_CALLBACK (delete_all_added_cb), data); 
     297        g_signal_connect (notes_view, "progress", 
     298                G_CALLBACK (delete_all_progress_cb), data); 
     299        jana_store_view_start (notes_view); 
    259300} 
    260301 
  • trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms.h

    r3650 r3658  
    3636typedef struct { 
    3737        JanaStore *notes; 
    38         JanaStoreView *notes_view; 
    3938        GtkTreeModel *note_store; 
    4039        GtkTreeModel *note_filter; 
Note: See TracChangeset for help on using the changeset viewer.