Changeset 90
- Timestamp:
- 04/25/08 14:01:07
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/src/tmut-account-editor.c (modified) (8 diffs)
- trunk/src/tmut-account-editor.h (modified) (1 diff)
- trunk/src/tmut-account-manager.c (modified) (2 diffs)
- trunk/src/tmut-account-store.c (modified) (11 diffs)
- trunk/src/tmut-account-store.h (modified) (2 diffs)
- trunk/src/tmut-msg-creator.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r88 r90 2 2 3 3 * Bugfix when error reporting on sending message 4 * The From of transport-accounts 4 5 5 6 2008-04-22 Philip Van Hoof <pvanhoof@gnome.org> trunk/src/tmut-account-editor.c
r87 r90 29 29 30 30 #include <tny-camel-account.h> 31 #include <tny-camel-transport-account.h> 31 32 #include <tny-simple-list.h> 32 33 #include <tny-list.h> … … 51 52 52 53 GtkWidget *name_entry, *hostname_entry, *enabled_checkbutton, 53 *proto_entry, *type_entry, *user_entry, *options_entry; 54 *proto_entry, *type_entry, *user_entry, *options_entry, 55 *from_entry; 54 56 }; 55 57 … … 77 79 return gtk_entry_get_text (GTK_ENTRY (priv->hostname_entry)); 78 80 } 81 82 const gchar* 83 tmut_account_editor_get_from (TMutAccountEditor *self) 84 { 85 TMutAccountEditorPriv *priv = TMUT_ACCOUNT_EDITOR_GET_PRIVATE (self); 86 return gtk_entry_get_text (GTK_ENTRY (priv->from_entry)); 87 } 88 79 89 80 90 const gchar* … … 137 147 tny_account_get_user (account)?tny_account_get_user (account):""); 138 148 149 if (TNY_IS_CAMEL_TRANSPORT_ACCOUNT (account)) { 150 TnyCamelTransportAccount *ta = (TnyCamelTransportAccount *) account; 151 gtk_entry_set_text (GTK_ENTRY (priv->from_entry), 152 tny_camel_transport_account_get_from (ta)?tny_camel_transport_account_get_from (ta):""); 153 } 154 139 155 tny_camel_account_get_options (TNY_CAMEL_ACCOUNT (account), options); 140 156 iter = tny_list_create_iterator (options); … … 203 219 GtkWidget *ok_button, *cancel_button; 204 220 GtkWidget *hbox = gtk_hbox_new (FALSE, 0); 221 GtkWidget *mhbox = gtk_hbox_new (FALSE, 0); 222 205 223 table = gtk_table_new (6, 2, FALSE); 206 224 … … 211 229 gtk_widget_show (cancel_button); 212 230 gtk_widget_show (ok_button); 231 gtk_widget_show (mhbox); 213 232 214 233 gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (cancel_button), … … 245 264 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); 246 265 247 label = gtk_label_new (_("Type "));266 label = gtk_label_new (_("Type (+ From)")); 248 267 gtk_widget_show (label); 249 268 gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, … … 285 304 priv->type_entry = gtk_entry_new (); 286 305 gtk_widget_show (priv->type_entry); 287 gtk_table_attach (GTK_TABLE (table), priv->type_entry, 1, 2, 4, 5, 288 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 289 (GtkAttachOptions) (0), 0, 0); 306 307 priv->from_entry = gtk_entry_new (); 308 gtk_widget_show (priv->from_entry); 309 310 gtk_box_pack_start (GTK_BOX (mhbox), GTK_WIDGET (priv->type_entry), 311 TRUE, TRUE, 0); 312 gtk_box_pack_start (GTK_BOX (mhbox), GTK_WIDGET (priv->from_entry), 313 TRUE, TRUE, 0); 314 315 gtk_table_attach (GTK_TABLE (table), mhbox, 1, 2, 4, 5, 316 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 317 (GtkAttachOptions) (0), 0, 0); 318 290 319 291 320 priv->options_entry = gtk_entry_new (); trunk/src/tmut-account-editor.h
r76 r90 63 63 const gchar* tmut_account_editor_get_account_type (TMutAccountEditor *self); 64 64 const gchar* tmut_account_editor_get_user (TMutAccountEditor *self); 65 const gchar* tmut_account_editor_get_from (TMutAccountEditor *self); 65 66 gchar** tmut_account_editor_get_options (TMutAccountEditor *self); 66 67 TnyAccount *tmut_account_editor_get_account (TMutAccountEditor *self); trunk/src/tmut-account-manager.c
r89 r90 79 79 tmut_account_editor_get_account_type (editor), 80 80 tmut_account_editor_get_user (editor), 81 NULL, -1, 81 NULL, 82 tmut_account_editor_get_from (editor), 83 -1, 82 84 (const char **) options); 83 85 … … 101 103 tmut_account_editor_get_proto (editor), 102 104 tmut_account_editor_get_user (editor), 103 NULL, -1, 105 NULL, 106 tmut_account_editor_get_from (editor), 107 -1, 104 108 (const char **) options); 105 109 trunk/src/tmut-account-store.c
r89 r90 103 103 104 104 static TnyAccount* 105 create_account_instance (TMutAccountStorePriv *priv, const gchar *type, const gchar *proto, const gchar *mech, const gchar *name, gchar **options, const gchar *user, const gchar *hostname, gint port, const gchar *url_string, const gchar *fullfilen )105 create_account_instance (TMutAccountStorePriv *priv, const gchar *type, const gchar *proto, const gchar *mech, const gchar *name, gchar **options, const gchar *user, const gchar *hostname, gint port, const gchar *url_string, const gchar *fullfilen, const gchar *from) 106 106 { 107 107 TnyAccount *account = NULL; … … 150 150 151 151 if (!g_ascii_strncasecmp (proto, "pop", 3) || 152 !g_ascii_strncasecmp (proto, "imap", 4)) { 152 !g_ascii_strncasecmp (proto, "imap", 4) || 153 !g_ascii_strncasecmp (proto, "smtp", 4)) { 153 154 tny_account_set_user (account, user); 154 155 tny_account_set_hostname (account, hostname); 155 156 if (port != -1) 156 157 tny_account_set_port (account, port); 157 } else 158 tny_account_set_url_string (account, url_string); 158 } 159 159 160 160 tny_account_set_id (account, fullfilen); … … 166 166 167 167 } 168 169 if (TNY_IS_CAMEL_TRANSPORT_ACCOUNT (account)) 170 tny_camel_transport_account_set_from (TNY_CAMEL_TRANSPORT_ACCOUNT (account), from); 168 171 169 172 return account; … … 179 182 const gchar *user, 180 183 const gchar *mech, 184 const gchar *from, 181 185 gint port, 182 186 const gchar **options) … … 231 235 232 236 account = create_account_instance (priv, type, proto, mech, name, 233 (gchar **) options, user, hostname, port, NULL, filen );237 (gchar **) options, user, hostname, port, NULL, filen, from); 234 238 235 239 if (account) { … … 271 275 } 272 276 273 void tmut_account_store_edit_account (TMutAccountStore *self, TnyAccount *account, 277 void 278 tmut_account_store_edit_account (TMutAccountStore *self, TnyAccount *account, 274 279 gboolean enabled, 275 280 const gchar *name, … … 278 283 const gchar *user, 279 284 const gchar *mech, 285 const gchar *from, 280 286 gint port, 281 287 const gchar **options) … … 316 322 tny_account_set_secure_auth_mech (account, mech); 317 323 g_key_file_set_value (keyfile, "tmut", "mech", mech); 324 } 325 326 if (from && TNY_IS_CAMEL_TRANSPORT_ACCOUNT (account)) { 327 tny_camel_transport_account_set_from (TNY_CAMEL_TRANSPORT_ACCOUNT (account), from); 328 g_key_file_set_value (keyfile, "tmut", "from", from); 318 329 } 319 330 … … 393 404 GError *port_err = NULL; 394 405 GKeyFile *keyfile; 395 gchar *proto, *type, * user, *hostname, *url_string;406 gchar *proto, *type, *from, *user, *hostname, *url_string; 396 407 gchar *name, *mech, **options; 397 408 gsize options_len; … … 423 434 url_string = g_key_file_get_value (keyfile, "tmut", "url_string", NULL); 424 435 port = g_key_file_get_integer (keyfile, "tmut", "port", &port_err); 436 from = g_key_file_get_value (keyfile, "tmut", "from", NULL); 425 437 426 438 if (port_err) { … … 429 441 } 430 442 431 account = create_account_instance (priv, type, proto, mech, name, options, user, hostname, port, url_string, fullfilen );443 account = create_account_instance (priv, type, proto, mech, name, options, user, hostname, port, url_string, fullfilen, from); 432 444 433 445 if (account) trunk/src/tmut-account-store.h
r79 r90 61 61 const gchar *user, 62 62 const gchar *mech, 63 const gchar *from, 63 64 gint port, 64 65 const gchar **options); … … 73 74 const gchar *user, 74 75 const gchar *mech, 76 const gchar *from, 75 77 gint port, 76 78 const gchar **options); trunk/src/tmut-msg-creator.c
r88 r90 37 37 #include <tny-camel-send-queue.h> 38 38 #include <tny-camel-mime-part.h> 39 #include <tny-camel-transport-account.h> 39 40 40 41 #include <string.h> … … 220 221 221 222 tny_header_set_subject (header, gtk_entry_get_text (priv->subject_entry)); 222 tny_header_set_from (header, tny_account_get_name (account)); 223 224 if (TNY_IS_CAMEL_TRANSPORT_ACCOUNT (account)) { 225 TnyCamelTransportAccount *ta = (TnyCamelTransportAccount *) account; 226 if (tny_camel_transport_account_get_from (ta)) 227 tny_header_set_from (header, tny_camel_transport_account_get_from (ta)); 228 else 229 tny_header_set_from (header, tny_account_get_name (account)); 230 } else 231 tny_header_set_from (header, tny_account_get_name (account)); 232 223 233 tny_header_set_to (header, gtk_entry_get_text (priv->to_entry)); 224 234
