[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/appointmentwidth into lp:indicator-datetime

2011-04-18 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/appointmentwidth into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #750671 in Indicator Date and Time: Calendar entry's title should be 
trimmed in the Calendar
  https://bugs.launchpad.net/indicator-datetime/+bug/750671
  Bug #762976 in indicator-datetime (Ubuntu): Menu is too narrow with calendar 
hidden
  https://bugs.launchpad.net/ubuntu/+source/indicator-datetime/+bug/762976

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/appointmentwidth/+merge/58098

fixes long appointment items, and items too short because the calendar is 
hidden.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/appointmentwidth/+merge/58098
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-04-13 19:32:18 +
+++ src/indicator-datetime.c	2011-04-18 09:52:25 +
@@ -1285,6 +1285,13 @@
 	/* Label, probably a username, chat room or mailbox name */
 	mi_data-label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, APPOINTMENT_MENUITEM_PROP_LABEL));
 	gtk_misc_set_alignment(GTK_MISC(mi_data-label), 0.0, 0.5);
+	
+	GtkStyle * style = gtk_widget_get_style(GTK_WIDGET(mi_data-label));
+PangoContext * context = gtk_widget_get_pango_context(GTK_WIDGET(mi_data-label));
+gint length = measure_string(style, context, GGG); // 15 char wide string max
+	gtk_widget_set_size_request(GTK_WIDGET(mi_data-label), length, -1); // Set the min size in pixels
+	
+	gtk_label_set_ellipsize(GTK_LABEL(mi_data-label), PANGO_ELLIPSIZE_END);
 	gtk_box_pack_start(GTK_BOX(hbox), mi_data-label, TRUE, TRUE, 0);
 	gtk_widget_show(mi_data-label);
 

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/appointmentwidth into lp:indicator-datetime

2011-04-15 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/appointmentwidth into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #750671 in Indicator Date and Time: Calendar entry's title should be 
trimmed in the Calendar
  https://bugs.launchpad.net/indicator-datetime/+bug/750671

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/appointmentwidth/+merge/57871

fixes long appointment items
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/appointmentwidth/+merge/57871
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-04-13 19:32:18 +
+++ src/indicator-datetime.c	2011-04-15 13:23:28 +
@@ -1285,6 +1285,7 @@
 	/* Label, probably a username, chat room or mailbox name */
 	mi_data-label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, APPOINTMENT_MENUITEM_PROP_LABEL));
 	gtk_misc_set_alignment(GTK_MISC(mi_data-label), 0.0, 0.5);
+	gtk_label_set_ellipsize(GTK_LABEL(mi_data-label), PANGO_ELLIPSIZE_END);
 	gtk_box_pack_start(GTK_BOX(hbox), mi_data-label, TRUE, TRUE, 0);
 	gtk_widget_show(mi_data-label);
 

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/locations-select into lp:indicator-datetime

2011-04-11 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/locations-select into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #740948 in Indicator Date and Time: Removing a location doesn't select 
the next one
  https://bugs.launchpad.net/indicator-datetime/+bug/740948

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/locations-select/+merge/57151

fixes associated bug.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/locations-select/+merge/57151
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-prefs-locations.c'
--- src/datetime-prefs-locations.c	2011-03-30 13:12:30 +
+++ src/datetime-prefs-locations.c	2011-04-11 12:12:31 +
@@ -77,13 +77,81 @@
 gtk_tree_path_free (iter-data);
   }
   g_list_free (paths);
-
+  
+  // Find the next item to select
+  GtkTreeIter *last_selected = g_list_nth_data(tree_iters, 0);
+  GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL (store), last_selected);
+  GtkTreeIter titer;
+  if (!gtk_tree_model_get_iter(GTK_TREE_MODEL (store), titer, path)) {
+g_debug(Failed to get last selected iter from path);
+  	last_selected = NULL;
+  } else {
+	  if (!gtk_tree_model_iter_next(GTK_TREE_MODEL (store), titer)) {
+	  	if (gtk_tree_path_prev(path)) {
+	  	  	if (!gtk_tree_model_get_iter(GTK_TREE_MODEL (store), titer, path)) {
+	  			g_debug(Failed to get iter from path);
+	  			last_selected = NULL;
+	  		} else {
+		  		last_selected = titer;
+		  	}
+	  	} else {
+	  		g_debug(handle_remove: Failed to find another location to select (assume single selected));
+	  		last_selected = NULL;
+	  	}
+	  } else {
+	  	g_debug(Got next item in model);
+		last_selected = titer;
+	  }
+  }
+ 
+  if (last_selected) {
+	  gboolean clear = TRUE;
+	  path = gtk_tree_model_get_path(GTK_TREE_MODEL (store), last_selected);
+	  
+  // Step over the path to find an item which isn't in the delete list
+	  if (g_list_length(tree_iters)  1) {
+		  for (iter = tree_iters; iter; iter = iter-next) {
+		  	GtkTreePath *ipath = gtk_tree_model_get_path(GTK_TREE_MODEL (store), (GtkTreeIter *)iter-data);
+		  	if (gtk_tree_path_compare(path, ipath) == 0) {
+		  		clear = FALSE;
+		  		break;
+		  	}
+		  }
+	  	  while (clear == FALSE) {
+			if (gtk_tree_path_prev(path)) {
+clear = TRUE;
+		  	  	for (iter = tree_iters; iter; iter = iter-next) {
+		  			GtkTreePath *ipath = gtk_tree_model_get_path(GTK_TREE_MODEL (store), (GtkTreeIter *)iter-data);
+		  			if (gtk_tree_path_compare(path, ipath) == 0) {
+		  clear = FALSE;
+		  break;
+		  			}
+		  		}
+		  		if (clear) {
+			  		if (!gtk_tree_model_get_iter(GTK_TREE_MODEL (store), titer, path)) {
+			  			g_debug(Failed to get iter from path);
+			  			last_selected = NULL;
+			  		} else {
+  		last_selected = titer;
+  	}
+}
+		  	} else {
+		  		last_selected = NULL;
+		  		break;
+		  	}
+		  }
+	  }
+  }
+  
   /* Now delete each iterator */
   for (iter = tree_iters; iter; iter = iter-next) {
 gtk_list_store_remove (store, (GtkTreeIter *)iter-data);
 g_free (iter-data);
   }
   g_list_free (tree_iters);
+  
+  if (last_selected)
+	  gtk_tree_selection_select_iter(selection, last_selected);
 }
 
 static void

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/datereset into lp:indicator-datetime

2011-04-11 Thread Karl Lattimer
Karl Lattimer has proposed merging lp:~karl-qdh/indicator-datetime/datereset 
into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #649800 in Indicator Date and Time: datetime indicator won't show 
today's date if you've ever clicked on any others
  https://bugs.launchpad.net/indicator-datetime/+bug/649800

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/datereset/+merge/57173

Different method of resetting the date works.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/datereset/+merge/57173
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-04-07 15:48:50 +
+++ src/datetime-service.c	2011-04-11 14:18:32 +
@@ -440,28 +440,6 @@
 	return TRUE;
 }
 
-static gboolean
-close_menu_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant) 
-{
-	if (calendar == NULL) return FALSE;
-	g_debug(Resetting date on menu close);
-	start_time_appointments = 0;
-	// TODO create a variant which will be an array of 3 ints {y,m,d}
-	GVariant *date_variant;
-	time_t curtime;
-	struct tm *t1;
-	time(curtime);
-	t1 = localtime(curtime);
-	GVariant *date[3];
-	date[0] = g_variant_new_uint32(t1-tm_year + 1900);
-	date[1] = g_variant_new_uint32(t1-tm_mon);
-	date[2] = g_variant_new_uint32(t1-tm_mday);
-	date_variant = g_variant_new_array(NULL, date, 3);
-	
-	dbusmenu_menuitem_property_set_variant (calendar, CALENDAR_MENUITEM_PROP_SET_DATE, date_variant);
-	return TRUE;
-}
-
 static guint ecaltimer = 0;
 
 static void
@@ -1439,9 +1417,6 @@
 	
 	build_menus(root);
 	
-	// Connect to the close signal to reset the calendar date 
-	g_signal_connect(root, event::closed, G_CALLBACK(close_menu_cb), NULL);
-	
 	/* Cache the timezone */
 	update_current_timezone();
 

=== modified file 'src/dbus-shared.h'
--- src/dbus-shared.h	2011-03-30 15:29:58 +
+++ src/dbus-shared.h	2011-04-11 14:18:32 +
@@ -29,11 +29,7 @@
 
 #define DBUSMENU_CALENDAR_MENUITEM_TYPEx-canonical-calendar-item
 
-// The following properties are not *really* properties, but are just
-// a way of accessing the calendar from the service
 #define CALENDAR_MENUITEM_PROP_MARKS   calendar-marks
-#define CALENDAR_MENUITEM_PROP_SET_DATEcalendar-set-date
-
 
 #define APPOINTMENT_MENUITEM_TYPE  appointment-item	
 #define APPOINTMENT_MENUITEM_PROP_LABELappointment-label

=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-03-31 10:35:35 +
+++ src/indicator-datetime.c	2011-04-11 14:18:32 +
@@ -269,6 +269,35 @@
 }
 
 static void
+menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data)
+{
+	IndicatorDatetime * self = INDICATOR_DATETIME(user_data);
+	g_debug(notify visible signal recieved);
+	
+	// we should only react if we're currently visible
+	gboolean visible;
+	g_object_get(G_OBJECT(menu), visible, visible, NULL);
+	if (visible) return;
+	g_debug(notify visible menu hidden, resetting date);
+	
+	time_t curtime;
+	
+	time(curtime);
+  	struct tm *today = localtime(curtime);
+  	int y = today-tm_year;
+  	int m = today-tm_mon;
+  	int d = today-tm_mday;
+  	
+  	// Set the calendar to todays date
+	ido_calendar_menu_item_set_date (self-priv-ido_calendar, y+1900, m, d);
+	
+	// Make sure the day-selected signal is sent so the menu updates - may duplicate
+	/*GVariant *variant = g_variant_new_uint32((guint)curtime);
+	guint timestamp = (guint)time(NULL);
+	dbusmenu_menuitem_handle_event(DBUSMENU_MENUITEM(self-priv-ido_calendar), day-selected, variant, timestamp);*/
+}
+
+static void
 indicator_datetime_init (IndicatorDatetime *self)
 {
 	self-priv = INDICATOR_DATETIME_GET_PRIVATE(self);
@@ -348,6 +377,8 @@
 
 	self-priv-menu = dbusmenu_gtkmenu_new(SERVICE_NAME, MENU_OBJ);
 
+	g_signal_connect(self-priv-menu, notify::visible, G_CALLBACK(menu_visible_notfy_cb), self);
+	
 	DbusmenuGtkClient *client = dbusmenu_gtkmenu_get_client(self-priv-menu);
 	dbusmenu_client_add_type_handler_full(DBUSMENU_CLIENT(client), DBUSMENU_CALENDAR_MENUITEM_TYPE, new_calendar_item, self, NULL);
 	dbusmenu_client_add_type_handler_full(DBUSMENU_CLIENT(client), APPOINTMENT_MENUITEM_TYPE, new_appointment_item, self, NULL);
@@ -1233,13 +1264,6 @@
 		} else {
 			g_debug(\tMarks: cleared);
 		}
-	} else if (!g_strcmp0(prop, CALENDAR_MENUITEM_PROP_SET_DATE)) {
-		if (value != NULL) {
-			gsize size = 3;
-			const gint * array = g_variant_get_fixed_array(value, size, sizeof(gint));
-			g_debug(Setting date y-m-d: %d-%d-%d, array[0], array[1], array[2]);
-			ido_calendar_menu_item_set_date (IDO_CALENDAR_MENU_ITEM (mi_data), array[0], array[1], array[2]);
-		}
 	}
 	return;
 }
@@ -1418,11 +1442,6 @@
 		calendar_prop_change_cb(newitem, CALENDAR_MENUITEM_PROP_MARKS, propval, ido);
 	}
 
-	propval = dbusmenu_menuitem_property_get_variant(newitem, CALENDAR_MENUITEM_PROP_SET_DATE);
-	if (propval != NULL) {
-		calendar_prop_change_cb(newitem

Re: [Ayatana-commits] [Merge] lp:~dylanmccall/indicator-datetime/bug-748772 into lp:indicator-datetime

2011-04-04 Thread Karl Lattimer
Review: Approve
Looks good to me
-- 
https://code.launchpad.net/~dylanmccall/indicator-datetime/bug-748772/+merge/56092
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/onlyenabledcalendars into lp:indicator-datetime

2011-04-04 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/onlyenabledcalendars into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #729033 in Indicator Date and Time: Show only Evolution calendar events 
if the calendar is active
  https://bugs.launchpad.net/indicator-datetime/+bug/729033

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/onlyenabledcalendars/+merge/56151

working patch to show only enabled calendars
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/onlyenabledcalendars/+merge/56151
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'configure.ac'
--- configure.ac	2011-03-23 21:03:40 +
+++ configure.ac	2011-04-04 12:56:34 +
@@ -66,6 +66,7 @@
 GLIB_REQUIRED_VERSION=2.26
 GTK_REQUIRED_VERSION=2.12
 GTK3_REQUIRED_VERSION=3.0
+GCONF_REQUIRED_VERSION=2.31
 
 AS_IF([test x$with_gtk = x3],
 [PKG_CHECK_MODULES(INDICATOR, indicator3 = $INDICATOR_REQUIRED_VERSION
@@ -86,7 +87,7 @@
 
 AS_IF([test x$with_gtk = x3],
 	[PKG_CHECK_MODULES(SERVICE,  indicator = $INDICATOR_REQUIRED_VERSION
- glib-2.0 = $GLIB_REQUIRED_VERSION
+ glib-2.0 = $GLIB_REQUIRED_VERSION
 	 dbusmenu-glib-0.4 = $DBUSMENUGLIB_REQUIRED_VERSION
  dbusmenu-gtk3-0.4 = $DBUSMENUGTK_REQUIRED_VERSION
 	 libido-0.1 = $INDICATOR_DISPLAY_OBJECTS
@@ -97,11 +98,12 @@
 	 libedataserver-1.2 = EDS_REQUIRED_VERSION
 	 libedataserverui-1.2 = EDS_REQUIRED_VERSION
 	 cairo = CAIRO_REQUIRED_VERSION
-	 gdk-2.0 = GDK_REQUIRED_VERSION)
+	 gdk-2.0 = GDK_REQUIRED_VERSION
+	 gconf-2.0 = GCONF_REQUIRED_VERSION)
 		],
   [test x$with_gtk = x2],
 	[PKG_CHECK_MODULES(SERVICE,  indicator = $INDICATOR_REQUIRED_VERSION
- glib-2.0 = $GLIB_REQUIRED_VERSION
+ glib-2.0 = $GLIB_REQUIRED_VERSION
 	 dbusmenu-glib-0.4 = $DBUSMENUGLIB_REQUIRED_VERSION
  dbusmenu-gtk-0.4 = $DBUSMENUGTK_REQUIRED_VERSION
 	 libido-0.1 = $INDICATOR_DISPLAY_OBJECTS
@@ -112,7 +114,8 @@
 	 libedataserver-1.2 = EDS_REQUIRED_VERSION
 	 libedataserverui-1.2 = EDS_REQUIRED_VERSION
 	 cairo = CAIRO_REQUIRED_VERSION
-	 gdk-2.0 = GDK_REQUIRED_VERSION)
+	 gdk-2.0 = GDK_REQUIRED_VERSION
+	 gconf-2.0 = GCONF_REQUIRED_VERSION)
 ],
 [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
 )

=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-30 21:55:14 +
+++ src/datetime-service.c	2011-04-04 12:56:34 +
@@ -28,6 +28,7 @@
 #include glib/gi18n.h
 #include gio/gio.h
 #include math.h
+#include gconf/gconf-client.h
 
 #include libdbusmenu-gtk/menuitem.h
 #include libdbusmenu-glib/server.h
@@ -82,6 +83,7 @@
 static gboolean   updating_appointments = FALSE;
 static time_t			  start_time_appointments = (time_t) 0;
 GSettings *conf;
+GConfClient* gconf;
 
 
 /* Geoclue trackers */
@@ -698,7 +700,13 @@
 			comp_instances = NULL;
 		}
 	}
-	
+	GSList *cal_list = gconf_client_get_list(gconf, /apps/evolution/calendar/display/selected_calendars, GCONF_VALUE_STRING, gerror);
+	if (gerror) {
+	  g_debug(Failed to get evolution preference for enabled calendars);
+	  g_error_free(gerror);
+	  gerror = NULL;
+	  cal_list = NULL;
+	}
 	// Generate instances for all sources
 	for (g = e_source_list_peek_groups (sources); g; g = g-next) {
 		ESourceGroup *group = E_SOURCE_GROUP (g-data);
@@ -716,6 +724,18 @@
 gerror = NULL;
 continue;
 	}
+			const gchar *ecal_uid = e_source_peek_uid(source);
+			gboolean match = FALSE;
+			g_debug(Checking ecal_uid is enabled: %s, ecal_uid);
+			for (i = 0; ig_slist_length(cal_list);i++) {
+char *cuid = (char *)g_slist_nth_data(cal_list, i);
+if (g_strcmp0(cuid, ecal_uid) == 0) {
+	match = TRUE;
+	break;
+}
+			}
+			if (!match) continue;
+			g_debug(ecal_uid is enabled, generating instances);
 			
 			e_cal_generate_instances (ecal, t1, t2, (ECalRecurInstanceFn) populate_appointment_instances, (gpointer) source);
 		}
@@ -1300,6 +1320,8 @@
 
 	/* Set up GSettings */
 	conf = g_settings_new(SETTINGS_INTERFACE);
+	/* Set up gconf for getting evolution enabled calendars */
+	gconf = gconf_client_get_default();
 	// TODO Add a signal handler to catch gsettings changes and respond to them
 
 	/* Building the base menu */

___
Mailing list: https://launchpad.net/~ayatana-commits
Post

[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/monthappointments into lp:indicator-datetime

2011-04-01 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/monthappointments into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #746713 in Indicator Date and Time: Upcoming events aren't listed if 
they are in a different month
  https://bugs.launchpad.net/indicator-datetime/+bug/746713

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/monthappointments/+merge/55877

make sure we get at least 7 days worth of events past the end of the month, 
just in case there are appointments there.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/monthappointments/+merge/55877
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-30 21:55:14 +
+++ src/datetime-service.c	2011-04-01 08:30:59 +
@@ -656,6 +656,8 @@
 	const int mon = today-tm_mon;
 	const int year = today-tm_year;
 
+	int start_month_saved = mon;
+
   	struct tm *start_tm = NULL;
 	int this_year = today-tm_year + 1900;
 	int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
@@ -667,6 +669,7 @@
 	if (start_time_appointments  0) {
   		start_tm = localtime(start_time_appointments);
 		int start_month = start_tm-tm_mon;
+		start_month_saved = start_month;
 		int start_year = start_tm-tm_year + 1900;
 		if ((start_month != mon) || (start_year != this_year)) {
 			// Set t1 to the start of that month.
@@ -681,6 +684,7 @@
 	
 	g_debug(Will highlight %d days from %s, highlightdays, ctime(t1));
 
+	highlightdays = highlightdays + 7; // Minimum of 7 days ahead 
 	t2 = t1 + (time_t) (highlightdays * 24 * 60 * 60);
 	
 	if (!e_cal_get_sources(sources, E_CAL_SOURCE_TYPE_EVENT, gerror)) {
@@ -781,10 +785,12 @@
 		const int dmon = due-tm_mon;
 		const int dyear = due-tm_year;
 		
-		// Mark day
-		g_debug(Adding marked date %s, %d, ctime(ci-start), dmday);
-		g_variant_builder_add (markeddays, i, dmday);
-
+		if (start_month_saved == dmon) {
+			// Mark day if our query hasn't hit the next month. 
+			g_debug(Adding marked date %s, %d, ctime(ci-start), dmday);
+			g_variant_builder_add (markeddays, i, dmday);
+		}
+		
 		// If the appointment time is less than the selected date, 
 		// don't create an appointment item for it.
 		if (vtype == E_CAL_COMPONENT_EVENT) {

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/updateonresume into lp:indicator-datetime

2011-03-31 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/updateonresume into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #726053 in Indicator Date and Time: Resuming from suspend should trigger 
a time update
  https://bugs.launchpad.net/indicator-datetime/+bug/726053

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/updateonresume/+merge/55724

Simple change to a different signal and the clock will refresh on resume from 
suspend. It will also refresh whenever the session changes from idle to active 
too but there's not much we can do about that.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/updateonresume/+merge/55724
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-03-30 21:55:14 +
+++ src/indicator-datetime.c	2011-03-31 10:39:45 +
@@ -830,7 +830,7 @@
 {
 	// Just returned from suspend
 	IndicatorDatetime * self = INDICATOR_DATETIME(user_data);
-	if (g_strcmp0(signal_name, ActiveChanged) == 0) {
+	if (g_strcmp0(signal_name, SystemIdleHintChanged) == 0  g_variant_get_boolean(parameters) == FALSE) {
 		update_time(self);
 	}
 	return;

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/propupdatefail into lp:indicator-datetime

2011-03-30 Thread Karl Lattimer
I can't reproduce the bug at all so this was the only inconsistency which 
*could* have matched the fact that the show seconds was triggering an update 
but the change in format wasn't. 

Remove the inconsistency, hopefully the bug's gone. 
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/propupdatefail/+merge/55119
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/resetdate into lp:indicator-datetime

2011-03-29 Thread Karl Lattimer
Karl Lattimer has proposed merging lp:~karl-qdh/indicator-datetime/resetdate 
into lp:indicator-datetime.

Requested reviews:
  tedgagnon (tedg)
Related bugs:
  Bug #649800 in Indicator Date and Time: datetime indicator won't show 
today's date if you've ever clicked on any others
  https://bugs.launchpad.net/indicator-datetime/+bug/649800
  Bug #740980 in indicator-datetime (Ubuntu): Date with event isn't 
highlighted in the calendar
  https://bugs.launchpad.net/ubuntu/+source/indicator-datetime/+bug/740980

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/resetdate/+merge/55336

Used the suggested arrays for marking/unmarking days but there's no change, the 
signal is still not received by the indicator, restarted everything in various 
ways and nothing seems to get it working. 
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/resetdate/+merge/55336
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-23 12:03:21 +
+++ src/datetime-service.c	2011-03-29 13:30:57 +
@@ -316,6 +316,28 @@
 	return TRUE;
 }
 
+static gboolean
+close_menu_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant) 
+{
+	if (calendar == NULL) return FALSE;
+	g_debug(Resetting date on menu close);
+	start_time_appointments = 0;
+	// TODO create a variant which will be an array of 3 ints {y,m,d}
+	GVariant *date_variant;
+	time_t curtime;
+	struct tm *t1;
+	time(curtime);
+	t1 = localtime(curtime);
+	GVariant *date[3];
+	date[0] = g_variant_new_uint32(t1-tm_year + 1900);
+	date[1] = g_variant_new_uint32(t1-tm_mon);
+	date[2] = g_variant_new_uint32(t1-tm_mday);
+	date_variant = g_variant_new_array(NULL, date, 3);
+	
+	dbusmenu_menuitem_property_set_variant (calendar, CALENDAR_MENUITEM_PROP_SET_DATE, date_variant);
+	return TRUE;
+}
+
 static guint ecaltimer = 0;
 
 static void
@@ -585,7 +607,7 @@
 	int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
 	if ((this_year % 400 == 0) || (this_year % 100  0  this_year % 4 == 0)) days[1] = 29;
 	
-	int highlightdays = days[mon] - mday + 1;
+	int highlightdays = days[mon] - mday;
 	t1 = curtime; // By default the current time is the appointment start time. 
 	
 	if (start_time_appointments  0) {
@@ -605,10 +627,7 @@
 	
 	g_debug(Will highlight %d days from %s, highlightdays, ctime(t1));
 
-	t2 = t1 + (time_t) (highlightdays * 24 * 60 * 60); 
-	
-	// Remove all highlights from the calendar widget
-	dbusmenu_menuitem_property_set (calendar, CALENDAR_MENUITEM_PROP_CLEAR_MARKS, NULL);
+	t2 = t1 + (time_t) (highlightdays * 24 * 60 * 60);
 	
 	if (!e_cal_get_sources(sources, E_CAL_SOURCE_TYPE_EVENT, gerror)) {
 		g_debug(Failed to get ecal sources\n);
@@ -680,6 +699,11 @@
 	} else {
 		apt_output = SETTINGS_TIME_LOCALE;
 	}
+	// Remove all highlights from the calendar widget
+	dbusmenu_menuitem_property_set (calendar, CALENDAR_MENUITEM_PROP_CLEAR_MARKS, NULL);
+	
+	GVariantBuilder markeddays;
+	g_variant_builder_init (markeddays, G_VARIANT_TYPE_ARRAY);
 	
 	i = 0;
 	for (l = sorted_comp_instances; l; l = l-next) {
@@ -702,9 +726,8 @@
 		const int dyear = due-tm_year;
 		
 		// Mark day
-		g_debug(Marking date %s, ctime(ci-start));
-		dbusmenu_menuitem_property_set_int (calendar, CALENDAR_MENUITEM_PROP_MARK, due-tm_mday);
-
+		g_debug(Adding marked date %s, %d, ctime(ci-start), dmday);
+		g_variant_builder_add (markeddays, i, dmday);
 
 		// If the appointment time is less than the selected date, 
 		// don't create an appointment item for it.
@@ -832,6 +855,9 @@
 	}
 	g_list_free(sorted_comp_instances);
 	
+	GVariant * marks = g_variant_builder_end (markeddays);
+	dbusmenu_menuitem_property_set_variant (calendar, CALENDAR_MENUITEM_PROP_MARK, marks);
+	
 	updating_appointments = FALSE;
 	g_debug(End of objects);
 	return TRUE;
@@ -1218,6 +1244,9 @@
 	
 	build_menus(root);
 	
+	// Connect to the close signal to reset the calendar date 
+	g_signal_connect(root, event::closed, G_CALLBACK(close_menu_cb), NULL);
+	
 	/* Cache the timezone */
 	update_current_timezone();
 

=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-03-15 15:47:25 +
+++ src/indicator-datetime.c	2011-03-29 13:30:57 +
@@ -1144,18 +1144,43 @@
 		timezone_update_labels(mi_data);
 	} else if (!g_strcmp0(prop, TIMEZONE_MENUITEM_PROP_RADIO)) {
 		gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mi_data-gmi), g_variant_get_boolean(value));
-		
-	// Properties for marking and unmarking the calendar
-	
-	} else if (!g_strcmp0(prop, CALENDAR_MENUITEM_PROP_MARK)) {
-		ido_calendar_menu_item_mark_day (IDO_CALENDAR_MENU_ITEM (mi_data), g_variant_get_int16(value));
+	} else {
+		g_warning(Indicator Item property '%s' unknown, prop);
+	}
+	return;
+}
+// Properties for marking and unmarking the calendar
+static void
+calendar_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant *value, IdoCalendarMenuItem * mi_data)
+{
+	g_debug(Changing calendar

[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/propupdatefail into lp:indicator-datetime

2011-03-28 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/propupdatefail into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #743394 in indicator-datetime (Ubuntu): inicator-datetime dosen't show 
corretly the time when changing from 24 hours format to 12 hours
  https://bugs.launchpad.net/ubuntu/+source/indicator-datetime/+bug/743394

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/propupdatefail/+merge/55119

Small update to remove an inconsistency that may have caused the related bug.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/propupdatefail/+merge/55119
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-03-15 15:47:25 +
+++ src/indicator-datetime.c	2011-03-28 10:56:34 +
@@ -525,7 +525,7 @@
 		}
 		break;
 	}
-	case PROP_SHOW_SECONDS:
+	case PROP_SHOW_SECONDS: {
 		if (g_value_get_boolean(value) != self-priv-show_seconds) {
 			self-priv-show_seconds = !self-priv-show_seconds;
 			if (self-priv-time_mode != SETTINGS_TIME_CUSTOM) {
@@ -534,7 +534,8 @@
 			}
 		}
 		break;
-	case PROP_SHOW_DAY:
+	}
+	case PROP_SHOW_DAY: {
 		if (g_value_get_boolean(value) != self-priv-show_day) {
 			self-priv-show_day = !self-priv-show_day;
 			if (self-priv-time_mode != SETTINGS_TIME_CUSTOM) {
@@ -542,7 +543,8 @@
 			}
 		}
 		break;
-	case PROP_SHOW_DATE:
+	}
+	case PROP_SHOW_DATE: {
 		if (g_value_get_boolean(value) != self-priv-show_date) {
 			self-priv-show_date = !self-priv-show_date;
 			if (self-priv-time_mode != SETTINGS_TIME_CUSTOM) {
@@ -550,6 +552,7 @@
 			}
 		}
 		break;
+	}
 	case PROP_CUSTOM_TIME_FORMAT: {
 		const gchar * newstr = g_value_get_string(value);
 		if (g_strcmp0(newstr, self-priv-custom_string) != 0) {
@@ -585,11 +588,12 @@
 			gtk_widget_set_visible (GTK_WIDGET (self-priv-ido_calendar), self-priv-show_calendar);
 		}
 		break;
-	}
-	default:
+	} 
+	default: {
 		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
 		return;
 	}
+	}
 
 	if (!update) {
 		return;

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/sniffles into lp:indicator-datetime

2011-03-23 Thread Karl Lattimer
Karl Lattimer has proposed merging lp:~karl-qdh/indicator-datetime/sniffles 
into lp:indicator-datetime.

Requested reviews:
  David Barth (dbarth)
Related bugs:
  Bug #740806 in indicator-datetime (Ubuntu): Add Appointment should be Add 
Event…
  https://bugs.launchpad.net/ubuntu/+source/indicator-datetime/+bug/740806
  Bug #740819 in indicator-datetime (Ubuntu): Date item isn't sensitive when 
Evolution is installed
  https://bugs.launchpad.net/ubuntu/+source/indicator-datetime/+bug/740819

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/sniffles/+merge/54501

Two UX bugs from MPT 'sniffles' 
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/sniffles/+merge/54501
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-22 21:38:50 +
+++ src/datetime-service.c	2011-03-23 12:06:08 +
@@ -371,11 +371,15 @@
 		dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
 		dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
 
+		dbusmenu_menuitem_property_set_bool(date, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
+		g_signal_connect (G_OBJECT(date), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
+		  G_CALLBACK (activate_cb), evolution -c calendar);
+		  
 		events_separator = dbusmenu_menuitem_new();
 		dbusmenu_menuitem_property_set(events_separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
 		dbusmenu_menuitem_child_add_position(root, events_separator, 2);
 		add_appointment = dbusmenu_menuitem_new();
-		dbusmenu_menuitem_property_set (add_appointment, DBUSMENU_MENUITEM_PROP_LABEL, _(Add Appointment));
+		dbusmenu_menuitem_property_set (add_appointment, DBUSMENU_MENUITEM_PROP_LABEL, _(Add Event...));
 		dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
 		g_signal_connect(G_OBJECT(add_appointment), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), evolution -c calendar);
 		dbusmenu_menuitem_child_add_position (root, add_appointment, 3);

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/sniffles into lp:indicator-datetime

2011-03-23 Thread Karl Lattimer
this is already done a few lines above the diff;

368: datetime-service.c
gchar *evo = g_find_program_in_path(evolution);
if (evo != NULL) {
g_debug(Found the calendar application: %s, evo);
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/sniffles/+merge/54501
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/nopwdprompt into lp:indicator-datetime

2011-03-17 Thread Karl Lattimer
Karl Lattimer has proposed merging lp:~karl-qdh/indicator-datetime/nopwdprompt 
into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/nopwdprompt/+merge/53846

Removes prompting for password if no stored credential exists.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/nopwdprompt/+merge/53846
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-16 21:47:51 +
+++ src/datetime-service.c	2011-03-17 15:55:46 +
@@ -469,7 +469,6 @@
const gchar *key, 
gpointer user_data)
 {
-	gboolean remember; // TODO: Is this useful?  Should we be storing it somewhere?
 	ESource *source = e_cal_get_source (ecal);
 	gchar *auth_domain = e_source_get_duped_property (source, auth-domain);
 
@@ -479,16 +478,6 @@
 	
 	gchar *password = e_passwords_get_password (component_name, key);
 	
-	if (password == NULL) {
-		password = e_passwords_ask_password (
-			_(Enter password),
-			component_name, key, prompt,
-			E_PASSWORDS_REMEMBER_FOREVER |
-			E_PASSWORDS_SECRET |
-			E_PASSWORDS_ONLINE,
-			remember, NULL);
-	}
-	
 	g_free (auth_domain);
 
 	return password;

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals into lp:indicator-datetime

2011-03-15 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals into 
lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #726531 in Indicator Date and Time: Browsing calendar widget should 
update appointments
  https://bugs.launchpad.net/indicator-datetime/+bug/726531

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/calendarmenuitemsignals/+merge/53467

Updated code in this branch to fulfil ted's comments

Partially fixes bug #726531
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/calendarmenuitemsignals/+merge/53467
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-15 02:43:27 +
+++ src/datetime-service.c	2011-03-15 15:51:12 +
@@ -280,9 +280,6 @@
 static gboolean
 month_changed_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant, guint timestamp)
 {
-	// BLOCKED: get type, then get type as string from the variant causes segfault in glib
-	// TODO: * Set some globals so when we-re-run update appointment menu items it gets the right start date
-	//		 * update appointment menu items
 	start_time_appointments = (time_t)g_variant_get_uint32(variant);
 	
 	g_debug(Received month changed with timestamp: %d - %s,(int)start_time_appointments, ctime(start_time_appointments));	
@@ -290,6 +287,37 @@
 	return TRUE;
 }
 
+static gboolean
+day_selected_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant, guint timestamp)
+{
+	start_time_appointments = (time_t)g_variant_get_uint32(variant);
+	
+	g_debug(Received day-selected with timestamp: %d - %s,(int)start_time_appointments, ctime(start_time_appointments));	
+	update_appointment_menu_items(NULL);
+	return TRUE;
+}
+
+static gboolean
+day_selected_double_click_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant, guint timestamp)
+{
+	time_t evotime = (time_t)g_variant_get_uint32(variant);
+	
+	g_debug(Received day-selected-double-click with timestamp: %d - %s,(int)evotime, ctime(evotime));	
+	
+	gchar *ad = isodate_from_time_t(evotime);
+	gchar *cmd = g_strconcat(evolution calendar:///?startdate=, ad, NULL);
+	
+	GError * error = NULL;
+
+	g_debug(Issuing command '%s', cmd);
+	if (!g_spawn_command_line_async(cmd, error)) {
+		g_warning(Unable to start %s: %s, (char *)cmd, error-message);
+		g_error_free(error);
+	}
+	
+	return TRUE;
+}
+
 static guint ecaltimer = 0;
 
 static void
@@ -365,8 +393,10 @@
 			stop_ecal_timer();
 		}
 		
-		// Connect to event::month-changed 
+		// Connect to calendar events
 		g_signal_connect(calendar, event::month-changed, G_CALLBACK(month_changed_cb), NULL);
+		g_signal_connect(calendar, event::day-selected, G_CALLBACK(day_selected_cb), NULL);
+		g_signal_connect(calendar, event::day-selected-double-click, G_CALLBACK(day_selected_double_click_cb), NULL);
 		g_free(evo);
 	} else {
 		g_debug(Unable to find calendar app.);
@@ -543,27 +573,51 @@
 	if (updating_appointments) return TRUE;
 	updating_appointments = TRUE;
 	
-	time_t t1, t2;
+	time_t curtime = 0, t1 = 0, t2 = 0;
 	gchar *ad;
 	GList *l;
 	GSList *g;
 	GError *gerror = NULL;
 	gint i;
-	gint width, height;
+	gint width = 0, height = 0;
 	ESourceList * sources = NULL;
-	
-	if (start_time_appointments  0)
-		t1 = start_time_appointments;
-	else
-		time(t1);
-
-	/* TODO: 7 days ahead of now, we actually need number_of_days_in_this_month 
-	 *   so we call mark-day for all remaining days in this month
-	 * N.B. Ideally we want any/all dates which are later than today to be marked.
-	 */
-	t2 = t1 + (time_t) (7 * 24 * 60 * 60); 
-	
-	// TODO Remove all highlights from the calendar widget
+
+	// Get today  work out query times
+	time(curtime);
+  	struct tm *today = localtime(curtime);
+	const int mday = today-tm_mday;
+	const int mon = today-tm_mon;
+	const int year = today-tm_year;
+	
+  	struct tm *start_tm = NULL;
+	int this_year = today-tm_year + 1900;
+	int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
+	if ((this_year % 400 == 0) || (this_year % 100  0  this_year % 4 == 0)) days[1] = 29;
+	
+	int highlightdays = days[mon] - mday + 1;
+	t1 = curtime; // By default the current time is the appointment start time. 
+	
+	if (start_time_appointments  0) {
+  		start_tm = localtime(start_time_appointments);
+		int start_month = start_tm-tm_mon;
+		int start_year = start_tm-tm_year + 1900;
+		if ((start_month != mon) || (start_year != this_year)) {
+			// Set t1 to the start of that month.
+			struct tm month_start = {0};
+			month_start.tm_year = start_tm-tm_year;
+			month_start.tm_mon = start_tm-tm_mon;
+			month_start.tm_mday = 1;
+			t1 = mktime(month_start);
+			highlightdays = days[mon];
+		}
+	}
+	
+	g_debug(Will highlight %d days from %s, highlightdays, ctime(t1));
+
+	t2 = t1 + (time_t) (highlightdays * 24 * 60 * 60); 
+	
+	// Remove all highlights from the calendar widget
+	dbusmenu_menuitem_property_set (calendar

Re: [Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals into lp:indicator-datetime

2011-03-14 Thread Karl Lattimer

  + // TODO This needs to be an array of 3 ints
 
 Confused here... use an array of 3 ints then? :)

This isn't actually used as there was an ido branch I was working on that 
hadn't been merged. 


 
  +static void
  +day_selected_double_click_cb (IdoCalendarMenuItem *ido,
  +   guint   day,
  +  gpointeruser_data)
  +{
  + gchar datestring[20];
  + guint d,m,y;
  + DbusmenuMenuitem * item = DBUSMENU_MENUITEM (user_data);
  + ido_calendar_menu_item_get_date(ido, y, m, d);
  + g_sprintf(datestring, %d-%d-%d, y, m, d);
  + GVariant *variant = g_variant_new_string(datestring);
  + guint timestamp = (guint)time(NULL);
  + dbusmenu_menuitem_handle_event(DBUSMENU_MENUITEM(item), day-selected-
 double-click, variant, timestamp);
  + g_debug(Got day-selected-double-click signal: %s, datestring);
  +}
  +*/
 
 Why are you encoding the data into a string instead of just passing an
 array of ints?  Seems it would be better to let GVariant do the encoding
 for us.

I _was_ encoding to a string, but I changed it, the month-changed signal being 
the only one libido actually supported at the time.


 
  + dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem,
 GTK_MENU_ITEM(ido), parent);
  + /*g_signal_connect_after(ido, day-selected,
 G_CALLBACK(day_selected_cb), (gpointer)newitem);
  + dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem,
 GTK_MENU_ITEM(ido), parent);
  + g_signal_connect_after(ido, day-selected-double-click,
 G_CALLBACK(day_selected_double_click_cb), (gpointer)newitem);*/
 
 _newitem_base() should only need to be called once here.

True

   review needsfixing



-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/calendarmenuitemsignals/+merge/52570
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals into lp:indicator-datetime

2011-03-14 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals into 
lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  Bug #726531 in Indicator Date and Time: Browsing calendar widget should 
update appointments
  https://bugs.launchpad.net/indicator-datetime/+bug/726531

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/calendarmenuitemsignals/+merge/53212

Updated code in this branch to fulfil ted's comments

Partially fixes bug #726531
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/calendarmenuitemsignals/+merge/53212
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-10 15:05:51 +
+++ src/datetime-service.c	2011-03-14 10:02:49 +
@@ -82,6 +82,7 @@
 static GList			* dconflocations = NULL;
 static GList			* comp_instances = NULL;
 static gboolean   updating_appointments = FALSE;
+static time_t			  start_time_appointments = (time_t) 0;
 GSettings *conf;
 
 
@@ -277,14 +278,15 @@
 }
 
 static gboolean
-month_changed_cb (DbusmenuMenuitem * menuitem, GVariant *variant, guint timestamp)
+month_changed_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant, guint timestamp)
 {
-	// BLOCKED: We're not getting the signal from calendar the ido calendar menuitem
-	// TODO: * Decode the month/year from the string we received
-	//   * Check what our current month/year are
-	//		 * Set some globals so when we-re-run update appointment menu items it gets the right start date
+	// BLOCKED: get type, then get type as string from the variant causes segfault in glib
+	// TODO: * Set some globals so when we-re-run update appointment menu items it gets the right start date
 	//		 * update appointment menu items
-	g_debug(Received month changed : %s, g_variant_get_string(variant, NULL));
+	start_time_appointments = (time_t)g_variant_get_uint32(variant);
+	
+	g_debug(Received month changed with timestamp: %d - %s,(int)start_time_appointments, ctime(start_time_appointments));	
+	update_appointment_menu_items(NULL);
 	return TRUE;
 }
 
@@ -535,6 +537,7 @@
 {
 	// FFR: we should take into account short term timers, for instance
 	// tea timers, pomodoro timers etc... that people may add, this is hinted to in the spec.
+	g_debug(Update appointments called);
 	if (calendar == NULL) return FALSE;
 	if (!g_settings_get_boolean(conf, SETTINGS_SHOW_EVENTS_S)) return FALSE;
 	if (updating_appointments) return TRUE;
@@ -543,29 +546,22 @@
 	time_t t1, t2;
 	gchar *ad;
 	GList *l;
-	//GList *allobjects = NULL;
 	GSList *g;
 	GError *gerror = NULL;
 	gint i;
 	gint width, height;
 	ESourceList * sources = NULL;
 	
-	time(t1);
-	time(t2);
-	t2 += (time_t) (7 * 24 * 60 * 60); /* 7 days ahead of now, we actually need number_of_days_in_this_month */
+	if (start_time_appointments  0)
+		t1 = start_time_appointments;
+	else
+		time(t1);
 
-	/* Remove all of the previous appointments */
-	if (appointments != NULL) {
-		g_debug(Freeing old appointments);
-		while (appointments != NULL) {
-			DbusmenuMenuitem * litem =  DBUSMENU_MENUITEM(appointments-data);
-			g_debug(Freeing old appointment: %p, litem);
-			// Remove all the existing menu items which are in appointments.
-			appointments = g_list_remove(appointments, litem);
-			dbusmenu_menuitem_child_delete(root, DBUSMENU_MENUITEM(litem));
-			g_object_unref(G_OBJECT(litem));
-		}
-	}
+	/* TODO: 7 days ahead of now, we actually need number_of_days_in_this_month 
+	 *   so we call mark-day for all remaining days in this month
+	 * N.B. Ideally we want any/all dates which are later than today to be marked.
+	 */
+	t2 = t1 + (time_t) (7 * 24 * 60 * 60); 
 	
 	// TODO Remove all highlights from the calendar widget
 	
@@ -609,11 +605,27 @@
 	g_debug(Number of ECalComponents returned: %d, g_list_length(comp_instances));
 	GList *sorted_comp_instances = g_list_sort(comp_instances, compare_comp_instances);
 	comp_instances = NULL;
-	
-	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height);
+
+	/* Remove all of the previous appointments */
+	if (appointments != NULL) {
+		g_debug(Freeing old appointments);
+		while (appointments != NULL) {
+			DbusmenuMenuitem * litem =  DBUSMENU_MENUITEM(appointments-data);
+			g_debug(Freeing old appointment: %p, litem);
+			// Remove all the existing menu items which are in appointments.
+			appointments = g_list_remove(appointments, litem);
+			dbusmenu_menuitem_child_delete(root, DBUSMENU_MENUITEM(litem));
+			g_object_unref(G_OBJECT(litem));
+		}
+	}
+
+	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height); 
+	// Sometimes these give negative numbers, sometimes large numbers which look like timestamps
+	// is there a buffer overwrite causing it?
 	if (width = 0) width = 12;
-	if (height = 0) height = 13;
-	
+	if (height = 0) height = 12;
+	if (width  30) width = 12;
+	if (height  30) height = 12;
 	i = 0;
 	for (l

[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals into lp:indicator-datetime

2011-03-08 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals into 
lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  #726531 Browsing calendar widget should update appointments
  https://bugs.launchpad.net/bugs/726531

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/calendarmenuitemsignals/+merge/52570

Partially fixes bug #726531
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/calendarmenuitemsignals/+merge/52570
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-04 10:35:22 +
+++ src/datetime-service.c	2011-03-08 15:46:34 +
@@ -82,6 +82,7 @@
 static GList			* dconflocations = NULL;
 static GList			* comp_instances = NULL;
 static gboolean   updating_appointments = FALSE;
+static time_t			  start_time_appointments = (time_t) 0;
 GSettings *conf;
 
 
@@ -277,14 +278,15 @@
 }
 
 static gboolean
-month_changed_cb (DbusmenuMenuitem * menuitem, GVariant *variant, guint timestamp)
+month_changed_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant, guint timestamp)
 {
-	// BLOCKED: We're not getting the signal from calendar the ido calendar menuitem
-	// TODO: * Decode the month/year from the string we received
-	//   * Check what our current month/year are
-	//		 * Set some globals so when we-re-run update appointment menu items it gets the right start date
+	// BLOCKED: get type, then get type as string from the variant causes segfault in glib
+	// TODO: * Set some globals so when we-re-run update appointment menu items it gets the right start date
 	//		 * update appointment menu items
-	g_debug(Received month changed : %s, g_variant_get_string(variant, NULL));
+	start_time_appointments = (time_t)g_variant_get_uint32(variant);
+	
+	g_debug(Received month changed with timestamp: %d - %s,(int)start_time_appointments, ctime(start_time_appointments));	
+	update_appointment_menu_items(NULL);
 	return TRUE;
 }
 
@@ -537,6 +539,7 @@
 {
 	// FFR: we should take into account short term timers, for instance
 	// tea timers, pomodoro timers etc... that people may add, this is hinted to in the spec.
+	g_debug(Update appointments called);
 	if (calendar == NULL) return FALSE;
 	if (!g_settings_get_boolean(conf, SETTINGS_SHOW_EVENTS_S)) return FALSE;
 	if (updating_appointments) return TRUE;
@@ -552,22 +555,12 @@
 	gint width, height;
 	ESourceList * sources = NULL;
 	
-	time(t1);
-	time(t2);
-	t2 += (time_t) (7 * 24 * 60 * 60); /* 7 days ahead of now, we actually need number_of_days_in_this_month */
+	if (start_time_appointments  0)
+		t1 = start_time_appointments;
+	else
+		time(t1);
 
-	/* Remove all of the previous appointments */
-	if (appointments != NULL) {
-		g_debug(Freeing old appointments);
-		while (appointments != NULL) {
-			DbusmenuMenuitem * litem =  DBUSMENU_MENUITEM(appointments-data);
-			g_debug(Freeing old appointment: %p, litem);
-			// Remove all the existing menu items which are in appointments.
-			appointments = g_list_remove(appointments, litem);
-			dbusmenu_menuitem_child_delete(root, DBUSMENU_MENUITEM(litem));
-			g_object_unref(G_OBJECT(litem));
-		}
-	}
+	t2 = t1 + (time_t) (7 * 24 * 60 * 60); /* 7 days ahead of now, we actually need number_of_days_in_this_month */
 	
 	// TODO Remove all highlights from the calendar widget
 	
@@ -611,11 +604,26 @@
 	g_debug(Number of ECalComponents returned: %d, g_list_length(comp_instances));
 	GList *sorted_comp_instances = g_list_sort(comp_instances, compare_comp_instances);
 	comp_instances = NULL;
-	
-	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height);
+
+	/* Remove all of the previous appointments */
+	if (appointments != NULL) {
+		g_debug(Freeing old appointments);
+		while (appointments != NULL) {
+			DbusmenuMenuitem * litem =  DBUSMENU_MENUITEM(appointments-data);
+			g_debug(Freeing old appointment: %p, litem);
+			// Remove all the existing menu items which are in appointments.
+			appointments = g_list_remove(appointments, litem);
+			dbusmenu_menuitem_child_delete(root, DBUSMENU_MENUITEM(litem));
+			g_object_unref(G_OBJECT(litem));
+		}
+	}
+
+	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height); 
+	// Sometimes these give negative numbers, sometimes large numbers which look like timestampss
 	if (width = 0) width = 12;
-	if (height = 0) height = 13;
-	
+	if (height = 0) height = 12;
+	if (width  30) width = 12;
+	if (height  30) height = 12;
 	i = 0;
 	for (l = sorted_comp_instances; l; l = l-next) {
 		struct comp_instance *ci = l-data;
@@ -671,7 +679,7 @@
 		else
 			strftime(right, 20, %a %l:%M %p, due);
 			
-		g_debug(Appointment time: %s, right);
+		g_debug(Appointment time: %s, for date %s, right, asctime(due));
 		dbusmenu_menuitem_property_set (item, APPOINTMENT_MENUITEM_PROP_RIGHT, right);
 		
 		// Now we pull out the URI for the calendar event and try to create a URI that'll work when we

[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/fixappointmentformat into lp:indicator-datetime

2011-03-08 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/fixappointmentformat into lp:indicator-datetime 
with lp:~karl-qdh/indicator-datetime/calendarmenuitemsignals as a prerequisite.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  #727100 Appointments' time format doesn't respect the settings
  https://bugs.launchpad.net/bugs/727100

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/fixappointmentformat/+merge/52574

Fixes bug #727100
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/fixappointmentformat/+merge/52574
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-08 16:09:42 +
+++ src/datetime-service.c	2011-03-08 16:09:42 +
@@ -624,6 +624,17 @@
 	if (height = 0) height = 12;
 	if (width  30) width = 12;
 	if (height  30) height = 12;
+	
+	gchar *time_format_str = g_settings_get_string(conf, SETTINGS_TIME_FORMAT_S);
+	gint apt_output;
+	if (g_strcmp0(time_format_str, 12-hour) == 0) {
+		apt_output = SETTINGS_TIME_12_HOUR;
+	} else if (g_strcmp0(time_format_str, 24-hour) == 0) {
+		apt_output = SETTINGS_TIME_24_HOUR;
+	} else {
+		apt_output = SETTINGS_TIME_LOCALE;
+	}
+	
 	i = 0;
 	for (l = sorted_comp_instances; l; l = l-next) {
 		struct comp_instance *ci = l-data;
@@ -674,11 +685,23 @@
 		int dmon = due-tm_mon;
 		int dyear = due-tm_year;
 		
-		if ((mday == dmday)  (mon == dmon)  (year == dyear))
-			strftime(right, 20, %l:%M %p, due);
-		else
-			strftime(right, 20, %a %l:%M %p, due);
-			
+		if (apt_output == SETTINGS_TIME_12_HOUR) {
+			if ((mday == dmday)  (mon == dmon)  (year == dyear))
+strftime(right, 20, DEFAULT_TIME_12_FORMAT, due);
+			else
+strftime(right, 20, DEFAULT_TIME_12_FORMAT_WITH_DAY, due);
+		} else if (apt_output == SETTINGS_TIME_24_HOUR) {
+			if ((mday == dmday)  (mon == dmon)  (year == dyear))
+strftime(right, 20, DEFAULT_TIME_24_FORMAT, due);
+			else
+strftime(right, 20, DEFAULT_TIME_24_FORMAT_WITH_DAY, due);
+		} else {
+			if ((mday == dmday)  (mon == dmon)  (year == dyear))
+strftime(right, 20, DEFAULT_TIME_FORMAT, due);
+			else
+strftime(right, 20, DEFAULT_TIME_FORMAT_WITH_DAY, due);
+		}
+		
 		g_debug(Appointment time: %s, for date %s, right, asctime(due));
 		dbusmenu_menuitem_property_set (item, APPOINTMENT_MENUITEM_PROP_RIGHT, right);
 		

=== modified file 'src/settings-shared.h'
--- src/settings-shared.h	2011-02-25 14:18:57 +
+++ src/settings-shared.h	2011-03-08 16:09:42 +
@@ -51,5 +51,9 @@
 #define DEFAULT_TIME_24_FORMAT   N_(%H:%M)
 
 #define DEFAULT_TIME_FORMAT  DEFAULT_TIME_12_FORMAT
+#define DEFAULT_TIME_FORMAT_WITH_DAY DEFAULT_TIME_12_FORMAT
+
+#define DEFAULT_TIME_12_FORMAT_WITH_DAY N_(%a %l:%M %p)
+#define DEFAULT_TIME_24_FORMAT_WITH_DAY N_(%a %H:%M)
 
 #endif

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/colours-refresh-fix into lp:indicator-datetime

2011-03-04 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/colours-refresh-fix into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  #728956 Appointment coloured squares disappear after first refresh
  https://bugs.launchpad.net/bugs/728956

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/colours-refresh-fix/+merge/52175

Fixes bug https://bugs.launchpad.net/indicator-datetime/+bug/728956

gtk lookup icon size is returning a negative number
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/colours-refresh-fix/+merge/52175
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-03 18:51:26 +
+++ src/datetime-service.c	2011-03-04 10:43:04 +
@@ -279,6 +279,7 @@
 static gboolean
 month_changed_cb (DbusmenuMenuitem * menuitem, GVariant *variant, guint timestamp)
 {
+	// BLOCKED: We're not getting the signal from calendar the ido calendar menuitem
 	// TODO: * Decode the month/year from the string we received
 	//   * Check what our current month/year are
 	//		 * Set some globals so when we-re-run update appointment menu items it gets the right start date
@@ -404,8 +405,6 @@
 	
 	gboolean show = g_settings_get_boolean (conf, SETTINGS_SHOW_LOCATIONS_S);
 
-	// TODO: Remove items from the dconflocations at the end of the iteration
-	// Make sure if there are multiple locations, our current location is shown
 	if (len  0) {
 		dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
 		dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
@@ -432,7 +431,6 @@
 		}
 	}
 	g_strfreev (locations);
-	// Get the evolution calendar timezone as a place and time and add it
 	return FALSE;
 }
 
@@ -514,43 +512,16 @@
 	
 	// TODO: Convert the timezone into a 3 letter abbreviation if it's different to current_timezone
 	// TODO: Add the appointment timezone to the list if it's not already there. 
-		
-	GSList *period_list = NULL, *l;
-	if (e_cal_component_has_recurrences (comp)) {
-		e_cal_component_get_rdate_list (comp, period_list);
-		g_debug(ECalComponent has recurrences);
-	} else {
-		g_debug(ECalComponent doesn't have recurrences);
-	}
 	
 	struct comp_instance *ci;
 	ci = g_new (struct comp_instance, 1);
 	
-	// Do we get rdate_list?
-	if (period_list != NULL) {
-		g_debug(Got recurring periods);
-		for (l = period_list; l; l = l-next) {
-			ECalComponentPeriod *period = l-data;
-			struct tm tmp_tm  = icaltimetype_to_tm_with_zone (period-start, appointment_zone, current_zone);
-			time_t start = mktime(tmp_tm);
-			g_debug(period time: %d, (int)start);
-		
-			tmp_tm = icaltimetype_to_tm_with_zone (period-u.end, appointment_zone, current_zone);
-			time_t end = mktime(tmp_tm);
-		
-			if (start = instance_start  end  instance_end) {
-ci-start = start;
-ci-end = end;
-			}
-		}
-	} else {
-		ci-start = instance_start;
-		ci-end = instance_end;
-		g_debug(Got no recurring periods set time to start %s, end %s, ctime(instance_start), ctime(instance_end));
-	}
+	g_debug(Using times start %s, end %s, ctime(instance_start), ctime(instance_end));
 	
 	ci-comp = comp;
 	ci-source = E_SOURCE(data);
+	ci-start = instance_start;
+	ci-end = instance_end;
 	
 	comp_instances = g_list_append(comp_instances, ci);
 	return TRUE;
@@ -616,7 +587,7 @@
 		}
 	}
 	
-	// iterate the query for all sources
+	// Generate instances for all sources
 	for (g = e_source_list_peek_groups (sources); g; g = g-next) {
 		ESourceGroup *group = E_SOURCE_GROUP (g-data);
 		GSList *s;
@@ -634,23 +605,22 @@
 continue;
 	}
 			
-			g_debug(Generating instances);
 			e_cal_generate_instances (ecal, t1, t2, (ECalRecurInstanceFn) populate_appointment_instances, (gpointer) source);
-			g_debug(Number of objects returned: %d, g_list_length(comp_instances));
 		}
 	}
+	g_debug(Number of ECalComponents returned: %d, g_list_length(comp_instances));
 	GList *sorted_comp_instances = g_list_sort(comp_instances, compare_comp_instances);
 	comp_instances = NULL;
+	
+	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height);
+	if (width = 0) width = 12;
+	if (height = 0) height = 13;
+	
 	i = 0;
-	
-	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height);
-	if (width == 0) width = 12;
-	if (height == 0) height = 12;
 	for (l = sorted_comp_instances; l; l = l-next) {
 		struct comp_instance *ci = l-data;
 		ECalComponent *ecalcomp = ci-comp;
 		ECalComponentText valuetext;
-		//ECalComponentDateTime datetime;
 		gchar *summary, *cmd;
 		char right[20];
 		//const gchar *uri;
@@ -675,19 +645,7 @@
 		dbusmenu_menuitem_property_set (item, APPOINTMENT_MENUITEM_PROP_LABEL, summary);
 		g_debug(Summary: %s, summary);
 		g_free (summary);
-		
-		//appointment_zone = icaltimezone_get_builtin_timezone_from_tzid(datetime.tzid);
-		//current_zone = icaltimezone_get_builtin_timezone_from_tzid

[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/week-numbers-on-start into lp:indicator-datetime

2011-03-04 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/week-numbers-on-start into 
lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  #729020 indicator datetime calendar doesn't show week numbers if configured 
on startup, only on change
  https://bugs.launchpad.net/bugs/729020

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/week-numbers-on-start/+merge/52188

Bug fix for show week numbers settings on startup
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/week-numbers-on-start/+merge/52188
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-03-03 18:51:26 +
+++ src/datetime-service.c	2011-03-04 12:06:33 +
@@ -279,6 +279,7 @@
 static gboolean
 month_changed_cb (DbusmenuMenuitem * menuitem, GVariant *variant, guint timestamp)
 {
+	// BLOCKED: We're not getting the signal from calendar the ido calendar menuitem
 	// TODO: * Decode the month/year from the string we received
 	//   * Check what our current month/year are
 	//		 * Set some globals so when we-re-run update appointment menu items it gets the right start date
@@ -404,8 +405,6 @@
 	
 	gboolean show = g_settings_get_boolean (conf, SETTINGS_SHOW_LOCATIONS_S);
 
-	// TODO: Remove items from the dconflocations at the end of the iteration
-	// Make sure if there are multiple locations, our current location is shown
 	if (len  0) {
 		dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
 		dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
@@ -432,7 +431,6 @@
 		}
 	}
 	g_strfreev (locations);
-	// Get the evolution calendar timezone as a place and time and add it
 	return FALSE;
 }
 
@@ -514,43 +512,16 @@
 	
 	// TODO: Convert the timezone into a 3 letter abbreviation if it's different to current_timezone
 	// TODO: Add the appointment timezone to the list if it's not already there. 
-		
-	GSList *period_list = NULL, *l;
-	if (e_cal_component_has_recurrences (comp)) {
-		e_cal_component_get_rdate_list (comp, period_list);
-		g_debug(ECalComponent has recurrences);
-	} else {
-		g_debug(ECalComponent doesn't have recurrences);
-	}
 	
 	struct comp_instance *ci;
 	ci = g_new (struct comp_instance, 1);
 	
-	// Do we get rdate_list?
-	if (period_list != NULL) {
-		g_debug(Got recurring periods);
-		for (l = period_list; l; l = l-next) {
-			ECalComponentPeriod *period = l-data;
-			struct tm tmp_tm  = icaltimetype_to_tm_with_zone (period-start, appointment_zone, current_zone);
-			time_t start = mktime(tmp_tm);
-			g_debug(period time: %d, (int)start);
-		
-			tmp_tm = icaltimetype_to_tm_with_zone (period-u.end, appointment_zone, current_zone);
-			time_t end = mktime(tmp_tm);
-		
-			if (start = instance_start  end  instance_end) {
-ci-start = start;
-ci-end = end;
-			}
-		}
-	} else {
-		ci-start = instance_start;
-		ci-end = instance_end;
-		g_debug(Got no recurring periods set time to start %s, end %s, ctime(instance_start), ctime(instance_end));
-	}
+	g_debug(Using times start %s, end %s, ctime(instance_start), ctime(instance_end));
 	
 	ci-comp = comp;
 	ci-source = E_SOURCE(data);
+	ci-start = instance_start;
+	ci-end = instance_end;
 	
 	comp_instances = g_list_append(comp_instances, ci);
 	return TRUE;
@@ -616,7 +587,7 @@
 		}
 	}
 	
-	// iterate the query for all sources
+	// Generate instances for all sources
 	for (g = e_source_list_peek_groups (sources); g; g = g-next) {
 		ESourceGroup *group = E_SOURCE_GROUP (g-data);
 		GSList *s;
@@ -634,23 +605,22 @@
 continue;
 	}
 			
-			g_debug(Generating instances);
 			e_cal_generate_instances (ecal, t1, t2, (ECalRecurInstanceFn) populate_appointment_instances, (gpointer) source);
-			g_debug(Number of objects returned: %d, g_list_length(comp_instances));
 		}
 	}
+	g_debug(Number of ECalComponents returned: %d, g_list_length(comp_instances));
 	GList *sorted_comp_instances = g_list_sort(comp_instances, compare_comp_instances);
 	comp_instances = NULL;
+	
+	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height);
+	if (width = 0) width = 12;
+	if (height = 0) height = 13;
+	
 	i = 0;
-	
-	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, width, height);
-	if (width == 0) width = 12;
-	if (height == 0) height = 12;
 	for (l = sorted_comp_instances; l; l = l-next) {
 		struct comp_instance *ci = l-data;
 		ECalComponent *ecalcomp = ci-comp;
 		ECalComponentText valuetext;
-		//ECalComponentDateTime datetime;
 		gchar *summary, *cmd;
 		char right[20];
 		//const gchar *uri;
@@ -675,19 +645,7 @@
 		dbusmenu_menuitem_property_set (item, APPOINTMENT_MENUITEM_PROP_LABEL, summary);
 		g_debug(Summary: %s, summary);
 		g_free (summary);
-		
-		//appointment_zone = icaltimezone_get_builtin_timezone_from_tzid(datetime.tzid);
-		//current_zone = icaltimezone_get_builtin_timezone_from_tzid(current_timezone

[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/configandcalsignals into lp:indicator-datetime

2011-02-25 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/configandcalsignals into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/configandcalsignals/+merge/51296

Replaces about-to-show with a timer every 30 mins to update the appointments, 
adds gsettings reading but misses out on responding to location changes. Adds 
theoretical only signal handling for month-changes so we can then update the 
calendars. Various other small fixes.
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/configandcalsignals/+merge/51296
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'data/com.canonical.indicator.datetime.gschema.xml'
--- data/com.canonical.indicator.datetime.gschema.xml	2011-02-15 14:54:00 +
+++ data/com.canonical.indicator.datetime.gschema.xml	2011-02-25 14:13:06 +
@@ -5,6 +5,11 @@
 		value nick=24-hour value=2 /
 		value nick=custom value=3 /
 	/enum
+	enum id=week-start-enum
+		value nick=locale-default value=0 /
+		value nick=sunday value=1 /
+		value nick=monday value=2 /
+	/enum
 	schema id=com.canonical.indicator.datetime path=/com/canonical/indicator/datetime/ gettext-domain=indicator-datetime
 		key name=time-format enum=time-enum
 			default'locale-default'/default
@@ -57,13 +62,41 @@
 			  more information.
 			/description
 		/key
+		key name=show-week-numbers type=b
+			defaultfalse/default
+			summaryShow week numbers in calendar/summary
+			description
+			  Shows the week numbers in the monthly calendar in indicator-datetime's menu.
+			/description
+		/key
 		key name=locations type=as
-			default[]/default
+			default['UTC']/default
 			summaryA List of locations/summary
 			description
 			  Adds the list of locations the user has configured to display in the 
 			  indicator-datetime menu.
 			/description
 		/key
+		key name=show-calendar type=b
+			defaulttrue/default
+			summaryShow the monthly calendar in the indicator/summary
+			description
+			  Puts the monthly calendar in indicator-datetime's menu.
+			/description
+		/key
+		key name=show-events type=b
+			defaulttrue/default
+			summaryShow events in the indicator/summary
+			description
+			  Shows events from Evolution in indicator-datetime's menu.
+			/description
+		/key
+		key name=show-locations type=b
+			defaultfalse/default
+			summaryShow locations in the indicator/summary
+			description
+			  Shows custom defined locations in indicator-datetime's menu.
+			/description
+		/key
 	/schema
 /schemalist

=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-02-17 18:58:54 +
+++ src/datetime-service.c	2011-02-25 14:13:06 +
@@ -54,8 +54,11 @@
 #include dbus-shared.h
 
 
-#define SETTINGS_INTERFACE com.canonical.indicator.datetime
-#define SETTINGS_LOCATIONS locations
+#define SETTINGS_INTERFACE  com.canonical.indicator.datetime
+#define SETTINGS_LOCATIONS  locations
+#define SETTINGS_SHOW_CALENDAR  show-calendar
+#define SETTINGS_SHOW_EVENTSshow-events
+#define SETTINGS_SHOW_LOCATIONS show-locations
 
 static void geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar * path, GError * error, gpointer user_data);
 static gboolean update_appointment_menu_items (gpointer user_data);
@@ -115,6 +118,13 @@
 	} else {
 		g_debug(Timezones are different);
 	}
+	
+	if (!g_settings_get_boolean(conf, SETTINGS_SHOW_LOCATIONS)) {
+		dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
+		dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
+		dbusmenu_menuitem_property_set_bool (geo_location, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
+		return;
+	}
 
 	if (geo_location != NULL  current_location != NULL) {
 		g_debug(Got timezone %s, current_timezone);
@@ -288,52 +298,35 @@
 	}
 }
 
+static gboolean
+month_changed_cb (DbusmenuMenuitem * menuitem, GVariant *variant, guint timestamp)
+{
+	// TODO: * Decode the month/year from the string we received
+	//   * Check what our current month/year are
+	//		 * Set some globals so when we-re-run update appointment menu items it gets the right start date
+	//		 * update appointment menu items
+	g_debug(Received month changed : %s, g_variant_get_string(variant, NULL));
+	return TRUE;
+}
+
 /* Looks for the calendar application and enables the item if
we have one */
 static gboolean
 check_for_calendar (gpointer user_data)
 {
 	g_return_val_if_fail (calendar != NULL, FALSE);
+	
+	if (!g_settings_get_boolean(conf, SETTINGS_SHOW_CALENDAR)) return FALSE;
 
 	gchar *evo = g_find_program_in_path(evolution);
 	if (evo != NULL) {
 		g_debug(Found the calendar application: %s, evo);
 		dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
 		dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
-/*
-		GError *gerror = NULL

[Ayatana-commits] [Merge] lp:~karl-qdh/indicator-datetime/multiplecalendarsources_and_timezones into lp:indicator-datetime

2011-02-16 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/indicator-datetime/multiplecalendarsources_and_timezones into 
lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  #715844 Locations in datetime indicator
  https://bugs.launchpad.net/bugs/715844
  #717209 Support remote calendars, asynchronously
  https://bugs.launchpad.net/bugs/717209

For more details, see:
https://code.launchpad.net/~karl-qdh/indicator-datetime/multiplecalendarsources_and_timezones/+merge/50011
-- 
https://code.launchpad.net/~karl-qdh/indicator-datetime/multiplecalendarsources_and_timezones/+merge/50011
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'configure.ac'
--- configure.ac	2011-02-09 03:37:50 +
+++ configure.ac	2011-02-16 17:06:57 +
@@ -91,6 +91,7 @@
 	 libecal-1.2 = $ECAL_REQUIRED_VERSION
 	 libical = $ICAL_REQUIRED_VERSION
 	 libedataserver-1.2 = EDS_REQUIRED_VERSION
+	 libedataserverui-1.2 = EDS_REQUIRED_VERSION
 	 cairo = CAIRO_REQUIRED_VERSION
 	 gdk-2.0 = GDK_REQUIRED_VERSION)
 		],
@@ -105,6 +106,7 @@
 	 libecal-1.2 = $ECAL_REQUIRED_VERSION
 	 libical = $ICAL_REQUIRED_VERSION
 	 libedataserver-1.2 = EDS_REQUIRED_VERSION
+	 libedataserverui-1.2 = EDS_REQUIRED_VERSION
 	 cairo = CAIRO_REQUIRED_VERSION
 	 gdk-2.0 = GDK_REQUIRED_VERSION)
 ],

=== modified file 'data/com.canonical.indicator.datetime.gschema.xml'
--- data/com.canonical.indicator.datetime.gschema.xml	2011-01-17 17:50:14 +
+++ data/com.canonical.indicator.datetime.gschema.xml	2011-02-16 17:06:57 +
@@ -57,5 +57,13 @@
 			  more information.
 			/description
 		/key
+		key name=locations type=as
+			default[]/default
+			summaryA List of locations/summary
+			description
+			  Adds the list of locations the user has configured to display in the 
+			  indicator-datetime menu.
+			/description
+		/key
 	/schema
 /schemalist

=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-02-09 04:26:31 +
+++ src/datetime-service.c	2011-02-16 17:06:57 +
@@ -42,6 +42,7 @@
 #include libical/ical.h
 #include libecal/e-cal-time-util.h
 #include libedataserver/e-source.h
+#include libedataserverui/e-passwords.h
 // Other users of ecal seem to also include these, not sure why they should be included by the above
 #include libical/icaltime.h
 #include cairo/cairo.h
@@ -52,8 +53,13 @@
 #include datetime-interface.h
 #include dbus-shared.h
 
+
+#define SETTINGS_INTERFACE com.canonical.indicator.datetime
+#define SETTINGS_LOCATIONS locations
+
 static void geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar * path, GError * error, gpointer user_data);
 static gboolean update_appointment_menu_items (gpointer user_data);
+static gboolean update_timezone_menu_items(gpointer user_data);
 static void setup_timer (void);
 static void geo_client_invalid (GeoclueMasterClient * client, gpointer user_data);
 static void geo_address_change (GeoclueMasterClient * client, gchar * a, gchar * b, gchar * c, gchar * d, gpointer user_data);
@@ -63,30 +69,35 @@
 static DbusmenuServer * server = NULL;
 static DbusmenuMenuitem * root = NULL;
 static DatetimeInterface * dbus = NULL;
-static gchar * current_timezone = NULL;
 
 /* Global Items */
 static DbusmenuMenuitem * date = NULL;
 static DbusmenuMenuitem * calendar = NULL;
 static DbusmenuMenuitem * settings = NULL;
-static DbusmenuMenuitem * tzchange = NULL;
+static DbusmenuMenuitem * locations_separator = NULL;
+static DbusmenuMenuitem * geo_location = NULL;
+static DbusmenuMenuitem * current_location = NULL;
+//static DbusmenuMenuitem * ecal_location = NULL;
 static DbusmenuMenuitem * add_appointment = NULL;
-// static DbusmenuMenuitem * add_location = NULL;
 static GList			* appointments = NULL;
-static ECal* ecal = NULL;
-static const gchar		* ecal_timezone = NULL;
-static icaltimezone *tzone;
+static GList			* dconflocations = NULL;
+GSettings *conf;
+
 
 /* Geoclue trackers */
 static GeoclueMasterClient * geo_master = NULL;
 static GeoclueAddress * geo_address = NULL;
-static gchar * geo_timezone = NULL;
+
+/* Our 2 important timezones */
+static gchar 			* current_timezone = NULL;
+static gchar 			* geo_timezone = NULL;
 
 /* Check to see if our timezones are the same */
 static void
 check_timezone_sync (void) {
+	gchar * label;
 	gboolean in_sync = FALSE;
-
+	
 	if (geo_timezone == NULL) {
 		in_sync = TRUE;
 	}
@@ -105,18 +116,67 @@
 		g_debug(Timezones are different);
 	}
 
-	if (tzchange != NULL) {
+	if (geo_location != NULL  current_location != NULL) {
+		g_debug(Got timezone %s, current_timezone);
+		g_debug(Got timezone %s, geo_timezone);
+		// Show

Re: [Ayatana-commits] [Merge] lp:~karl-qdh/ubuntu/natty/indicator-datetime/indicator-datetime.withappointments into lp:indicator-datetime

2011-02-04 Thread Karl Lattimer
Added mterry for review: this code exhibits bugs you said I should *expect* 
when deleting menu items. So please use it if it helps, and let me know if you 
can see how to prevent the bug appearing.

The bug puts a pair of characters into each menu item label field. It may be 
adding a new item with some uninitialised data in it, or it may be overwriting 
one of the old ones - only one item per refresh.

bug #713041 covers this problem.
-- 
https://code.launchpad.net/~karl-qdh/ubuntu/natty/indicator-datetime/indicator-datetime.withappointments/+merge/48607
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~karl-qdh/ubuntu/natty/indicator-datetime/indicator-datetime.withappointments into lp:indicator-datetime

2011-01-26 Thread Karl Lattimer
Karl Lattimer has proposed merging 
lp:~karl-qdh/ubuntu/natty/indicator-datetime/indicator-datetime.withappointments
 into lp:indicator-datetime.

Requested reviews:
  Ted Gould (ted)
Related bugs:
  #542218 integration with Evolution calendar events and time locations
  https://bugs.launchpad.net/bugs/542218

For more details, see:
https://code.launchpad.net/~karl-qdh/ubuntu/natty/indicator-datetime/indicator-datetime.withappointments/+merge/47514

This change introduces a new dbusmenu item type of APPOINTMENT_MENUITEM_TYPE 
which has 3 columns of imageappointment summary -- due time/date

with the new item type, we also introduce a small part of code to 
datetime-service which reads the EDS data for ecal and produces the values to 
fill into the menu items.

However, there are issues with this.

For some bizarre reason this indicator is affecting other indicators. Most 
notably the sound indicator which switches the volume up/down repeatedly, other 
indicators have strange effects too and it's difficult to see why this can 
happen in the code itself.
-- 
https://code.launchpad.net/~karl-qdh/ubuntu/natty/indicator-datetime/indicator-datetime.withappointments/+merge/47514
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'configure.ac'
--- configure.ac	2011-01-11 16:19:07 +
+++ configure.ac	2011-01-26 11:50:11 +
@@ -59,6 +59,8 @@
 INDICATOR_DISPLAY_OBJECTS=0.1.10
 GEOCLUE_REQUIRED_VERSION=0.12.0
 OOBS_REQUIRED_VERSION=2.31.0
+ECAL_REQUIRED_VERSION=2.30
+ICAL_REQUIRED_VERSION=0.44
 
 AS_IF([test x$with_gtk = x3],
 [PKG_CHECK_MODULES(INDICATOR, indicator3 = $INDICATOR_REQUIRED_VERSION
@@ -80,7 +82,9 @@
  libido-0.1 = $INDICATOR_DISPLAY_OBJECTS
  gio-2.0 = $GIO_REQUIRED_VERSION
  geoclue = $GEOCLUE_REQUIRED_VERSION
- liboobs-1 = $OOBS_REQUIRED_VERSION)
+ liboobs-1 = $OOBS_REQUIRED_VERSION
+ libecal-1.2 = $ECAL_REQUIRED_VERSION
+ libical = $ICAL_REQUIRED_VERSION)
 
 AC_SUBST(INDICATOR_CFLAGS)
 AC_SUBST(INDICATOR_LIBS)

=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2010-10-22 13:31:37 +
+++ src/datetime-service.c	2011-01-26 11:50:11 +
@@ -23,6 +23,7 @@
 #include libindicator/indicator-service.h
 #include locale.h
 
+#include gtk/gtk.h
 #include glib/gi18n.h
 #include gio/gio.h
 
@@ -33,6 +34,15 @@
 #include geoclue/geoclue-master.h
 #include geoclue/geoclue-master-client.h
 
+#include time.h
+#include libecal/e-cal.h
+#include libical/ical.h
+#include libecal/e-cal-time-util.h
+#include libedataserver/e-source.h
+// Other users of ecal seem to also include these, not sure why they should be included by the above
+#include libical/icaltime.h
+
+
 #include oobs/oobs-timeconfig.h
 
 #include datetime-interface.h
@@ -53,6 +63,9 @@
 static DbusmenuMenuitem * calendar = NULL;
 static DbusmenuMenuitem * settings = NULL;
 static DbusmenuMenuitem * tzchange = NULL;
+static GList			* appointments = NULL;
+static ECal* ecal = NULL;
+static const gchar		* ecal_timezone = NULL;
 
 /* Geoclue trackers */
 static GeoclueMasterClient * geo_master = NULL;
@@ -225,6 +238,186 @@
 	return FALSE;
 }
 
+static gboolean
+update_timezone_menu_items(gpointer user_data) {
+	// Get the location preferences and the current location, highlight the current location somehow
+	return FALSE;
+}
+
+/* Populate the menu with todays, next 5 appointments. 
+ * we should hook into the ABOUT TO SHOW signal and use that to update the appointments.
+ * Experience has shown that caldav's and webcals can be slow to load from eds
+ * this is a problem mainly on the EDS side of things, not ours. 
+ */
+static gboolean
+update_appointment_menu_items (gpointer user_data) {
+	// FFR: we should take into account short term timers, for instance
+	// tea timers, pomodoro timers etc... that people may add, this is hinted to in the spec.
+	time_t t1, t2;
+	icaltimezone *tzone;
+	gchar *query, *is, *ie;
+	GList *objects = NULL, *l;
+	GError *gerror = NULL;
+	DbusmenuMenuitem * item = NULL;
+	gint i;
+	gint width, height;
+	
+	if (!ecal)
+		ecal = e_cal_new_system_calendar();
+	
+	if (!ecal) {
+		g_debug(e_cal_new_system_calendar failed);
+		ecal = NULL;
+		return FALSE;
+	}
+	if (!e_cal_open(ecal, FALSE, gerror) ) {
+		g_debug(e_cal_open: %s\n, gerror-message);
+		g_free(ecal);
+		ecal = NULL;
+		return FALSE;
+	}
+	
+	if (!e_cal_get_timezone(ecal, UTC, tzone, gerror)) {
+		g_debug(failed to get time zone\n);
+		g_free(ecal);
+		ecal = NULL;
+		return FALSE;
+	}
+	
+	/* This timezone represents the timezone of the calendar, this might be different to the current UTC offset.
+	 * this means we'll have some geoclue interaction going on, and possibly the user will be involved in setting
+	 * their location manually, case in point: trains have satellite links which often geoclue

Re: [Ayatana-dev] Indicator datetime changes coming

2011-01-10 Thread Karl Lattimer
 
 MPT says: Each event should be presented as an ordinary menu item. The
 icon for the item should represent what kind of event it is
 (appointment, meeting, etc), and for calendar events the icon should be
 tinted depending on which calendar it comes from (Personal, Work, etc).
 
 In: https://wiki.ubuntu.com/TimeAndDate#Coming%20events
 
 So I'm not going to make a judgement here. I'm happy (if we have the
 right icons) to just mask fill a cairo surface in the right colour and
 push it off as a pixbuf. 

On another unrelated note; the spec says:

Activating an event’s item should open Evolution to edit that event.
Activating “Add Event…” should open Evolution Calendar to its interface
for adding a new appointment.

However, I don't believe there's an actual way of getting evolution to
open specific items of any type. 

BR,
 K


___
Mailing list: https://launchpad.net/~ayatana-dev
Post to : ayatana-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-dev
More help   : https://help.launchpad.net/ListHelp


[Ayatana-dev] Indicator datetime changes coming

2011-01-07 Thread Karl Lattimer
Hello everyone,

I've been around on IRC for a while but this is my first time posting to
the list, so hello list ;)

I'm writing to outline some specifications and changes which
indicator-datetime will be needing during the natty cycle and wanted to
start a bit of a discussion on a couple of the topics.

mpt has specified nicely what he'd like to see here;

https://wiki.ubuntu.com/TimeAndDate#Coming%20events

So the first item for discussion is, The icon for the item should
represent what kind of event it is, and for calendar events the icon
should be tinted depending on which calendar it comes from.

In dbusmenu there's currently no way of specifying an icon colour but we
do have something similar here;

https://bugs.launchpad.net/indicator-session/+bug/634003
https://code.launchpad.net/~bilalakhtar/dbusmenu/fix-634003/+merge/34985

As far as I know the present situation is that symbolic icons won't be
available in Natty, and then there's the issue of should the tint of the
icon be a symbolic tint (from a list of colours), which would contradict
the evolution UI which allows you to set an arbitrary colour.

The second item is regarding the right aligned text in the menu items. 

As far as I can tell the only right aligned text that appears in the UI
is the keyboard-shortcut (possibly out of my control) or the number of
messages in the me menu (which doesn't match the desired style). 

However, I don't see how this is done in dbus menu looking at the
available properties. I see here;
http://bazaar.launchpad.net/~dbusmenu-team/dbusmenu/trunk/annotate/head:/libdbusmenu-glib/menuitem.h

I'm wondering if there's something I've missed somewhere which allows
this to be done fairly easily.
--
Regards,
Karl Lattimer 


___
Mailing list: https://launchpad.net/~ayatana-dev
Post to : ayatana-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~bilalakhtar/dbusmenu/fix-634003 into lp:dbusmenu

2011-01-07 Thread Karl Lattimer
 I'm going to mark this as Needs Fixing as we need to instead of setting a
 specific color value move this over to a semantic meaning.  So have a lookup
 of alert is #FF type of thing.  That should come from the theme's
 symbolic colors as well.  A bigger change is needed, but this should be the
 basis of it.

I can think of another use case where specific colour is useful, that's where 
we're setting the hint of the indicator-datetime calendar menu items. 

As specified here; https://wiki.ubuntu.com/TimeAndDate#Coming%20events

So yeah, it needs fixing, but there's probably something useful we can do with 
this.
-- 
https://code.launchpad.net/~bilalakhtar/dbusmenu/fix-634003/+merge/34985
Your team ayatana-commits is subscribed to branch lp:dbusmenu.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~bilalakhtar/dbusmenu/fix-634003 into lp:dbusmenu

2010-12-23 Thread Karl Lattimer
Review: Approve
This part of the patches is fine, a very simple change that should survive the 
gtk3 transition well.
-- 
https://code.launchpad.net/~bilalakhtar/dbusmenu/fix-634003/+merge/34985
Your team ayatana-commits is subscribed to branch lp:dbusmenu.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~bilalakhtar/indicator-session/fix-634003 into lp:indicator-session

2010-12-23 Thread Karl Lattimer
Review: Approve
The changes here should be considered temporary, eventually we'll want to be 
able to set a hint on the menu item which will change the colour to the 
symbolic colour.
-- 
https://code.launchpad.net/~bilalakhtar/indicator-session/fix-634003/+merge/34986
Your team ayatana-commits is subscribed to branch lp:indicator-session.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~chrisccoulson/dbusmenu/ffox-fixes into lp:dbusmenu

2010-12-20 Thread Karl Lattimer
Review: Needs Information
I have one question about this patch, in line 38 you remove the ITEM_ACTIVATED 
signal. Does anything in existence utilise this signal and would need to be 
changed to use ABOUT_TO_SHOW instead?
-- 
https://code.launchpad.net/~chrisccoulson/dbusmenu/ffox-fixes/+merge/43810
Your team ayatana-commits is subscribed to branch lp:dbusmenu.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~cristiklein/notify-osd/multihead-bottompanel into lp:notify-osd/trunk

2010-07-28 Thread Karl Lattimer
I have a few concerns about this patch partly because the conversation with 
Chow Loong Jin doesn't come to any actual conclusion.

 1, I'm concerned the patch breaks the following specification for spacing; 
https://wiki.ubuntu.com/NotifyOSD#Outside%20the%20bubble
 2, That in certain monitor configurations e.g. fullscreen application on the 
screen above the desktop screen and other similar corner cases this patch fails 
to correctly assign a screen for the notification to be on.
 3, There are commented out pieces of code left in the patch.

 
 
-- 
https://code.launchpad.net/~cristiklein/notify-osd/multihead-bottompanel/+merge/14983
Your team ayatana-commits is subscribed to branch lp:notify-osd/trunk.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana-commits] [Merge] lp:~cristiklein/notify-osd/multihead-bottompanel into lp:notify-osd/trunk

2010-07-28 Thread Karl Lattimer
Review: Needs Information
This patch needs more information and clarification from the author.
-- 
https://code.launchpad.net/~cristiklein/notify-osd/multihead-bottompanel/+merge/14983
Your team ayatana-commits is subscribed to branch lp:notify-osd/trunk.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp