aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@gnome.org>2010-04-27 17:13:04 +0800
committerSrinivasa Ragavan <sragavan@gnome.org>2010-04-27 17:13:04 +0800
commitf1d7e36a2f26f1633f9282f8210879ca7f1ea0a0 (patch)
tree68b1bb1df61d11deb4e20f711f37d264919867ab /modules/calendar
parente83142e20922bcfd6d7b6c9ced55753d661dd39c (diff)
downloadgsoc2013-evolution-f1d7e36a2f26f1633f9282f8210879ca7f1ea0a0.tar.gz
gsoc2013-evolution-f1d7e36a2f26f1633f9282f8210879ca7f1ea0a0.tar.zst
gsoc2013-evolution-f1d7e36a2f26f1633f9282f8210879ca7f1ea0a0.zip
Add 'add new calendar' to the side pane like annum.
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c32
1 files changed, 31 insertions, 1 deletions
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"
@@ -559,6 +560,21 @@ cal_shell_sidebar_finalize (GObject *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)
{
ECalShellSidebarPrivate *priv;
@@ -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;