bool FillIdentities (SigningIdentityCombo combo, string preferredPrefix, string excludePrefix,
			Gtk.CheckButton enabledCheck, Gtk.Image errorImage)
		{
			combo.ClearList ();
			
			var preferred = new List<string> ();
			var other = new List<string> ();
			
			foreach (var cert in certs) {
				var name = Keychain.GetCertificateCommonName (cert);
				if (excludePrefix != null && name.StartsWith (excludePrefix))
					continue;
				if (name.StartsWith (preferredPrefix)) {
					preferred.Add (name);
				} else {
					other.Add (name);
				}
			}
			
			//disable signing options and show message if no keys found
			if (preferred.Count == 0 && other.Count == 0) {
				enabledCheck.Sensitive = false;
				if (errorImage != null)
					errorImage.Visible = true;
				return false;
			} else {
				enabledCheck.Sensitive = true;
				if (errorImage != null)
					errorImage.Visible = false;
			}
			
			if (preferred.Count > 0) {
				combo.AddItemWithMarkup (GettextCatalog.GetString ("<b>Default App Store Identity</b>"), "", null);
				combo.AddSeparator ();
				foreach (var name in preferred)
					combo.AddItem (name, name, null);
			}
			
			if (other.Count > 0) {
				if (preferred.Any ())
					combo.AddSeparator ();
				foreach (var name in other)
					combo.AddItem (name, name, null);
			}
			return true;
		}
        bool FillIdentities(SigningIdentityCombo combo, string preferredPrefix, string excludePrefix,
                            Gtk.CheckButton enabledCheck, Gtk.Image errorImage)
        {
            combo.ClearList();

            var preferred = new List <string> ();
            var other     = new List <string> ();

            foreach (var cert in certs)
            {
                var name = Keychain.GetCertificateCommonName(cert);
                if (excludePrefix != null && name.StartsWith(excludePrefix))
                {
                    continue;
                }
                if (name.StartsWith(preferredPrefix))
                {
                    preferred.Add(name);
                }
                else
                {
                    other.Add(name);
                }
            }

            //disable signing options and show message if no keys found
            if (preferred.Count == 0 && other.Count == 0)
            {
                enabledCheck.Sensitive = false;
                if (errorImage != null)
                {
                    errorImage.Visible = true;
                }
                return(false);
            }
            else
            {
                enabledCheck.Sensitive = true;
                if (errorImage != null)
                {
                    errorImage.Visible = false;
                }
            }

            if (preferred.Count > 0)
            {
                combo.AddItemWithMarkup(GettextCatalog.GetString("<b>Default App Store Identity</b>"), "", null);
                combo.AddSeparator();
                foreach (var name in preferred)
                {
                    combo.AddItem(name, name, null);
                }
            }

            if (other.Count > 0)
            {
                if (preferred.Any())
                {
                    combo.AddSeparator();
                }
                foreach (var name in other)
                {
                    combo.AddItem(name, name, null);
                }
            }
            return(true);
        }
		void FillIdentities (SigningIdentityCombo combo, string preferredPrefix, string excludePrefix)
		{
			combo.ClearList ();
			
			combo.AddItemWithMarkup (GettextCatalog.GetString ("<b>Default App Store Identity</b>"), "", null);
			if (certs.Count == 0)
				return;
			
			var preferred = new List<string> ();
			var other = new List<string> ();
			
			foreach (var cert in certs) {
				var name = Keychain.GetCertificateCommonName (cert);
				if (excludePrefix != null && name.StartsWith (excludePrefix))
					continue;
				if (name.StartsWith ("iPhone"))
					continue;
				if (name.StartsWith (preferredPrefix)) {
					preferred.Add (name);
				} else {
					other.Add (name);
				}
			}
			
			if (preferred.Any ()) {
				combo.AddSeparator ();
				foreach (var name in preferred)
					combo.AddItem (name, name, null);
			}
			
			if (other.Any ()) {
				combo.AddSeparator ();
				foreach (var name in other)
					combo.AddItem (name, name, null);
			}
		}