From 8d85229f8fc9ff0e27b1f7790f61605c04337d7b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 28 Jan 2010 17:36:03 -0500 Subject: Sidebar cleanups for Memos and Tasks. Kill the EMemoTable::user-created signal and connect directly to ECalModel::row-appended in e_memo_shell_view_private.c. Same goes for tasks. --- modules/calendar/e-memo-shell-view-private.c | 36 +++++++++++++--------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'modules/calendar/e-memo-shell-view-private.c') diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c index 9e2be0fe7d..2caa6ec2ed 100644 --- a/modules/calendar/e-memo-shell-view-private.c +++ b/modules/calendar/e-memo-shell-view-private.c @@ -24,27 +24,15 @@ #include "widgets/menus/gal-view-factory-etable.h" static void -memo_shell_view_table_popup_event_cb (EShellView *shell_view, - GdkEventButton *event) -{ - const gchar *widget_path; - - widget_path = "/memo-popup"; - e_shell_view_show_popup_menu (shell_view, widget_path, event); -} - -static void -memo_shell_view_table_user_created_cb (EMemoShellView *memo_shell_view, - EMemoTable *memo_table) +memo_shell_view_model_row_appended_cb (EMemoShellView *memo_shell_view, + ECalModel *model) { EMemoShellSidebar *memo_shell_sidebar; - ECalModel *model; ECal *client; ESource *source; /* This is the "Click to Add" handler. */ - model = e_memo_table_get_model (memo_table); client = e_cal_model_get_default_client (model); source = e_cal_get_source (client); @@ -54,6 +42,16 @@ memo_shell_view_table_user_created_cb (EMemoShellView *memo_shell_view, e_cal_model_add_client (model, client); } +static void +memo_shell_view_table_popup_event_cb (EShellView *shell_view, + GdkEventButton *event) +{ + const gchar *widget_path; + + widget_path = "/memo-popup"; + e_shell_view_show_popup_menu (shell_view, widget_path, event); +} + static void memo_shell_view_selector_client_added_cb (EMemoShellView *memo_shell_view, ECal *client) @@ -201,6 +199,11 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) G_CALLBACK (e_memo_shell_view_update_timezone), memo_shell_view); + g_signal_connect_swapped ( + model, "row-appended", + G_CALLBACK (memo_shell_view_model_row_appended_cb), + memo_shell_view); + g_signal_connect_swapped ( memo_table, "open-component", G_CALLBACK (e_memo_shell_view_open_memo), @@ -226,11 +229,6 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) G_CALLBACK (e_memo_shell_view_set_status_message), memo_shell_view); - g_signal_connect_swapped ( - memo_table, "user-created", - G_CALLBACK (memo_shell_view_table_user_created_cb), - memo_shell_view); - g_signal_connect_swapped ( model, "model-changed", G_CALLBACK (e_memo_shell_view_update_sidebar), -- cgit