aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-09 04:37:00 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-09 04:37:00 +0800
commit5350eebb5ef8c07e69110616ce1662e0e92bea16 (patch)
treed1d822ed1af3c92168b04780cfb6ac48a18b5996 /addressbook/gui
parent52d683e48cf1103a9806da95c72abce2db3ae1f4 (diff)
downloadgsoc2013-evolution-5350eebb5ef8c07e69110616ce1662e0e92bea16.tar.gz
gsoc2013-evolution-5350eebb5ef8c07e69110616ce1662e0e92bea16.tar.zst
gsoc2013-evolution-5350eebb5ef8c07e69110616ce1662e0e92bea16.zip
Progress update:
- Merge ETaskBar into EShellTaskbar. - Remember the last view, and make --component work. svn path=/branches/kill-bonobo/; revision=36278
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/e-book-shell-module.c2
-rw-r--r--addressbook/gui/component/e-book-shell-view-actions.c19
-rw-r--r--addressbook/gui/component/e-book-shell-view-private.c43
-rw-r--r--addressbook/gui/component/e-book-shell-view-private.h1
-rw-r--r--addressbook/gui/component/e-book-shell-view.c25
5 files changed, 51 insertions, 39 deletions
diff --git a/addressbook/gui/component/e-book-shell-module.c b/addressbook/gui/component/e-book-shell-module.c
index 08c372f220..117206c9b7 100644
--- a/addressbook/gui/component/e-book-shell-module.c
+++ b/addressbook/gui/component/e-book-shell-module.c
@@ -40,7 +40,7 @@
#include <autocompletion-config.h>
#define MODULE_NAME "addressbook"
-#define MODULE_ALIASES ""
+#define MODULE_ALIASES "contacts"
#define MODULE_SCHEMES ""
#define MODULE_SEARCHES "addresstypes.xml"
#define MODULE_SORT_ORDER 300
diff --git a/addressbook/gui/component/e-book-shell-view-actions.c b/addressbook/gui/component/e-book-shell-view-actions.c
index e5e08e34a2..515531af88 100644
--- a/addressbook/gui/component/e-book-shell-view-actions.c
+++ b/addressbook/gui/component/e-book-shell-view-actions.c
@@ -52,7 +52,7 @@ action_address_book_delete_cb (GtkAction *action,
GError *error = NULL;
shell_view = E_SHELL_VIEW (book_shell_view);
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
selector = E_SOURCE_SELECTOR (book_shell_view->priv->selector);
source = e_source_selector_peek_primary_selection (selector);
@@ -112,7 +112,7 @@ action_address_book_new_cb (GtkAction *action,
EShellWindow *shell_window;
shell_view = E_SHELL_VIEW (book_shell_view);
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
addressbook_config_create_new_source (GTK_WIDGET (shell_window));
}
@@ -130,7 +130,7 @@ action_address_book_properties_cb (GtkAction *action,
const gchar *uid;
shell_view = E_SHELL_VIEW (book_shell_view);
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
selector = E_SOURCE_SELECTOR (book_shell_view->priv->selector);
source = e_source_selector_peek_primary_selection (selector);
@@ -370,6 +370,7 @@ action_search_execute_cb (GtkAction *action,
{
EShellView *shell_view;
EShellWindow *shell_window;
+ EShellContent *shell_content;
GtkWidget *widget;
GString *string;
EABView *view;
@@ -382,12 +383,10 @@ action_search_execute_cb (GtkAction *action,
if (!e_shell_view_is_selected (shell_view))
return;
- /* Dig up the search text. */
- widget = e_shell_view_get_content_widget (shell_view);
- widget = e_shell_content_get_search_bar (E_SHELL_CONTENT (widget));
- search_text = e_search_bar_get_search_text (E_SEARCH_BAR (widget));
+ shell_content = e_shell_view_get_content (shell_view);
+ search_text = e_shell_content_get_search_text (shell_content);
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
action = ACTION (CONTACT_SEARCH_ANY_FIELD_CONTAINS);
value = gtk_radio_action_get_current_value (
GTK_RADIO_ACTION (action));
@@ -689,7 +688,7 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view)
const gchar *key;
shell_view = E_SHELL_VIEW (book_shell_view);
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
manager = e_shell_window_get_ui_manager (shell_window);
domain = GETTEXT_PACKAGE;
@@ -743,7 +742,7 @@ e_book_shell_view_update_actions (EBookShellView *book_shell_view,
return;
shell_view = E_SHELL_VIEW (book_shell_view);
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
selector = E_SOURCE_SELECTOR (book_shell_view->priv->selector);
source = e_source_selector_peek_primary_selection (selector);
diff --git a/addressbook/gui/component/e-book-shell-view-private.c b/addressbook/gui/component/e-book-shell-view-private.c
index 71be4b5254..e2f23e8324 100644
--- a/addressbook/gui/component/e-book-shell-view-private.c
+++ b/addressbook/gui/component/e-book-shell-view-private.c
@@ -42,12 +42,10 @@ set_status_message (EABView *view,
activity_handler, activity_id);
activity_id = 0;
}
- } else if (activity_id == 0) {
- gchar *client_id = g_strdup_printf ("%p", book_shell_view);
-
+ } else if (activity_id == 0)
activity_id = e_activity_handler_operation_started (
- activity_handler, client_id, message, TRUE);
- } else
+ activity_handler, message, TRUE);
+ else
e_activity_handler_operation_progressing (
activity_handler, activity_id, message, -1.0);
@@ -74,8 +72,8 @@ set_folder_bar_message (EABView *view,
* and have it handle this directly. */
EShellView *shell_view;
+ EShellSidebar *shell_sidebar;
EABView *current_view;
- GtkWidget *widget;
const gchar *name;
shell_view = E_SHELL_VIEW (book_shell_view);
@@ -85,10 +83,9 @@ set_folder_bar_message (EABView *view,
return;
name = e_source_peek_name (view->source);
- widget = e_shell_view_get_sidebar_widget (shell_view);
-
- e_shell_sidebar_set_primary_text (E_SHELL_SIDEBAR (widget), name);
- e_shell_sidebar_set_secondary_text (E_SHELL_SIDEBAR (widget), message);
+ shell_sidebar = e_shell_view_get_sidebar (shell_view);
+ e_shell_sidebar_set_primary_text (shell_sidebar, name);
+ e_shell_sidebar_set_secondary_text (shell_sidebar, message);
}
static void
@@ -175,6 +172,7 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view)
g_object_set (uid_view, "type", EAB_VIEW_TABLE, NULL);
gtk_widget_show (uid_view);
+ g_object_ref_sink (uid_view);
gtk_notebook_append_page (notebook, uid_view, NULL);
g_hash_table_insert (hash_table, g_strdup (uid), uid_view);
@@ -217,7 +215,7 @@ book_shell_view_show_popup_menu (GdkEventButton *event,
const gchar *widget_path;
widget_path = "/address-book-popup";
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
menu = e_shell_window_get_managed_widget (shell_window, widget_path);
if (event != NULL)
@@ -265,7 +263,7 @@ book_shell_view_selector_key_press_event_cb (EShellView *shell_view,
EShellWindow *shell_window;
/* Needed for the ACTION() macro. */
- shell_window = e_shell_view_get_window (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
if (event->keyval == GDK_Delete) {
gtk_action_activate (ACTION (ADDRESS_BOOK_DELETE));
@@ -314,25 +312,18 @@ e_book_shell_view_private_init (EBookShellView *book_shell_view)
/* Construct view widgets. */
widget = gtk_notebook_new ();
- container = e_shell_view_get_content_widget (shell_view);
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE);
- gtk_container_add (GTK_CONTAINER (container), widget);
- priv->notebook = g_object_ref (widget);
+ priv->notebook = g_object_ref_sink (widget);
gtk_widget_show (widget);
- widget = e_shell_view_get_taskbar_widget (shell_view);
- e_activity_handler_attach_task_bar (
- priv->activity_handler, E_TASK_BAR (widget));
-
widget = gtk_scrolled_window_new (NULL, NULL);
- container = e_shell_view_get_sidebar_widget (shell_view);
gtk_scrolled_window_set_policy (
GTK_SCROLLED_WINDOW (widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (
GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
- gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->scrolled_window = g_object_ref_sink (widget);
gtk_widget_show (widget);
container = widget;
@@ -368,7 +359,6 @@ e_book_shell_view_private_init (EBookShellView *book_shell_view)
e_categories_register_change_listener (
G_CALLBACK (book_shell_view_categories_changed_cb),
book_shell_view);
- e_book_shell_view_update_search_filter (book_shell_view);
}
void
@@ -379,6 +369,7 @@ e_book_shell_view_private_dispose (EBookShellView *book_shell_view)
DISPOSE (priv->contact_actions);
DISPOSE (priv->notebook);
+ DISPOSE (priv->scrolled_window);
DISPOSE (priv->selector);
DISPOSE (priv->activity_handler);
@@ -430,17 +421,15 @@ e_book_shell_view_editor_weak_notify (EditorUidClosure *closure,
void
e_book_shell_view_update_search_filter (EBookShellView *book_shell_view)
{
+ EShellContent *shell_content;
EShellView *shell_view;
GtkRadioAction *action;
- GtkWidget *widget;
GList *list, *iter;
GSList *group = NULL;
gint ii;
- /* Dig up the search bar. */
shell_view = E_SHELL_VIEW (book_shell_view);
- widget = e_shell_view_get_content_widget (shell_view);
- widget = e_shell_content_get_search_bar (E_SHELL_CONTENT (widget));
+ shell_content = e_shell_view_get_content (shell_view);
action = gtk_radio_action_new (
"category-any", _("Any Category"), NULL, NULL, -1);
@@ -464,5 +453,5 @@ e_book_shell_view_update_search_filter (EBookShellView *book_shell_view)
g_list_free (list);
/* Use any action in the group; doesn't matter which. */
- e_search_bar_set_filter_action (E_SEARCH_BAR (widget), action);
+ e_shell_content_set_filter_action (shell_content, action);
}
diff --git a/addressbook/gui/component/e-book-shell-view-private.h b/addressbook/gui/component/e-book-shell-view-private.h
index 80fb21dbde..6c5a3f8963 100644
--- a/addressbook/gui/component/e-book-shell-view-private.h
+++ b/addressbook/gui/component/e-book-shell-view-private.h
@@ -88,6 +88,7 @@ struct _EBookShellViewPrivate {
/*** Other Stuff ***/
GtkWidget *notebook;
+ GtkWidget *scrolled_window;
GtkWidget *selector;
EActivityHandler *activity_handler;
diff --git a/addressbook/gui/component/e-book-shell-view.c b/addressbook/gui/component/e-book-shell-view.c
index d9f34b8d21..e383e8bb7b 100644
--- a/addressbook/gui/component/e-book-shell-view.c
+++ b/addressbook/gui/component/e-book-shell-view.c
@@ -171,10 +171,33 @@ book_shell_view_finalize (GObject *object)
static void
book_shell_view_constructed (GObject *object)
{
- e_book_shell_view_actions_init (E_BOOK_SHELL_VIEW (object));
+ EBookShellView *book_shell_view;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ EShellTaskbar *shell_taskbar;
+ EShellView *shell_view;
+ GtkWidget *widget;
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (parent_class)->constructed (object);
+
+ shell_view = E_SHELL_VIEW (object);
+ book_shell_view = E_BOOK_SHELL_VIEW (object);
+
+ widget = book_shell_view->priv->notebook;
+ shell_content = e_shell_view_get_content (shell_view);
+ gtk_container_add (GTK_CONTAINER (shell_content), widget);
+
+ widget = book_shell_view->priv->scrolled_window;
+ shell_sidebar = e_shell_view_get_sidebar (shell_view);
+ gtk_container_add (GTK_CONTAINER (shell_sidebar), widget);
+
+ shell_taskbar = e_shell_view_get_taskbar (shell_view);
+ e_activity_handler_attach_task_bar (
+ book_shell_view->priv->activity_handler, shell_taskbar);
+
+ e_book_shell_view_actions_init (book_shell_view);
+ e_book_shell_view_update_search_filter (book_shell_view);
}
static void