aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/calendar/e-cal-shell-backend.c83
-rw-r--r--modules/calendar/e-cal-shell-backend.h4
-rw-r--r--widgets/misc/e-calendar-item.c12
-rw-r--r--widgets/misc/e-calendar-item.h4
4 files changed, 94 insertions, 9 deletions
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index e1f682357c..006dca5cb6 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -48,6 +48,7 @@
#include "e-cal-shell-content.h"
#include "e-cal-shell-migrate.h"
#include "e-cal-shell-settings.h"
+#include "e-cal-shell-sidebar.h"
#include "e-cal-shell-view.h"
#define E_CAL_SHELL_BACKEND_GET_PRIVATE(obj) \
@@ -539,6 +540,8 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
gchar *source_uid = NULL;
gchar *comp_uid = NULL;
gchar *comp_rid = NULL;
+ GDate start_date;
+ GDate end_date;
gboolean handled = FALSE;
GError *error = NULL;
@@ -553,6 +556,9 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
if (cp == NULL)
goto exit;
+ g_date_clear (&start_date, 1);
+ g_date_clear (&end_date, 1);
+
while (*cp != '\0') {
gchar *header;
gchar *content;
@@ -572,7 +578,13 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
content_len = strcspn (cp, "&");
content = g_strndup (cp, content_len);
- if (g_ascii_strcasecmp (header, "source-uid") == 0)
+ if (g_ascii_strcasecmp (header, "startdate") == 0)
+ g_date_set_time_t (
+ &start_date, time_from_isodate (content));
+ else if (g_ascii_strcasecmp (header, "enddate") == 0)
+ g_date_set_time_t (
+ &end_date, time_from_isodate (content));
+ else if (g_ascii_strcasecmp (header, "source-uid") == 0)
source_uid = g_strdup (content);
else if (g_ascii_strcasecmp (header, "comp-uid") == 0)
comp_uid = g_strdup (content);
@@ -588,6 +600,21 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
}
}
+ /* This is primarily for launching Evolution
+ * from the calendar in the clock applet. */
+ if (g_date_valid (&start_date)) {
+ if (g_date_valid (&end_date))
+ e_cal_shell_backend_open_date_range (
+ E_CAL_SHELL_BACKEND (shell_backend),
+ &start_date, &end_date);
+ else
+ e_cal_shell_backend_open_date_range (
+ E_CAL_SHELL_BACKEND (shell_backend),
+ &start_date, NULL);
+ handled = TRUE;
+ goto exit;
+ }
+
if (source_uid == NULL || comp_uid == NULL)
goto exit;
@@ -831,3 +858,57 @@ e_cal_shell_backend_get_source_list (ECalShellBackend *cal_shell_backend)
return cal_shell_backend->priv->source_list;
}
+
+void
+e_cal_shell_backend_open_date_range (ECalShellBackend *cal_shell_backend,
+ const GDate *start_date,
+ const GDate *end_date)
+{
+ EShell *shell;
+ EShellView *shell_view;
+ EShellBackend *shell_backend;
+ EShellSidebar *shell_sidebar;
+ GtkWidget *shell_window = NULL;
+ ECalendar *navigator;
+ GList *watched_windows;
+
+ g_return_if_fail (E_IS_CAL_SHELL_BACKEND (cal_shell_backend));
+
+ shell_backend = E_SHELL_BACKEND (cal_shell_backend);
+ shell = e_shell_backend_get_shell (shell_backend);
+ watched_windows = e_shell_get_watched_windows (shell);
+
+ /* Try to find an EShellWindow already in calendar view. */
+ while (watched_windows != NULL) {
+ GtkWidget *window = GTK_WIDGET (watched_windows->data);
+
+ if (E_IS_SHELL_WINDOW (window)) {
+ const gchar *active_view;
+
+ active_view = e_shell_window_get_active_view (
+ E_SHELL_WINDOW (window));
+ if (g_strcmp0 (active_view, "calendar") == 0) {
+ gtk_window_present (GTK_WINDOW (window));
+ shell_window = window;
+ break;
+ }
+ }
+
+ watched_windows = g_list_next (watched_windows);
+ }
+
+ /* Otherwise create a new EShellWindow in calendar view. */
+ if (shell_window == NULL)
+ shell_window = e_shell_create_shell_window (shell, "calendar");
+
+ /* Now dig up the date navigator and select the date range. */
+
+ shell_view = e_shell_window_get_shell_view (
+ E_SHELL_WINDOW (shell_window), "calendar");
+ shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ navigator = e_cal_shell_sidebar_get_date_navigator (
+ E_CAL_SHELL_SIDEBAR (shell_sidebar));
+
+ e_calendar_item_set_selection (
+ navigator->calitem, start_date, end_date);
+}
diff --git a/modules/calendar/e-cal-shell-backend.h b/modules/calendar/e-cal-shell-backend.h
index 497e200490..4b19275b79 100644
--- a/modules/calendar/e-cal-shell-backend.h
+++ b/modules/calendar/e-cal-shell-backend.h
@@ -64,6 +64,10 @@ void e_cal_shell_backend_register_type
(GTypeModule *type_module);
ESourceList * e_cal_shell_backend_get_source_list
(ECalShellBackend *cal_shell_backend);
+void e_cal_shell_backend_open_date_range
+ (ECalShellBackend *cal_shell_backend,
+ const GDate *start_date,
+ const GDate *end_date);
G_END_DECLS
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index e67c2b7eeb..98ed03a735 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -190,8 +190,8 @@ static void e_calendar_item_date_range_changed (ECalendarItem *calitem);
static void e_calendar_item_queue_signal_emission (ECalendarItem *calitem);
static gboolean e_calendar_item_signal_emission_idle_cb (gpointer data);
static void e_calendar_item_set_selection_if_emission (ECalendarItem *calitem,
- GDate *start_date,
- GDate *end_date,
+ const GDate *start_date,
+ const GDate *end_date,
gboolean emission);
/* Our arguments. */
@@ -3096,8 +3096,8 @@ e_calendar_item_get_selection (ECalendarItem *calitem,
static void
e_calendar_item_set_selection_if_emission (ECalendarItem *calitem,
- GDate *start_date,
- GDate *end_date,
+ const GDate *start_date,
+ const GDate *end_date,
gboolean emission)
{
gint start_year, start_month, start_day;
@@ -3199,8 +3199,8 @@ e_calendar_item_style_set (GtkWidget *widget, ECalendarItem *calitem)
void
e_calendar_item_set_selection (ECalendarItem *calitem,
- GDate *start_date,
- GDate *end_date)
+ const GDate *start_date,
+ const GDate *end_date)
{
/* If the user is in the middle of a selection, we must abort it. */
if (calitem->selecting) {
diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h
index 4aab58ea2e..34fa3e2be4 100644
--- a/widgets/misc/e-calendar-item.h
+++ b/widgets/misc/e-calendar-item.h
@@ -331,8 +331,8 @@ gboolean
the start of the selection is shown. If start_date is NULL it clears the
selection. */
void e_calendar_item_set_selection (ECalendarItem *calitem,
- GDate *start_date,
- GDate *end_date);
+ const GDate *start_date,
+ const GDate *end_date);
/* Marks a particular day. Passing E_CALENDAR_ITEM_MARK_BOLD as the day style
will result in the day being shown as bold by default. The style callback
4/cgit/freebsd-ports-graphics/commit/devel/libgtop/pkg-plist?id=4b80610a49db4506ed53b48ab72743a3122cc7ba'>4b80610a49d
4b80610a49d







b7b7fb4c92d








7873f8893a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
                  

                  
                        
                  
                 











                            
                         

                           

                          






















                             


                         


                                                              
             
              
                
                    
                     
                       
                   
                    
                      
                         
                          
                            
                   
                    
                      
                         
                          
                            
                     
                      
                        
                          
                           
                             

                                                                   
                                      
                                      







                                         








                                      
                      
bin/libgtop-config
bin/libgtop_daemon
bin/libgtop_server
etc/libgtop-features.def
etc/libgtopConf.sh
include/glibtop.h
include/glibtop/close.h
include/glibtop/command.h
include/glibtop/cpu.h
include/glibtop/error.h
include/glibtop/fsusage.h
include/glibtop/global.h
include/glibtop/gnuserv.h
include/glibtop/inodedb.h
include/glibtop/loadavg.h
include/glibtop/mem.h
include/glibtop/mountlist.h
include/glibtop/msg_limits.h
include/glibtop/netload.h
include/glibtop/open.h
include/glibtop/parameter.h
include/glibtop/ppp.h
include/glibtop/procargs.h
include/glibtop/prockernel.h
include/glibtop/proclist.h
include/glibtop/procmap.h
include/glibtop/procmem.h
include/glibtop/procsegment.h
include/glibtop/procsignal.h
include/glibtop/procstate.h
include/glibtop/proctime.h
include/glibtop/procuid.h
include/glibtop/read.h
include/glibtop/read_data.h
include/glibtop/sem_limits.h
include/glibtop/shm_limits.h
include/glibtop/signal.h
include/glibtop/swap.h
include/glibtop/sysdeps.h
include/glibtop/sysinfo.h
include/glibtop/types.h
include/glibtop/union.h
include/glibtop/uptime.h
include/glibtop/version.h
include/glibtop/write.h
include/glibtop/xmalloc.h
include/glibtop_machine.h
include/glibtop_server.h
include/glibtop_suid.h
@unexec install-info --delete %D/info/libgtop.info %D/info/dir
info/libgtop.info
@exec install-info %D/info/libgtop.info %D/info/dir
lib/libgtop.a
lib/libgtop.so
lib/libgtop.so.1
lib/libgtop_common.a
lib/libgtop_common.so
lib/libgtop_common.so.1
lib/libgtop_guile.a
lib/libgtop_guile.so
lib/libgtop_guile.so.1
lib/libgtop_guile_names.a
lib/libgtop_guile_names.so
lib/libgtop_guile_names.so.1
lib/libgtop_names.a
lib/libgtop_names.so
lib/libgtop_names.so.1
lib/libgtop_suid_common.a
lib/libgtop_suid_common.so
lib/libgtop_suid_common.so.1
lib/libgtop_sysdeps.a
lib/libgtop_sysdeps.so
lib/libgtop_sysdeps.so.1
lib/libgtop_sysdeps_suid.a
lib/libgtop_sysdeps_suid.so
lib/libgtop_sysdeps_suid.so.1
@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m %B
share/locale/da/LC_MESSAGES/libgtop.mo
share/locale/de/LC_MESSAGES/libgtop.mo
share/locale/es/LC_MESSAGES/libgtop.mo
share/locale/es_DO/LC_MESSAGES/libgtop.mo
share/locale/es_GT/LC_MESSAGES/libgtop.mo
share/locale/es_HN/LC_MESSAGES/libgtop.mo
share/locale/es_MX/LC_MESSAGES/libgtop.mo
share/locale/es_PA/LC_MESSAGES/libgtop.mo
share/locale/es_PE/LC_MESSAGES/libgtop.mo
share/locale/es_SV/LC_MESSAGES/libgtop.mo
share/locale/fi/LC_MESSAGES/libgtop.mo
share/locale/fr/LC_MESSAGES/libgtop.mo
share/locale/gl/LC_MESSAGES/libgtop.mo
share/locale/ja/LC_MESSAGES/libgtop.mo
share/locale/ko/LC_MESSAGES/libgtop.mo
share/locale/nl/LC_MESSAGES/libgtop.mo
share/locale/no/LC_MESSAGES/libgtop.mo
share/locale/pl/LC_MESSAGES/libgtop.mo
share/locale/sv/LC_MESSAGES/libgtop.mo
@dirrm include/glibtop