Ok, here's an updated version, that ought to address your concerns. -David On Fri, 2004-10-15 at 09:07 +0800, Not Zed wrote: > > The ESource in the target should be modified instantly as the widgets > change. This is required for a couple of reasons: > 1. Communicate the changed state to any other interested widgets, > which may be supplied by plugins > 2. Lets the gui know when things have changed, so it can only enable > the "ok" button if the data validates. > > It also simplifies 'commit' since you just copy/install that source. > Obviously the ESource in the target should be a working-copy and not > the actual ESource. And clearly point 1 is the vital one. > > For the plugin it needs to ref the source and keep it around for the > widget modified callbacks. Also note that this should mean you don't > need to keep any globals to access them since the data will just be on > the source already. It doesn't need a commit method really since all > of its state is stored in the source which will be committed by the > master programme. > > I suspect as the calendar naming conventions seem to be e_cal, that > would make sense more than ec_, esp since the filename was changed to > e-cal-. > > You should probably also do page_check(xx, NULL) since you want all > values checked - there might be more pages. > > But those are minor points apart from the instant-change-to-source > thing. > > I'm not sure who needs to own the copyrights if the code is going to > be in the main tree, Novell may want to, even for plugins. > > On Thu, 2004-10-14 at 15:27 -0600, David Trowbridge wrote: > > Here is my first attempt at adding config hooks for the calendar > > properties window. > > > > Note that at this time, field verification isn't enabled, since I wasn't > > sure what people wanted for it. > > > > It requires a plugin to be installed for webcal properties to function > > correctly - i've added a plugins/ directory to the evolution root (as > > per some discussion on irc a week or so back). This will probably mean > > changing EPlugin to load plugins from both the system directory and the > > user EVOLUTION_PLUGIN_PATH, rather than just one or the other. > > > > -David > -- > > Michael Zucchi <notzed ximian com> > "born to die, live to work, it's > all downhill from here" > Novell's Evolution and Free > Software Developer
? plugins
? calendar/gui/e-cal-config.c
? calendar/gui/e-cal-config.h
? calendar/gui/dialogs/cal-properties.c
? calendar/gui/dialogs/cal-properties.h
Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution/configure.in,v
retrieving revision 1.727
diff -u -r1.727 configure.in
--- configure.in 20 Oct 2004 08:18:12 -0000 1.727
+++ configure.in 21 Oct 2004 03:27:01 -0000
@@ -1338,21 +1338,27 @@
EVO_PLUGIN_RULE=$srcdir/plugin.mk
AC_SUBST_FILE(EVO_PLUGIN_RULE)
-AC_ARG_ENABLE(plugins, [ --enable-plugins=[no/all/list] Enable plugins.],enable_plugins="$enableval",enable_plugins=no)
+AC_ARG_ENABLE(plugins, [ --enable-plugins=[base/no/all/list] Enable plugins.],enable_plugins="$enableval",enable_plugins=base)
dnl Add any new plugins here
-plugins_all="subject-thread save-attachments prefer-plain"
+plugins_base="calendar-http"
+plugins_all="calendar-http subject-thread save-attachments prefer-plain"
if test x"$enable_plugins" = "xno"; then
plugins_enabled=""
msg_plugins="no"
else
- if test x"$enable_plugins" = "xall"; then
- plugins_enabled="$plugins_all"
+ if test x"$enable_plugins" = "xbase"; then
+ plugins_enabled="$plugins_base"
+ msg_plugins="$plugins_base"
else
- plugins_enabled="$enable_plugins"
- fi
- msg_plugins="$enable_plugins"
+ if test x"$enable_plugins" = "xall"; then
+ plugins_enabled="$plugins_all"
+ else
+ plugins_enabled="$enable_plugins"
+ fi
+ msg_plugins="$enable_plugins"
+ fi
fi
AC_SUBST(plugins_enabled)
AC_SUBST(plugins_all)
@@ -1533,6 +1539,7 @@
mail/default/C/Makefile
mail/importers/Makefile
plugins/Makefile
+plugins/calendar-http/Makefile
plugins/subject-thread/Makefile
plugins/save-attachments/Makefile
plugins/prefer-plain/Makefile
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2550
diff -u -r1.2550 ChangeLog
--- calendar/ChangeLog 20 Oct 2004 03:03:30 -0000 1.2550
+++ calendar/ChangeLog 21 Oct 2004 03:27:06 -0000
@@ -1,3 +1,11 @@
+2004-10-20 David Trowbridge <trowbrds cs colorado edu>
+
+ * gui/e-cal-config.c: added EConfig subclass for calendars
+ * gui/calendar-component.c: initialize plugin hooks on
+ component startup.
+ * gui/dialogs/cal-properties.c: added EConfig-based dialog
+ for the calendar properties window.
+
2004-10-19 JP Rosevear <jpr novell com>
* gui/calendar-component.c, gui/e-cal-menu.c, gui/e-cal-popup.c,
Index: calendar/gui/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/Makefile.am,v
retrieving revision 1.299
diff -u -r1.299 Makefile.am
--- calendar/gui/Makefile.am 18 Oct 2004 04:08:47 -0000 1.299
+++ calendar/gui/Makefile.am 21 Oct 2004 03:27:06 -0000
@@ -59,6 +59,11 @@
component_LTLIBRARIES = libevolution-calendar.la
+ecalendarincludedir = $(privincludedir)/calendar/gui
+
+ecalendarinclude_HEADERS = \
+ e-cal-config.h
+
INCLUDES = \
-DG_LOG_DOMAIN=\"calendar-gui\" \
-I$(top_builddir)/shell \
@@ -115,6 +120,8 @@
e-alarm-list.h \
e-cal-component-preview.c \
e-cal-component-preview.h \
+ e-cal-config.c \
+ e-cal-config.h \
e-cal-menu.c \
e-cal-menu.h \
e-cal-model-calendar.h \
Index: calendar/gui/calendar-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-component.c,v
retrieving revision 1.188
diff -u -r1.188 calendar-component.c
--- calendar/gui/calendar-component.c 20 Oct 2004 03:03:30 -0000 1.188
+++ calendar/gui/calendar-component.c 21 Oct 2004 03:27:07 -0000
@@ -47,6 +47,7 @@
#include "comp-util.h"
#include "common/authentication.h"
#include "dialogs/calendar-setup.h"
+#include "dialogs/cal-properties.h"
#include "dialogs/comp-editor.h"
#include "dialogs/copy-source-dialog.h"
#include "dialogs/event-editor.h"
@@ -54,6 +55,7 @@
#include "widgets/misc/e-error.h"
#include "e-util/e-icon-factory.h"
#include "e-cal-popup.h"
+#include "e-cal-config.h"
/* IDs for user creatable items */
#define CREATE_EVENT_ID "event"
@@ -375,7 +377,7 @@
if (!selected_source)
return;
- calendar_setup_edit_calendar (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source);
+ e_calendar_properties_show (GTK_WINDOW (gtk_widget_get_toplevel (ep->target->widget)), selected_source);
}
static EPopupItem ecc_source_popups[] = {
@@ -1182,6 +1184,17 @@
}
static void
+cc_startup (CalendarComponent *cc)
+{
+ static int started = 0;
+ if (started)
+ return;
+ started = 1;
+
+ e_plugin_hook_register_type (e_cal_config_hook_get_type ());
+}
+
+static void
impl_createControls (PortableServer_Servant servant,
Bonobo_Control *corba_sidebar_control,
Bonobo_Control *corba_view_control,
@@ -1191,7 +1204,9 @@
CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant));
CalendarComponentPrivate *priv;
CalendarComponentView *component_view;
-
+
+ cc_startup (calendar_component);
+
priv = calendar_component->priv;
/* Create the calendar component view */
Index: calendar/gui/dialogs/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/Makefile.am,v
retrieving revision 1.64
diff -u -r1.64 Makefile.am
--- calendar/gui/dialogs/Makefile.am 24 Jun 2004 21:02:09 -0000 1.64
+++ calendar/gui/dialogs/Makefile.am 21 Oct 2004 03:27:08 -0000
@@ -38,6 +38,8 @@
alarm-list-dialog.h \
cal-prefs-dialog.c \
cal-prefs-dialog.h \
+ cal-properties.c \
+ cal-properties.h \
calendar-setup.c \
calendar-setup.h \
cancel-comp.c \
Attachment:
newfiles.tar.gz
Description: application/compressed-tar