aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/ChangeLog5
-rw-r--r--widgets/meeting-time-sel/ChangeLog4
-rw-r--r--widgets/meeting-time-sel/e-meeting-time-sel.c9
-rw-r--r--widgets/menus/gal-view-menus.c36
-rw-r--r--widgets/menus/gal-view-menus.h34
5 files changed, 58 insertions, 30 deletions
diff --git a/widgets/ChangeLog b/widgets/ChangeLog
index 6a030412ff..4efba177ca 100644
--- a/widgets/ChangeLog
+++ b/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2000-12-06 Christopher James Lahey <clahey@helixcode.com>
+
+ * menus/gal-view-menus.c, menus/gal-view-menus.h: Added a
+ GalViewCollection argument to the new function here.
+
2000-12-04 Dan Winship <danw@helixcode.com>
* menus/gal-view-menus.c: NULL-terminate gal_view_menus_apply's
diff --git a/widgets/meeting-time-sel/ChangeLog b/widgets/meeting-time-sel/ChangeLog
index 85825fa965..b2d6228343 100644
--- a/widgets/meeting-time-sel/ChangeLog
+++ b/widgets/meeting-time-sel/ChangeLog
@@ -1,3 +1,7 @@
+2000-12-06 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-meeting-time-sel.c: Fixed a bunch of warnings.
+
2000-09-25 Damon Chaplin <damon@helixcode.com>
* e-meeting-time-sel-item.c:
diff --git a/widgets/meeting-time-sel/e-meeting-time-sel.c b/widgets/meeting-time-sel/e-meeting-time-sel.c
index 0cb9e4e8b9..2130b14bc2 100644
--- a/widgets/meeting-time-sel/e-meeting-time-sel.c
+++ b/widgets/meeting-time-sel/e-meeting-time-sel.c
@@ -2421,7 +2421,7 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts)
23, 20, 17, 22, 19, 24 };
GDate date;
gint max_date_width, longest_weekday_width, longest_month_width, width;
- gint day, weekday, longest_weekday, month, longest_month;
+ gint day, longest_weekday, month, longest_month;
gchar buffer[128];
GdkFont *font;
@@ -2432,9 +2432,10 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts)
/* Find the biggest full weekday name. We start on a particular
Monday and go through seven days. */
- longest_weekday_width = 0;
g_date_clear (&date, 1);
g_date_set_dmy (&date, 3, 1, 2000); /* Monday 3rd Jan 2000. */
+ longest_weekday_width = 0;
+ longest_weekday = G_DATE_MONDAY;
for (day = G_DATE_MONDAY; day <= G_DATE_SUNDAY; day++) {
g_date_strftime (buffer, sizeof (buffer), "%A", &date);
width = gdk_string_width (font, buffer);
@@ -2447,6 +2448,7 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts)
/* Now find the biggest month name. */
longest_month_width = 0;
+ longest_month = G_DATE_JANUARY;
for (month = G_DATE_JANUARY; month <= G_DATE_DECEMBER; month++) {
g_date_set_month (&date, month);
g_date_strftime (buffer, sizeof (buffer), "%B", &date);
@@ -2477,12 +2479,13 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts)
/* Now try it with abbreviated weekday names. */
longest_weekday_width = 0;
+ longest_weekday = G_DATE_MONDAY;
g_date_set_dmy (&date, 3, 1, 2000); /* Monday 3rd Jan 2000. */
for (day = G_DATE_MONDAY; day <= G_DATE_SUNDAY; day++) {
g_date_strftime (buffer, sizeof (buffer), "%a", &date);
width = gdk_string_width (font, buffer);
if (width > longest_weekday_width) {
- longest_weekday = weekday;
+ longest_weekday = day;
longest_weekday_width = width;
}
g_date_add_days (&date, 1);
diff --git a/widgets/menus/gal-view-menus.c b/widgets/menus/gal-view-menus.c
index 2808eff29f..377bb5918a 100644
--- a/widgets/menus/gal-view-menus.c
+++ b/widgets/menus/gal-view-menus.c
@@ -17,6 +17,10 @@
#include "gal-view-menus.h"
#include <gal/menus/gal-define-views-dialog.h>
+struct _GalViewMenusPrivate {
+ GalViewCollection *collection;
+};
+
#define PARENT_TYPE (gtk_object_get_type())
static GtkObjectClass *gvm_parent_class;
@@ -24,9 +28,12 @@ static GtkObjectClass *gvm_parent_class;
static void
gvm_destroy (GtkObject *object)
{
-#if 0
GalViewMenus *gvm = GAL_VIEW_MENUS (object);
-#endif
+
+ if (gvm->priv->collection)
+ gtk_object_unref(GTK_OBJECT(gvm->priv->collection));
+ g_free(gvm->priv);
+ gvm->priv = NULL;
GTK_OBJECT_CLASS (gvm_parent_class)->destroy (object);
}
@@ -39,14 +46,33 @@ gvm_class_init (GtkObjectClass *klass)
klass->destroy = gvm_destroy;
}
-E_MAKE_TYPE(gal_view_menus, "GalViewMenus", GalViewMenus, gvm_class_init, NULL, PARENT_TYPE);
+static void
+gvm_init (GalViewMenus *gvm)
+{
+ gvm->priv = g_new(GalViewMenusPrivate, 1);
+ gvm->priv->collection = NULL;
+}
+
+E_MAKE_TYPE(gal_view_menus, "GalViewMenus", GalViewMenus, gvm_class_init, gvm_init, PARENT_TYPE);
GalViewMenus *
-gal_view_menus_new (void)
+gal_view_menus_new (GalViewCollection *collection)
{
GalViewMenus *gvm = gtk_type_new (GAL_VIEW_MENUS_TYPE);
- return (GalViewMenus *) gvm;
+ gal_view_menus_construct(gvm, collection);
+
+ return gvm;
+}
+
+GalViewMenus *
+gal_view_menus_construct (GalViewMenus *gvm,
+ GalViewCollection *collection)
+{
+ if (collection)
+ gtk_object_ref(GTK_OBJECT(gvm));
+ gvm->priv->collection = collection;
+ return gvm;
}
static void
diff --git a/widgets/menus/gal-view-menus.h b/widgets/menus/gal-view-menus.h
index 74bfbdbe82..21b302771c 100644
--- a/widgets/menus/gal-view-menus.h
+++ b/widgets/menus/gal-view-menus.h
@@ -5,6 +5,7 @@
#include <gtk/gtkobject.h>
#include <gnome-xml/tree.h>
#include <bonobo/bonobo-ui-component.h>
+#include <gal/menus/gal-view-collection.h>
#define GAL_VIEW_MENUS_TYPE (gal_view_menus_get_type ())
#define GAL_VIEW_MENUS(o) (GTK_CHECK_CAST ((o), GAL_VIEW_MENUS_TYPE, GalViewMenus))
@@ -12,35 +13,24 @@
#define GAL_IS_VIEW_MENUS(o) (GTK_CHECK_TYPE ((o), GAL_VIEW_MENUS_TYPE))
#define GAL_IS_VIEW_MENUS_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_VIEW_MENUS_TYPE))
+typedef struct _GalViewMenusPrivate GalViewMenusPrivate;
+
typedef struct {
GtkObject base;
- void *priv;
+ GalViewMenusPrivate *priv;
} GalViewMenus;
typedef struct {
GtkObjectClass parent_class;
} GalViewMenusClass;
-GtkType gal_view_menus_get_type (void);
-GalViewMenus *gal_view_menus_new (void);
-
-void gal_view_menus_apply (GalViewMenus *menus,
- BonoboUIComponent *component,
- CORBA_Environment *ev);
-
-#if 0
-gboolean gal_view_menus_load_from_file (GalViewMenus *menus,
- const char *filename);
-void gal_view_menus_load_from_string (GalViewMenus *menus,
- const char *xml);
-void gal_view_menus_load_from_node (GalViewMenus *menus,
- const xmlNode *node);
-
-void gal_view_menus_save_to_file (GalViewMenus *menus,
- const char *filename);
-char *gal_view_menus_save_to_string (GalViewMenus *menus);
-xmlNode *gal_view_menus_save_to_node (GalViewMenus *menus,
- xmlNode *parent);
-#endif
+GtkType gal_view_menus_get_type (void);
+GalViewMenus *gal_view_menus_new (GalViewCollection *collection);
+GalViewMenus *gal_view_menus_construct (GalViewMenus *menus,
+ GalViewCollection *collection);
+
+void gal_view_menus_apply (GalViewMenus *menus,
+ BonoboUIComponent *component,
+ CORBA_Environment *ev);
#endif /* _GAL_VIEW_MENUS_H_ */