aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-commands.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-02-14 07:50:25 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-02-14 07:50:25 +0800
commita74d594e2fcea73193b8ab208b0d333c76e9ece0 (patch)
tree01431b9cfa846c486b6cf1cd3f06fb204bcfe2ca /calendar/gui/calendar-commands.c
parent1cd5f1093b9803a0598d4aac1c1e03a49df94108 (diff)
downloadgsoc2013-evolution-a74d594e2fcea73193b8ab208b0d333c76e9ece0.tar
gsoc2013-evolution-a74d594e2fcea73193b8ab208b0d333c76e9ece0.tar.gz
gsoc2013-evolution-a74d594e2fcea73193b8ab208b0d333c76e9ece0.tar.bz2
gsoc2013-evolution-a74d594e2fcea73193b8ab208b0d333c76e9ece0.tar.lz
gsoc2013-evolution-a74d594e2fcea73193b8ab208b0d333c76e9ece0.tar.xz
gsoc2013-evolution-a74d594e2fcea73193b8ab208b0d333c76e9ece0.tar.zst
gsoc2013-evolution-a74d594e2fcea73193b8ab208b0d333c76e9ece0.zip
Set toolbar new appointment icon (set_pixmap): load files rather than
2001-02-13 JP Rosevear <jpr@ximian.com> * gui/calendar-commands.c (update_pixmaps): Set toolbar new appointment icon (set_pixmap): load files rather than create from xpm file * gui/*view.xpm: move to the art directory 2001-02-13 JP Rosevear <jpr@ximian.com> * art/Makefile.am: install new files * art/*view.xpm: add files from calendar/gui svn path=/trunk/; revision=8216
Diffstat (limited to 'calendar/gui/calendar-commands.c')
-rw-r--r--calendar/gui/calendar-commands.c77
1 files changed, 35 insertions, 42 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index a9a9d62101..29557e2d68 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -45,14 +45,6 @@
#include "print.h"
#include "dialogs/cal-prefs-dialog.h"
-#include "dayview.xpm"
-#include "workweekview.xpm"
-#include "weekview.xpm"
-#include "monthview.xpm"
-#if 0
-#include "yearview.xpm"
-#endif
-
/* A list of all of the calendars started */
static GList *all_calendars = NULL;
@@ -60,13 +52,6 @@ static GList *all_calendars = NULL;
/* We have one global preferences dialog. */
static CalPrefsDialog *preferences_dialog = NULL;
-
-static void update_pixmaps (BonoboUIComponent *uic);
-static void set_pixmap (BonoboUIComponent *uic,
- const char *xml_path,
- char **xpm_data);
-
-
/* Callback for the new appointment command */
static void
new_appointment_cb (BonoboUIComponent *uic, gpointer data, const char *path)
@@ -360,6 +345,41 @@ static BonoboUIVerb verbs [] = {
BONOBO_UI_VERB_END
};
+static void
+set_pixmap (BonoboUIComponent *uic,
+ const char *xml_path,
+ const char *icon)
+{
+ char *path;
+ GdkPixbuf *pixbuf;
+
+ path = g_concat_dir_and_file (EVOLUTION_DATADIR "/images/evolution", icon);
+
+ pixbuf = gdk_pixbuf_new_from_file (path);
+ if (pixbuf == NULL) {
+ g_warning ("Cannot load image -- %s", path);
+ g_free (path);
+ return;
+ }
+
+ bonobo_ui_util_set_pixbuf (uic, xml_path, pixbuf);
+
+ gdk_pixbuf_unref (pixbuf);
+
+ g_free (path);
+}
+
+static void
+update_pixmaps (BonoboUIComponent *uic)
+{
+ set_pixmap (uic, "/Toolbar/New", "buttons/new_appointment.png");
+
+ set_pixmap (uic, "/Toolbar/DayView", "buttons/dayview.xpm");
+ set_pixmap (uic, "/Toolbar/WorkWeekView", "buttons/workweekview.xpm");
+ set_pixmap (uic, "/Toolbar/WeekView", "buttons/weekview.xpm");
+ set_pixmap (uic, "/Toolbar/MonthView", "buttons/monthview.xpm");
+}
+
void
calendar_control_activate (BonoboControl *control,
GnomeCalendar *cal)
@@ -404,33 +424,6 @@ calendar_control_activate (BonoboControl *control,
bonobo_ui_component_thaw (uic, NULL);
}
-
-static void
-update_pixmaps (BonoboUIComponent *uic)
-{
- set_pixmap (uic, "/Toolbar/DayView", dayview_xpm);
- set_pixmap (uic, "/Toolbar/WorkWeekView", workweekview_xpm);
- set_pixmap (uic, "/Toolbar/WeekView", weekview_xpm);
- set_pixmap (uic, "/Toolbar/MonthView", monthview_xpm);
-}
-
-
-static void
-set_pixmap (BonoboUIComponent *uic,
- const char *xml_path,
- char **xpm_data)
-{
- GdkPixbuf *pixbuf;
-
- pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) xpm_data);
- g_return_if_fail (pixbuf != NULL);
-
- bonobo_ui_util_set_pixbuf (uic, xml_path, pixbuf);
-
- gdk_pixbuf_unref (pixbuf);
-}
-
-
void
calendar_control_deactivate (BonoboControl *control)
{