diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-29 06:36:03 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-30 22:02:11 +0800 |
commit | 8d85229f8fc9ff0e27b1f7790f61605c04337d7b (patch) | |
tree | 20d2dd06cc12df2fda95b3af7920a9e2e50cb997 /modules | |
parent | 7c02582ae70e45d58bf0966d60e23b50f854a06a (diff) | |
download | gsoc2013-evolution-8d85229f8fc9ff0e27b1f7790f61605c04337d7b.tar gsoc2013-evolution-8d85229f8fc9ff0e27b1f7790f61605c04337d7b.tar.gz gsoc2013-evolution-8d85229f8fc9ff0e27b1f7790f61605c04337d7b.tar.bz2 gsoc2013-evolution-8d85229f8fc9ff0e27b1f7790f61605c04337d7b.tar.lz gsoc2013-evolution-8d85229f8fc9ff0e27b1f7790f61605c04337d7b.tar.xz gsoc2013-evolution-8d85229f8fc9ff0e27b1f7790f61605c04337d7b.tar.zst gsoc2013-evolution-8d85229f8fc9ff0e27b1f7790f61605c04337d7b.zip |
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.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/calendar/e-memo-shell-view-private.c | 36 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-private.c | 50 |
2 files changed, 41 insertions, 45 deletions
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); @@ -55,6 +43,16 @@ memo_shell_view_table_user_created_cb (EMemoShellView *memo_shell_view, } 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) { @@ -202,6 +200,11 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) 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), memo_shell_view); @@ -227,11 +230,6 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) 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), memo_shell_view); diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index 4b04185d0d..1cdf6697ff 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -24,6 +24,25 @@ #include "widgets/menus/gal-view-factory-etable.h" static void +task_shell_view_model_row_appended_cb (ETaskShellView *task_shell_view, + ECalModel *model) +{ + ETaskShellSidebar *task_shell_sidebar; + ECal *client; + ESource *source; + + /* This is the "Click to Add" handler. */ + + client = e_cal_model_get_default_client (model); + source = e_cal_get_source (client); + + task_shell_sidebar = task_shell_view->priv->task_shell_sidebar; + e_task_shell_sidebar_add_source (task_shell_sidebar, source); + + e_cal_model_add_client (model, client); +} + +static void task_shell_view_process_completed_tasks (ETaskShellView *task_shell_view) { ETaskShellContent *task_shell_content; @@ -57,27 +76,6 @@ task_shell_view_table_popup_event_cb (EShellView *shell_view, } static void -task_shell_view_table_user_created_cb (ETaskShellView *task_shell_view, - ETaskTable *task_table) -{ - ETaskShellSidebar *task_shell_sidebar; - ECalModel *model; - ECal *client; - ESource *source; - - /* This is the "Click to Add" handler. */ - - model = e_task_table_get_model (task_table); - client = e_cal_model_get_default_client (model); - source = e_cal_get_source (client); - - task_shell_sidebar = task_shell_view->priv->task_shell_sidebar; - e_task_shell_sidebar_add_source (task_shell_sidebar, source); - - e_cal_model_add_client (model, client); -} - -static void task_shell_view_selector_client_added_cb (ETaskShellView *task_shell_view, ECal *client) { @@ -254,6 +252,11 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) task_shell_view); g_signal_connect_swapped ( + model, "row-appended", + G_CALLBACK (task_shell_view_model_row_appended_cb), + task_shell_view); + + g_signal_connect_swapped ( task_table, "open-component", G_CALLBACK (e_task_shell_view_open_task), task_shell_view); @@ -279,11 +282,6 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) task_shell_view); g_signal_connect_swapped ( - task_table, "user-created", - G_CALLBACK (task_shell_view_table_user_created_cb), - task_shell_view); - - g_signal_connect_swapped ( model, "model-changed", G_CALLBACK (e_task_shell_view_update_sidebar), task_shell_view); |