Some message composer improvements.

svn path=/trunk/; revision=1382
This commit is contained in:
Ettore Perazzoli
1999-11-12 03:15:30 +00:00
parent 0ebe0334b1
commit 15b4b77c8a
11 changed files with 605 additions and 384 deletions

View File

@ -1,3 +1,49 @@
1999-11-12 Ettore Perazzoli <ettore@gnu.org>
* e-msg-composer-address-dialog.glade: Cosmetical changes.
* e-msg-composer-attachment-bar.c (size_to_string): New helper
function.
(update): Put the size in the icon's label using this function.
(ICON_SEPARATORS): Remove '.' to avoid wrapping of the size string
on the decimal dot. But gnome-libs is broken and this has no real
effect! :-(
(e_msg_composer_attachment_bar_new): No longer make text editable.
Use the `GTK_SELECTION_MULTIPLE' selection mode.
(remove_selected): No longer assume only one attachment is
selected.
* e-msg-composer-attachment.c: #include <sys/stat.h>
(init): Initialize all the members.
(e_msg_composer_attachment_new): Set size using `stat()'.
* e-msg-composer-attachment.h: New member `size' in `struct
_EMsgComposerAttachment'.
* e-msg-composer.c (setup_signals): Connect `address_dialog_cb' to
the "show_address_dialog" signal of the header widget.
* e-msg-composer-hdrs.c (add_address_header): Renamed to
`add_header'. New parameter `addrbook_button': if true, use a
button instead of a label and make it trigger an
"show_address_dialog" signal.
(address_button_clicked_cb): Signal handler to handle this on a
"clicked" signal from the button.
(setup_headers): Updated accordingly. Also, make "Subject" the
last item. (This makes it look more like Outlook and friends.)
* e-msg-composer-hdrs.c: New signal "show_address_dialog".
* e-msg-composer-hdrs.h: Updated accordingly.
* e-msg-composer-hdrs.c (add_address_header): Reduce padding
considerably.
* e-msg-composer.c (e_msg_composer_construct): Do not use any
padding in the main vbox.
* Makefile.am: Moved the `e-table*' sources to `EXTRA_DIST'.
Compile as a shared library.
1999-11-08 Ettore Perazzoli <ettore@gnu.org>
* e-msg-composer-address-dialog.c: Implemented cut & paste for the

View File

@ -13,10 +13,10 @@ INCLUDES = \
CPPFLAGS = \
-DE_GUIDIR=\"$(guidir)\"
noinst_LIBRARIES = \
libevolutionwidgets.a
noinst_LTLIBRARIES = \
libevolutionwidgets.la
libevolutionwidgets_a_SOURCES = \
libevolutionwidgets_la_SOURCES = \
e-msg-composer-address-dialog.c \
e-msg-composer-address-dialog.h \
e-msg-composer-address-entry.c \
@ -28,7 +28,9 @@ libevolutionwidgets_a_SOURCES = \
e-msg-composer-hdrs.c \
e-msg-composer-hdrs.h \
e-msg-composer.c \
e-msg-composer.h \
e-msg-composer.h
EXTRA_DIST = \
e-table-group.c \
e-table-group.h \
e-table-header.c \

View File

@ -55,7 +55,7 @@
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<column_spacing>2</column_spacing>
<child>
<padding>0</padding>
<expand>True</expand>
@ -88,352 +88,6 @@
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox2</name>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkButton</class>
<name>button5</name>
<can_focus>True</can_focus>
<label>Properties...</label>
<child>
<padding>10</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button6</name>
<can_focus>True</can_focus>
<label>Add...</label>
<child>
<padding>10</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<width>200</width>
<height>200</height>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>10</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>address_clist</name>
<can_focus>True</can_focus>
<columns>2</columns>
<column_widths>128,80</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label5</name>
<width>150</width>
<label>Name</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label6</name>
<width>1024</width>
<label>Address</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkTable</class>
<name>table2</name>
<rows>3</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>10</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkButton</class>
<name>cc_add_button</name>
<width>60</width>
<can_focus>True</can_focus>
<label>Cc: -&gt;</label>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>10</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>to_add_button</name>
<width>60</width>
<can_focus>True</can_focus>
<label>To: -&gt;</label>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>10</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>bcc_add_button</name>
<width>60</width>
<can_focus>True</can_focus>
<label>Bcc: -&gt;</label>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>10</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>to_clist</name>
<width>200</width>
<height>100</height>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label7</name>
<label>label7</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow4</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>bcc_clist</name>
<width>200</width>
<height>100</height>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label9</name>
<label>label9</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow3</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>10</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>cc_clist</name>
<width>200</width>
<height>100</height>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label8</name>
<label>label8</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<name>label1</name>
@ -464,13 +118,13 @@
<class>GtkHBox</class>
<name>hbox1</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<spacing>5</spacing>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
@ -491,7 +145,7 @@
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>5</padding>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
@ -519,12 +173,358 @@
<can_focus>True</can_focus>
<label>Search...</label>
<child>
<padding>5</padding>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>address_clist</name>
<width>180</width>
<height>200</height>
<can_focus>True</can_focus>
<columns>2</columns>
<column_widths>128,107</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label5</name>
<width>50</width>
<label>Name</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label6</name>
<width>100</width>
<label>Address</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox2</name>
<homogeneous>True</homogeneous>
<spacing>10</spacing>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkButton</class>
<name>button5</name>
<can_focus>True</can_focus>
<label>Properties...</label>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button6</name>
<can_focus>True</can_focus>
<label>Add...</label>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkTable</class>
<name>table2</name>
<rows>3</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkButton</class>
<name>to_add_button</name>
<width>60</width>
<can_focus>True</can_focus>
<label>To: &gt;&gt;</label>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>cc_add_button</name>
<width>60</width>
<can_focus>True</can_focus>
<label>Cc: &gt;&gt;</label>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>bcc_add_button</name>
<width>60</width>
<can_focus>True</can_focus>
<label>Bcc: &gt;&gt;</label>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow4</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>2</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>bcc_clist</name>
<width>180</width>
<height>100</height>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label9</name>
<label>label9</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>2</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>to_clist</name>
<width>180</width>
<height>100</height>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label7</name>
<label>label7</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow3</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>2</xpad>
<ypad>4</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>cc_clist</name>
<width>180</width>
<height>100</height>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_BROWSE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label8</name>
<label>label8</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
@ -548,6 +548,7 @@
<class>GtkButton</class>
<name>button1</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>

View File

@ -29,7 +29,7 @@
#define ICON_WIDTH 64
#define ICON_SEPARATORS " /-_."
#define ICON_SEPARATORS " /-_"
#define ICON_SPACING 2
#define ICON_ROW_SPACING ICON_SPACING
#define ICON_COL_SPACING ICON_SPACING
@ -58,6 +58,43 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void update (EMsgComposerAttachmentBar *bar);
static gchar *
size_to_string (gulong size)
{
gchar *size_string;
/* FIXME: The following should probably go into a separate module, as
we might have to do the same thing in other places as well. Also,
I am not sure this will be OK for all the languages. */
if (size < 1e3L) {
if (size == 1)
size_string = g_strdup (_("1 byte"));
else
size_string = g_strdup_printf (_("%u bytes"),
(guint) size);
} else {
gdouble displayed_size;
if (size < 1e6L) {
displayed_size = (gdouble) size / 1.0e3;
size_string = g_strdup_printf (_("%.1fK"),
displayed_size);
} else if (size < 1e9L) {
displayed_size = (gdouble) size / 1.0e6;
size_string = g_strdup_printf (_("%.1fM"),
displayed_size);
} else {
displayed_size = (gdouble) size / 1.0e9;
size_string = g_strdup_printf (_("%.1fG"),
displayed_size);
}
}
return size_string;
}
/* Sorting. */
@ -162,6 +199,8 @@ update (EMsgComposerAttachmentBar *bar)
for (p = priv->attachments; p != NULL; p = p->next) {
EMsgComposerAttachment *attachment;
const gchar *icon_name;
gchar *size_string;
gchar *label;
attachment = p->data;
icon_name = gnome_mime_get_value (attachment->mime_type,
@ -172,8 +211,17 @@ update (EMsgComposerAttachmentBar *bar)
icon_name = gnome_mime_get_value ("text/plain",
"icon-filename");
gnome_icon_list_append (icon_list, icon_name,
attachment->description);
size_string = size_to_string (attachment->size);
/* FIXME: If GnomeIconList honoured "\n", the result would be a
lot better. */
label = g_strconcat (attachment->description, "\n(",
size_string, ")", NULL);
gnome_icon_list_append (icon_list, icon_name, label);
g_free (label);
g_free (size_string);
}
gnome_icon_list_thaw (icon_list);
@ -184,17 +232,29 @@ remove_selected (EMsgComposerAttachmentBar *bar)
{
GnomeIconList *icon_list;
EMsgComposerAttachment *attachment;
GList *attachment_list;
GList *p;
gint num;
icon_list = GNOME_ICON_LIST (bar);
num = GPOINTER_TO_INT (icon_list->selection->data);
/* FIXME do this with icon data. */
/* Weee! I am especially proud of this piece of cheesy code: it is
truly awful. But unless one attaches a huge number of files, it
will not be as greedy as intended. FIXME of course. */
attachment = E_MSG_COMPOSER_ATTACHMENT
(g_list_nth (bar->priv->attachments, num)->data);
attachment_list = NULL;
for (p = icon_list->selection; p != NULL; p = p->next) {
num = GPOINTER_TO_INT (p->data);
attachment = E_MSG_COMPOSER_ATTACHMENT
(g_list_nth (bar->priv->attachments, num)->data);
attachment_list = g_list_prepend (attachment_list, attachment);
}
for (p = attachment_list; p != NULL; p = p->next)
remove_attachment (bar, E_MSG_COMPOSER_ATTACHMENT (p->data));
g_list_free (attachment_list);
remove_attachment (bar, attachment);
update (bar);
}
@ -299,7 +359,7 @@ remove_cb (GtkWidget *widget,
static GnomeUIInfo icon_context_menu_info[] = {
GNOMEUIINFO_ITEM (N_("Remove"),
N_("Remove this item from the attachment list"),
N_("Remove selected items from the attachment list"),
remove_cb, NULL),
GNOMEUIINFO_MENU_PROPERTIES_ITEM (properties_cb, NULL),
GNOMEUIINFO_END
@ -481,7 +541,8 @@ init (EMsgComposerAttachmentBar *bar)
/* FIXME partly hardcoded. We should compute height from the font, and
allow at least 2 lines for every item. */
icon_size = ICON_WIDTH + ICON_SPACING + ICON_BORDER + ICON_TEXT_SPACING + 24;
icon_size = ICON_WIDTH + ICON_SPACING + ICON_BORDER + ICON_TEXT_SPACING;
icon_size += 24;
gtk_widget_set_usize (GTK_WIDGET (bar), icon_size * 4, icon_size);
}
@ -524,15 +585,14 @@ e_msg_composer_attachment_bar_new (GtkAdjustment *adj)
icon_list = GNOME_ICON_LIST (new);
gnome_icon_list_construct (icon_list, ICON_WIDTH, adj,
GNOME_ICON_LIST_IS_EDITABLE);
gnome_icon_list_construct (icon_list, ICON_WIDTH, adj, 0);
gnome_icon_list_set_separators (icon_list, ICON_SEPARATORS);
gnome_icon_list_set_row_spacing (icon_list, ICON_ROW_SPACING);
gnome_icon_list_set_col_spacing (icon_list, ICON_COL_SPACING);
gnome_icon_list_set_icon_border (icon_list, ICON_BORDER);
gnome_icon_list_set_text_spacing (icon_list, ICON_TEXT_SPACING);
gnome_icon_list_set_selection_mode (icon_list, GTK_SELECTION_SINGLE);
gnome_icon_list_set_selection_mode (icon_list, GTK_SELECTION_MULTIPLE);
return GTK_WIDGET (new);
}

View File

@ -21,7 +21,16 @@
* Author: Ettore Perazzoli
*/
/* This is the object representing an email attachment. It is implemented as a
GtkObject to make it easier for the application to handle it. For example,
the "changed" signal is emitted whenever something changes in the
attachment. Also, this contains the code to let users edit the
attachment manually. */
#include <sys/stat.h>
#include <gnome.h>
#include "e-msg-composer-attachment.h"
@ -122,6 +131,11 @@ class_init (EMsgComposerAttachmentClass *klass)
static void
init (EMsgComposerAttachment *msg_composer_attachment)
{
msg_composer_attachment->editor_gui = NULL;
msg_composer_attachment->file_name = NULL;
msg_composer_attachment->description = NULL;
msg_composer_attachment->mime_type = NULL;
msg_composer_attachment->size = 0;
}
GtkType
@ -158,6 +172,7 @@ EMsgComposerAttachment *
e_msg_composer_attachment_new (const gchar *file_name)
{
EMsgComposerAttachment *new;
struct stat statbuf;
g_return_val_if_fail (file_name != NULL, NULL);
@ -168,6 +183,11 @@ e_msg_composer_attachment_new (const gchar *file_name)
new->file_name = g_strdup (file_name);
new->description = g_strdup (g_basename (new->file_name));
if (stat (file_name, &statbuf) < 0)
new->size = 0;
else
new->size = statbuf.st_size;
init_mime_type (new);
return new;

View File

@ -49,12 +49,13 @@ struct _EMsgComposerAttachment {
gchar *file_name;
gchar *description;
gchar *mime_type;
gulong size;
};
struct _EMsgComposerAttachmentClass {
GtkObjectClass parent_class;
/* Signals go here */
void (*changed) (EMsgComposerAttachment *msg_composer_attachment);
};

View File

@ -46,29 +46,55 @@ struct _EMsgComposerHdrsPrivate {
static GtkTableClass *parent_class = NULL;
enum {
SHOW_ADDRESS_DIALOG,
LAST_SIGNAL
};
static gint signals[LAST_SIGNAL];
static void
address_button_clicked_cb (GtkButton *button,
gpointer data)
{
gtk_signal_emit (GTK_OBJECT (data), signals[SHOW_ADDRESS_DIALOG]);
}
static GtkWidget *
add_address_header (EMsgComposerHdrs *hdrs,
const gchar *name)
add_header (EMsgComposerHdrs *hdrs,
const gchar *name,
gboolean addrbook_button)
{
EMsgComposerHdrsPrivate *priv;
GtkWidget *label;
GtkWidget *entry;
guint pad;
priv = hdrs->priv;
label = gtk_label_new (name);
if (addrbook_button) {
label = gtk_button_new_with_label (name);
gtk_signal_connect (GTK_OBJECT (label), "clicked",
GTK_SIGNAL_FUNC (address_button_clicked_cb),
hdrs);
pad = 2;
} else {
label = gtk_label_new (name);
pad = GNOME_PAD;
}
gtk_table_attach (GTK_TABLE (hdrs), label,
0, 1, priv->num_hdrs, priv->num_hdrs + 1,
GTK_FILL, GTK_FILL,
GNOME_PAD, GNOME_PAD);
pad, pad);
gtk_widget_show (label);
entry = e_msg_composer_address_entry_new ();
gtk_table_attach (GTK_TABLE (hdrs), entry,
1, 2, priv->num_hdrs, priv->num_hdrs + 1,
GTK_FILL | GTK_EXPAND, GTK_FILL,
GNOME_PAD, GNOME_PAD);
2, 2);
gtk_widget_show (entry);
priv->num_hdrs++;
@ -83,10 +109,10 @@ setup_headers (EMsgComposerHdrs *hdrs)
priv = hdrs->priv;
priv->subject_entry = add_address_header (hdrs, _("Subject:"));
priv->to_entry = add_address_header (hdrs, _("To:"));
priv->cc_entry = add_address_header (hdrs, _("Cc:"));
priv->bcc_entry = add_address_header (hdrs, _("Bcc:"));
priv->to_entry = add_header (hdrs, _("To:"), TRUE);
priv->cc_entry = add_header (hdrs, _("Cc:"), TRUE);
priv->bcc_entry = add_header (hdrs, _("Bcc:"), TRUE);
priv->subject_entry = add_header (hdrs, _("Subject:"), FALSE);
}
@ -98,6 +124,17 @@ class_init (EMsgComposerHdrsClass *klass)
object_class = (GtkObjectClass*) klass;
parent_class = gtk_type_class (gtk_table_get_type ());
signals[SHOW_ADDRESS_DIALOG] =
gtk_signal_new ("show_address_dialog",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (EMsgComposerHdrsClass,
show_address_dialog),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void

View File

@ -51,6 +51,8 @@ struct _EMsgComposerHdrs {
struct _EMsgComposerHdrsClass {
GtkTableClass parent_class;
void (* show_address_dialog) (EMsgComposerHdrs *hdrs);
};

View File

@ -323,6 +323,10 @@ setup_signals (EMsgComposer *composer)
"changed",
GTK_SIGNAL_FUNC (attachment_bar_changed),
composer);
gtk_signal_connect (GTK_OBJECT (composer->hdrs), "show_address_dialog",
GTK_SIGNAL_FUNC (address_dialog_cb),
composer);
}
@ -455,7 +459,7 @@ e_msg_composer_construct (EMsgComposer *composer)
glade_xml_get_widget (composer->appbar_gui,
"appbar"));
vbox = gtk_vbox_new (FALSE, GNOME_PAD);
vbox = gtk_vbox_new (FALSE, 0);
composer->hdrs = e_msg_composer_hdrs_new ();
gtk_box_pack_start (GTK_BOX (vbox), composer->hdrs, FALSE, TRUE, 0);
@ -492,7 +496,7 @@ e_msg_composer_construct (EMsgComposer *composer)
composer->attachment_bar);
gtk_box_pack_start (GTK_BOX (vbox),
composer->attachment_scrolled_window,
FALSE, TRUE, 0);
FALSE, TRUE, GNOME_PAD_SMALL);
gnome_app_set_contents (GNOME_APP (composer), vbox);
gtk_widget_show (vbox);

View File

@ -1,3 +1,49 @@
1999-11-12 Ettore Perazzoli <ettore@gnu.org>
* e-msg-composer-address-dialog.glade: Cosmetical changes.
* e-msg-composer-attachment-bar.c (size_to_string): New helper
function.
(update): Put the size in the icon's label using this function.
(ICON_SEPARATORS): Remove '.' to avoid wrapping of the size string
on the decimal dot. But gnome-libs is broken and this has no real
effect! :-(
(e_msg_composer_attachment_bar_new): No longer make text editable.
Use the `GTK_SELECTION_MULTIPLE' selection mode.
(remove_selected): No longer assume only one attachment is
selected.
* e-msg-composer-attachment.c: #include <sys/stat.h>
(init): Initialize all the members.
(e_msg_composer_attachment_new): Set size using `stat()'.
* e-msg-composer-attachment.h: New member `size' in `struct
_EMsgComposerAttachment'.
* e-msg-composer.c (setup_signals): Connect `address_dialog_cb' to
the "show_address_dialog" signal of the header widget.
* e-msg-composer-hdrs.c (add_address_header): Renamed to
`add_header'. New parameter `addrbook_button': if true, use a
button instead of a label and make it trigger an
"show_address_dialog" signal.
(address_button_clicked_cb): Signal handler to handle this on a
"clicked" signal from the button.
(setup_headers): Updated accordingly. Also, make "Subject" the
last item. (This makes it look more like Outlook and friends.)
* e-msg-composer-hdrs.c: New signal "show_address_dialog".
* e-msg-composer-hdrs.h: Updated accordingly.
* e-msg-composer-hdrs.c (add_address_header): Reduce padding
considerably.
* e-msg-composer.c (e_msg_composer_construct): Do not use any
padding in the main vbox.
* Makefile.am: Moved the `e-table*' sources to `EXTRA_DIST'.
Compile as a shared library.
1999-11-08 Ettore Perazzoli <ettore@gnu.org>
* e-msg-composer-address-dialog.c: Implemented cut & paste for the

View File

@ -13,10 +13,10 @@ INCLUDES = \
CPPFLAGS = \
-DE_GUIDIR=\"$(guidir)\"
noinst_LIBRARIES = \
libevolutionwidgets.a
noinst_LTLIBRARIES = \
libevolutionwidgets.la
libevolutionwidgets_a_SOURCES = \
libevolutionwidgets_la_SOURCES = \
e-msg-composer-address-dialog.c \
e-msg-composer-address-dialog.h \
e-msg-composer-address-entry.c \
@ -28,7 +28,9 @@ libevolutionwidgets_a_SOURCES = \
e-msg-composer-hdrs.c \
e-msg-composer-hdrs.h \
e-msg-composer.c \
e-msg-composer.h \
e-msg-composer.h
EXTRA_DIST = \
e-table-group.c \
e-table-group.h \
e-table-header.c \