static void update_window_title (ModestMsgEditWindow *window);
static void update_dimmed (ModestMsgEditWindow *window);
static void update_paste_dimming (ModestMsgEditWindow *window);
+static void update_remove_attachment_dimming (ModestMsgEditWindow *window);
static void update_copy_cut_dimming (ModestMsgEditWindow *window);
static void update_select_all_dimming (ModestMsgEditWindow *window);
static void update_zoom_dimming (ModestMsgEditWindow *window);
return transports;
}
+static gboolean attachment_view_focus_lost (
+ GtkWidget *widget,
+ GdkEventFocus *event,
+ ModestMsgEditWindow *window)
+{
+ g_return_val_if_fail(MODEST_IS_MSG_EDIT_WINDOW(window), FALSE);
+
+ update_remove_attachment_dimming(window);
+
+ return FALSE;
+}
+
void vadj_changed (GtkAdjustment *adj,
ModestMsgEditWindow *window)
{
gtk_container_add (GTK_CONTAINER (priv->add_attachment_button), attachment_icon);
gtk_box_pack_start (GTK_BOX (subject_box), priv->add_attachment_button, FALSE, FALSE, 0);
priv->attachments_view = modest_attachments_view_new (NULL);
+ g_signal_connect (G_OBJECT (priv->attachments_view), "focus-out-event",
+ G_CALLBACK (attachment_view_focus_lost), obj);
priv->header_box = gtk_vbox_new (FALSE, 0);
action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/ToolBar/ActionsItalics");
modest_maemo_toggle_action_set_active_block_notify (GTK_TOGGLE_ACTION (action), buffer_format->italic);
- action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/BulletedListMenu");
- modest_maemo_toggle_action_set_active_block_notify (GTK_TOGGLE_ACTION (action), buffer_format->bullet);
+/* action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/BulletedListMenu"); */
+/* modest_maemo_toggle_action_set_active_block_notify (GTK_TOGGLE_ACTION (action), buffer_format->bullet); */
g_signal_handlers_block_by_func (G_OBJECT (priv->font_color_button),
G_CALLBACK (modest_msg_edit_window_color_button_change),
action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/SelectFontMenu");
gtk_action_set_sensitive (action, rich_text && editor_focused);
- action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/BulletedListMenu");
- gtk_action_set_sensitive (action, rich_text && editor_focused);
+/* action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/BulletedListMenu"); */
+/* gtk_action_set_sensitive (action, rich_text && editor_focused); */
action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/AlignmentMenu");
gtk_action_set_sensitive (action, rich_text && editor_focused);
action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/AlignmentMenu/AlignmentLeftMenu");
return FALSE;
}
+
+
+
gboolean
modest_msg_edit_window_check_names (ModestMsgEditWindow *window, gboolean add_to_addressbook)
{
GdkEvent *event,
ModestMsgEditWindow *window)
{
- ModestWindowPrivate *parent_priv;
- ModestMsgEditWindowPrivate *priv;
- GtkAction *action;
- GList *selected_attachments = NULL;
- gint n_att_selected = 0;
-
- priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
- parent_priv = MODEST_WINDOW_GET_PRIVATE (window);
-
if (!GTK_WIDGET_VISIBLE (window))
return;
- selected_attachments = modest_attachments_view_get_selection (MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
- n_att_selected = g_list_length (selected_attachments);
- g_list_free (selected_attachments);
-
- action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/AttachmentsMenu/RemoveAttachmentsMenu");
- gtk_action_set_sensitive (action, n_att_selected == 1);
-
+ update_remove_attachment_dimming (window);
update_copy_cut_dimming (window);
update_paste_dimming (window);
}
if (MIN (result_len, 1000) != g_utf8_strlen (new_text, 1000)) {
g_signal_stop_emission_by_name (G_OBJECT (editable), "insert-text");
if (result_len > 0)
+ {
+ /* Prevent endless recursion */
+ g_signal_handlers_block_by_func(G_OBJECT(editable), G_CALLBACK(subject_field_insert_text), window);
g_signal_emit_by_name (editable, "insert-text",
- (gpointer) result->str, (gpointer) strlen (result->str),
+ (gpointer) result->str, (gpointer) result->len,
(gpointer) position, (gpointer) window);
+ g_signal_handlers_unblock_by_func(G_OBJECT(editable), G_CALLBACK(subject_field_insert_text), window);
+ }
}
g_string_free (result, TRUE);
gtk_toggle_action_set_active (toggle, FALSE);
}
+static void
+update_remove_attachment_dimming (ModestMsgEditWindow *window)
+{
+ ModestWindowPrivate *parent_priv;
+ ModestMsgEditWindowPrivate *priv;
+ GtkAction *action;
+ GList *selected_attachments = NULL;
+ gint n_att_selected = 0;
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
+ parent_priv = MODEST_WINDOW_GET_PRIVATE (window);
+
+ selected_attachments = modest_attachments_view_get_selection (
+ MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
+ n_att_selected = g_list_length (selected_attachments);
+ g_list_free (selected_attachments);
+
+ action = gtk_ui_manager_get_action (
+ parent_priv->ui_manager,
+ "/MenuBar/AttachmentsMenu/RemoveAttachmentsMenu");
+ gtk_action_set_sensitive (action, n_att_selected == 1);
+}
static void
update_copy_cut_dimming (ModestMsgEditWindow *window)