Index: gnome-packagekit-0.3.14/src/gpk-check-update.c
===================================================================
--- gnome-packagekit-0.3.14.orig/src/gpk-check-update.c
+++ gnome-packagekit-0.3.14/src/gpk-check-update.c
@@ -73,6 +73,8 @@ struct GpkCheckUpdatePrivate
 	GpkClient		*gclient_get_updates;
 	GpkClient		*gclient_get_distro_upgrades;
 	GConfClient		*gconf_client;
+	gboolean		 distro_upgrade_available;
+	gboolean		 updates_available;
 	gboolean		 cache_okay;
 	gboolean		 cache_update_in_progress;
 	gboolean		 get_updates_in_progress;
@@ -342,6 +344,22 @@ gpk_check_update_menuitem_show_updates_c
 		egg_warning ("Couldn't execute command: %s", command);
 }
 
+static void
+gpk_check_update_menuitem_show_distro_upgrade_cb (GtkMenuItem *item, gpointer data)
+{
+	GError *error = NULL;
+	GpkCheckUpdate *cupdate = GPK_CHECK_UPDATE (data);
+	pk_control_suggest_daemon_quit (cupdate->priv->control, &error);
+	if (error) {
+		egg_debug ("Failure calling pk_control_suggest_daemon_quit: %s", error->message);
+		g_error_free (error);
+	}
+	
+	const gchar *command = "/usr/share/PackageKit/pk-upgrade-distro.sh";
+	if (!g_spawn_command_line_async (command, NULL))
+		egg_warning ("Couldn't execute command: %s", command);
+}
+
 /**
  * gpk_check_update_activate_update_cb:
  * @button: Which buttons are pressed
@@ -357,24 +375,40 @@ gpk_check_update_activate_update_cb (Gtk
 
 	egg_debug ("icon left clicked");
 
-	/* TRANSLATORS: context menu to execute the update viewer  */
-	item = gtk_image_menu_item_new_with_mnemonic (_("_Show Updates"));
-	image = gtk_image_new_from_icon_name (GPK_ICON_SOFTWARE_UPDATE, GTK_ICON_SIZE_MENU);
-	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-	g_signal_connect (G_OBJECT (item), "activate",
-			  G_CALLBACK (gpk_check_update_menuitem_show_updates_cb), icon);
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
-	/* TRANSLATORS: context menu to update any pending updates */
-	item = gtk_image_menu_item_new_with_mnemonic (_("_Update System Now"));
-	if (icon->priv->only_optional_updates_available)
-		gtk_widget_set_sensitive (item, FALSE);
-	image = gtk_image_new_from_icon_name (GPK_ICON_SOFTWARE_UPDATE_AVAILABLE, GTK_ICON_SIZE_MENU);
-	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-	g_signal_connect (G_OBJECT (item), "activate",
-			  G_CALLBACK (gpk_check_update_menuitem_update_system_cb), icon);
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+	if (icon->priv->updates_available) {
+		/* TRANSLATORS: context menu to execute the update viewer  */
+		item = gtk_image_menu_item_new_with_mnemonic (_("_Show Updates"));
+		image = gtk_image_new_from_icon_name (GPK_ICON_SOFTWARE_UPDATE, GTK_ICON_SIZE_MENU);
+		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+		g_signal_connect (G_OBJECT (item), "activate",
+				  G_CALLBACK (gpk_check_update_menuitem_show_updates_cb), icon);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+		/* TRANSLATORS: context menu to update any pending updates */
+		item = gtk_image_menu_item_new_with_mnemonic (_("_Update System Now"));
+		if (icon->priv->only_optional_updates_available)
+			gtk_widget_set_sensitive (item, FALSE);
+		image = gtk_image_new_from_icon_name (GPK_ICON_SOFTWARE_UPDATE_AVAILABLE, GTK_ICON_SIZE_MENU);
+		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+		g_signal_connect (G_OBJECT (item), "activate",
+				  G_CALLBACK (gpk_check_update_menuitem_update_system_cb), icon);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+	}
+
+	if (icon->priv->distro_upgrade_available) {
+		/* TRANSLATORS: context menu to show distro upgrade  */
+		item = gtk_image_menu_item_new_with_mnemonic (_("Show _Distribution Upgrade"));
+		image = gtk_image_new_from_icon_name (GPK_ICON_SOFTWARE_UPDATE, GTK_ICON_SIZE_MENU);
+		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+		g_signal_connect (G_OBJECT (item), "activate",
+				  G_CALLBACK (gpk_check_update_menuitem_show_distro_upgrade_cb), icon);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+	}
 
+	if (!icon->priv->distro_upgrade_available && !icon->priv->updates_available) {
+		egg_warning ("hrmm - logic problem in gpk_check_update_activate_update_cb");
+	}
+	
 	/* show the menu */
 	gtk_widget_show_all (GTK_WIDGET (menu));
 	gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
@@ -574,8 +608,18 @@ gpk_check_update_get_best_update_icon (G
 
 	g_return_val_if_fail (GPK_IS_CHECK_UPDATE (cupdate), NULL);
 
+	if (list == NULL)
+	{
+		if (!cupdate->priv->distro_upgrade_available)
+			return NULL;
+		return gpk_info_enum_to_icon_name (PK_INFO_ENUM_SECURITY);
+	}
+	
 	/* get an enumerated list with all the update types */
 	infos = gpk_check_update_client_info_to_bitfield (cupdate, list);
+	if (cupdate->priv->distro_upgrade_available) {
+		pk_bitfield_add (infos, PK_INFO_ENUM_SECURITY);
+	}
 
 	/* get the most important icon */
 	value = pk_bitfield_contain_priority (infos,
@@ -737,9 +781,11 @@ gpk_check_update_query_updates (GpkCheck
 	/* we have no updates */
 	if (length == 0) {
 		egg_debug ("no updates");
-		gpk_smart_icon_set_icon_name (cupdate->priv->sicon, NULL);
+		cupdate->priv->updates_available = FALSE;
+		gpk_smart_icon_set_icon_name (cupdate->priv->sicon, gpk_check_update_get_best_update_icon (cupdate, NULL));
 		goto out;
 	}
+	cupdate->priv->updates_available = TRUE;
 
 	/* find the security updates first */
 	cupdate->priv->only_optional_updates_available = TRUE;
@@ -976,6 +1022,12 @@ gpk_check_update_auto_get_updates_cb (Gp
 static void
 gpk_check_update_auto_get_upgrades_cb (GpkAutoRefresh *arefresh, GpkCheckUpdate *cupdate)
 {
+	gchar * filename = NULL;
+	GFile *file = NULL;
+	GFile *file_parent = NULL;
+	GFileOutputStream *filestream = NULL;
+	GFileInfo *file_info = NULL;
+	GTimeVal mod_time, cur_time;
 	GError *error = NULL;
 	const GPtrArray	*array;
 	gboolean ret;
@@ -1001,6 +1053,12 @@ gpk_check_update_auto_get_upgrades_cb (G
 		goto out;
 	}
 
+	/* Dont think that we need to somehow monitor and change status after the upgrade is done
+	   because distro upgrades are going to require a reboot anyway so the applet will be restarted
+	*/
+	cupdate->priv->distro_upgrade_available = TRUE;
+	gpk_smart_icon_set_icon_name (cupdate->priv->sicon, gpk_check_update_get_best_update_icon (cupdate, NULL));
+
 	/* do we do the notification? */
 	ret = gconf_client_get_bool (cupdate->priv->gconf_client, GPK_CONF_NOTIFY_DISTRO_UPGRADES, NULL);
 	if (!ret) {
@@ -1008,6 +1066,46 @@ gpk_check_update_auto_get_upgrades_cb (G
 		goto out;
 	}
 
+	filename = g_build_filename (g_get_user_data_dir (), PACKAGE, "last_prompt_upgrade_time", NULL);
+	if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
+		file = g_file_new_for_path (filename);
+		file_parent = g_file_get_parent (file);
+		g_file_make_directory_with_parents (file_parent, NULL, &error);
+		if (error != NULL) {
+			egg_warning ("skipping upgrade notification - can't create parent dir: %s", error->message);
+			g_error_free (error);
+			goto out;
+		}
+		filestream = g_file_create (file, G_FILE_CREATE_NONE, NULL, &error);
+		if (error != NULL) {
+			egg_warning ("skipping upgrade notification - can't create file: %s", error->message);
+			g_error_free (error);
+			goto out;
+		}
+	}
+	else {
+		file = g_file_new_for_path (filename);
+		file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, &error);
+		if (error != NULL) {
+			egg_warning ("skipping upgrade notification - can't query file: %s", error->message);
+			g_error_free (error);
+			goto out;
+		}
+		g_file_info_get_modification_time (file_info, &mod_time);
+		g_get_current_time (&cur_time);
+		if (cur_time.tv_sec - mod_time.tv_sec < 60*60*24*14) {
+			egg_debug ("skipping upgrade notification - not time yet: %d", (int)(cur_time.tv_sec - mod_time.tv_sec));
+			goto out;
+		}
+		g_file_info_set_modification_time (file_info, &cur_time);
+		g_file_set_attributes_from_info (file, file_info, G_FILE_QUERY_INFO_NONE, NULL, &error);
+		if (error != NULL) {
+			egg_warning ("skipping upgrade notification - cant set file modification time: %s", error->message);
+			g_error_free (error);
+			goto out;
+		}
+	}
+
 	/* find the upgrade string */
 	string = g_string_new ("");
 	for (i=0; i < array->len; i++) {
@@ -1038,6 +1136,11 @@ gpk_check_update_auto_get_upgrades_cb (G
 		g_error_free (error);
 	}
 out:
+	if (file_info) 	 g_object_unref (file_info);
+	if (filestream)  g_object_unref (filestream);
+	if (file_parent) g_object_unref (file_parent);
+	if (file)        g_object_unref (file);
+	if (filename)    g_free (filename);
 	if (string != NULL)
 		g_string_free (string, TRUE);
 }
@@ -1102,6 +1205,9 @@ gpk_check_update_init (GpkCheckUpdate *c
 	g_signal_connect (cupdate->priv->tlist, "changed",
 			  G_CALLBACK (gpk_check_update_task_list_changed_cb), cupdate);
 
+	cupdate->priv->distro_upgrade_available = FALSE;
+	cupdate->priv->updates_available = FALSE;
+	
 	/* refresh the cache, and poll until we get a good refresh */
 	cupdate->priv->cache_okay = FALSE;
 	cupdate->priv->cache_update_in_progress = FALSE;
Index: gnome-packagekit-0.3.14/data/gnome-packagekit.schemas.in
===================================================================
--- gnome-packagekit-0.3.14.orig/data/gnome-packagekit.schemas.in
+++ gnome-packagekit-0.3.14/data/gnome-packagekit.schemas.in
@@ -249,7 +249,7 @@
       <applyto>/apps/gnome-packagekit/frequency_get_upgrades</applyto>
       <owner>gnome-packagekit</owner>
       <type>string</type>
-      <default>weekly</default>
+      <default>daily</default>
       <locale name="C">
         <short>How often to check for distribution upgrades</short>
         <long>How often to check for distribution upgrades. Options are "daily", "weekly", "never"</long>
