+2007-06-11 Murray Cumming <murrayc@murrayc.com>
+
+ * src/modest-ui-actions.c:
+ (modest_ui_actions_on_password_requested): Check that the server name
+ is not NULL, because I just saw a password dialog with (null) as the
+ server name.
+
+ * src/modest-tny-folder.[h|c]: Added
+ modest_tny_folder_is_memory_card_folder().
+ * src/modest-ui-dimming-rules.c:
+ (modest_ui_dimming_rules_on_new_folder): Do not dim the new folder context
+ menu item for memory cards, as per the UI spec (section 7.4). This should
+ fix projects.maemo.org bug NB#59297.
+
2007-06-10 Johannes Schmid <johannes.schmid@openismus.com>
* src/maemo/modest-main-window.c: (sync_accounts_cb):
{
g_return_if_fail (MODEST_IS_DIMMING_RULE (value));
- /* Process diomming rule */
+ /* Process dimming rule */
modest_dimming_rule_process (MODEST_DIMMING_RULE(value));
}
g_return_val_if_fail (TNY_IS_FOLDER(folder), -1);
- if (modest_tny_folder_is_local_folder (folder)) {
+ if (modest_tny_folder_is_local_folder (folder) ||
+ modest_tny_folder_is_memory_card_folder (folder)) {
type = modest_tny_folder_get_local_folder_type (folder);
g_object_unref (G_OBJECT(account));
return (strcmp (account_id, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) == 0);
+}
+
+gboolean
+modest_tny_folder_is_memory_card_folder (TnyFolder *folder)
+{
+ g_return_val_if_fail (folder, FALSE);
+
+ /* The merge folder is a special case,
+ * used to merge the per-account local outbox folders.
+ * and can have no get_account() implementation.
+ */
+ if (TNY_IS_MERGE_FOLDER (folder))
+ return FALSE;
+
+ TnyAccount* account = tny_folder_get_account ((TnyFolder*)folder);
+ if (!account)
+ return FALSE;
+
+ const gchar* account_id = tny_account_get_id (account);
+ if (!account_id)
+ return FALSE;
+
+ g_object_unref (G_OBJECT(account));
+
+ return (strcmp (account_id, MODEST_MMC_ACCOUNT_ID) == 0);
}
*/
gboolean modest_tny_folder_is_local_folder (TnyFolder *folder);
+/**
+ * modest_tny_folder_is_memory_card_folder:
+ * @folder: a valid tnymail folder
+ *
+ * checks if the folder is part of the memory card account.
+ *
+ * Returns: TRUE if it's a memory card folder, FALSE otherwise
+ */
+gboolean
+modest_tny_folder_is_memory_card_folder (TnyFolder *folder);
/**
* modest_tny_folder_get_local_folder_type:
gchar *server_name = modest_server_account_get_hostname (
modest_runtime_get_account_mgr(), server_account_name);
+ if (!server_name) {/* This happened once, though I don't know why. murrayc. */
+ g_warning("%s: Could not get server name for server account '%s'", __FUNCTION__, server_account_name);
+ *cancel = TRUE;
+ return;
+ }
/* This causes a warning because the logical ID has no %s in it,
* though the translation does, but there is not much we can do about that: */
gtk_widget_destroy (dialog);
- printf ("DEBUG: %s: cancel=%d\n", __FUNCTION__, *cancel);
+ /* printf ("DEBUG: %s: cancel=%d\n", __FUNCTION__, *cancel); */
}
void
priv = MODEST_UI_DIMMING_MANAGER_GET_PRIVATE(self);
- /* Serach group by name */
+ /* Search group by name */
group = MODEST_DIMMING_RULES_GROUP(g_hash_table_lookup (priv->groups_map, group_name));
g_return_if_fail (group != NULL);
TNY_ACCOUNT (parent_folder)))
return FALSE;
else {
- /* If it's the MMC root folder then dim it */
- if (!strcmp (tny_account_get_id (TNY_ACCOUNT (parent_folder)), MODEST_MMC_ACCOUNT_ID)) {
- dimmed = TRUE;
- } else {
- const gchar *proto_str = tny_account_get_proto (TNY_ACCOUNT (parent_folder));
- /* If it's POP then dim */
- dimmed = (modest_protocol_info_get_transport_store_protocol (proto_str) ==
- MODEST_PROTOCOL_STORE_POP) ? TRUE : FALSE;
- }
+ const gchar *proto_str = tny_account_get_proto (TNY_ACCOUNT (parent_folder));
+ /* If it's POP then dim */
+ dimmed = (modest_protocol_info_get_transport_store_protocol (proto_str) ==
+ MODEST_PROTOCOL_STORE_POP) ? TRUE : FALSE;
}
} else {
/* TODO: the specs say that only one level of subfolder is allowed, is this true ? */