From f1d7e36a2f26f1633f9282f8210879ca7f1ea0a0 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Tue, 27 Apr 2010 14:43:04 +0530 Subject: Add 'add new calendar' to the side pane like annum. --- modules/calendar/e-cal-shell-sidebar.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'modules/calendar/e-cal-shell-sidebar.c') diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index a00ade73df..546d21b3c3 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -33,6 +33,7 @@ #include "calendar/gui/calendar-config.h" #include "calendar/gui/e-calendar-selector.h" #include "calendar/gui/misc.h" +#include "calendar/gui/dialogs/calendar-setup.h" #include "e-cal-shell-view.h" #include "e-cal-shell-backend.h" @@ -558,6 +559,21 @@ cal_shell_sidebar_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } +static void +new_calendar_clicked (GtkButton *button, + EShellSidebar *shell_sidebar) +{ + EShellView *shell_view; + EShellWindow *shell_window; + EShellBackend *shell_backend; + + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_backend = e_shell_view_get_shell_backend (shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + + calendar_setup_new_calendar (GTK_WINDOW (shell_window)); +} + static void cal_shell_sidebar_constructed (GObject *object) { @@ -605,7 +621,21 @@ cal_shell_sidebar_constructed (GObject *object) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); - gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE); + if(!e_shell_get_express_mode(e_shell_get_default())) { + gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE); + } else { + GtkWidget *button; + + container = gtk_vbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX(container), widget, TRUE, TRUE, 0); + + button = gtk_button_new_with_label (_("New Calendar...")); + gtk_box_pack_start (GTK_BOX(container), button, FALSE, FALSE, 0); + g_signal_connect (button, "clicked", G_CALLBACK(new_calendar_clicked), shell_sidebar); + + gtk_paned_pack1 (GTK_PANED (priv->paned), container, TRUE, TRUE); + gtk_widget_show_all (container); + } gtk_widget_show (widget); container = widget; -- cgit