aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2001-08-10 15:17:54 +0800
committerRadek Doulik <rodo@src.gnome.org>2001-08-10 15:17:54 +0800
commit79265bbca3ba043df0a735ff6eab1ace879b7a08 (patch)
tree3c22051a38841cebbe080f91e76fefda3df98a02 /composer
parentd9ae7c3b78cd10b9fec1ee8bf972cf05e319d968 (diff)
downloadgsoc2013-evolution-79265bbca3ba043df0a735ff6eab1ace879b7a08.tar
gsoc2013-evolution-79265bbca3ba043df0a735ff6eab1ace879b7a08.tar.gz
gsoc2013-evolution-79265bbca3ba043df0a735ff6eab1ace879b7a08.tar.bz2
gsoc2013-evolution-79265bbca3ba043df0a735ff6eab1ace879b7a08.tar.lz
gsoc2013-evolution-79265bbca3ba043df0a735ff6eab1ace879b7a08.tar.xz
gsoc2013-evolution-79265bbca3ba043df0a735ff6eab1ace879b7a08.tar.zst
gsoc2013-evolution-79265bbca3ba043df0a735ff6eab1ace879b7a08.zip
new helper function, just setup idle callback to grab focus
2001-08-09 Radek Doulik <rodo@ximian.com> * e-msg-composer.c (set_focus_to_editor): new helper function, just setup idle callback to grab focus (set_focus_to_editor_idle): grab focus for editor, before we have better solution, it run grab-focus command on editor control (e_msg_composer_construct): call prepare_engine here, set focus to editor svn path=/trunk/; revision=11875
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog9
-rw-r--r--composer/e-msg-composer.c37
2 files changed, 34 insertions, 12 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 7397b1a38d..850f605303 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,12 @@
+2001-08-09 Radek Doulik <rodo@ximian.com>
+
+ * e-msg-composer.c (set_focus_to_editor): new helper function,
+ just setup idle callback to grab focus
+ (set_focus_to_editor_idle): grab focus for editor, before we have
+ better solution, it run grab-focus command on editor control
+ (e_msg_composer_construct): call prepare_engine here, set focus to
+ editor
+
2001-08-10 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer.c (autosave_manager_query_load_orphans): Don't
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 544adb9f5c..622c18ecb4 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -239,6 +239,24 @@ e_msg_composer_clear_inlined_table (EMsgComposer *composer)
g_hash_table_foreach_remove (composer->inline_images, clear_inline_images, NULL);
}
+static guint
+set_focus_to_editor_idle (EMsgComposer *composer)
+{
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+ GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "grab-focus", &ev);
+ CORBA_exception_free (&ev);
+
+ return FALSE;
+}
+
+static inline void
+set_focus_to_editor (EMsgComposer *composer)
+{
+ gtk_idle_add (set_focus_to_editor_idle, composer);
+}
+
static void
add_inlined_image (gpointer key, gpointer value, gpointer data)
{
@@ -2349,13 +2367,9 @@ e_msg_composer_construct (EMsgComposer *composer)
gtk_widget_show (composer->editor);
e_msg_composer_show_attachments (composer, FALSE);
-
- /* Set focus on the `To:' field.
-
- gtk_widget_grab_focus (e_msg_composer_hdrs_get_to_entry (E_MSG_COMPOSER_HDRS (composer->hdrs)));
- GTK_WIDGET_SET_FLAGS (composer->editor, GTK_CAN_FOCUS);
- gtk_window_set_focus (GTK_WINDOW (composer), composer->editor); */
- gtk_widget_grab_focus (composer->editor);
+
+ prepare_engine (composer);
+ set_focus_to_editor (composer);
}
static EMsgComposer *
@@ -2371,7 +2385,6 @@ create_composer (void)
gtk_object_unref (GTK_OBJECT (new));
return NULL;
}
- prepare_engine (new);
return new;
}
@@ -2412,7 +2425,7 @@ e_msg_composer_new_with_sig_file ()
e_msg_composer_set_send_html (new, mail_config_get_send_html ());
set_editor_text (new, "");
}
-
+
return new;
}
@@ -2621,7 +2634,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
}
e_msg_composer_set_headers (new, account_name, To, Cc, Bcc, subject);
-
+
free_recipients (To);
free_recipients (Cc);
free_recipients (Bcc);
@@ -2695,7 +2708,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
e_msg_composer_set_body_text (new, final_text);
}
}
-
+
return new;
}
@@ -2829,7 +2842,7 @@ e_msg_composer_new_from_url (const char *url)
}
}
}
-
+
hdrs = E_MSG_COMPOSER_HDRS (composer->hdrs);
e_msg_composer_hdrs_set_to (hdrs, to);
free_recipients (to);