aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2009-08-07 11:32:17 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-08-12 03:48:04 +0800
commit46cc80aa8c6579a8badb79e719bd9aec29220e9f (patch)
tree702642f7b2dff8845bd9013d5a50b5ccca0d9c54 /calendar
parent50302d03b3ce145b165db2ddef4e92ad190cbef9 (diff)
downloadgsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar
gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.gz
gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.bz2
gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.lz
gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.xz
gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.zst
gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.zip
Changes for having a light version of calendar.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/dialogs/comp-editor.c75
-rw-r--r--calendar/gui/dialogs/comp-editor.h2
-rw-r--r--calendar/gui/dialogs/event-page.c7
-rw-r--r--calendar/gui/dialogs/event-page.glade23
4 files changed, 100 insertions, 7 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 100a1615fb..0b9dfba93c 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -75,6 +75,8 @@
#define d(x)
+static gboolean comp_lite = FALSE;
+
/* Private part of the CompEditor structure */
struct _CompEditorPrivate {
@@ -1606,6 +1608,7 @@ comp_editor_init (CompEditor *editor)
GtkAction *action;
GtkWidget *container;
GtkWidget *widget;
+ GtkWidget *scroll;
EShell *shell;
gint n_targets;
GError *error = NULL;
@@ -1628,7 +1631,9 @@ comp_editor_init (CompEditor *editor)
priv->is_group_item = FALSE;
priv->ui_manager = gtk_ui_manager_new ();
-
+
+ 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));
@@ -1702,9 +1707,11 @@ comp_editor_init (CompEditor *editor)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- widget = comp_editor_get_managed_widget (editor, "/main-toolbar");
- 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");
+ 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);
@@ -1712,15 +1719,60 @@ comp_editor_init (CompEditor *editor)
priv->attachment_view = g_object_ref (widget);
gtk_widget_show (widget);
+ if (comp_lite) {
+ GtkWidget *tmp, *tmp1, *tmp_box, *cont;
+ GtkWidget *combo;
+
+ e_attachment_paned_set_expanded (E_ATTACHMENT_PANED (widget), TRUE);
+ e_attachment_paned_set_expanded (E_ATTACHMENT_PANED (widget), FALSE);
+
+ combo = e_attachment_paned_get_view_combo (
+ E_ATTACHMENT_PANED (widget));
+ 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);
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 0);
+ tmp1 = gtk_label_new_with_mnemonic (_("Save"));
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 3);
+ gtk_widget_show_all(tmp);
+
+ combo = gtk_ui_manager_get_widget (priv->ui_manager, "/main-toolbar/save");
+ gtk_widget_reparent (combo, tmp_box);
+ gtk_box_set_child_packing ((GtkBox *)tmp_box, combo, FALSE, FALSE, 6, GTK_PACK_END);
+ gtk_tool_item_set_is_important (GTK_TOOL_ITEM (combo), TRUE);
+ combo = gtk_bin_get_child ((GtkBin *)combo);
+ gtk_container_remove((GtkContainer *)combo, gtk_bin_get_child ((GtkBin *)combo));
+ gtk_container_add((GtkContainer *)combo, tmp);
+ gtk_button_set_relief ((GtkButton *)combo, GTK_RELIEF_NORMAL);
+
+ 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) {
+ scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy ((GtkScrolledWindow *)scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_widget_show(scroll);
+ gtk_box_pack_start (GTK_BOX (container), scroll, TRUE, TRUE, 0);
+ }
+
widget = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
- gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+ if (!comp_lite)
+ 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)
+ gtk_widget_set_size_request (scroll, 300, -1);
comp_editor_setup_recent_menu (editor);
/* Drag-and-Drop Support */
@@ -2944,3 +2996,14 @@ 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 0edb2cc8eb..157343bcac 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -156,6 +156,8 @@ 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/event-page.c b/calendar/gui/dialogs/event-page.c
index c48fe3cb79..4b0962228b 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -161,6 +161,7 @@ struct _EventPagePrivate {
GtkWidget *remove;
GtkWidget *edit;
GtkWidget *invite;
+ GtkWidget *invite_label;
GtkWidget *attendees_label;
/* ListView stuff */
@@ -2259,6 +2260,12 @@ get_widgets (EventPage *epage)
priv->info_string = GW ("generic-info-msgs");
priv->invite = GW ("invite");
+ priv->invite_label = GW ("invite-label");
+ if (comp_editor_get_lite ())
+ gtk_widget_hide (priv->invite);
+ else
+ gtk_widget_hide (priv->invite_label);
+
priv->add = GW ("add-attendee");
priv->remove = GW ("remove-attendee");
priv->edit = GW ("edit-attendee");
diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade
index 7a57f6b716..f1bb4e15dc 100644
--- a/calendar/gui/dialogs/event-page.glade
+++ b/calendar/gui/dialogs/event-page.glade
@@ -898,7 +898,28 @@ b</property>
</child>
<child>
- <placeholder/>
+ <widget class="GtkLabel" id="invite-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Attendees</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</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>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
</child>
</widget>
<packing>