GNOME Bugzilla – Bug 128283
Panel clock/calendar integration
Last modified: 2004-12-22 21:47:04 UTC
Here is a patch for panel clock / calendar integration. http://www.gnome.org/bounties/Calendar.php3#127532 Instead of adding another configuration dialog it simply aggregates the calendars that are selected in Evolution (and responds to changes). So it just works. Double clicking on a day brings up Evolution calendar (or another program stored in gconf). However, I'm not sure there is a way to request a specific day to be displayed from the command line. It seems to be possible by using bonobo or libeshell but that would add a dependency on evolution to gnome-panel. That doesn't seem to be right. Please let me know if this looks ok.
Created attachment 21973 [details] [review] patch for head
This requires that the following patch be applied to evolution-data-server: http://lists.ximian.com/archives/public/evolution-hackers/2003-December/001914.html
Some random comments (I looked really quickly at the code): * there are things coming from Ximian that we may not want (ALLOW_UNIX_TIME, show_day_of_week, etc.) * the quick alarm reminder window should appear on all workspaces (IMHO) * don't use GtkOptionMenu: it's deprecated in gtk+ 2.4. Use GtkComboBox instead. Using a GtkComboBox, you won't need alarm_minutes[] (just use a GtkListStore with 2 columns) * couldn't we use try_appointment_tool for evolution (instead of having another function try_evolution_calendar) Could you provide a screenshot too? Thanks
Created attachment 21982 [details] [review] updated patch
Thanks for the quick feedback! This patch should address all of your comments. Removed show_day_of_week. I only re-enabled ALLOW_UNIX_TIME instead of removing it altogether in case it might be useful. Uses GtkComboBox. Quick Alarm dialog is shown on all workspaces. Uses try_appointment_tool for evolution.
Created attachment 21985 [details] screenshot
*** Bug 119109 has been marked as a duplicate of this bug. ***
I just checked in the required e-d-s patch to HEAD.
Is it possible to have colors like what is shown in the screenshot at http://www.gnome.org/bounties/Calendar.php3#127532 ? And maybe adding icons would be nice too. Another nice thing would be to ellipsize the appointment/task (instead of having it cut like the first appointment in your screenshot). eel_ellipsizing_label would help, but I think you're using a treeview. I don't know what we can do here...
I started looking into the colors the other day. It seems that the colors are not stored by the backend but generated by the frontend. We could just use the same algorithm I suppose. I was worried that they might get out of sync and the utility of color would be lessened. The other thing I worried about is theming and accessibility problems. I'll assume the evo folks have already thought about that. I will try to do this today. We'll see how it looks. Icons are also handled/installed by the frontend. Yes, cutting off long event summaries isn't very nice. I didn't want the window to grow to fit. I'll try to think of a better way.
Created attachment 22025 [details] screenshot of event list with colors
I think icons are in gnome-icon-theme.
Actually, the colors do seem to stay synch'd with evo. I think this will be true as long as the event sources are processed in the same order from gconf. Since the applet and evo both use the e-d-s API e_source_list_new_for_gconf I think they should stay in the same order. Should the background for the times be colored too? In evolution there can be multiple icons relevent to each event, such as: reminder, recurrence, timezone, meeting and any number of categories. I think it might be clumsy to try to add multiple icons per row. Not to mention we don't have much space to work with. However, the icons on http://www.gnome.org/bounties/Calendar.php3#127532 don't seem to be any of those. I think they might just indicate event versus task/todo. What do you think?
Created attachment 22031 [details] [review] updated patch to use colors and icons
Created attachment 22032 [details] screenshot with event colors and icons
Created attachment 22063 [details] [review] updated patch to add ellipsis to long summaries
Created attachment 22064 [details] screenshot with ellipsis on long summaries
Created attachment 22072 [details] [review] updated to ellipsize tasks also (and add back configure.in change)
Created attachment 22119 [details] [review] updated patch to start evolution when event/task rows are activated
Looks nice! Some comments follow :) One thing you might want to have there is a checkbox to make a task done? Also, is it possible to colorize days in the calendar widget? It would be nice if those bold events got a color from the calendar they are part of. No idea if the widget supports that though..? Also, can you add those frames around the item groups like in the original mockup and adda few pixels of padding between the tasks? If you use a list widget for the tasks, then we got to figure out something else thouhg if it is not easy to do that.
Thanks for your comments. It is possible to add checkboxes to the tasks. However, once they were checked the task would disappear from the list, since only uncompleted tasks are displayed. Would that be confusing from the users point of view, especially if they toggled it by mistake? I don't think it is currently possible to colorize the calendar days with different colors. In gtkcalendar.c is this: #define MARKED_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)]) This is called by gtk_calendar_paint_day which is called in a loop in gtk_calendar_paint_main to "paint" the entire calendar. So I don't think it is possible to change the foreground color for different days. Regarding the frames. It was my understanding that using frame borders was deprecated by the HIG. Is that true? If not then it is trivial to add them back in. It is easy to put some vertical padding between the task rows. I tried 3 pixels (top and bottom of each row, so 6 between each row) and it looks pretty good. Should the event list have the same? Maybe not since there might be a lot of events.
Created attachment 22168 [details] [review] updated patch to use scrollbar instead of ellipsis, added checkboxes, start evolution tasks on row click
Created attachment 22169 [details] latest screenshot
Obviously, I chose to use a GtkTreeView. I think it has a number of benefits: Built in accessibility Automatic sorting Sorting on any column Homogenous cell spacing it is much easier to scan a long list if the elements are aligned Existing, stable API Simple access to viewport we could do cool things like add a bit to the timeout function that would center the next occuring event Simple access to the data model once evolution supports it we can easily add a row activation handler that will load the selected event/task in the editor One limitation of GtkTreeView at the moment is that, as far as I know, it isn't able to display per row/cell tooltips.
Created attachment 22263 [details] Screenshot of clock preferences dialog.
Created attachment 22270 [details] [review] updated patch to fix positioning for bottom panel and add more error checking
you need to update the patch to latest CVS
Created attachment 22348 [details] [review] updated patch for latest CVS
*** Bug 128704 has been marked as a duplicate of this bug. ***
William, Martin, Christian: I spent a long time playing with both patches and started playing around with different ways of doing this. In the end I ended up starting pretty much from scratch using a lot of ideas from both patches. I've just committed the result. It still needs some work, for a start see the TODO list in clock.c. It'd be great if you guys could help out. I don't know what's going to happen about the bounty. My hope is that the bounty will be awarded and split between both patches. We'll see how that goes. Thanks much for all your hard work :-)
The patch I committed is here if you're interested: http://www.gnome.org/~markmc/clock-evo-integration.diff