aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnu.org>2000-04-06 14:46:20 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2000-04-06 14:46:20 +0800
commitbbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69 (patch)
tree10b8992cf86eb9aa0221266742d255dfaabcc08d /mail
parent3d9889baee9c5c11cd960a43c0f51c449ce35b45 (diff)
downloadgsoc2013-evolution-bbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69.tar
gsoc2013-evolution-bbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69.tar.gz
gsoc2013-evolution-bbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69.tar.bz2
gsoc2013-evolution-bbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69.tar.lz
gsoc2013-evolution-bbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69.tar.xz
gsoc2013-evolution-bbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69.tar.zst
gsoc2013-evolution-bbc6d63ef0aa4b2ae1244f1a7de63b0b86f3ce69.zip
Load the icons from the installation path, not form the GNOME-libs
2000-04-06 Miguel de Icaza <miguel@gnu.org> * shell/e-shortcut.c (shell_icon_cb): Load the icons from the installation path, not form the GNOME-libs installation prefix. (shell_icon_cb): Memory leak fix. * shell/Makefile.am (imagesdir): Pass the EVOLUTION_IMAGES installation directory here. * art/Makefile.am (images_DATA): Renamed from pixmaps to images. 2000-04-06 Miguel de Icaza <miguel@gnu.org> * message-list.c: Stick pixmaps here. * mail-display.c (embeddable_destroy_cb): Replaced C++ comments with C comments. * message-list.c (load_internal_images): New function, loads images. (message_list_init_renderers): Load images, fix previous attempt at loading images. * Makefile.am (dist-hook): Added distribution of pixmaps. * pixmaps: New directory, used to hold the XPMs we ship with. * pixmaps/envelope-closed.xpm, pixmaps/envelope-open.xpm: Tigert's envelopes incorporated. 2000-04-06 Miguel de Icaza <miguel@gnu.org> * e-cell-text.c: Killed ARG_EDITABLE. (ect_event): Updated to new editable setup. (e_cell_text_new): Kill editable argument. * e-cell-toggle.c (etog_event): Handle editability here * e-cell-text.h: Removed editable bit field from here, it is now taken care at the e-cell level. * e-cell.c (e_cell_set_editable): New function. (e_cell_init): Set editable to TRUE by default. * test-check.c (check_test): update to new api * test-table.c (table_browser_test): ditto. (do_e_table_demo): ditto. * test-cols.c (multi_cols_test): ditto svn path=/trunk/; revision=2302
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog22
-rw-r--r--mail/Makefile.am4
-rw-r--r--mail/mail-display.c7
-rw-r--r--mail/message-list.c153
-rw-r--r--mail/pixmaps.h10
-rw-r--r--mail/pixmaps/attachment.xpm22
-rw-r--r--mail/pixmaps/empty.xpm21
-rw-r--r--mail/pixmaps/envelope-closed.xpm65
-rw-r--r--mail/pixmaps/envelope-opened.xpm74
9 files changed, 325 insertions, 53 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 4cea6c6a55..6877b6f8f9 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,25 @@
+2000-04-06 Miguel de Icaza <miguel@gnu.org>
+
+ * message-list.c: Stick pixmaps here.
+
+ * mail-display.c (embeddable_destroy_cb): Replaced C++ comments
+ with C comments.
+
+ * message-list.c (load_internal_images): New function, loads images.
+ (message_list_init_renderers): Load images, fix previous attempt
+ at loading images.
+
+ * Makefile.am (dist-hook): Added distribution of pixmaps.
+
+ * pixmaps: New directory, used to hold the XPMs we ship with.
+
+ * pixmaps/envelope-closed.xpm, pixmaps/envelope-open.xpm: Tigert's
+ envelopes incorporated.
+
+2000-03-31 Miguel de Icaza <miguel@gnu.org>
+
+ * message-list.c (ml_value_at): Fix miss-used variable.
+
2000-04-01 Michael Meeks <michael@helixcode.com>
* folder-browser.c (folder_browser_properties_init): update to
diff --git a/mail/Makefile.am b/mail/Makefile.am
index 936312eecd..707d514af3 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -73,3 +73,7 @@ $(EVOLUTION_MAIL_CORBA_GENERATED): Mail.idl
orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Mail.idl
EXTRA_DIST = Mail.idl evolution-mail.gnorba
+
+dist-hook:
+ -mkdir $(distdir)/pixmaps
+ cp $(srcdir)/pixmaps/*.xpm $(distdir)/pixmaps \ No newline at end of file
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 57da4b65f8..fa3d3588eb 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -141,7 +141,6 @@ embeddable_destroy_cb (GtkObject *obj, gpointer user_data)
{
BonoboWidget *be; /* bonobo embeddable */
BonoboViewFrame *vf; /* the embeddable view frame */
- GtkWidget *w; /* the viewframe widget */
BonoboObjectClient* server;
CORBA_Environment ev;
@@ -155,9 +154,9 @@ embeddable_destroy_cb (GtkObject *obj, gpointer user_data)
vf = bonobo_widget_get_view_frame (be);
bonobo_control_frame_control_deactivate (
BONOBO_CONTROL_FRAME (vf));
- //w = bonobo_control_frame_get_widget (BONOBO_CONTROL_FRAME (vf));
+ /* w = bonobo_control_frame_get_widget (BONOBO_CONTROL_FRAME (vf)); */
- //gtk_widget_destroy (w);
+ /* gtk_widget_destroy (w); */
CORBA_exception_init (&ev);
Bonobo_Unknown_unref (
@@ -167,7 +166,7 @@ embeddable_destroy_cb (GtkObject *obj, gpointer user_data)
CORBA_exception_free (&ev);
bonobo_object_destroy (BONOBO_OBJECT (vf));
- //gtk_object_unref (obj);
+ /* gtk_object_unref (obj); */
}
diff --git a/mail/message-list.c b/mail/message-list.c
index f84d0d2797..a5ede2071f 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -20,6 +20,8 @@
#include "widgets/e-table/e-table-header-item.h"
#include "widgets/e-table/e-table-item.h"
+#include "pixmaps.h"
+
/*
* Default sizes for the ETable display
*
@@ -32,8 +34,8 @@
#define COL_FROM_WIDTH_MIN 32
#define COL_SUBJECT_WIDTH N_CHARS(30)
#define COL_SUBJECT_WIDTH_MIN 32
-#define COL_SENT_WIDTH N_CHARS(20)
-#define COL_SENT_WIDTH_MIN 32
+#define COL_SENT_WIDTH N_CHARS(4)
+#define COL_SENT_WIDTH_MIN 1
#define COL_RECEIVE_WIDTH N_CHARS(20)
#define COL_RECEIVE_WIDTH_MIN 32
#define COL_TO_WIDTH N_CHARS(24)
@@ -133,7 +135,7 @@ ml_value_at (ETableModel *etm, int col, int row, void *data)
static char buffer [10];
MessageList *message_list = data;
CamelFolderSummary *summary;
- GPtrArray *msg_info_array;
+ GPtrArray *msg_info_array = NULL;
CamelMessageInfo *msg_info;
CamelException ex;
void *retval = NULL;
@@ -215,16 +217,17 @@ ml_value_at (ETableModel *etm, int col, int row, void *data)
return retval;
- nothing_to_see :
- /*
- * in the case there is nothing to look at,
- * notify the user.
- */
+ nothing_to_see:
+ /*
+ * in the case there is nothing to look at,
+ * notify the user.
+ */
+ if (msg_info_array)
g_ptr_array_free (msg_info_array, TRUE);
- if (col == COL_SUBJECT)
- return "No item in this view";
- else
- return NULL;
+ if (col == COL_SUBJECT)
+ return "No item in this view";
+ else
+ return NULL;
}
static void
@@ -246,7 +249,7 @@ ml_duplicate_value (ETableModel *etm, int col, const void *value, void *data)
case COL_MESSAGE_STATUS:
case COL_PRIORITY:
case COL_ATTACHMENT:
- return value;
+ return (void *) value;
case COL_FROM:
case COL_SUBJECT:
@@ -254,7 +257,7 @@ ml_duplicate_value (ETableModel *etm, int col, const void *value, void *data)
case COL_RECEIVE:
case COL_TO:
case COL_SIZE:
- return g_strdup(value);
+ return g_strdup (value);
default:
g_assert_not_reached ();
}
@@ -269,7 +272,7 @@ ml_free_value (ETableModel *etm, int col, void *value, void *data)
case COL_MESSAGE_STATUS:
case COL_PRIORITY:
case COL_ATTACHMENT:
- break;
+ break;
case COL_FROM:
case COL_SUBJECT:
@@ -277,8 +280,8 @@ ml_free_value (ETableModel *etm, int col, void *value, void *data)
case COL_RECEIVE:
case COL_TO:
case COL_SIZE:
- g_free(value);
- break;
+ g_free (value);
+ break;
default:
g_assert_not_reached ();
}
@@ -287,36 +290,78 @@ ml_free_value (ETableModel *etm, int col, void *value, void *data)
static void
ml_thaw (ETableModel *etm, void *data)
{
- e_table_model_changed(etm);
+ e_table_model_changed (etm);
}
+static struct {
+ char **image_base;
+ GdkPixbuf *pixbuf;
+} states_pixmaps [] = {
+ { envelope_opened_xpm, NULL },
+ { envelope_closed_xpm, NULL },
+ { empty_xpm, NULL },
+ { attachment_xpm, NULL },
+ { NULL, NULL },
+};
+
static void
-message_list_init_renderers (MessageList *message_list)
+load_internal_images (void)
{
- gchar *attachment_path;
- GdkPixbuf *image;
+ int i;
+ /*
+ * Only load once, and share
+ */
+ if (states_pixmaps [0].pixbuf)
+ return;
+
+ for (i = 0; states_pixmaps [i].image_base; i++){
+ states_pixmaps [i].pixbuf = gdk_pixbuf_new_from_xpm_data (
+ states_pixmaps [i].image_base);
+ }
+}
+
+static void
+message_list_init_renderers (MessageList *message_list)
+{
g_assert (message_list);
g_assert (message_list->table_model);
+
+ load_internal_images ();
message_list->render_text = e_cell_text_new (
message_list->table_model,
- NULL, GTK_JUSTIFY_LEFT, FALSE);
+ NULL, GTK_JUSTIFY_LEFT);
+ e_cell_set_editable (E_CELL (message_list->render_text), FALSE);
message_list->render_online_status = e_cell_checkbox_new ();
- message_list->render_message_status = e_cell_checkbox_new ();
-#if 1
- message_list->render_attachment = e_cell_checkbox_new ();
-#else
+
+ /*
+ * Message status
+ */
+ {
+ GdkPixbuf *images [2];
+
+ images [0] = states_pixmaps [0].pixbuf;
+ images [1] = states_pixmaps [1].pixbuf;
+
+ message_list->render_message_status = e_cell_toggle_new (0, 2, images);
+ }
+ e_cell_set_editable (E_CELL (message_list->render_message_status), FALSE);
+
/*
- * if we want to use a pixmap, use this code
+ * Attachment
*/
- attachment_path = gnome_unconditional_datadir_file ("evolution/e-attchmt.png");
- image = gdk_pixbuf_new_from_file (attachment_path);
- message_list->render_attachment = e_cell_toggle_new (0, 1, &image);
- g_free (attachment_path);
-#endif
+ {
+ GdkPixbuf *images [2];
+ images [0] = states_pixmaps [2].pixbuf;
+ images [1] = states_pixmaps [3].pixbuf;
+
+ message_list->render_attachment = e_cell_toggle_new (0, 2, images);
+ }
+ e_cell_set_editable (E_CELL (message_list->render_attachment), FALSE);
+
/*
* FIXME: We need a real renderer here
*/
@@ -336,8 +381,8 @@ message_list_init_header (MessageList *message_list)
*/
message_list->header_model = e_table_header_new ();
- gtk_object_ref(GTK_OBJECT(message_list->header_model));
- gtk_object_sink(GTK_OBJECT(message_list->header_model));
+ gtk_object_ref (GTK_OBJECT (message_list->header_model));
+ gtk_object_sink (GTK_OBJECT (message_list->header_model));
message_list->table_cols [COL_ONLINE_STATUS] =
e_table_col_new (COL_ONLINE_STATUS, _("Online status"),
@@ -404,15 +449,22 @@ message_list_init_header (MessageList *message_list)
* of this.
*/
for (i = 0; i < COL_LAST; i++) {
- gtk_object_ref(GTK_OBJECT(message_list->table_cols [i]));
+ gtk_object_ref (GTK_OBJECT (message_list->table_cols [i]));
e_table_header_add_column (message_list->header_model,
message_list->table_cols [i], i);
}
}
-
-
-
+static char *
+message_list_get_layout (MessageList *message_list)
+{
+ if (0)
+ return g_strdup ("<ETableSpecification> <columns-shown> <column> 0 </column> <column> 1 </column> <column> 2 </column> <column> 3 </column> <column> 4 </column> <column> 5 </column> <column> 6 </column> <column> 7 </column> <column> 8 </column> <column> 9 </column> </columns-shown> <grouping> <group column=\"4\" ascending=\"1\"> <leaf column=\"5\" ascending=\"1\"/> </group> </grouping> </ETableSpecification>");
+ else {
+ /* Message status, From, Sent, Subject */
+ return g_strdup ("<ETableSpecification> <columns-shown> <column> 1 </column> <column> 4 </column> <column> 6 </column> <column> 5 </column> </columns-shown> <grouping> </grouping> </ETableSpecification>");
+ }
+}
/*
* GtkObject::init
@@ -421,7 +473,8 @@ static void
message_list_init (GtkObject *object)
{
MessageList *message_list = MESSAGE_LIST (object);
-
+ char *spec;
+
message_list->table_model = e_table_simple_new (
ml_col_count, ml_row_count, ml_value_at,
ml_set_value_at, ml_is_cell_editable, ml_duplicate_value, ml_free_value,
@@ -433,16 +486,19 @@ message_list_init (GtkObject *object)
/*
* The etable
*/
+
+ spec = message_list_get_layout (message_list);
+ message_list->etable = e_table_new (
+ message_list->header_model, message_list->table_model, spec);
+ g_free (spec);
- message_list->etable = e_table_new (message_list->header_model, message_list->table_model, "<ETableSpecification> <columns-shown> <column> 0 </column> <column> 1 </column> <column> 2 </column> <column> 3 </column> <column> 4 </column> <column> 5 </column> <column> 6 </column> <column> 7 </column> <column> 8 </column> <column> 9 </column> </columns-shown> <grouping> <group column=\"4\" ascending=\"1\"> <leaf column=\"5\" ascending=\"1\"/> </group> </grouping> </ETableSpecification>");
-
- gtk_signal_connect(GTK_OBJECT(message_list->etable), "row_selection",
- GTK_SIGNAL_FUNC(on_row_selection_cmd), message_list);
+ gtk_signal_connect (GTK_OBJECT (message_list->etable), "row_selection",
+ GTK_SIGNAL_FUNC (on_row_selection_cmd), message_list);
- gtk_widget_show(message_list->etable);
+ gtk_widget_show (message_list->etable);
- gtk_object_ref(message_list->table_model);
- gtk_object_sink(message_list->table_model);
+ gtk_object_ref (GTK_OBJECT (message_list->table_model));
+ gtk_object_sink (GTK_OBJECT (message_list->table_model));
/*
* We do own the Etable, not some widget container
@@ -662,8 +718,6 @@ message_list_get_widget (MessageList *message_list)
E_MAKE_TYPE (message_list, "MessageList", MessageList, message_list_class_init, message_list_init, PARENT_TYPE);
-
-
static void
on_row_selection_cmd (ETable *table,
int row,
@@ -674,7 +728,8 @@ on_row_selection_cmd (ETable *table,
message_list = MESSAGE_LIST (user_data);
- if ( selected )
+
+ if (selected)
select_msg (message_list, row);
}
diff --git a/mail/pixmaps.h b/mail/pixmaps.h
new file mode 100644
index 0000000000..2d11733bbb
--- /dev/null
+++ b/mail/pixmaps.h
@@ -0,0 +1,10 @@
+#ifndef EVOLUTION_PIXMAPS_H
+#define EVOLUTION_PIXMAPS_H
+
+#include "pixmaps/envelope-opened.xpm"
+#include "pixmaps/envelope-closed.xpm"
+#include "pixmaps/empty.xpm"
+#include "pixmaps/attachment.xpm"
+
+#endif /* EVOLUTION_PIXMAPS_H */
+
diff --git a/mail/pixmaps/attachment.xpm b/mail/pixmaps/attachment.xpm
new file mode 100644
index 0000000000..45e2dfb134
--- /dev/null
+++ b/mail/pixmaps/attachment.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static char * attachment_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"................",
+".......++.......",
+"....+..+.+......",
+"....+.+..++.....",
+"....+.+...+.....",
+"....+.+...+.....",
+"....+.+...+.....",
+"....+.+...+.....",
+"....+.+...+.....",
+"....+.....+.....",
+"....+.....+.....",
+"....++...++.....",
+".....++.++......",
+".......++.......",
+"................",
+"................"};
diff --git a/mail/pixmaps/empty.xpm b/mail/pixmaps/empty.xpm
new file mode 100644
index 0000000000..93b02c0164
--- /dev/null
+++ b/mail/pixmaps/empty.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * empty_xpm[] = {
+"16 16 2 1",
+" c None",
+". c #FFFFFF",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................",
+"................"};
diff --git a/mail/pixmaps/envelope-closed.xpm b/mail/pixmaps/envelope-closed.xpm
new file mode 100644
index 0000000000..be3b6e1a34
--- /dev/null
+++ b/mail/pixmaps/envelope-closed.xpm
@@ -0,0 +1,65 @@
+/* XPM */
+static char * envelope_closed_xpm[] = {
+"16 16 46 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"@ c #837D71",
+"# c #4E4B42",
+"$ c #767165",
+"% c #FFFEFE",
+"& c #FFF4DB",
+"* c #FFFEFD",
+"= c #F4E9D1",
+"- c #625D54",
+"; c #D0C7B2",
+"> c #767166",
+", c #FFFDFA",
+"' c #F2E7CF",
+") c #666257",
+"! c #C8BFAB",
+"~ c #736D63",
+"{ c #FFFEFC",
+"] c #F6EBD3",
+"^ c #EEE3CC",
+"/ c #FAEFD6",
+"( c #918A7C",
+"_ c #7E786B",
+": c #E0D6C0",
+"< c #C7BEAA",
+"[ c #FDF2D9",
+"} c #8A8476",
+"| c #746F63",
+"1 c #CEC4B0",
+"2 c #8C8678",
+"3 c #F9EED5",
+"4 c #F1E6CE",
+"5 c #F7ECD3",
+"6 c #EFE4CD",
+"7 c #D1C7B2",
+"8 c #555149",
+"9 c #CDC4B0",
+"0 c #666258",
+"a c #C1B8A5",
+"b c #C2B9A6",
+"c c #C0B7A4",
+"d c #C3BAA7",
+"e c #C4BBA8",
+"f c #CAC1AD",
+"g c #4E4B43",
+" ",
+" ...............",
+" ...............",
+" ...............",
+" ...............",
+" ..+++++++++++..",
+" .+@.........#+.",
+" .+.$%&.&*&=-;+.",
+" .+.&>%&,&')'!+.",
+" .+.&&~{&])&^!+.",
+" .+.&/().)_=:<+.",
+" .+.[}&&)]]|1<+.",
+" .+.2&^3456789+.",
+" .+0abbbcddefg+.",
+" ..+++++++++++..",
+" ..............."};
diff --git a/mail/pixmaps/envelope-opened.xpm b/mail/pixmaps/envelope-opened.xpm
new file mode 100644
index 0000000000..4894e21a78
--- /dev/null
+++ b/mail/pixmaps/envelope-opened.xpm
@@ -0,0 +1,74 @@
+/* XPM */
+static char * envelope_opened_xpm[] = {
+"16 16 55 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"@ c #F4EDDD",
+"# c #F1EBDB",
+"$ c #F1EAD8",
+"% c #EAE3CB",
+"& c #F4EAD5",
+"* c #F1E6CF",
+"= c #DDD4BE",
+"- c #ECE3CD",
+"; c #D3CAB6",
+"> c #C1C1C1",
+", c #BDBDBD",
+"' c #BFBFBF",
+") c #12110F",
+"! c #514D45",
+"~ c #767165",
+"{ c #D0C7B2",
+"] c #FFF4DB",
+"^ c #625D54",
+"/ c #565249",
+"( c #F2E7CF",
+"_ c #C8BFAB",
+": c #3B3732",
+"< c #837D71",
+"[ c #807A6D",
+"} c #45423B",
+"| c #EEE3CC",
+"1 c #FBF0D7",
+"2 c #918A7C",
+"3 c #7E786B",
+"4 c #F4E9D1",
+"5 c #E0D6C0",
+"6 c #C7BEAA",
+"7 c #FDF2D9",
+"8 c #6A665B",
+"9 c #F6EBD3",
+"0 c #656157",
+"a c #CEC4B0",
+"b c #6D675D",
+"c c #F9EED5",
+"d c #F1E6CE",
+"e c #F7ECD3",
+"f c #EFE4CD",
+"g c #D1C7B2",
+"h c #CDC4B0",
+"i c #080707",
+"j c #C1B8A5",
+"k c #C2B9A6",
+"l c #C0B7A4",
+"m c #C3BAA7",
+"n c #C4BBA8",
+"o c #CAC1AD",
+"p c #1E1D1A",
+" ",
+" ...............",
+" .....+++++.....",
+" ....+@#$$%+....",
+" ...+&*****=+...",
+" ..+-*******;+..",
+" .++>,,,,,,,')+.",
+" .+.!.......~{+.",
+" .+.]^...../(_+.",
+" .+.]]:<<[}]|_+.",
+" .+.]12]]]3456+.",
+" .+.78]]]990a6+.",
+" .+.b]|cdefg0h+.",
+" .+ijkkklmmnop+.",
+" ..+++++++++++..",
+" ..............."};