aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c56
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.h32
-rw-r--r--calendar/gui/dialogs/comp-editor.c201
-rw-r--r--calendar/gui/dialogs/comp-editor.h5
-rw-r--r--calendar/gui/dialogs/event-editor.c14
-rw-r--r--calendar/gui/dialogs/event-editor.h1
-rw-r--r--calendar/gui/dialogs/event-page.c113
-rw-r--r--calendar/gui/dialogs/memo-editor.c14
-rw-r--r--calendar/gui/dialogs/memo-editor.h1
-rw-r--r--calendar/gui/dialogs/memo-page.c10
-rw-r--r--calendar/gui/dialogs/memo-page.glade1
-rw-r--r--calendar/gui/dialogs/task-details-page.c7
-rw-r--r--calendar/gui/dialogs/task-details-page.glade190
-rw-r--r--calendar/gui/dialogs/task-editor.c14
-rw-r--r--calendar/gui/dialogs/task-editor.h1
-rw-r--r--calendar/gui/dialogs/task-page.c92
16 files changed, 491 insertions, 261 deletions
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
index f00adc0f0d..097c91907f 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ b/calendar/gui/dialogs/cal-prefs-dialog.c
@@ -31,6 +31,7 @@
#include "../calendar-config.h"
#include "cal-prefs-dialog.h"
#include <widgets/misc/e-dateedit.h>
+#include <e-util/e-binding.h>
#include <e-util/e-dialog-widgets.h>
#include <e-util/e-util-private.h>
#include <glib/gi18n.h>
@@ -486,7 +487,9 @@ template_url_changed (GtkEntry *entry, CalendarPrefsDialog *prefs)
}
static void
-update_system_tz_widgets (CalendarPrefsDialog *prefs)
+update_system_tz_widgets (EShellSettings *shell_settings,
+ GParamSpec *pspec,
+ CalendarPrefsDialog *prefs)
{
icaltimezone *zone;
@@ -498,15 +501,6 @@ update_system_tz_widgets (CalendarPrefsDialog *prefs)
} else {
gtk_label_set_text (GTK_LABEL (prefs->system_tz_label), "(UTC)");
}
-
- gtk_widget_set_sensitive (prefs->timezone, !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs->use_system_tz_check)));
-}
-
-static void
-use_system_tz_changed (GtkWidget *check, CalendarPrefsDialog *prefs)
-{
- calendar_config_set_use_system_timezone (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
- update_system_tz_widgets (prefs);
}
static void
@@ -517,7 +511,6 @@ setup_changes (CalendarPrefsDialog *prefs)
for (i = 0; i < 7; i ++)
g_signal_connect (G_OBJECT (prefs->working_days[i]), "toggled", G_CALLBACK (working_days_changed), prefs);
- g_signal_connect (G_OBJECT (prefs->use_system_tz_check), "toggled", G_CALLBACK (use_system_tz_changed), prefs);
g_signal_connect (G_OBJECT (prefs->timezone), "changed", G_CALLBACK (timezone_changed), prefs);
g_signal_connect (G_OBJECT (prefs->day_second_zone), "clicked", G_CALLBACK (day_second_zone_clicked), prefs);
@@ -652,11 +645,6 @@ show_config (CalendarPrefsDialog *prefs)
CalUnits units;
int interval;
- /* Use system timezone */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->use_system_tz_check), calendar_config_get_use_system_timezone ());
- gtk_widget_set_sensitive (prefs->system_tz_label, FALSE);
- update_system_tz_widgets (prefs);
-
/* Timezone. */
location = calendar_config_get_timezone_stored ();
zone = icaltimezone_get_builtin_timezone (location);
@@ -666,6 +654,9 @@ show_config (CalendarPrefsDialog *prefs)
/* Day's second zone */
update_day_second_zone_caption (prefs);
+ /* Day's second zone */
+ update_day_second_zone_caption (prefs);
+
/* Working Days. */
working_days = calendar_config_get_working_days ();
mask = 1 << 0;
@@ -759,13 +750,16 @@ eccp_free (EConfig *ec, GSList *items, void *data)
}
static void
-calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs)
+calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs,
+ EShell *shell)
{
GladeXML *gui;
ECalConfig *ec;
ECalConfigTargetPrefs *target;
+ EShellSettings *shell_settings;
int i;
GtkWidget *toplevel;
+ GtkWidget *widget;
GSList *l;
const char *working_day_names[] = {
"sun_button",
@@ -778,6 +772,8 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs)
};
char *gladefile;
+ shell_settings = e_shell_get_shell_settings (shell);
+
gladefile = g_build_filename (EVOLUTION_GLADEDIR,
"cal-prefs-dialog.glade",
NULL);
@@ -801,8 +797,20 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs)
l = g_slist_prepend (l, &eccp_items[i]);
e_config_add_items ((EConfig *) ec, l, NULL, NULL, eccp_free, prefs);
+ widget = glade_xml_get_widget (gui, "use-system-tz-check");
+ e_mutual_binding_new (
+ G_OBJECT (shell_settings), "cal-use-system-timezone",
+ G_OBJECT (widget), "active");
+ g_signal_connect (
+ G_OBJECT (shell_settings), "notify::cal-use-system-timezone",
+ G_CALLBACK (update_system_tz_widgets), prefs);
+
+ widget = glade_xml_get_widget (gui, "timezone");
+ e_mutual_binding_new_with_negation (
+ G_OBJECT (shell_settings), "cal-use-system-timezone",
+ G_OBJECT (widget), "sensitive");
+
/* General tab */
- prefs->use_system_tz_check = glade_xml_get_widget (gui, "use-system-tz-check");
prefs->system_tz_label = glade_xml_get_widget (gui, "system-tz-label");
prefs->timezone = glade_xml_get_widget (gui, "timezone");
prefs->day_second_zone = glade_xml_get_widget (gui, "day_second_zone");
@@ -873,14 +881,18 @@ calendar_prefs_dialog_get_type (void)
}
GtkWidget *
-calendar_prefs_dialog_new (void)
+calendar_prefs_dialog_new (EShell *shell)
{
CalendarPrefsDialog *dialog;
- dialog = (CalendarPrefsDialog *) g_object_new (calendar_prefs_dialog_get_type (), NULL);
- calendar_prefs_dialog_construct (dialog);
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
+
+ dialog = g_object_new (CALENDAR_TYPE_PREFS_DIALOG, NULL);
+
+ /* FIXME Kill this function. */
+ calendar_prefs_dialog_construct (dialog, shell);
- return (GtkWidget *) dialog;
+ return GTK_WIDGET (dialog);
}
/* called by libglade to create our custom EDateEdit widgets. */
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h
index 647df417df..397cb35cfa 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.h
+++ b/calendar/gui/dialogs/cal-prefs-dialog.h
@@ -21,14 +21,33 @@
*
*/
-#ifndef _CAL_PREFS_DIALOG_H_
-#define _CAL_PREFS_DIALOG_H_
+#ifndef CAL_PREFS_DIALOG_H
+#define CAL_PREFS_DIALOG_H
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <gconf/gconf-client.h>
#include <libedataserverui/e-source-selector.h>
-#include "evolution-config-control.h"
+#include <shell/e-shell.h>
+
+/* Standard GObject macros */
+#define CALENDAR_TYPE_PREFS_DIALOG \
+ (calendar_prefs_dialog_get_type ())
+#define CALENDAR_PREFS_DIALOG(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CALENDAR_TYPE_PREFS_DIALOG, CalendarPrefsDialog))
+#define CALENDAR_PREFS_DIALOG_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CALENDAR_TYPE_PREFS_DIALOG, CalendarPrefsDialogClass))
+#define CALENDAR_IS_PREFS_DIALOG(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CALENDAR_TYPE_PREFS_DIALOG))
+#define CALENDAR_IS_PREFS_DIALOG_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CALENDAR_TYPE_PREFS_DIALOG))
+#define CALENDAR_PREFS_DIALOG_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CALENDAR_TYPE_PREFS_DIALOG, CalendarPrefsDialogClass))
G_BEGIN_DECLS
@@ -43,7 +62,6 @@ struct _CalendarPrefsDialog {
GConfClient *gconf;
/* General tab */
- GtkWidget *use_system_tz_check;
GtkWidget *system_tz_label;
GtkWidget *timezone;
GtkWidget *day_second_zone;
@@ -95,9 +113,9 @@ struct _CalendarPrefsDialogClass {
GtkVBoxClass parent;
};
-GType calendar_prefs_dialog_get_type (void);
-GtkWidget *calendar_prefs_dialog_new (void);
+GType calendar_prefs_dialog_get_type (void);
+GtkWidget * calendar_prefs_dialog_new (EShell *shell);
G_END_DECLS
-#endif /* _CAL_PREFS_DIALOG_H_ */
+#endif /* CAL_PREFS_DIALOG_H */
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index cd2dac7a9e..06fd724680 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -39,7 +39,7 @@
#include <e-util/e-dialog-utils.h>
#include <e-util/e-util-private.h>
#include <e-util/gconf-bridge.h>
-#include <evolution-shell-component-utils.h>
+#include <shell/e-shell.h>
#include <camel/camel-url.h>
#include <camel/camel-exception.h>
@@ -76,6 +76,9 @@
/* Private part of the CompEditor structure */
struct _CompEditorPrivate {
+
+ gpointer shell; /* weak pointer */
+
/* Client to use */
ECal *client;
@@ -125,6 +128,7 @@ enum {
PROP_CHANGED,
PROP_CLIENT,
PROP_FLAGS,
+ PROP_SHELL,
PROP_SUMMARY
};
@@ -133,7 +137,10 @@ static const gchar *ui =
" <menubar action='main-menu'>"
" <menu action='file-menu'>"
" <menuitem action='save'/>"
+" <separator/>"
+" <menuitem action='print-preview'/>"
" <menuitem action='print'/>"
+" <separator/>"
" <menuitem action='close'/>"
" </menu>"
" <menu action='edit-menu'>"
@@ -170,8 +177,8 @@ static void close_dialog (CompEditor *editor);
static void page_dates_changed_cb (CompEditor *editor, CompEditorPageDates *dates, CompEditorPage *page);
-static void obj_modified_cb (ECal *client, GList *objs, gpointer data);
-static void obj_removed_cb (ECal *client, GList *uids, gpointer data);
+static void obj_modified_cb (ECal *client, GList *objs, CompEditor *editor);
+static void obj_removed_cb (ECal *client, GList *uids, CompEditor *editor);
G_DEFINE_TYPE (CompEditor, comp_editor, GTK_TYPE_WINDOW)
@@ -180,7 +187,15 @@ enum {
LAST_SIGNAL
};
-static guint comp_editor_signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL];
+static GList *active_editors;
+
+static void
+comp_editor_weak_notify_cb (gpointer unused,
+ GObject *where_the_object_was)
+{
+ active_editors = g_list_remove (active_editors, where_the_object_was);
+}
static void
attachment_store_changed_cb (CompEditor *editor)
@@ -697,17 +712,22 @@ action_print_cb (GtkAction *action,
CompEditor *editor)
{
CompEditorPrivate *priv = editor->priv;
+ GtkPrintOperationAction print_action;
ECalComponent *comp;
GList *l;
- icalcomponent *icalcomp = e_cal_component_get_icalcomponent (priv->comp);
+ icalcomponent *component;
+ icalcomponent *clone;
comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
+ component = e_cal_component_get_icalcomponent (priv->comp);
+ clone = icalcomponent_new_clone (component);
+ e_cal_component_set_icalcomponent (comp, clone);
for (l = priv->pages; l != NULL; l = l->next)
comp_editor_page_fill_component (l->data, comp);
- print_comp (comp, priv->client, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
+ print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG;
+ print_comp (comp, priv->client, print_action);
g_object_unref (comp);
}
@@ -717,15 +737,22 @@ action_print_preview_cb (GtkAction *action,
CompEditor *editor)
{
CompEditorPrivate *priv = editor->priv;
+ GtkPrintOperationAction print_action;
ECalComponent *comp;
GList *l;
- icalcomponent *icalcomp = e_cal_component_get_icalcomponent (priv->comp);
+ icalcomponent *component;
+ icalcomponent *clone;
comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
+ component = e_cal_component_get_icalcomponent (priv->comp);
+ clone = icalcomponent_new_clone (component);
+ e_cal_component_set_icalcomponent (comp, clone);
+
for (l = priv->pages; l != NULL; l = l->next)
comp_editor_page_fill_component (l->data, comp);
- print_comp (comp, priv->client, TRUE);
+
+ print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW;
+ print_comp (comp, priv->client, print_action);
g_object_unref (comp);
}
@@ -793,12 +820,10 @@ action_save_cb (GtkAction *action,
if (e_cal_component_has_recurrences (priv->comp)) {
if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), delegated))
return;
-
} else if (e_cal_component_is_instance (priv->comp))
priv->mod = CALOBJ_MOD_THIS;
comp = comp_editor_get_current_comp (editor, &correct);
-
e_cal_component_get_summary (comp, &text);
g_object_unref (comp);
@@ -1180,6 +1205,17 @@ comp_editor_setup_recent_menu (CompEditor *editor)
}
static void
+comp_editor_set_shell (CompEditor *editor,
+ EShell *shell)
+{
+ g_return_if_fail (editor->priv->shell == NULL);
+
+ editor->priv->shell = shell;
+
+ g_object_add_weak_pointer (G_OBJECT (shell), &editor->priv->shell);
+}
+
+static void
comp_editor_set_property (GObject *object,
guint property_id,
const GValue *value,
@@ -1204,6 +1240,12 @@ comp_editor_set_property (GObject *object,
g_value_get_int (value));
return;
+ case PROP_SHELL:
+ comp_editor_set_shell (
+ COMP_EDITOR (object),
+ g_value_get_object (value));
+ return;
+
case PROP_SUMMARY:
comp_editor_set_summary (
COMP_EDITOR (object),
@@ -1239,6 +1281,12 @@ comp_editor_get_property (GObject *object,
COMP_EDITOR (object)));
return;
+ case PROP_SHELL:
+ g_value_set_object (
+ value, comp_editor_get_shell (
+ COMP_EDITOR (object)));
+ return;
+
case PROP_SUMMARY:
g_value_set_string (
value, comp_editor_get_summary (
@@ -1314,42 +1362,39 @@ static void
comp_editor_map (GtkWidget *widget)
{
CompEditor *editor = COMP_EDITOR (widget);
- GConfBridge *bridge = gconf_bridge_get ();
+ GConfBridge *bridge;
GtkAction *action;
+ const gchar *key;
+
+ bridge = gconf_bridge_get ();
/* Give subclasses a chance to construct their pages before
* we fiddle with their widgets. That's why we don't do this
* until after object construction. */
+ key = "/apps/evolution/calendar/display/show_categories";
action = comp_editor_get_action (editor, "view-categories");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_CATEGORIES,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_role";
action = comp_editor_get_action (editor, "view-role");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_ROLE,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_rsvp";
action = comp_editor_get_action (editor, "view-rsvp");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_RSVP,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_status";
action = comp_editor_get_action (editor, "view-status");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_STATUS,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_timezone";
action = comp_editor_get_action (editor, "view-time-zone");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_TIMEZONE,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_type";
action = comp_editor_get_action (editor, "view-type");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_TYPE,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
/* Chain up to parent's map() method. */
GTK_WIDGET_CLASS (comp_editor_parent_class)->map (widget);
@@ -1496,6 +1541,17 @@ comp_editor_class_init (CompEditorClass *class)
g_object_class_install_property (
object_class,
+ PROP_SHELL,
+ g_param_spec_object (
+ "shell",
+ NULL,
+ NULL,
+ E_TYPE_SHELL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (
+ object_class,
PROP_SUMMARY,
g_param_spec_string (
"summary",
@@ -1504,7 +1560,7 @@ comp_editor_class_init (CompEditorClass *class)
NULL,
G_PARAM_READWRITE));
- comp_editor_signals[OBJECT_CREATED] =
+ signals[OBJECT_CREATED] =
g_signal_new ("object_created",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
@@ -1527,11 +1583,18 @@ comp_editor_init (CompEditor *editor)
GtkAction *action;
GtkWidget *container;
GtkWidget *widget;
+ EShell *shell;
gint n_targets;
GError *error = NULL;
editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor);
+ g_object_weak_ref (
+ G_OBJECT (editor), (GWeakNotify)
+ comp_editor_weak_notify_cb, NULL);
+
+ active_editors = g_list_prepend (active_editors, editor);
+
priv->pages = NULL;
priv->changed = FALSE;
priv->needs_send = FALSE;
@@ -1665,6 +1728,10 @@ comp_editor_init (CompEditor *editor)
g_signal_connect_swapped (
store, "row-inserted",
G_CALLBACK (attachment_store_changed_cb), editor);
+
+ /* FIXME Shell should be passed in. */
+ shell = e_shell_get_default ();
+ e_shell_watch_window (shell, GTK_WINDOW (editor));
}
static gboolean
@@ -1747,7 +1814,18 @@ close_dialog (CompEditor *editor)
gtk_widget_destroy (GTK_WIDGET (editor));
}
-
+gint
+comp_editor_compare (CompEditor *editor_a,
+ CompEditor *editor_b)
+{
+ const gchar *uid_a = NULL;
+ const gchar *uid_b = NULL;
+
+ e_cal_component_get_uid (editor_a->priv->comp, &uid_a);
+ e_cal_component_get_uid (editor_b->priv->comp, &uid_b);
+
+ return g_strcmp0 (uid_a, uid_b);
+}
void
comp_editor_set_existing_org (CompEditor *editor, gboolean existing_org)
@@ -1833,6 +1911,14 @@ comp_editor_get_classification (CompEditor *editor)
return gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
}
+EShell *
+comp_editor_get_shell (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL);
+
+ return editor->priv->shell;
+}
+
void
comp_editor_set_summary (CompEditor *editor,
const gchar *summary)
@@ -1938,11 +2024,10 @@ comp_editor_set_flags (CompEditor *editor,
g_object_notify (G_OBJECT (editor), "flags");
}
-
CompEditorFlags
comp_editor_get_flags (CompEditor *editor)
{
- g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), 0);
return editor->priv->flags;
}
@@ -2000,6 +2085,20 @@ comp_editor_get_managed_widget (CompEditor *editor,
return widget;
}
+CompEditor *
+comp_editor_find_instance (const gchar *uid)
+{
+ GList *link;
+
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ link = g_list_find_custom (
+ active_editors, uid,
+ (GCompareFunc) comp_editor_compare);
+
+ return (link != NULL) ? link->data : NULL;
+}
+
/**
* comp_editor_set_needs_send:
* @editor: A component editor
@@ -2275,8 +2374,14 @@ fill_widgets (CompEditor *editor)
EAttachmentStore *store;
EAttachmentView *view;
CompEditorPrivate *priv;
- GList *l;
GtkAction *action;
+ GList *iter;
+
+ view = E_ATTACHMENT_VIEW (editor->priv->attachment_view);
+ store = e_attachment_view_get_store (view);
+
+ view = E_ATTACHMENT_VIEW (editor->priv->attachment_view);
+ store = e_attachment_view_get_store (view);
view = E_ATTACHMENT_VIEW (editor->priv->attachment_view);
store = e_attachment_view_get_store (view);
@@ -2299,12 +2404,14 @@ fill_widgets (CompEditor *editor)
}
action = comp_editor_get_action (editor, "classify-public");
- g_signal_handlers_block_by_func (action, G_CALLBACK (action_classification_cb), editor);
+ g_signal_handlers_block_by_func (
+ action, G_CALLBACK (action_classification_cb), editor);
- for (l = priv->pages; l != NULL; l = l->next)
- comp_editor_page_fill_widgets (l->data, priv->comp);
+ for (iter = priv->pages; iter != NULL; iter = iter->next)
+ comp_editor_page_fill_widgets (iter->data, priv->comp);
- g_signal_handlers_unblock_by_func (action, G_CALLBACK (action_classification_cb), editor);
+ g_signal_handlers_unblock_by_func (
+ action, G_CALLBACK (action_classification_cb), editor);
}
static void
@@ -2710,9 +2817,10 @@ page_dates_changed_cb (CompEditor *editor,
}
static void
-obj_modified_cb (ECal *client, GList *objects, gpointer data)
+obj_modified_cb (ECal *client,
+ GList *objects,
+ CompEditor *editor)
{
- CompEditor *editor = COMP_EDITOR (data);
CompEditorPrivate *priv;
ECalComponent *comp = NULL;
@@ -2745,12 +2853,11 @@ obj_modified_cb (ECal *client, GList *objects, gpointer data)
}
static void
-obj_removed_cb (ECal *client, GList *uids, gpointer data)
+obj_removed_cb (ECal *client,
+ GList *uids,
+ CompEditor *editor)
{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
-
- priv = editor->priv;
+ CompEditorPrivate *priv = editor->priv;
if (changed_component_dialog ((GtkWindow *) editor, priv->comp, TRUE, priv->changed))
close_dialog (editor);
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
index 22167cb78f..278501b9ba 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -29,6 +29,7 @@
#include <libecal/e-cal.h>
#include "../itip-utils.h"
#include "comp-editor-page.h"
+#include <shell/e-shell.h>
/* Standard GObject macros */
#define TYPE_COMP_EDITOR \
@@ -87,6 +88,8 @@ typedef enum {
} CompEditorFlags;
GType comp_editor_get_type (void);
+gint comp_editor_compare (CompEditor *editor_a,
+ CompEditor *editor_b);
void comp_editor_set_changed (CompEditor *editor,
gboolean changed);
gboolean comp_editor_get_changed (CompEditor *editor);
@@ -106,6 +109,7 @@ void comp_editor_set_classification (CompEditor *editor,
ECalComponentClassification classification);
ECalComponentClassification
comp_editor_get_classification (CompEditor *editor);
+EShell * comp_editor_get_shell (CompEditor *editor);
void comp_editor_set_summary (CompEditor *editor,
const gchar *summary);
const gchar * comp_editor_get_summary (CompEditor *editor);
@@ -150,6 +154,7 @@ GtkActionGroup *
const gchar *group_name);
GtkWidget * comp_editor_get_managed_widget (CompEditor *editor,
const gchar *widget_path);
+CompEditor * comp_editor_find_instance (const gchar *uid);
G_END_DECLS
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index cff9d75950..987c716b6f 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -36,7 +36,6 @@
#include <misc/e-dateedit.h>
#include <e-util/e-plugin-ui.h>
#include <e-util/e-util-private.h>
-#include <evolution-shell-component-utils.h>
#include "event-page.h"
#include "recurrence-page.h"
@@ -466,6 +465,7 @@ event_editor_init (EventEditor *ee)
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
GtkAction *action;
+ const gchar *id;
GError *error = NULL;
ee->priv = EVENT_EDITOR_GET_PRIVATE (ee);
@@ -488,7 +488,10 @@ event_editor_init (EventEditor *ee)
ui_manager = comp_editor_get_ui_manager (editor);
gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, &error);
- e_plugin_ui_register_manager ("event-editor", ui_manager, ee);
+
+ id = "org.gnome.evolution.event-editor";
+ e_plugin_ui_register_manager (ui_manager, id, ee);
+ e_plugin_ui_enable_manager (ui_manager, id);
if (error != NULL) {
g_critical ("%s: %s", G_STRFUNC, error->message);
@@ -662,13 +665,16 @@ event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboo
* editor could not be created.
**/
CompEditor *
-event_editor_new (ECal *client, CompEditorFlags flags)
+event_editor_new (ECal *client,
+ EShell *shell,
+ CompEditorFlags flags)
{
g_return_val_if_fail (E_IS_CAL (client), NULL);
+ g_return_val_if_fail (E_IS_SHELL (client), NULL);
return g_object_new (
TYPE_EVENT_EDITOR,
- "flags", flags, "client", client, NULL);
+ "client", client, "flags", flags, "shell", shell, NULL);
}
void
diff --git a/calendar/gui/dialogs/event-editor.h b/calendar/gui/dialogs/event-editor.h
index 03afd6448a..abb8f0e659 100644
--- a/calendar/gui/dialogs/event-editor.h
+++ b/calendar/gui/dialogs/event-editor.h
@@ -66,6 +66,7 @@ struct _EventEditorClass {
GType event_editor_get_type (void);
CompEditor * event_editor_new (ECal *client,
+ EShell *shell,
CompEditorFlags flags);
void event_editor_show_meeting (EventEditor *ee);
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index b2ac6b55db..fa1faa2f79 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -381,9 +381,11 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD
EventPagePrivate *priv = epage->priv;
CompEditor *editor;
ECal *client;
+ GtkAction *action;
struct icaltimetype *start_tt, *end_tt, implied_tt;
icaltimezone *start_zone = NULL, *def_zone = NULL;
gboolean all_day_event, homezone=TRUE;
+ gboolean show_timezone;
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
client = comp_editor_get_client (editor);
@@ -455,7 +457,9 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD
if (!def_zone || !start_zone || strcmp (icaltimezone_get_tzid(def_zone), icaltimezone_get_tzid (start_zone)))
homezone = FALSE;
- event_page_set_show_timezone (epage, (calendar_config_get_show_timezone()|| !homezone) & !all_day_event);
+ action = comp_editor_get_action (editor, "view-time-zone");
+ show_timezone = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ event_page_set_show_timezone (epage, (show_timezone || !homezone) & !all_day_event);
/*unblock the endtimezone widget*/
g_signal_handlers_unblock_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
@@ -1815,15 +1819,10 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage)
}
static void
-invite_cb (GtkWidget *widget, gpointer data)
+invite_cb (GtkWidget *widget,
+ EventPage *page)
{
- EventPage *page;
- EventPagePrivate *priv;
-
- page = EVENT_PAGE (data);
- priv = page->priv;
-
- e_meeting_list_view_invite_others_dialog (priv->list_view);
+ e_meeting_list_view_invite_others_dialog (page->priv->list_view);
}
static void
@@ -2013,6 +2012,7 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day)
CompEditor *editor;
GtkAction *action;
gboolean date_set;
+ gboolean active;
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
@@ -2091,7 +2091,10 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day)
TRUE);
}
- event_page_set_show_timezone (epage, calendar_config_get_show_timezone() & !all_day);
+ action = comp_editor_get_action (editor, "view-time-zone");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ event_page_set_show_timezone (epage, active & !all_day);
+
g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
@@ -2173,10 +2176,12 @@ event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *ms
static gboolean
get_widgets (EventPage *epage)
{
+ CompEditor *editor;
CompEditorPage *page = COMP_EDITOR_PAGE (epage);
GtkEntryCompletion *completion;
EventPagePrivate *priv;
GSList *accel_groups;
+ GtkAction *action;
GtkWidget *toplevel;
GtkWidget *sw;
@@ -2184,6 +2189,8 @@ get_widgets (EventPage *epage)
#define GW(name) glade_xml_get_widget (priv->xml, name)
+ editor = comp_editor_page_get_editor (page);
+
priv->main = GW ("event-page");
if (!priv->main)
return FALSE;
@@ -2205,7 +2212,8 @@ get_widgets (EventPage *epage)
gtk_widget_show (priv->status_icons);
- if (!calendar_config_get_show_timezone()) {
+ action = comp_editor_get_action (editor, "view-time-zone");
+ if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
gtk_widget_hide (priv->timezone_label);
gtk_widget_hide (priv->start_timezone);
} else {
@@ -2483,14 +2491,10 @@ times_updated (EventPage *epage, gboolean adjust_end_time)
* start date < end date and we set the "all day event" button as appropriate.
*/
static void
-start_date_changed_cb (GtkWidget *dedit, gpointer data)
+start_date_changed_cb (GtkWidget *dedit,
+ EventPage *epage)
{
- EventPage *epage;
-
- epage = EVENT_PAGE (data);
-
hour_minute_changed (epage);
-
times_updated (epage, TRUE);
}
@@ -2498,12 +2502,9 @@ start_date_changed_cb (GtkWidget *dedit, gpointer data)
* start date < end date and we set the "all day event" button as appropriate.
*/
static void
-end_date_changed_cb (GtkWidget *dedit, gpointer data)
+end_date_changed_cb (GtkWidget *dedit,
+ EventPage *epage)
{
- EventPage *epage;
-
- epage = EVENT_PAGE (data);
-
times_updated (epage, FALSE);
}
@@ -2512,15 +2513,12 @@ end_date_changed_cb (GtkWidget *dedit, gpointer data)
* labels on the other notebook pages.
*/
static void
-start_timezone_changed_cb (GtkWidget *widget, gpointer data)
+start_timezone_changed_cb (GtkWidget *widget,
+ EventPage *epage)
{
- EventPage *epage;
- EventPagePrivate *priv;
+ EventPagePrivate *priv = epage->priv;
icaltimezone *zone;
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
if (priv->sync_timezones) {
zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
comp_editor_page_set_updating (COMP_EDITOR_PAGE (epage), TRUE);
@@ -2537,17 +2535,13 @@ start_timezone_changed_cb (GtkWidget *widget, gpointer data)
* category list dialog.
*/
static void
-categories_clicked_cb (GtkWidget *button, gpointer data)
+categories_clicked_cb (GtkWidget *button,
+ EventPage *epage)
{
- EventPage *epage;
- EventPagePrivate *priv;
- GtkWidget *entry;
+ GtkEntry *entry;
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
- entry = priv->categories;
- e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry));
+ entry = GTK_ENTRY (epage->priv->categories);
+ e_categories_config_open_dialog_for_entry (entry);
}
void
@@ -2666,13 +2660,10 @@ set_subscriber_info_string (EventPage *epage, const char *backend_address)
}
static void
-alarm_changed_cb (GtkWidget *widget, gpointer data)
+alarm_changed_cb (GtkWidget *widget,
+ EventPage *epage)
{
- EventPage *epage;
- EventPagePrivate *priv;
-
- epage = EVENT_PAGE (data);
- priv = epage->priv;
+ EventPagePrivate *priv = epage->priv;
if (e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) != ALARM_NONE) {
ECalComponentAlarm *ca;
@@ -2814,7 +2805,9 @@ init_widgets (EventPage *epage)
GtkTextBuffer *text_buffer;
icaltimezone *zone;
char *combo_label = NULL;
+ GtkAction *action;
GtkTreeSelection *selection;
+ gboolean active;
ECal *client;
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
@@ -2871,11 +2864,28 @@ init_widgets (EventPage *epage)
g_signal_connect((priv->start_timezone), "changed",
G_CALLBACK (start_timezone_changed_cb), epage);
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ATTENDEE_COL, TRUE);
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ROLE_COL, calendar_config_get_show_role ());
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_RSVP_COL, calendar_config_get_show_rsvp ());
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_STATUS_COL, calendar_config_get_show_status ());
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_TYPE_COL, calendar_config_get_show_type ());
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_ATTENDEE_COL, TRUE);
+
+ action = comp_editor_get_action (editor, "view-role");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_ROLE_COL, active);
+
+ action = comp_editor_get_action (editor, "view-rsvp");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_RSVP_COL, active);
+
+ action = comp_editor_get_action (editor, "view-status");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_STATUS_COL, active);
+
+ action = comp_editor_get_action (editor, "view-type");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_TYPE_COL, active);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
@@ -2911,7 +2921,8 @@ init_widgets (EventPage *epage)
gtk_widget_show (GTK_WIDGET (priv->list_view));
/* categories */
- if (!calendar_config_get_show_categories()) {
+ action = comp_editor_get_action (editor, "view-categories");
+ if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
gtk_widget_hide (priv->categories_btn);
gtk_widget_hide (priv->categories);
} else {
@@ -3005,7 +3016,9 @@ init_widgets (EventPage *epage)
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), zone);
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->end_timezone), zone);
- event_page_set_show_timezone (epage, calendar_config_get_show_timezone());
+ action = comp_editor_get_action (editor, "view-time-zone");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ event_page_set_show_timezone (epage, active);
return TRUE;
}
diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c
index cf3781a3c2..bda54e55eb 100644
--- a/calendar/gui/dialogs/memo-editor.c
+++ b/calendar/gui/dialogs/memo-editor.c
@@ -34,7 +34,6 @@
#include <e-util/e-plugin-ui.h>
#include <e-util/e-util-private.h>
-#include <evolution-shell-component-utils.h>
#include "memo-page.h"
#include "cancel-comp.h"
@@ -135,6 +134,7 @@ memo_editor_init (MemoEditor *me)
{
CompEditor *editor = COMP_EDITOR (me);
GtkUIManager *ui_manager;
+ const gchar *id;
GError *error = NULL;
me->priv = MEMO_EDITOR_GET_PRIVATE (me);
@@ -142,7 +142,10 @@ memo_editor_init (MemoEditor *me)
ui_manager = comp_editor_get_ui_manager (editor);
gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, &error);
- e_plugin_ui_register_manager ("memo-editor", ui_manager, me);
+
+ id = "org.gnome.evolution.memo-editor";
+ e_plugin_ui_register_manager (ui_manager, id, me);
+ e_plugin_ui_enable_manager (ui_manager, id);
if (error != NULL) {
g_critical ("%s: %s", G_STRFUNC, error->message);
@@ -160,11 +163,14 @@ memo_editor_init (MemoEditor *me)
* editor could not be created.
**/
CompEditor *
-memo_editor_new (ECal *client, CompEditorFlags flags)
+memo_editor_new (ECal *client,
+ EShell *shell,
+ CompEditorFlags flags)
{
g_return_val_if_fail (E_IS_CAL (client), NULL);
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
return g_object_new (
TYPE_MEMO_EDITOR,
- "flags", flags, "client", client, NULL);
+ "client", client, "flags", flags, "shell", shell, NULL);
}
diff --git a/calendar/gui/dialogs/memo-editor.h b/calendar/gui/dialogs/memo-editor.h
index 2e431b507f..cd4bc194ac 100644
--- a/calendar/gui/dialogs/memo-editor.h
+++ b/calendar/gui/dialogs/memo-editor.h
@@ -68,6 +68,7 @@ struct _MemoEditorClass {
GType memo_editor_get_type (void);
CompEditor * memo_editor_new (ECal *client,
+ EShell *shell,
CompEditorFlags flags);
G_END_DECLS
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 957b8f695c..f8ce1bece2 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -929,9 +929,14 @@ to_button_clicked_cb (GtkButton *button,
static gboolean
init_widgets (MemoPage *mpage)
{
+ CompEditor *editor;
MemoPagePrivate *priv = mpage->priv;
GtkTextBuffer *buffer;
GtkTextView *view;
+ GtkAction *action;
+ gboolean active;
+
+ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (mpage));
/* Generic informative messages */
gtk_widget_hide (priv->info_hbox);
@@ -996,8 +1001,9 @@ init_widgets (MemoPage *mpage)
G_CALLBACK (comp_editor_page_changed), mpage);
}
- memo_page_set_show_categories (
- mpage, calendar_config_get_show_categories());
+ action = comp_editor_get_action (editor, "view-categories");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ memo_page_set_show_categories (mpage, active);
return TRUE;
}
diff --git a/calendar/gui/dialogs/memo-page.glade b/calendar/gui/dialogs/memo-page.glade
index b1ff10f3f4..8728c9366e 100644
--- a/calendar/gui/dialogs/memo-page.glade
+++ b/calendar/gui/dialogs/memo-page.glade
@@ -159,6 +159,7 @@
<widget class="GtkLabel" id="label18">
<property name="visible">True</property>
<property name="label" translatable="yes">_Description:</property>
+ <property name="mnemonic_widget">memo_content</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 7fb4679047..95764cde48 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -517,16 +517,15 @@ complete_date_changed (TaskDetailsPage *tdpage, time_t ctime, gboolean complete)
}
static void
-date_changed_cb (EDateEdit *dedit, gpointer data)
+date_changed_cb (EDateEdit *dedit,
+ TaskDetailsPage *tdpage)
{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
+ TaskDetailsPagePrivate *priv = tdpage->priv;
CompEditorPageDates dates = {NULL, NULL, NULL, NULL};
struct icaltimetype completed_tt = icaltime_null_time ();
icalproperty_status status;
gboolean date_set;
- tdpage = TASK_DETAILS_PAGE (data);
priv = tdpage->priv;
if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tdpage)))
diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade
index 44fc3b2fbb..aac90876ed 100644
--- a/calendar/gui/dialogs/task-details-page.glade
+++ b/calendar/gui/dialogs/task-details-page.glade
@@ -4,7 +4,7 @@
<glade-interface>
<widget class="GtkWindow" id="task-details-toplevel">
- <property name="title">window1</property>
+ <property name="title" translatable="no">window1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
@@ -15,8 +15,6 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
<child>
<widget class="GtkVBox" id="task-details-page">
@@ -38,10 +36,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -69,10 +63,6 @@
<property name="yalign">0.5</property>
<property name="xpad">12</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -103,10 +93,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
+ <property name="mnemonic_widget">status</property>
</widget>
<packing>
<property name="left_attach">0</property>
@@ -132,10 +119,6 @@
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">percent-complete</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
@@ -160,10 +143,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
+ <property name="mnemonic_widget">priority</property>
</widget>
<packing>
<property name="left_attach">0</property>
@@ -188,10 +168,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
@@ -204,85 +180,153 @@
</child>
<child>
- <widget class="GtkSpinButton" id="percent-complete">
+ <widget class="GtkOptionMenu" id="priority">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 100 1 10 0</property>
+ <property name="history">0</property>
+
+ <child internal-child="menu">
+ <widget class="GtkMenu" id="convertwidget7">
+ <property name="visible">True</property>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">High</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget9">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Normal</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget10">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Low</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget11">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Undefined</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="Custom" id="completed-date">
+ <widget class="GtkOptionMenu" id="status">
<property name="visible">True</property>
- <property name="creation_function">task_details_page_create_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Jun 2001 18:58:51 GMT</property>
- <accessibility>
- <atkrelation target="date_completed_label" type="labelled-by"/>
- </accessibility>
+ <property name="can_focus">True</property>
+ <property name="history">0</property>
+
+ <child internal-child="menu">
+ <widget class="GtkMenu" id="convertwidget1">
+ <property name="visible">True</property>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Not Started</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">In Progress</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Completed</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="convertwidget6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Canceled</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkComboBox" id="priority-combobox">
+ <widget class="GtkSpinButton" id="percent-complete">
<property name="visible">True</property>
- <property name="items" translatable="yes">High
-Normal
-Low
-Undefined</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">True</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">fill</property>
- <property name="y_options">fill</property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkComboBox" id="status-combobox">
+ <widget class="Custom" id="completed-date">
<property name="visible">True</property>
- <property name="items" translatable="yes">Not Started
-In Progress
-Completed
-Canceled</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
+ <property name="creation_function">task_details_page_create_date_edit</property>
+ <property name="int1">0</property>
+ <property name="int2">0</property>
+ <property name="last_modification_time">Fri, 01 Jun 2001 18:58:51 GMT</property>
+ <accessibility>
+ <atkrelation target="date_completed_label" type="labelled-by"/>
+ </accessibility>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
- <property name="y_options">fill</property>
+ <property name="y_options"></property>
</packing>
</child>
</widget>
@@ -313,10 +357,6 @@ Canceled</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -344,10 +384,6 @@ Canceled</property>
<property name="yalign">0.5</property>
<property name="xpad">12</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -379,10 +415,6 @@ Canceled</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index fbab8b0581..8926ac720b 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -35,7 +35,6 @@
#include <e-util/e-plugin-ui.h>
#include <e-util/e-util-private.h>
-#include <evolution-shell-component-utils.h>
#include "task-page.h"
#include "task-details-page.h"
@@ -304,6 +303,7 @@ task_editor_init (TaskEditor *te)
CompEditor *editor = COMP_EDITOR (te);
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
+ const gchar *id;
GError *error = NULL;
te->priv = TASK_EDITOR_GET_PRIVATE (te);
@@ -346,7 +346,10 @@ task_editor_init (TaskEditor *te)
ui_manager = comp_editor_get_ui_manager (editor);
gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, &error);
- e_plugin_ui_register_manager ("task-editor", ui_manager, te);
+
+ id = "org.gnome.evolution.task-editor";
+ e_plugin_ui_register_manager (ui_manager, id, te);
+ e_plugin_ui_enable_manager (ui_manager, id);
if (error != NULL) {
g_critical ("%s: %s", G_STRFUNC, error->message);
@@ -489,13 +492,16 @@ task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gbool
* editor could not be created.
**/
CompEditor *
-task_editor_new (ECal *client, CompEditorFlags flags)
+task_editor_new (ECal *client,
+ EShell *shell,
+ CompEditorFlags flags)
{
g_return_val_if_fail (E_IS_CAL (client), NULL);
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
return g_object_new (
TYPE_TASK_EDITOR,
- "flags", flags, "client", client, NULL);
+ "client", client, "flags", flags, "shell", shell, NULL);
}
void
diff --git a/calendar/gui/dialogs/task-editor.h b/calendar/gui/dialogs/task-editor.h
index 57ab33b54f..f026acae0c 100644
--- a/calendar/gui/dialogs/task-editor.h
+++ b/calendar/gui/dialogs/task-editor.h
@@ -66,6 +66,7 @@ struct _TaskEditorClass {
GType task_editor_get_type (void);
CompEditor * task_editor_new (ECal *client,
+ EShell *shell,
CompEditorFlags flags);
void task_editor_show_assignment (TaskEditor *te);
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index b088fb4ff1..a3700f5bf7 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -451,12 +451,14 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
ECalComponentClassification cl;
CompEditor *editor;
CompEditorFlags flags;
+ GtkAction *action;
ECal *client;
GSList *l;
icalcomponent *icalcomp;
const char *categories, *uid;
icaltimezone *zone, *default_zone;
gchar *backend_addr = NULL;
+ gboolean active;
tpage = TASK_PAGE (page);
priv = tpage->priv;
@@ -538,7 +540,10 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->timezone),
zone ? zone : default_zone);
- task_page_set_show_timezone (tpage, calendar_config_get_show_timezone());
+
+ action = comp_editor_get_action (editor, "view-time-zone");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ task_page_set_show_timezone (tpage, active);
if (!(flags & COMP_EDITOR_NEW_ITEM) && !zone) {
GtkAction *action;
@@ -1125,15 +1130,10 @@ remove_clicked_cb (GtkButton *btn, TaskPage *page)
}
static void
-invite_cb (GtkWidget *widget, gpointer data)
+invite_cb (GtkWidget *widget,
+ TaskPage *page)
{
- TaskPage *page;
- TaskPagePrivate *priv;
-
- page = TASK_PAGE (data);
- priv = page->priv;
-
- e_meeting_list_view_invite_others_dialog (priv->list_view);
+ e_meeting_list_view_invite_others_dialog (page->priv->list_view);
}
static void
@@ -1494,17 +1494,16 @@ summary_changed_cb (GtkEditable *editable,
* other pages in the task editor, so they can update any labels.
*/
static void
-date_changed_cb (EDateEdit *dedit, gpointer data)
+date_changed_cb (EDateEdit *dedit,
+ TaskPage *tpage)
{
- TaskPage *tpage;
- TaskPagePrivate *priv;
+ TaskPagePrivate *priv = tpage->priv;
CompEditorPageDates dates;
gboolean date_set, time_set;
ECalComponentDateTime start_dt, due_dt;
struct icaltimetype start_tt = icaltime_null_time();
struct icaltimetype due_tt = icaltime_null_time();
- tpage = TASK_PAGE (data);
priv = tpage->priv;
if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage)))
@@ -1563,33 +1562,24 @@ date_changed_cb (EDateEdit *dedit, gpointer data)
}
static void
-timezone_changed_cb (EDateEdit *dedit, gpointer data)
+timezone_changed_cb (EDateEdit *dedit,
+ TaskPage *tpage)
{
- TaskPage *tpage;
- TaskPagePrivate *priv;
-
- tpage = TASK_PAGE (data);
- priv = tpage->priv;
-
- date_changed_cb ((EDateEdit *) priv->start_date, tpage);
- date_changed_cb ((EDateEdit *) priv->due_date, tpage);
+ date_changed_cb ((EDateEdit *) tpage->priv->start_date, tpage);
+ date_changed_cb ((EDateEdit *) tpage->priv->due_date, tpage);
}
/* Callback used when the categories button is clicked; we must bring up the
* category list dialog.
*/
static void
-categories_clicked_cb (GtkWidget *button, gpointer data)
+categories_clicked_cb (GtkWidget *button,
+ TaskPage *tpage)
{
- TaskPage *tpage;
- TaskPagePrivate *priv;
- GtkWidget *entry;
+ GtkEntry *entry;
- tpage = TASK_PAGE (data);
- priv = tpage->priv;
-
- entry = priv->categories;
- e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry));
+ entry = GTK_ENTRY (tpage->priv->categories);
+ e_categories_config_open_dialog_for_entry (entry);
}
static gboolean
@@ -1844,12 +1834,17 @@ task_page_sendoptions_clicked_cb (TaskPage *tpage)
static gboolean
init_widgets (TaskPage *tpage)
{
+ CompEditor *editor;
TaskPagePrivate *priv;
+ GtkAction *action;
GtkTextBuffer *text_buffer;
icaltimezone *zone;
+ gboolean active;
priv = tpage->priv;
+ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage));
+
/* Make sure the EDateEdit widgets use our timezones to get the
current time. */
e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->start_date),
@@ -1945,15 +1940,36 @@ init_widgets (TaskPage *tpage)
zone = calendar_config_get_icaltimezone ();
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->timezone), zone);
- task_page_set_show_timezone (tpage, calendar_config_get_show_timezone());
+ action = comp_editor_get_action (editor, "view-time-zone");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ task_page_set_show_timezone (tpage, active);
+
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_ATTENDEE_COL, TRUE);
+
+ action = comp_editor_get_action (editor, "view-role");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_ROLE_COL, active);
+
+ action = comp_editor_get_action (editor, "view-rsvp");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_RSVP_COL, active);
+
+ action = comp_editor_get_action (editor, "view-status");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_STATUS_COL, active);
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ATTENDEE_COL, TRUE);
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ROLE_COL, calendar_config_get_show_role ());
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_RSVP_COL, calendar_config_get_show_rsvp ());
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_STATUS_COL, calendar_config_get_show_status ());
- e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_TYPE_COL, calendar_config_get_show_type ());
+ action = comp_editor_get_action (editor, "view-type");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ e_meeting_list_view_column_set_visible (
+ priv->list_view, E_MEETING_STORE_TYPE_COL, active);
- task_page_set_show_categories (tpage, calendar_config_get_show_categories());
+ action = comp_editor_get_action (editor, "view-categories");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ task_page_set_show_categories (tpage, active);
return TRUE;
}