1 | /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
---|
2 | /* evolution-storage-set-view-factory.c |
---|
3 | * |
---|
4 | * Copyright (C) 2000 Ximian, Inc. |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or |
---|
7 | * modify it under the terms of version 2 of the GNU General Public |
---|
8 | * License as published by the Free Software Foundation. |
---|
9 | * |
---|
10 | * This program is distributed in the hope that it will be useful, |
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
13 | * General Public License for more details. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU General Public |
---|
16 | * License along with this program; if not, write to the |
---|
17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
18 | * Boston, MA 02111-1307, USA. |
---|
19 | * |
---|
20 | * Author: Ettore Perazzoli |
---|
21 | */ |
---|
22 | |
---|
23 | #ifdef HAVE_CONFIG_H |
---|
24 | #include <config.h> |
---|
25 | #endif |
---|
26 | |
---|
27 | #include "e-storage-set-view.h" |
---|
28 | #include "e-shell.h" |
---|
29 | #include "evolution-storage-set-view.h" |
---|
30 | |
---|
31 | #include "evolution-storage-set-view-factory.h" |
---|
32 | |
---|
33 | #include <gal/widgets/e-scroll-frame.h> |
---|
34 | |
---|
35 | |
---|
36 | BonoboControl * |
---|
37 | evolution_storage_set_view_factory_new_view (EShell *shell) |
---|
38 | { |
---|
39 | EStorageSet *storage_set; |
---|
40 | GtkWidget *storage_set_view; |
---|
41 | BonoboControl *control; |
---|
42 | EvolutionStorageSetView *storage_set_view_interface; |
---|
43 | GtkWidget *scroll_frame; |
---|
44 | |
---|
45 | g_return_val_if_fail (shell != NULL, NULL); |
---|
46 | g_return_val_if_fail (E_IS_SHELL (shell), NULL); |
---|
47 | |
---|
48 | storage_set = e_shell_get_storage_set (shell); |
---|
49 | storage_set_view = e_storage_set_create_new_view (storage_set, NULL /*XXX*/); |
---|
50 | e_storage_set_view_set_allow_dnd (E_STORAGE_SET_VIEW (storage_set_view), FALSE); |
---|
51 | |
---|
52 | storage_set_view_interface = evolution_storage_set_view_new (E_STORAGE_SET_VIEW (storage_set_view)); |
---|
53 | if (storage_set_view_interface == NULL) { |
---|
54 | gtk_widget_destroy (storage_set_view); |
---|
55 | return NULL; |
---|
56 | } |
---|
57 | |
---|
58 | scroll_frame = e_scroll_frame_new (NULL, NULL); |
---|
59 | e_scroll_frame_set_policy (E_SCROLL_FRAME (scroll_frame), |
---|
60 | GTK_POLICY_AUTOMATIC, |
---|
61 | GTK_POLICY_AUTOMATIC); |
---|
62 | e_scroll_frame_set_shadow_type (E_SCROLL_FRAME (scroll_frame), |
---|
63 | GTK_SHADOW_IN); |
---|
64 | |
---|
65 | gtk_container_add (GTK_CONTAINER (scroll_frame), storage_set_view); |
---|
66 | |
---|
67 | gtk_widget_show (scroll_frame); |
---|
68 | gtk_widget_show (storage_set_view); |
---|
69 | |
---|
70 | control = bonobo_control_new (scroll_frame); |
---|
71 | bonobo_object_add_interface (BONOBO_OBJECT (control), BONOBO_OBJECT (storage_set_view_interface)); |
---|
72 | |
---|
73 | return control; |
---|
74 | } |
---|