aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog13
-rw-r--r--calendar/gui/calendar-config.h1
-rw-r--r--calendar/gui/dialogs/event-page.c19
-rw-r--r--calendar/gui/dialogs/task-page.c20
-rw-r--r--calendar/gui/e-day-view-main-item.c9
-rw-r--r--calendar/gui/e-day-view-top-item.c7
-rw-r--r--calendar/gui/e-week-view-event-item.c7
7 files changed, 29 insertions, 47 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index c2e4d0eec1..024049f105 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,16 @@
+2001-07-02 Rodrigo Moya <rodrigo@ximian.com>
+
+ * gui/dialogs/task-page.c (categories_clicked_cb):
+ * gui/dialogs/event-page.c (categories_clicked_cb): use the new
+ self-contained e_categories_config_open_dialog_for_entry() function
+
+ * gui/e-week-view-event-item.c (e_week_view_item_draw_icons):
+ * gui/e-day-view-top-item.c (e_day_view_reshape_long_event):
+ (e_day_view_reshape_day_event): ditto
+ * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
+ use e_categories_config_get_icon_for() to retrieve the icon
+ associated with each category
+
2001-07-02 JP Rosevear <jpr@ximian.com>
* gui/e-itip-control.c (send_freebusy): implement
diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h
index a1a55a7267..2979d07d91 100644
--- a/calendar/gui/calendar-config.h
+++ b/calendar/gui/calendar-config.h
@@ -142,5 +142,4 @@ void calendar_config_set_tasks_due_today_color (const char *color);
const char *calendar_config_get_tasks_overdue_color (void);
void calendar_config_set_tasks_overdue_color (const char *color);
-
#endif /* _CALENDAR_CONFIG_H_ */
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 5646a31a76..89835ae4b3 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -837,30 +837,13 @@ categories_clicked_cb (GtkWidget *button, gpointer data)
{
EventPage *epage;
EventPagePrivate *priv;
- char *categories;
- GnomeDialog *dialog;
- int result;
GtkWidget *entry;
epage = EVENT_PAGE (data);
priv = epage->priv;
entry = priv->categories;
- categories = e_utf8_gtk_entry_get_text (GTK_ENTRY (entry));
-
- dialog = GNOME_DIALOG (e_categories_new (categories));
- result = gnome_dialog_run (dialog);
- g_free (categories);
-
- if (result == 0) {
- gtk_object_get (GTK_OBJECT (dialog),
- "categories", &categories,
- NULL);
- e_utf8_gtk_entry_set_text (GTK_ENTRY (entry), categories);
- g_free (categories);
- }
-
- gtk_object_destroy (GTK_OBJECT (dialog));
+ e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry));
}
/* This is called when any field is changed; it notifies upstream. */
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index ce01a389e6..705477f794 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -36,6 +36,7 @@
#include <gal/widgets/e-categories.h>
#include <widgets/misc/e-dateedit.h>
#include "e-util/e-dialog-widgets.h"
+#include "e-util/e-categories-config.h"
#include "../e-timezone-entry.h"
#include "comp-editor-util.h"
#include "task-page.h"
@@ -722,30 +723,13 @@ categories_clicked_cb (GtkWidget *button, gpointer data)
{
TaskPage *tpage;
TaskPagePrivate *priv;
- char *categories;
- GnomeDialog *dialog;
- int result;
GtkWidget *entry;
tpage = TASK_PAGE (data);
priv = tpage->priv;
entry = priv->categories;
- categories = e_utf8_gtk_entry_get_text (GTK_ENTRY (entry));
-
- dialog = GNOME_DIALOG (e_categories_new (categories));
- result = gnome_dialog_run (dialog);
- g_free (categories);
-
- if (result == 0) {
- gtk_object_get (GTK_OBJECT (dialog),
- "categories", &categories,
- NULL);
- e_utf8_gtk_entry_set_text (GTK_ENTRY (entry), categories);
- g_free (categories);
- }
-
- gtk_object_destroy (GTK_OBJECT (dialog));
+ e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry));
}
/* This is called when any field is changed; it notifies upstream. */
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index 6c7d47c911..661f62b702 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -29,6 +29,7 @@
*/
#include <config.h>
+#include "e-util/e-categories-config.h"
#include "e-day-view-layout.h"
#include "e-day-view-main-item.h"
@@ -629,16 +630,16 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
icon_y += icon_y_inc;
}
- /* draw icons per category */
+ /* draw categories icons */
for (elem = categories_list; elem; elem = elem->next) {
char *category;
GdkPixmap *pixmap;
GdkBitmap *mask;
category = (char *) elem->data;
- /* FIXME: get icon for this category */
- pixmap = day_view->recurrence_icon;
- mask = day_view->recurrence_mask;
+ e_categories_config_get_icon_for (category, &pixmap, &mask);
+ if (pixmap == NULL || mask == NULL)
+ continue;
max_icon_w = item_x + item_w - icon_x
- E_DAY_VIEW_EVENT_BORDER_WIDTH;
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index cf89ba06ba..7f2e8663af 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -30,6 +30,7 @@
#include <glib.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include "e-util/e-categories-config.h"
#include "e-day-view-top-item.h"
static void e_day_view_top_item_class_init (EDayViewTopItemClass *class);
@@ -577,9 +578,9 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
GdkBitmap *mask;
category = (char *) elem->data;
- /* FIXME: get icon for this category */
- pixmap = day_view->recurrence_icon;
- mask = day_view->recurrence_mask;
+ e_categories_config_get_icon_for (category, &pixmap, &mask);
+ if (pixmap == NULL || mask == NULL)
+ continue;
if (icon_x <= max_icon_x) {
gdk_gc_set_clip_origin (gc, icon_x, icon_y);
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index 023b297992..06a065d364 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -31,6 +31,7 @@
#include <config.h>
+#include "e-util/e-categories-config.h"
#include "e-week-view-event-item.h"
#include <gtk/gtksignal.h>
@@ -617,9 +618,9 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem,
GdkBitmap *mask;
category = (char *) elem->data;
- /* FIXME: get icon for this category */
- pixmap = week_view->recurrence_icon;
- mask = week_view->recurrence_mask;
+ e_categories_config_get_icon_for (category, &pixmap, &mask);
+ if (pixmap == NULL || mask == NULL)
+ continue;
if (icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) {
gdk_gc_set_clip_origin (gc, icon_x, icon_y);