aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-08-18 05:09:39 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-08-18 05:09:39 +0800
commitd398be6895584ef4d52ad2cf9f8bef6a639f4d38 (patch)
tree1652cb504ec42b2a07a90f50b777b488f2ebff8c /composer
parentbc037887bbf807e072669db44b7c13011e0d8368 (diff)
downloadgsoc2013-evolution-d398be6895584ef4d52ad2cf9f8bef6a639f4d38.tar
gsoc2013-evolution-d398be6895584ef4d52ad2cf9f8bef6a639f4d38.tar.gz
gsoc2013-evolution-d398be6895584ef4d52ad2cf9f8bef6a639f4d38.tar.bz2
gsoc2013-evolution-d398be6895584ef4d52ad2cf9f8bef6a639f4d38.tar.lz
gsoc2013-evolution-d398be6895584ef4d52ad2cf9f8bef6a639f4d38.tar.xz
gsoc2013-evolution-d398be6895584ef4d52ad2cf9f8bef6a639f4d38.tar.zst
gsoc2013-evolution-d398be6895584ef4d52ad2cf9f8bef6a639f4d38.zip
Toggle the View->Attachments menu item. This fixes bug #6107.
2001-08-17 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (show_attachments): Toggle the View->Attachments menu item. This fixes bug #6107. svn path=/trunk/; revision=12177
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog5
-rw-r--r--composer/e-msg-composer-hdrs.c32
-rw-r--r--composer/e-msg-composer.c30
3 files changed, 33 insertions, 34 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 165219cf29..f49833665f 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-17 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-msg-composer.c (show_attachments): Toggle the
+ View->Attachments menu item. This fixes bug #6107.
+
2001-07-12 Peter Williams <peterw@ximian.com>
* e-msg-composer.c (map_default_cb): New function. Figure out
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index fcc99e0806..b5c8b78664 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -125,23 +125,23 @@ typedef struct {
} EMsgComposerHdrsAndString;
static void
-e_msg_composer_hdrs_and_string_free(EMsgComposerHdrsAndString *emchas)
+e_msg_composer_hdrs_and_string_free (EMsgComposerHdrsAndString *emchas)
{
if (emchas->hdrs)
- gtk_object_unref(GTK_OBJECT(emchas->hdrs));
- g_free(emchas->string);
+ gtk_object_unref (GTK_OBJECT (emchas->hdrs));
+ g_free (emchas->string);
}
static EMsgComposerHdrsAndString *
-e_msg_composer_hdrs_and_string_create(EMsgComposerHdrs *hdrs, const char *string)
+e_msg_composer_hdrs_and_string_create (EMsgComposerHdrs *hdrs, const char *string)
{
EMsgComposerHdrsAndString *emchas;
-
- emchas = g_new(EMsgComposerHdrsAndString, 1);
+
+ emchas = g_new (EMsgComposerHdrsAndString, 1);
emchas->hdrs = hdrs;
- emchas->string = g_strdup(string);
+ emchas->string = g_strdup (string);
if (emchas->hdrs)
- gtk_object_ref(GTK_OBJECT(emchas->hdrs));
+ gtk_object_ref (GTK_OBJECT (emchas->hdrs));
return emchas;
}
@@ -154,16 +154,16 @@ address_button_clicked_cb (GtkButton *button,
EMsgComposerHdrs *hdrs;
EMsgComposerHdrsPrivate *priv;
CORBA_Environment ev;
-
+
emchas = data;
hdrs = emchas->hdrs;
priv = hdrs->priv;
-
+
CORBA_exception_init (&ev);
-
+
GNOME_Evolution_Addressbook_SelectNames_activateDialog (
priv->corba_select_names, emchas->string, &ev);
-
+
CORBA_exception_free (&ev);
}
@@ -187,9 +187,9 @@ create_from_optionmenu (EMsgComposerHdrs *hdrs)
omenu = gtk_option_menu_new ();
menu = gtk_menu_new ();
-
+
default_account = mail_config_get_default_account_num ();
-
+
accounts = mail_config_get_accounts ();
while (accounts) {
const MailConfigAccount *account;
@@ -235,8 +235,8 @@ create_from_optionmenu (EMsgComposerHdrs *hdrs)
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-
- if (first){
+
+ if (first) {
gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), history);
gtk_signal_emit_by_name (GTK_OBJECT (first), "activate", hdrs);
}
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 9bc2390fd4..89f30f4a5a 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -846,17 +846,9 @@ show_attachments (EMsgComposer *composer,
composer->attachment_bar_visible = show;
/* Update the GUI. */
-
-#if 0
- gtk_check_menu_item_set_active
- (GTK_CHECK_MENU_ITEM
- (glade_xml_get_widget (composer->menubar_gui,
- "menu_view_attachments")),
- show);
-#endif
-
- /* XXX we should update the toggle toolbar item as well. At
- this point, it is not a toggle because Glade is broken. */
+ bonobo_ui_component_set_prop (
+ composer->uic, "/commands/ViewAttach",
+ "state", show ? "1" : "0", NULL);
}
static void
@@ -1671,10 +1663,10 @@ static BonoboUIVerb verbs [] = {
BONOBO_UI_VERB ("FileSaveAs", menu_file_save_as_cb),
BONOBO_UI_VERB ("FileSaveDraft", menu_file_save_draft_cb),
BONOBO_UI_VERB ("FileClose", menu_file_close_cb),
-
+
BONOBO_UI_VERB ("FileInsertFile", menu_file_insert_file_cb),
BONOBO_UI_VERB ("FileAttach", menu_file_add_attachment_cb),
-
+
BONOBO_UI_VERB ("FileSend", menu_file_send_cb),
BONOBO_UI_VERB ("FileSendLater", menu_file_send_later_cb),
@@ -1849,15 +1841,17 @@ attachment_bar_changed_cb (EMsgComposerAttachmentBar *bar,
void *data)
{
EMsgComposer *composer;
+ gboolean show = FALSE;
composer = E_MSG_COMPOSER (data);
if (e_msg_composer_attachment_bar_get_num_attachments (bar) > 0)
- e_msg_composer_show_attachments (composer, TRUE);
- else
- e_msg_composer_show_attachments (composer, FALSE);
+ show = TRUE;
- /* Mark the composer as changed so it prompts about unsaved changes on close */
+ e_msg_composer_show_attachments (composer, show);
+
+ /* Mark the composer as changed so it prompts about unsaved
+ changes on close */
e_msg_composer_set_changed (composer);
}
@@ -2902,7 +2896,7 @@ e_msg_composer_show_attachments (EMsgComposer *composer,
{
g_return_if_fail (composer != NULL);
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
-
+
show_attachments (composer, show);
}