Changeset 558
- Timestamp:
- 07/05/06 12:43:58
- Files:
-
- trunk/libtinymailui-gtk/tny-msg-view.c (modified) (2 diffs)
- trunk/libtinymailui-gtk/tny-msg-window.c (modified) (3 diffs)
- trunk/libtinymailui-mozembed/tny-moz-embed-msg-view.c (modified) (2 diffs)
- trunk/libtinymailui/tny-msg-view-iface.c (modified) (1 diff)
- trunk/libtinymailui/tny-msg-view-iface.h (modified) (2 diffs)
- trunk/tinymail/tny-main.c (modified) (1 diff)
- trunk/tinymail/tny-summary-window.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymailui-gtk/tny-msg-view.c
r552 r558 226 226 } 227 227 228 static void 229 tny_msg_view_set_unavailable (TnyMsgViewIface *self, TnyMsgHeaderIface *header) 230 { 231 TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); 232 GtkTextBuffer *buffer; 233 234 buffer = gtk_text_view_get_buffer (priv->textview); 235 gtk_widget_hide (priv->attachview_sw); 236 gtk_text_buffer_set_text (buffer, _("Message is unavailable"), -1); 237 tny_msg_header_view_iface_set_header (priv->headerview, header); 238 gtk_widget_show (GTK_WIDGET (priv->headerview)); 239 240 return; 241 } 242 228 243 static void 229 244 tny_msg_view_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg) … … 360 375 klass->set_msg_func = tny_msg_view_set_msg; 361 376 klass->set_save_strategy_func = tny_msg_view_set_save_strategy; 377 klass->set_unavailable_func = tny_msg_view_set_unavailable; 362 378 363 379 return; trunk/libtinymailui-gtk/tny-msg-window.c
r418 r558 34 34 #define TNY_MSG_WINDOW_GET_PRIVATE(o) \ 35 35 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_MSG_WINDOW, TnyMsgWindowPriv)) 36 37 38 static void 39 tny_msg_window_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy) 40 { 41 TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); 42 43 tny_msg_view_iface_set_save_strategy (priv->msg_view, strategy); 44 45 return; 46 } 47 48 static void 49 tny_msg_window_set_unavailable (TnyMsgViewIface *self, TnyMsgHeaderIface *header) 50 { 51 TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); 52 53 tny_msg_view_iface_set_unavailable (priv->msg_view, header); 54 55 return; 56 } 36 57 37 58 … … 101 122 } 102 123 124 103 125 static void 104 126 tny_msg_view_iface_init (gpointer g_iface, gpointer iface_data) … … 107 129 108 130 klass->set_msg_func = tny_msg_window_set_msg; 131 klass->set_save_strategy_func = tny_msg_window_set_save_strategy; 132 klass->set_unavailable_func = tny_msg_window_set_unavailable; 109 133 110 134 return; trunk/libtinymailui-mozembed/tny-moz-embed-msg-view.c
r552 r558 196 196 } 197 197 198 static void 199 tny_mozembed_msg_view_set_unavailable (TnyMsgViewIface *self, TnyMsgHeaderIface *header) 200 { 201 TnyMozEmbedMsgViewPriv *priv = TNY_MOZ_EMBED_MSG_VIEW_GET_PRIVATE (self); 202 GtkTextBuffer *buffer; 203 204 gtk_widget_hide (GTK_WIDGET (priv->htmlview)); 205 gtk_widget_show (GTK_WIDGET (priv->textview)); 206 207 buffer = gtk_text_view_get_buffer (priv->textview); 208 gtk_widget_hide (priv->attachview_sw); 209 gtk_text_buffer_set_text (buffer, _("Message is unavailable"), -1); 210 tny_msg_header_view_iface_set_header (priv->headerview, header); 211 gtk_widget_show (GTK_WIDGET (priv->headerview)); 212 213 return; 214 } 215 198 216 199 217 static void … … 409 427 klass->set_msg_func = tny_moz_embed_msg_view_set_msg; 410 428 klass->set_save_strategy_func = tny_mozembed_msg_view_set_save_strategy; 429 klass->set_unavailable_func = tny_mozembed_msg_view_set_unavailable; 411 430 412 431 return; trunk/libtinymailui/tny-msg-view-iface.c
r542 r558 21 21 22 22 #include <tny-msg-view-iface.h> 23 24 25 26 /** 27 * tny_msg_view_iface_set_unavailable: 28 * @self: A #TnyMsgViewIface instance 29 * @header: a #TnyMsgHeaderIface instance or NULL 30 * 31 * Set the view to display that the message was unavailable 32 * 33 **/ 34 void 35 tny_msg_view_iface_set_unavailable (TnyMsgViewIface *self, TnyMsgHeaderIface *header) 36 { 37 #ifdef DEBUG 38 if (!TNY_MSG_VIEW_IFACE_GET_CLASS (self)->set_unavailable_func) 39 g_critical ("You must implement tny_msg_view_iface_set_unavailable\n"); 40 #endif 41 42 TNY_MSG_VIEW_IFACE_GET_CLASS (self)->set_unavailable_func (self, header); 43 return; 44 } 45 23 46 24 47 /** trunk/libtinymailui/tny-msg-view-iface.h
r347 r558 46 46 void (*set_msg_func) (TnyMsgViewIface *self, TnyMsgIface *msg); 47 47 void (*set_save_strategy_func) (TnyMsgViewIface *self, TnySaveStrategyIface *strategy); 48 void (*set_unavailable_func) (TnyMsgViewIface *self, TnyMsgHeaderIface *header); 48 49 }; 49 50 … … 52 53 void tny_msg_view_iface_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg); 53 54 void tny_msg_view_iface_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy); 55 void tny_msg_view_iface_set_unavailable (TnyMsgViewIface *self, TnyMsgHeaderIface *header); 54 56 55 57 trunk/tinymail/tny-main.c
r542 r558 66 66 gdk_threads_init (); 67 67 68 // demo69 /* g_object_unref (NULL); */70 71 68 #ifdef GNOME 72 69 gnome_vfs_init (); trunk/tinymail/tny-summary-window.c
r556 r558 120 120 } 121 121 122 /* This method uses the TnyAccountTreeModel as a TnyListIface */ 122 123 tny_account_store_iface_get_accounts (account_store, accounts, 123 124 TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS); 124 125 126 127 /* Here we use the TnyAccountTreeModel as a GtkTreeModelIface */ 125 128 sortable = gtk_tree_model_sort_new_with_model (mailbox_model); 126 129 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sortable), … … 216 219 if (G_LIKELY (device)) 217 220 { 218 priv->connchanged_signal = 219 g_signal_connect (G_OBJECT (device), "connection_changed",221 priv->connchanged_signal = g_signal_connect ( 222 G_OBJECT (device), "connection_changed", 220 223 G_CALLBACK (connection_changed), self); 221 224 } 222 225 223 /* g_object_ref (G_OBJECT (account_store)); */224 225 226 priv->account_store = account_store; 226 227 227 priv->accounts_reloaded_signal = g_signal_connect 228 (G_OBJECT (account_store), "accounts_reloaded",228 priv->accounts_reloaded_signal = g_signal_connect ( 229 G_OBJECT (account_store), "accounts_reloaded", 229 230 G_CALLBACK (accounts_reloaded), priv); 230 231 … … 237 238 on_header_view_key_press_event (GtkTreeView *header_view, GdkEventKey *event, gpointer user_data) 238 239 { 240 /* If the user presses the [Del] button on his keyboard */ 241 239 242 if (event->keyval == GDK_Delete) 240 243 { … … 326 329 tny_msg_view_iface_set_msg (priv->msg_view, TNY_MSG_IFACE (msg)); 327 330 else 328 { 329 /* Loading the message failed (service unavailable 330 or message deleted by an external device) */ 331 } 331 tny_msg_view_iface_set_unavailable (priv->msg_view, header); 332 332 333 333 } 334 } else { 335 tny_msg_view_iface_set_unavailable (priv->msg_view, NULL); 334 336 } 335 337 }
