ModestAccountMgr *mgr = modest_runtime_get_account_mgr();
ModestTnyAccountStore *store = modest_runtime_get_account_store();
- if (win) account_name = g_strdup (modest_window_get_active_account (win));
- if (!account_name) account_name = modest_account_mgr_get_default_account(mgr);
+ account_name = modest_account_mgr_get_default_account(mgr);
if (!account_name) {
g_printerr ("modest: no account found\n");
goto cleanup;
gpointer user_data)
{
GObject *source;
+ gboolean show_visual_notifications;
source = modest_mail_operation_get_source (self);
-
- /* Notify new messages have been downloaded. Do not notify if
- the send&receive was invoked by the user, i.e, if the mail
- operation has a source (the main window) */
- if ((new_headers != NULL) && (tny_list_get_length (new_headers) > 0) && !source)
- modest_platform_on_new_headers_received (new_headers);
-
+ show_visual_notifications = (source) ? FALSE : TRUE;
if (source)
g_object_unref (source);
+
+ /* Notify new messages have been downloaded. If the
+ send&receive was invoked by the user then do not show any
+ visual notification, only play a sound and activate the LED
+ (for the Maemo version) */
+ if ((new_headers != NULL) && (tny_list_get_length (new_headers) > 0))
+ modest_platform_on_new_headers_received (new_headers,
+ show_visual_notifications);
+
}
gboolean
modest_msg_edit_window_select_font (window);
}
+
void
modest_ui_actions_on_folder_display_name_changed (ModestFolderView *folder_view,
const gchar *display_name,
GtkWindow *window)
{
+ /* don't update the display name if it was already set;
+ * updating the display name apparently is expensive */
+ const gchar* old_name = gtk_window_get_title (window);
+
+ if (old_name && display_name && strcmp (old_name, display_name) == 0)
+ return; /* don't do anything */
+
/* This is usually used to change the title of the main window, which
* is the one that holds the folder view. Note that this change can
* happen even when the widget doesn't have the focus. */
gtk_window_set_title (window, display_name);
else
gtk_window_set_title (window, " ");
+
}
void