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.c42
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.h2
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.ui175
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c20
-rw-r--r--calendar/gui/dialogs/comp-editor-util.h2
-rw-r--r--calendar/gui/dialogs/comp-editor.c132
-rw-r--r--calendar/gui/dialogs/comp-editor.h8
-rw-r--r--calendar/gui/dialogs/copy-source-dialog.c14
-rw-r--r--calendar/gui/dialogs/event-editor.c62
-rw-r--r--calendar/gui/dialogs/event-page.c46
-rw-r--r--calendar/gui/dialogs/event-page.h2
-rw-r--r--calendar/gui/dialogs/task-editor.c6
12 files changed, 330 insertions, 181 deletions
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
index 559d5f879d..914c26c3ec 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ b/calendar/gui/dialogs/cal-prefs-dialog.c
@@ -36,6 +36,7 @@
#include "e-util/e-datetime-format.h"
#include "e-util/e-dialog-widgets.h"
#include "e-util/e-util-private.h"
+#include "shell/e-shell-utils.h"
#include <glib/gi18n.h>
#include <string.h>
@@ -739,16 +740,11 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs,
shell_settings, "cal-compress-weekend",
widget, "active");
- widget = e_builder_get_widget (prefs->builder, "dnav_show_week_no");
+ widget = e_builder_get_widget (prefs->builder, "show_week_numbers");
e_mutual_binding_new (
shell_settings, "cal-show-week-numbers",
widget, "active");
- widget = e_builder_get_widget (prefs->builder, "dview_show_week_no");
- e_mutual_binding_new (
- shell_settings, "cal-day-view-show-week-numbers",
- widget, "active");
-
prefs->month_scroll_by_week = e_builder_get_widget (prefs->builder, "month_scroll_by_week");
widget = e_builder_get_widget (prefs->builder, "tasks_due_today_color");
@@ -780,16 +776,42 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs,
e_mutual_binding_new (
shell_settings, "cal-free-busy-template",
widget, "text");
- target = e_cal_config_target_new_prefs (ec, prefs->gconf);
- e_config_set_target ((EConfig *)ec, (EConfigTarget *) target);
- toplevel = e_config_create_widget ((EConfig *)ec);
- gtk_container_add (GTK_CONTAINER (prefs), toplevel);
/* date/time format */
table = e_builder_get_widget (prefs->builder, "datetime_format_table");
e_datetime_format_add_setup_widget (table, 0, "calendar", "table", DTFormatKindDateTime, _("Ti_me and date:"));
e_datetime_format_add_setup_widget (table, 1, "calendar", "table", DTFormatKindDate, _("_Date only:"));
+ /* Hide senseless preferences when running in Express mode */
+ e_shell_hide_widgets_for_express_mode (shell, prefs->builder,
+ "label_second_zone",
+ "hbox_second_zone",
+ "timezone",
+ "timezone_label",
+ "hbox_use_system_timezone",
+ "hbox_time_divisions",
+ "show_end_times",
+ "month_scroll_by_week",
+ NULL);
+
+ /* HACK: GTK+ 2.18 and 2.20 has a GtkTable which includes row/column spacing even for empty rows/columns.
+ * When Evo runs in Express mode, we hide all the rows in the Time section of the calendar's General
+ * preferences page. However, due to that behavior in GTK+, we get a lot of extra spacing in that
+ * section. Since we know that in Express mode we only leave a single row visible, we'll make the
+ * table's row spacing equal to 0 in that case.
+ */
+ if (e_shell_get_express_mode (shell)) {
+ widget = e_builder_get_widget (prefs->builder, "time");
+ gtk_table_set_row_spacings (GTK_TABLE (widget), 0);
+ }
+
+ /* Hook up and add the toplevel widget */
+
+ target = e_cal_config_target_new_prefs (ec, prefs->gconf);
+ e_config_set_target ((EConfig *)ec, (EConfigTarget *) target);
+ toplevel = e_config_create_widget ((EConfig *)ec);
+ gtk_container_add (GTK_CONTAINER (prefs), toplevel);
+
show_config (prefs);
/* FIXME: weakref? */
setup_changes (prefs);
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h
index 14011d8403..1ae585a0e8 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.h
+++ b/calendar/gui/dialogs/cal-prefs-dialog.h
@@ -79,8 +79,6 @@ struct _CalendarPrefsDialog {
GtkWidget *time_divisions;
GtkWidget *show_end_times;
GtkWidget *compress_weekend;
- GtkWidget *dnav_show_week_no;
- GtkWidget *dview_show_week_no;
GtkWidget *month_scroll_by_week;
GtkWidget *tasks_hide_completed;
GtkWidget *tasks_hide_completed_interval;
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.ui b/calendar/gui/dialogs/cal-prefs-dialog.ui
index d4caf1b356..b94803fc43 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.ui
+++ b/calendar/gui/dialogs/cal-prefs-dialog.ui
@@ -167,7 +167,7 @@
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
- <object class="GtkLabel" id="label63">
+ <object class="GtkLabel" id="label_second_zone">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Se_cond zone:</property>
@@ -182,7 +182,7 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox25">
+ <object class="GtkHBox" id="hbox_second_zone">
<property name="visible">True</property>
<child>
<object class="GtkButton" id="day_second_zone">
@@ -219,25 +219,41 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label11">
+ <object class="ETimezoneEntry" id="timezone">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Time format:</property>
+ <accessibility>
+ <relation type="labelled-by" target="timezone_label"/>
+ </accessibility>
</object>
<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="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="timezone_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Time _zone:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">timezone</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox4">
+ <object class="GtkHBox" id="hbox_use_system_timezone">
<property name="visible">True</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkRadioButton" id="use_12_hour">
- <property name="label" translatable="yes">_12 hour (AM/PM)</property>
+ <object class="GtkCheckButton" id="use-system-tz-check">
+ <property name="label" translatable="yes">Use s_ystem time zone</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -246,19 +262,14 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="use_24_hour">
- <property name="label" translatable="yes">_24 hour</property>
+ <object class="GtkLabel" id="system-tz-label">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">use_12_hour</property>
+ <property name="xpad">5</property>
+ <property name="label">(system/tz)</property>
</object>
<packing>
<property name="expand">False</property>
@@ -270,34 +281,16 @@
<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="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="ETimezoneEntry" id="timezone">
- <property name="visible">True</property>
- <accessibility>
- <relation type="labelled-by" target="timezone_label"/>
- </accessibility>
- </object>
- <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="y_options">GTK_FILL</property>
+ <property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="timezone_label">
+ <object class="GtkLabel" id="label_time_format">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Time _zone:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">timezone</property>
+ <property name="label" translatable="yes">Time format:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@@ -305,27 +298,34 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox26">
+ <object class="GtkHBox" id="hbox_time_format">
<property name="visible">True</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkCheckButton" id="use-system-tz-check">
- <property name="label" translatable="yes">Use s_ystem time zone</property>
+ <object class="GtkRadioButton" id="use_12_hour">
+ <property name="label" translatable="yes">_12 hour (AM/PM)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="system-tz-label">
+ <object class="GtkRadioButton" id="use_24_hour">
+ <property name="label" translatable="yes">_24 hour</property>
<property name="visible">True</property>
- <property name="xpad">5</property>
- <property name="label">(system/tz)</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">use_12_hour</property>
</object>
<packing>
<property name="expand">False</property>
@@ -338,6 +338,7 @@
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
@@ -895,7 +896,7 @@
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox10">
+ <object class="GtkHBox" id="hbox_time_divisions">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
@@ -962,8 +963,8 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="dnav_show_week_no">
- <property name="label" translatable="yes">Show week _numbers in date navigator</property>
+ <object class="GtkCheckButton" id="show_week_numbers">
+ <property name="label" translatable="yes">Show week _numbers</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -977,21 +978,6 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="dview_show_week_no">
- <property name="label" translatable="yes">Show week n_umber in Day and Work Week View</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
<object class="GtkCheckButton" id="month_scroll_by_week">
<property name="label" translatable="yes">Sc_roll Month View by a week</property>
<property name="visible">True</property>
@@ -1003,7 +989,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">5</property>
+ <property name="position">4</property>
</packing>
</child>
</object>
@@ -1051,12 +1037,9 @@
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <object class="GtkTable" id="table2">
+ <object class="GtkHBox" id="hbox14">
<property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
+ <property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label21">
<property name="visible">True</property>
@@ -1066,57 +1049,59 @@
<property name="mnemonic_widget">tasks_due_today_color</property>
</object>
<packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label22">
+ <object class="GtkColorButton" id="tasks_due_today_color">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Overdue tasks:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">tasks_overdue_color</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="title" translatable="yes">Pick a color</property>
+ <property name="color">#000000000000</property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkColorButton" id="tasks_due_today_color">
+ <object class="GtkLabel" id="label22">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="title" translatable="yes">Pick a color</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Overdue tasks:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">tasks_overdue_color</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkColorButton" id="tasks_overdue_color">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="receives_default">True</property>
<property name="title" translatable="yes">Pick a color</property>
+ <property name="color">#000000000000</property>
</object>
<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="x_options"></property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -1441,8 +1426,8 @@
</object>
<object class="GtkSizeGroup" id="day_begins_ends_sizegroup">
<widgets>
- <widget name="day_end_label"/>
<widget name="day_start_label"/>
+ <widget name="day_end_label"/>
</widgets>
</object>
</interface>
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
index 45c08d3ae7..9856bd7c96 100644
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ b/calendar/gui/dialogs/comp-editor-util.c
@@ -294,7 +294,9 @@ free_slist_strs (gpointer data)
* @note The list is just string of emails separated by ';'
**/
void
-comp_editor_manage_new_attendees (ECalComponent *comp, EMeetingAttendee *ma, gboolean add)
+comp_editor_manage_new_attendees (ECalComponent *comp,
+ EMeetingAttendee *ma,
+ gboolean add)
{
const gchar *eml;
@@ -306,7 +308,11 @@ comp_editor_manage_new_attendees (ECalComponent *comp, EMeetingAttendee *ma, gbo
eml = itip_strip_mailto (eml);
g_return_if_fail (eml != NULL);
- g_object_set_data_full (G_OBJECT (comp), "new-attendees", manage_new_attendees (g_object_get_data (G_OBJECT (comp), "new-attendees"), eml, add), free_slist_strs);
+ g_object_set_data_full (
+ G_OBJECT (comp), "new-attendees",
+ manage_new_attendees (
+ g_object_get_data (G_OBJECT (comp), "new-attendees"),
+ eml, add), free_slist_strs);
}
/**
@@ -349,15 +355,19 @@ comp_editor_have_in_new_attendees (ECalComponent *comp, EMeetingAttendee *ma)
eml = itip_strip_mailto (eml);
g_return_val_if_fail (eml != NULL, FALSE);
- return comp_editor_have_in_new_attendees_lst (g_object_get_data (G_OBJECT (comp), "new-attendees"), eml);
+ return comp_editor_have_in_new_attendees_lst (
+ g_object_get_data (G_OBJECT (comp), "new-attendees"), eml);
}
/**
* comp_editor_have_in_new_attendees_lst:
- * Same as @ref comp_editor_have_in_new_attendees only parameters are direct GSList and string.
+ *
+ * Same as comp_editor_have_in_new_attendees() only parameters are
+ * direct GSList and string.
**/
gboolean
-comp_editor_have_in_new_attendees_lst (const GSList *new_attendees, const gchar *eml)
+comp_editor_have_in_new_attendees_lst (const GSList *new_attendees,
+ const gchar *eml)
{
const GSList *l;
diff --git a/calendar/gui/dialogs/comp-editor-util.h b/calendar/gui/dialogs/comp-editor-util.h
index d3230051e3..6eeb8c5410 100644
--- a/calendar/gui/dialogs/comp-editor-util.h
+++ b/calendar/gui/dialogs/comp-editor-util.h
@@ -32,6 +32,8 @@
void comp_editor_dates (CompEditorPageDates *date, ECalComponent *comp);
void comp_editor_free_dates (CompEditorPageDates *dates);
+void comp_editor_date_label (CompEditorPageDates *dates, GtkWidget *label);
+
GtkWidget * comp_editor_new_date_edit (gboolean show_date,
gboolean show_time,
gboolean make_time_insensitive);
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 1ff43d34f1..010dd1cbf6 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -65,8 +65,6 @@
#define d(x)
-static gboolean comp_lite = FALSE;
-
/* Private part of the CompEditor structure */
struct _CompEditorPrivate {
@@ -163,10 +161,16 @@ static const gchar *ui =
" </menu>"
" </menubar>"
" <toolbar name='main-toolbar'>"
-" <toolitem action='save'/>"
-" <toolitem action='print'/>"
-" <toolitem action='close'/>"
+" <toolitem action='save'/>\n"
+"#if !EXPRESS\n"
+" <toolitem action='print'/>\n"
+"#endif\n"
" <separator/>"
+" <placeholder name='content'/>\n"
+"#if EXPRESS\n"
+" <separator expand='true'/>\n"
+" <toolitem action='close'/>\n"
+"#endif\n"
" </toolbar>"
"</ui>";
@@ -411,7 +415,7 @@ save_comp (CompEditor *editor)
clone = e_cal_component_clone (priv->comp);
comp_editor_copy_new_attendees (clone, priv->comp);
for (l = priv->pages; l != NULL; l = l->next) {
- if (!comp_editor_page_fill_component (l->data, clone)) {
+ if (IS_COMP_EDITOR_PAGE(l->data) && !comp_editor_page_fill_component (l->data, clone)) {
g_object_unref (clone);
g_hash_table_destroy (timezones);
comp_editor_show_page (editor, COMP_EDITOR_PAGE (l->data));
@@ -419,7 +423,8 @@ save_comp (CompEditor *editor)
}
/* retrieve all timezones */
- comp_editor_page_fill_timezones (l->data, timezones);
+ if (IS_COMP_EDITOR_PAGE(l->data))
+ comp_editor_page_fill_timezones (l->data, timezones);
}
/* If we are not the organizer, we don't update the sequence number */
@@ -1588,6 +1593,9 @@ comp_editor_init (CompEditor *editor)
gint n_targets;
GError *error = NULL;
+ /* FIXME Shell should be passed in. */
+ shell = e_shell_get_default ();
+
editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor);
g_object_weak_ref (
@@ -1611,9 +1619,9 @@ comp_editor_init (CompEditor *editor)
priv->is_group_item = FALSE;
priv->ui_manager = e_ui_manager_new ();
+ e_ui_manager_set_express_mode (E_UI_MANAGER (priv->ui_manager),
+ e_shell_get_express_mode (shell));
- if (comp_lite)
- gtk_window_set_default_size ((GtkWindow *) editor, 800, 450);
gtk_window_add_accel_group (
GTK_WINDOW (editor),
gtk_ui_manager_get_accel_group (priv->ui_manager));
@@ -1695,7 +1703,7 @@ comp_editor_init (CompEditor *editor)
action = comp_editor_get_action (editor, "save");
gtk_action_set_sensitive (action, FALSE);
- gtk_ui_manager_add_ui_from_string (priv->ui_manager, ui, -1, &error);
+ e_ui_manager_add_ui_from_string (E_UI_MANAGER (priv->ui_manager), ui, &error);
if (error != NULL) {
g_warning ("%s: %s", G_STRFUNC, error->message);
g_error_free (error);
@@ -1711,24 +1719,25 @@ comp_editor_init (CompEditor *editor)
container = widget;
- widget = comp_editor_get_managed_widget (editor, "/main-menu");
- gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
- gtk_widget_show (widget);
-
- if (!comp_lite) {
- widget = comp_editor_get_managed_widget (editor, "/main-toolbar");
+ if (!e_shell_get_express_mode (shell)) {
+ widget = comp_editor_get_managed_widget (editor, "/main-menu");
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
- gtk_widget_show (widget);
+ gtk_widget_set_visible (widget, !e_shell_get_meego_mode (shell));
}
+ widget = comp_editor_get_managed_widget (editor, "/main-toolbar");
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
widget = e_attachment_paned_new ();
gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
priv->attachment_view = g_object_ref (widget);
gtk_widget_show (widget);
- if (comp_lite) {
- GtkWidget *tmp, *tmp1, *tmp_box, *cont;
+ if (e_shell_get_express_mode (shell)) {
+ /*GtkWidget *tmp, *tmp1, *tmp_box, */
+ GtkWidget *cont;
GtkWidget *combo;
e_attachment_paned_set_expanded (E_ATTACHMENT_PANED (widget), TRUE);
@@ -1739,7 +1748,7 @@ comp_editor_init (CompEditor *editor)
gtk_widget_hide (combo);
cont = e_attachment_paned_get_controls_container (
E_ATTACHMENT_PANED (widget));
-
+ /*
tmp_box = gtk_hbox_new (FALSE, 0);
tmp = gtk_hbox_new (FALSE, 0);
tmp1 = gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_BUTTON);
@@ -1759,12 +1768,12 @@ comp_editor_init (CompEditor *editor)
gtk_widget_show(tmp_box);
gtk_box_pack_end (GTK_BOX (cont), tmp_box, FALSE, FALSE, 4);
-
+ */
}
container = e_attachment_paned_get_content_area (
E_ATTACHMENT_PANED (priv->attachment_view));
- if (comp_lite) {
+ if (e_shell_get_express_mode (shell)) {
scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy ((GtkScrolledWindow *)scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_show(scroll);
@@ -1772,14 +1781,14 @@ comp_editor_init (CompEditor *editor)
}
widget = gtk_notebook_new ();
- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
- if (!comp_lite)
+ gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), e_shell_get_express_mode (shell));
+ if (!e_shell_get_express_mode (shell))
gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
else
gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) scroll, widget);
priv->notebook = GTK_NOTEBOOK (widget);
gtk_widget_show (widget);
- if (comp_lite)
+ if (e_shell_get_express_mode (shell))
gtk_widget_set_size_request (scroll, 300, -1);
comp_editor_setup_recent_menu (editor);
@@ -1821,9 +1830,8 @@ comp_editor_init (CompEditor *editor)
comp_editor_bind_gconf (editor);
- /* FIXME Shell should be passed in. */
- shell = e_shell_get_default ();
e_shell_watch_window (shell, GTK_WINDOW (editor));
+ e_shell_adapt_window_size (shell, GTK_WINDOW (editor));
}
static gboolean
@@ -2263,6 +2271,51 @@ page_unmapped_cb (GtkWidget *page_widget,
}
/**
+ * comp_editor_append_widget:
+ * @editor: A component editor
+ * @page: A component editor page
+ * @label: Label of the page. Should be NULL if add is FALSE.
+ * @add: Add's the page into the notebook if TRUE
+ *
+ * Appends a page to the notebook if add is TRUE else
+ * just adds it to the list of pages.
+ **/
+void
+comp_editor_append_widget (CompEditor *editor,
+ GtkWidget *page,
+ const gchar *label,
+ gboolean add)
+{
+ CompEditorPrivate *priv;
+ GtkWidget *label_widget = NULL;
+
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ priv = editor->priv;
+
+ g_object_ref (page);
+
+ if (label)
+ label_widget = gtk_label_new_with_mnemonic (label);
+
+ priv->pages = g_list_append (priv->pages, page);
+
+ if (add)
+ gtk_notebook_append_page (priv->notebook, page, label_widget);
+
+ /* Listen for when the page is mapped/unmapped so we can
+ install/uninstall the appropriate GtkAccelGroup.
+ g_signal_connect (
+ page, "map",
+ G_CALLBACK (page_mapped_cb), page);
+ g_signal_connect(
+ page, "unmap",
+ G_CALLBACK (page_unmapped_cb), page);
+ */
+
+}
+
+/**
* comp_editor_append_page:
* @editor: A component editor
* @page: A component editor page
@@ -2553,8 +2606,10 @@ fill_widgets (CompEditor *editor)
g_signal_handlers_block_by_func (
action, G_CALLBACK (action_classification_cb), editor);
- for (iter = priv->pages; iter != NULL; iter = iter->next)
- comp_editor_page_fill_widgets (iter->data, priv->comp);
+ for (iter = priv->pages; iter != NULL; iter = iter->next) {
+ if (IS_COMP_EDITOR_PAGE(iter->data))
+ comp_editor_page_fill_widgets (iter->data, priv->comp);
+ }
g_signal_handlers_unblock_by_func (
action, G_CALLBACK (action_classification_cb), editor);
@@ -2797,8 +2852,10 @@ comp_editor_get_current_comp (CompEditor *editor, gboolean *correct)
comp = e_cal_component_clone (priv->comp);
comp_editor_copy_new_attendees (comp, priv->comp);
if (priv->changed) {
- for (l = priv->pages; l != NULL; l = l->next)
- all_ok = comp_editor_page_fill_component (l->data, comp) && all_ok;
+ for (l = priv->pages; l != NULL; l = l->next) {
+ if (IS_COMP_EDITOR_PAGE(l->data))
+ all_ok = comp_editor_page_fill_component (l->data, comp) && all_ok;
+ }
}
if (correct)
@@ -2966,7 +3023,7 @@ page_dates_changed_cb (CompEditor *editor,
GList *l;
for (l = priv->pages; l != NULL; l = l->next)
- if (page != (CompEditorPage *) l->data)
+ if (page != (CompEditorPage *) l->data && IS_COMP_EDITOR_PAGE(l->data))
comp_editor_page_set_dates (l->data, dates);
if (!priv->warned && priv->existing_org && !priv->user_org && !(editor->priv->flags & COMP_EDITOR_NEW_ITEM)) {
@@ -3023,14 +3080,3 @@ obj_removed_cb (ECal *client,
close_dialog (editor);
}
-gboolean
-comp_editor_get_lite ()
-{
- return comp_lite;
-}
-
-void
-comp_editor_set_lite (gboolean status)
-{
- comp_lite = status;
-}
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
index 4871beae8f..bd26ce8b66 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -127,6 +127,11 @@ void comp_editor_append_page (CompEditor *editor,
CompEditorPage *page,
const gchar *label,
gboolean add);
+void comp_editor_append_widget (CompEditor *editor,
+ GtkWidget *page,
+ const gchar *label,
+ gboolean add);
+
void comp_editor_remove_page (CompEditor *editor,
CompEditorPage *page);
void comp_editor_show_page (CompEditor *editor,
@@ -165,9 +170,6 @@ GtkWidget * comp_editor_get_managed_widget (CompEditor *editor,
const gchar *widget_path);
CompEditor * comp_editor_find_instance (const gchar *uid);
-void comp_editor_set_lite (gboolean status);
-gboolean comp_editor_get_lite (void);
-
G_END_DECLS
#endif
diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c
index 9b8c8c4fed..f1c568849b 100644
--- a/calendar/gui/dialogs/copy-source-dialog.c
+++ b/calendar/gui/dialogs/copy-source-dialog.c
@@ -32,18 +32,19 @@
#include "common/authentication.h"
typedef struct {
+ GtkWindow *parent;
ESource *orig_source;
ECalSourceType obj_type;
ESource *selected_source;
} CopySourceDialogData;
static void
-show_error (GtkWindow *parent, const gchar *msg)
+show_error (CopySourceDialogData *csdd, const gchar *msg)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (
- parent, 0, GTK_MESSAGE_ERROR,
+ csdd->parent, 0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE, "%s", msg);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
@@ -88,7 +89,7 @@ copy_source (CopySourceDialogData *csdd)
/* open the source */
source_client = e_auth_new_cal_from_source (csdd->orig_source, csdd->obj_type);
if (!e_cal_open (source_client, TRUE, NULL)) {
- show_error (NULL, _("Could not open source"));
+ show_error (csdd, _("Could not open source"));
g_object_unref (source_client);
return FALSE;
}
@@ -96,7 +97,7 @@ copy_source (CopySourceDialogData *csdd)
/* open the destination */
dest_client = e_auth_new_cal_from_source (csdd->selected_source, csdd->obj_type);
if (!e_cal_open (dest_client, FALSE, NULL)) {
- show_error (NULL, _("Could not open destination"));
+ show_error (csdd, _("Could not open destination"));
g_object_unref (dest_client);
g_object_unref (source_client);
return FALSE;
@@ -105,7 +106,7 @@ copy_source (CopySourceDialogData *csdd)
/* check if the destination is read only */
e_cal_is_read_only (dest_client, &read_only, NULL);
if (read_only) {
- show_error (NULL, _("Destination is read only"));
+ show_error (csdd, _("Destination is read only"));
} else {
if (e_cal_get_object_list (source_client, "#t", &obj_list, NULL)) {
GList *l;
@@ -135,7 +136,7 @@ copy_source (CopySourceDialogData *csdd)
g_free (uid);
} else {
if (error) {
- show_error (NULL, error->message);
+ show_error (csdd, error->message);
g_error_free (error);
}
break;
@@ -168,6 +169,7 @@ copy_source_dialog (GtkWindow *parent, ESource *source, ECalSourceType obj_type)
g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
+ csdd.parent = parent;
csdd.orig_source = source;
csdd.selected_source = NULL;
csdd.obj_type = obj_type;
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 90fc910708..262751fa86 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -36,6 +36,7 @@
#include <e-util/e-binding.h>
#include <e-util/e-plugin-ui.h>
#include <e-util/e-util-private.h>
+#include <e-util/e-ui-manager.h>
#include "event-page.h"
#include "recurrence-page.h"
@@ -89,11 +90,19 @@ static const gchar *ui =
" </menu>"
" </menubar>"
" <toolbar name='main-toolbar'>"
-" <toolitem action='alarms'/>"
-" <toolitem action='show-time-busy'/>"
-" <toolitem action='recurrence'/>"
-" <toolitem action='all-day-event'/>"
-" <toolitem action='free-busy'/>"
+" <placeholder name='content'>\n"
+"#if !EXPRESS\n"
+" <toolitem action='alarms'/>\n"
+"#endif\n"
+" <toolitem action='show-time-busy'/>\n"
+"#if !EXPRESS\n"
+" <toolitem action='recurrence'/>\n"
+"#endif\n"
+" <toolitem action='all-day-event'/>\n"
+"#if !EXPRESS\n"
+" <toolitem action='free-busy'/>\n"
+"#endif\n"
+" </placeholder>"
" </toolbar>"
"</ui>";
@@ -280,6 +289,8 @@ event_editor_constructor (GType type,
GtkWidget *content_area;
ECal *client;
gboolean is_meeting;
+ GtkWidget *alarm_page;
+ GtkWidget *attendee_page;
/* Chain up to parent's constructor() method. */
object = G_OBJECT_CLASS (event_editor_parent_class)->constructor (
@@ -316,11 +327,34 @@ event_editor_constructor (GType type,
priv->recur_page = recurrence_page_new (editor);
page = COMP_EDITOR_PAGE (priv->recur_page);
- gtk_container_add (
- GTK_CONTAINER (content_area),
- comp_editor_page_get_widget (page));
- gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (priv->recur_window)));
- comp_editor_append_page (editor, page, NULL, FALSE);
+ if (!e_shell_get_express_mode(e_shell_get_default())) {
+ gtk_container_add (
+ GTK_CONTAINER ((GTK_DIALOG (priv->recur_window)->vbox)),
+ comp_editor_page_get_widget (page));
+ gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (priv->recur_window)));
+ comp_editor_append_page (editor, page, NULL, FALSE);
+ } else {
+ comp_editor_append_page (editor, page, _("_Recurrence"), TRUE);
+ }
+
+ if (e_shell_get_express_mode(e_shell_get_default())) {
+ ENameSelector *name_selector;
+
+ priv->sched_page = schedule_page_new (priv->model, editor);
+ page = COMP_EDITOR_PAGE (priv->sched_page);
+
+ name_selector = event_page_get_name_selector (priv->event_page);
+ schedule_page_set_name_selector (priv->sched_page, name_selector);
+
+ comp_editor_append_page (editor, page, _("_Free/Busy"), TRUE);
+ schedule_page_update_free_busy (priv->sched_page);
+
+ /* Alarm page */
+ alarm_page = event_page_get_alarm_page (priv->event_page);
+ comp_editor_append_widget (editor, alarm_page, _("_Alarm"), TRUE);
+ g_object_unref(alarm_page);
+
+ }
if (is_meeting) {
@@ -337,6 +371,12 @@ event_editor_constructor (GType type,
event_page_set_meeting (priv->event_page, TRUE);
priv->meeting_shown=TRUE;
+
+ if (e_shell_get_express_mode(e_shell_get_default())) {
+ attendee_page = event_page_get_attendee_page (priv->event_page);
+ comp_editor_append_widget (editor, attendee_page, _("Attendee_s"), TRUE);
+ g_object_unref(attendee_page);
+ }
}
return object;
@@ -513,7 +553,7 @@ event_editor_init (EventEditor *ee)
G_N_ELEMENTS (meeting_entries), ee);
ui_manager = comp_editor_get_ui_manager (editor);
- gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, &error);
+ e_ui_manager_add_ui_from_string (E_UI_MANAGER (ui_manager), ui, &error);
id = "org.gnome.evolution.event-editor";
e_plugin_ui_register_manager (ui_manager, id, ee);
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index cf1bc620ea..1dfabb7597 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -828,7 +828,8 @@ sensitize_widgets (EventPage *epage)
} else {
gtk_widget_show (priv->calendar_label);
gtk_widget_show (priv->list_box);
- gtk_widget_show (priv->attendee_box);
+ if (!e_shell_get_express_mode(e_shell_get_default()))
+ gtk_widget_show (priv->attendee_box);
gtk_widget_show (priv->organizer);
gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("Or_ganizer:"));
}
@@ -2199,7 +2200,7 @@ get_widgets (EventPage *epage)
priv->invite = GW ("invite");
priv->invite_label = GW ("invite-label");
- if (comp_editor_get_lite ())
+ if (e_shell_get_express_mode (e_shell_get_default ()))
gtk_widget_hide (priv->invite);
else
gtk_widget_hide (priv->invite_label);
@@ -2239,8 +2240,6 @@ get_widgets (EventPage *epage)
priv->source_selector = GW ("source");
-#undef GW
-
e_util_set_source_combo_box_list (priv->source_selector, "/apps/evolution/calendar/sources");
completion = e_category_completion_new ();
@@ -3255,3 +3254,42 @@ event_page_remove_all_attendees (EventPage *epage)
e_meeting_list_view_remove_all_attendees_from_name_selector (E_MEETING_LIST_VIEW (priv->list_view));
}
+GtkWidget *
+event_page_get_alarm_page (EventPage *epage)
+{
+ EventPagePrivate *priv;
+ GtkWidget *alarm_page, *tmp;
+
+ g_return_val_if_fail (epage != NULL, NULL);
+ g_return_val_if_fail (IS_EVENT_PAGE (epage), NULL);
+
+ priv = epage->priv;
+
+ tmp = GW("dialog-vbox1");
+ alarm_page = GW("vbox2");
+ g_object_ref(alarm_page);
+ gtk_container_remove ((GtkContainer *)tmp, alarm_page);
+
+ return alarm_page;
+}
+
+GtkWidget *
+event_page_get_attendee_page (EventPage *epage)
+{
+ EventPagePrivate *priv;
+ GtkWidget *apage;
+
+ g_return_val_if_fail (epage != NULL, NULL);
+ g_return_val_if_fail (IS_EVENT_PAGE (epage), NULL);
+
+ priv = epage->priv;
+
+ apage = priv->list_box;
+ g_object_ref(apage);
+ gtk_container_remove ((GtkContainer *)gtk_widget_get_parent(apage), apage);
+ gtk_widget_hide (priv->attendee_box);
+
+ return apage;
+}
+
+#undef GW
diff --git a/calendar/gui/dialogs/event-page.h b/calendar/gui/dialogs/event-page.h
index ab43c0f7ba..afa191e9c1 100644
--- a/calendar/gui/dialogs/event-page.h
+++ b/calendar/gui/dialogs/event-page.h
@@ -109,6 +109,8 @@ ENameSelector * event_page_get_name_selector (EventPage *epage);
void event_page_add_attendee (EventPage *epage,
EMeetingAttendee *attendee);
void event_page_remove_all_attendees (EventPage *epage);
+GtkWidget * event_page_get_alarm_page (EventPage *epage);
+GtkWidget * event_page_get_attendee_page (EventPage *epage);
G_END_DECLS
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 1733cf3a96..46a2f95d0e 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -81,8 +81,10 @@ static const gchar *ui =
" </menu>"
" </menubar>"
" <toolbar name='main-toolbar'>"
-" <toolitem action='view-time-zone'/>"
-" <toolitem action='option-status'/>"
+" <placeholder name='content'>"
+" <toolitem action='view-time-zone'/>"
+" <toolitem action='option-status'/>"
+" </placeholder>"
" </toolbar>"
"</ui>";