aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog11
-rw-r--r--composer/e-msg-composer-attachment.c41
-rw-r--r--composer/e-msg-composer-attachment.glade148
-rw-r--r--composer/e-msg-composer-attachment.glade.h10
4 files changed, 170 insertions, 40 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 75a183b1e0..6b9e8bfd75 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,14 @@
+2001-01-17 Iain Holmes <iain@ximian.com>
+
+ * e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
+ Get the option menu from the XML file.
+ (ok_cb): Set the attachment disposition depending on the option
+ menu results.
+ (option_menu_get_history): Really should have been in GTK at some
+ point.
+
+ * e-msg-composer-attachment.glade: Add the option menu.
+
2001-01-17 Michael Meeks <michael@helixcode.com>
* evolution-composer.c (enum_objects): comment out for now
diff --git a/composer/e-msg-composer-attachment.c b/composer/e-msg-composer-attachment.c
index 75df63d2bd..223d118de5 100644
--- a/composer/e-msg-composer-attachment.c
+++ b/composer/e-msg-composer-attachment.c
@@ -226,6 +226,7 @@ struct _DialogData {
GtkEntry *file_name_entry;
GtkEntry *description_entry;
GtkEntry *mime_type_entry;
+ GtkOptionMenu *disposition_option;
EMsgComposerAttachment *attachment;
};
typedef struct _DialogData DialogData;
@@ -303,6 +304,27 @@ close_cb (GtkWidget *widget,
destroy_dialog_data (dialog_data);
}
+/* Why was this never part of GTK? */
+static int
+option_menu_get_history (GtkOptionMenu *menu)
+{
+ GtkWidget *active;
+
+ g_return_val_if_fail (menu != NULL, -1);
+ g_return_val_if_fail (GTK_IS_OPTION_MENU (menu), -1);
+
+ if (menu->menu) {
+ active = gtk_menu_get_active (GTK_MENU (menu->menu));
+
+ if (active)
+ return g_list_index (GTK_MENU_SHELL (menu->menu)->children,
+ active);
+ else
+ return -1;
+ } else
+ return -1;
+}
+
static void
ok_cb (GtkWidget *widget,
gpointer data)
@@ -310,7 +332,8 @@ ok_cb (GtkWidget *widget,
DialogData *dialog_data;
EMsgComposerAttachment *attachment;
gchar *str;
-
+ int option;
+
dialog_data = (DialogData *) data;
attachment = dialog_data->attachment;
@@ -329,6 +352,19 @@ ok_cb (GtkWidget *widget,
camel_medium_get_content_object (CAMEL_MEDIUM (attachment->body)), str);
g_free (str);
+ option = option_menu_get_history (dialog_data->disposition_option);
+ switch (option) {
+ case 0:
+ camel_mime_part_set_disposition (attachment->body, "attachment");
+ break;
+ case 1:
+ camel_mime_part_set_disposition (attachment->body, "inline");
+ break;
+ default:
+ /* Hmmmm? */
+ break;
+ }
+
changed (attachment);
close_cb (widget, data);
}
@@ -389,6 +425,9 @@ e_msg_composer_attachment_edit (EMsgComposerAttachment *attachment,
dialog_data->mime_type_entry = GTK_ENTRY (glade_xml_get_widget
(editor_gui,
"mime_type_entry"));
+ dialog_data->disposition_option = GTK_OPTION_MENU (glade_xml_get_widget
+ (editor_gui,
+ "disposition_option"));
if (attachment != NULL) {
CamelContentType *content_type;
diff --git a/composer/e-msg-composer-attachment.glade b/composer/e-msg-composer-attachment.glade
index a9717bef69..fe25b6a4fd 100644
--- a/composer/e-msg-composer-attachment.glade
+++ b/composer/e-msg-composer-attachment.glade
@@ -10,6 +10,17 @@
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
+ <use_widget_names>False</use_widget_names>
+ <output_main_file>False</output_main_file>
+ <output_support_files>True</output_support_files>
+ <output_build_files>True</output_build_files>
+ <backup_source_files>True</backup_source_files>
+ <main_source_file>interface.c</main_source_file>
+ <main_header_file>interface.h</main_header_file>
+ <handler_source_file>callbacks.c</handler_source_file>
+ <handler_header_file>callbacks.h</handler_header_file>
+ <support_source_file>support.c</support_source_file>
+ <support_header_file>support.h</support_header_file>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>e-msg-composer-attachment.glade.h</translatable_strings_file>
</project>
@@ -17,6 +28,7 @@
<widget>
<class>GnomeDialog</class>
<name>dialog</name>
+ <cxx_use_heap>True</cxx_use_heap>
<title>Attachment properties</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
@@ -31,6 +43,7 @@
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox1</name>
+ <cxx_use_heap>True</cxx_use_heap>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
@@ -40,44 +53,10 @@
</child>
<widget>
- <class>GtkHButtonBox</class>
- <child_name>GnomeDialog:action_area</child_name>
- <name>dialog-action_area1</name>
- <layout_style>GTK_BUTTONBOX_END</layout_style>
- <spacing>8</spacing>
- <child_min_width>85</child_min_width>
- <child_min_height>27</child_min_height>
- <child_ipad_x>7</child_ipad_x>
- <child_ipad_y>0</child_ipad_y>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- <pack>GTK_PACK_END</pack>
- </child>
-
- <widget>
- <class>GtkButton</class>
- <name>ok_button</name>
- <can_default>True</can_default>
- <has_default>True</has_default>
- <can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>close_button</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
- </widget>
- </widget>
-
- <widget>
<class>GtkTable</class>
<name>table1</name>
- <rows>3</rows>
+ <cxx_use_heap>True</cxx_use_heap>
+ <rows>4</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>10</row_spacing>
@@ -91,6 +70,7 @@
<widget>
<class>GtkEntry</class>
<name>description_entry</name>
+ <cxx_use_heap>True</cxx_use_heap>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -115,6 +95,7 @@
<widget>
<class>GtkHBox</class>
<name>hbox3</name>
+ <cxx_use_heap>True</cxx_use_heap>
<homogeneous>False</homogeneous>
<spacing>10</spacing>
<child>
@@ -136,6 +117,7 @@
<class>GtkEntry</class>
<name>file_name_entry</name>
<width>290</width>
+ <cxx_use_heap>True</cxx_use_heap>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -152,6 +134,7 @@
<widget>
<class>GtkEntry</class>
<name>mime_type_entry</name>
+ <cxx_use_heap>True</cxx_use_heap>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<editable>False</editable>
@@ -177,6 +160,7 @@
<widget>
<class>GtkLabel</class>
<name>label3</name>
+ <cxx_use_heap>True</cxx_use_heap>
<label>MIME type:</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
@@ -203,6 +187,7 @@
<widget>
<class>GtkLabel</class>
<name>label1</name>
+ <cxx_use_heap>True</cxx_use_heap>
<label>Description:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@@ -229,6 +214,7 @@
<widget>
<class>GtkLabel</class>
<name>label2</name>
+ <cxx_use_heap>True</cxx_use_heap>
<label>File name:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@@ -251,6 +237,96 @@
<yfill>False</yfill>
</child>
</widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label4</name>
+ <cxx_use_heap>True</cxx_use_heap>
+ <label>Send as:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>disposition_option</name>
+ <cxx_use_heap>True</cxx_use_heap>
+ <can_focus>True</can_focus>
+ <items>Attachment
+Inline attachment
+</items>
+ <initial_choice>1</initial_choice>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area1</name>
+ <cxx_use_heap>True</cxx_use_heap>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>ok_button</name>
+ <cxx_use_heap>True</cxx_use_heap>
+ <can_default>True</can_default>
+ <has_default>True</has_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>close_button</name>
+ <cxx_use_heap>True</cxx_use_heap>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
+ </widget>
</widget>
</widget>
</widget>
diff --git a/composer/e-msg-composer-attachment.glade.h b/composer/e-msg-composer-attachment.glade.h
index 2f7bb7d044..f8bcebf1d7 100644
--- a/composer/e-msg-composer-attachment.glade.h
+++ b/composer/e-msg-composer-attachment.glade.h
@@ -1,10 +1,14 @@
/*
- * Translatable strings file generated by extract-ui.
- * Add this file to your project's POTFILES.in
+ * Translatable strings file generated by Glade.
+ * Add this file to your project's POTFILES.in.
* DO NOT compile it as part of your application.
*/
gchar *s = N_("Attachment properties");
+gchar *s = N_("MIME type:");
gchar *s = N_("Description:");
gchar *s = N_("File name:");
-gchar *s = N_("MIME type:");
+gchar *s = N_("Send as:");
+gchar *s = N_("Attachment\n"
+ "Inline attachment\n"
+ "");