Changeset 3468
- Timestamp:
- 11/21/07 17:55:09 (6 years ago)
- 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
r3467 r3468 1 2007-11-21 Chris Lord <chris@openedhand.com> 2 3 * src/sms-notes.c: (get_selected_contact), (page_hidden), 4 (sms_notes_data_func), (sms_notes_page_new): 5 * src/sms.h: 6 Add some code to show avatars/change justification depending on whether 7 a message was sent or received (unfinished) 8 1 9 2007-11-21 Chris Lord <chris@openedhand.com> 2 10 -
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c
r3464 r3468 24 24 #include <libmokoui2/moko-search-bar.h> 25 25 #include <libebook/e-book.h> 26 #include <string.h> 26 27 27 28 static GdkColor alt_color; … … 45 46 if (!gtk_tree_selection_get_selected (selection, &model, &iter)) 46 47 return NULL; 47 gtk_tree_model_get (model, &iter, COL_UID, &uid, -1); 48 gtk_tree_model_get (model, &iter, COL_UID, &uid, 49 COL_ICON, &data->author_icon, -1); 48 50 49 51 if (!e_book_get_contact (data->ebook, uid, &contact, &error)) { … … 101 103 gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON ( 102 104 data->new_button), FALSE); 105 if (data->recipient_icon) { 106 g_object_unref (data->recipient_icon); 107 data->recipient_icon = NULL; 108 } 103 109 } 104 110 … … 209 215 SmsData *data) 210 216 { 211 gchar *author, *recipient, *body ;217 gchar *author, *recipient, *body, **categories; 212 218 JanaTime *created, *modified; 219 gboolean outgoing = FALSE; 220 gint i; 213 221 214 222 gtk_tree_model_get (model, iter, … … 217 225 JANA_GTK_NOTE_STORE_COL_BODY, &body, 218 226 JANA_GTK_NOTE_STORE_COL_CREATED, &created, 219 JANA_GTK_NOTE_STORE_COL_MODIFIED, &modified, -1); 220 227 JANA_GTK_NOTE_STORE_COL_MODIFIED, &modified, 228 JANA_GTK_NOTE_STORE_COL_CATEGORIES, &categories, -1); 229 230 if (categories) for (i = 0; categories[i]; i++) { 231 /* Note that this category is not meant for display and 232 * shouldn't be translated... (see phone-kit) 233 */ 234 if ((strcmp (categories[i], "Sent") == 0) || 235 (strcmp (categories[i], "Sending") == 0) || 236 (strcmp (categories[i], "Rejected") == 0)) { 237 outgoing = TRUE; 238 break; 239 } 240 } 241 221 242 g_object_set (cell, 222 243 "author", author, … … 224 245 "body", body, 225 246 "created", created, 226 "modified", modified, NULL); 247 "modified", modified, 248 "justify", outgoing ? 249 GTK_JUSTIFY_LEFT : GTK_JUSTIFY_RIGHT, 250 "icon", outgoing ? 251 data->author_icon : data->recipient_icon, 252 NULL); 227 253 228 254 g_free (author); 229 255 g_free (recipient); 230 256 g_free (body); 257 g_strfreev (categories); 231 258 if (created) g_object_unref (created); 232 259 if (modified) g_object_unref (modified); … … 248 275 GHashTable *colours_hash; 249 276 277 /* FIXME: Set recipient pixbuf */ 278 data->recipient_icon = g_object_ref (data->no_photo); 279 250 280 /* Create note store */ 251 281 data->notes = jana_ecal_store_new (JANA_COMPONENT_NOTE); … … 260 290 colours_hash = g_hash_table_new (g_str_hash, g_str_equal); 261 291 g_hash_table_insert (colours_hash, "Sent", &alt_color); 292 g_hash_table_insert (colours_hash, "Sending", &alt_color); 262 293 263 294 /* Create treeview and cell renderer */ -
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms.h
r3464 r3468 48 48 GtkWidget *sms_hbox; 49 49 GtkWidget *sms_textview; 50 GdkPixbuf *author_icon; 51 GdkPixbuf *recipient_icon; 50 52 51 53 GtkWidget *contacts_treeview;
Note: See TracChangeset
for help on using the changeset viewer.
