Changeset 3918
- Timestamp:
- 01/22/08 16:07:45 (5 years ago)
- Location:
- trunk/src/target/OM-2007.2/applications/openmoko-messages2
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
src/sms-contacts.c (modified) (2 diffs)
-
src/sms-notes.c (modified) (2 diffs)
-
src/sms-utils.c (modified) (2 diffs)
-
src/sms-utils.h (modified) (1 diff)
-
src/sms.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
r3868 r3918 1 2008-01-22 Chris Lord <chris@openedhand.com> 2 3 * src/sms.h: 4 * src/sms-contacts.c: (sms_contacts_page_new): 5 Store the MokoFingerScroll the treeview is placed in 6 7 * src/sms-notes.c: (forward_clicked_cb): 8 Show a contacts chooser for picking which contact to forward to 9 10 * src/sms-utils.c: (sms_contact_picker_dialog): 11 * src/sms-utils.h: 12 Add a utility function to pop up a dialog with the contacts chooser 13 from the contacts page 14 1 15 2008-01-17 Chris Lord <chris@openedhand.com> 2 16 -
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-contacts.c
r3795 r3918 595 595 { 596 596 EBookQuery *qrys[(E_CONTACT_LAST_PHONE_ID-E_CONTACT_FIRST_PHONE_ID)+1]; 597 GtkWidget *contacts_combo, * scroll, *vbox;597 GtkWidget *contacts_combo, *vbox; 598 598 GtkTreeSelection *selection; 599 599 GtkCellRenderer *renderer; … … 731 731 732 732 /* Pack treeview into a finger-scroll */ 733 scroll = moko_finger_scroll_new (); 734 gtk_container_add (GTK_CONTAINER (scroll), data->contacts_treeview); 733 data->contacts_scroll = moko_finger_scroll_new (); 734 gtk_container_add (GTK_CONTAINER (data->contacts_scroll), 735 data->contacts_treeview); 735 736 736 737 /* Pack widgets into vbox and return */ 737 738 vbox = gtk_vbox_new (FALSE, 0); 738 gtk_box_pack_start (GTK_BOX (vbox), data->contacts_search, FALSE, TRUE, 0); 739 gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0); 739 gtk_box_pack_start (GTK_BOX (vbox), data->contacts_search, 740 FALSE, TRUE, 0); 741 gtk_box_pack_start (GTK_BOX (vbox), data->contacts_scroll, 742 TRUE, TRUE, 0); 740 743 gtk_widget_show_all (vbox); 741 744 -
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c
r3868 r3918 616 616 { 617 617 gchar *body; 618 GtkTreeIter iter ;618 GtkTreeIter iter, citer; 619 619 GtkTreeModel *model; 620 GtkTreeSelection *selection ;620 GtkTreeSelection *selection, *cselection; 621 621 622 622 /* Fill in compose box with message text and call new */ … … 633 633 g_free (body); 634 634 635 /* TODO: Launch a contact-picker */ 636 637 gtk_notebook_set_current_page ( 638 GTK_NOTEBOOK (data->notebook), SMS_PAGE_COMPOSE); 635 cselection = gtk_tree_view_get_selection ( 636 GTK_TREE_VIEW (data->contacts_treeview)); 637 if (cselection) 638 gtk_tree_selection_get_selected (cselection, NULL, &citer); 639 640 if (sms_contact_picker_dialog ( 641 data, "Choose a contact to forward to:")) { 642 gtk_notebook_set_current_page ( 643 GTK_NOTEBOOK (data->notebook), SMS_PAGE_COMPOSE); 644 } else { 645 gtk_tree_selection_select_iter (cselection, &citer); 646 } 639 647 } 640 648 -
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-utils.c
r3868 r3918 22 22 #include <string.h> 23 23 #include <libmokoui2/moko-search-bar.h> 24 #include <libmokoui2/moko-finger-scroll.h> 24 25 #ifdef HAVE_CONFIG_H 25 26 # include <config.h> … … 444 445 return FALSE; 445 446 } 447 448 gboolean 449 sms_contact_picker_dialog (SmsData *data, const gchar *message) 450 { 451 GtkWidget *dialog, *scroll, *frame; 452 gint width, height; 453 gint result; 454 455 dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (data->window), 456 GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, 457 message); 458 gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); 459 gtk_button_box_set_layout (GTK_BUTTON_BOX ( 460 GTK_DIALOG (dialog)->action_area), GTK_BUTTONBOX_SPREAD); 461 gtk_window_get_size (GTK_WINDOW (data->window), &width, &height); 462 gtk_window_resize (GTK_WINDOW (dialog), width * 0.85, height * 0.85); 463 464 /* Remove the main contacts treeview from the contacts page and add it 465 * to this dialog... Bit hacky... 466 */ 467 g_object_ref (data->contacts_treeview); 468 gtk_container_remove (GTK_CONTAINER (data->contacts_treeview->parent), 469 data->contacts_treeview); 470 471 frame = gtk_frame_new (NULL); 472 scroll = moko_finger_scroll_new (); 473 gtk_container_add (GTK_CONTAINER (scroll), data->contacts_treeview); 474 gtk_container_add (GTK_CONTAINER (frame), scroll); 475 gtk_widget_show_all (frame); 476 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), 477 frame, TRUE, TRUE, 0); 478 result = gtk_dialog_run (GTK_DIALOG (dialog)); 479 480 gtk_container_remove (GTK_CONTAINER (data->contacts_treeview->parent), 481 data->contacts_treeview); 482 gtk_container_add (GTK_CONTAINER (data->contacts_scroll), 483 data->contacts_treeview); 484 g_object_unref (data->contacts_treeview); 485 486 gtk_widget_destroy (dialog); 487 488 return (result == GTK_RESPONSE_OK) ? TRUE : FALSE; 489 } -
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-utils.h
r3868 r3918 32 32 gboolean sms_delete_selected_contact_messages (SmsData *data); 33 33 gboolean sms_select_contact (SmsData *data, const gchar *uid); 34 gboolean sms_contact_picker_dialog (SmsData *data, const gchar *message); 34 35 35 36 #endif /* SMS_UTILS_H */ -
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms.h
r3826 r3918 70 70 guint notes_scroll_idle; 71 71 72 GtkWidget *contacts_scroll; 72 73 GtkWidget *contacts_treeview; 73 74 GtkWidget *contacts_search;
Note: See TracChangeset
for help on using the changeset viewer.
