Ejemplo n.º 1
0
static void
prepare_unlock_token (GkmWrapPrompt *self, CK_TOKEN_INFO_PTR tinfo)
{
	GkuPrompt *prompt;
	gchar *label;
	gchar *text;

	g_assert (GKM_WRAP_IS_PROMPT (self));

	prompt = GKU_PROMPT (self);

	label = g_strndup ((gchar*)tinfo->label, sizeof (tinfo->label));
	g_strchomp (label);

	/* Build up the prompt */
	gku_prompt_show_widget (prompt, "password_area");
	gku_prompt_hide_widget (prompt, "confirm_area");
	gku_prompt_hide_widget (prompt, "original_area");
	gku_prompt_set_title (prompt, _("Unlock certificate/key storage"));
	gku_prompt_set_primary_text (prompt, _("Enter password to unlock the certificate/key storage"));

	/* TRANSLATORS: The storage is locked, and needs unlocking before the application can use it. */
	text = g_strdup_printf (_("An application wants access to the certificate/key storage '%s', but it is locked"), label);
	gku_prompt_set_secondary_text (prompt, text);
	g_free (text);

	gku_prompt_show_widget (prompt, "details_area");
	gku_prompt_show_widget (prompt, "options_area");
	gku_prompt_set_unlock_sensitive (prompt, GCR_UNLOCK_OPTION_IDLE, FALSE, NULL);
	gku_prompt_set_unlock_sensitive (prompt, GCR_UNLOCK_OPTION_TIMEOUT, FALSE, NULL);
	gku_prompt_set_unlock_sensitive (prompt, GCR_UNLOCK_OPTION_ALWAYS,
	                                 gkm_wrap_login_is_usable (), NULL);

	g_free (label);
}
Ejemplo n.º 2
0
static void
prepare_unlock_object (GkmWrapPrompt *self, const gchar *label, CK_OBJECT_CLASS klass)
{
	GkuPrompt *prompt;
	gchar *text;

	g_assert (GKM_WRAP_IS_PROMPT (self));

	prompt = GKU_PROMPT (self);

	gku_prompt_set_title (prompt, prepare_unlock_object_title (klass));
	gku_prompt_set_primary_text (prompt, prepare_unlock_object_primary (klass));

	text = prepare_unlock_object_secondary (klass, label);
	gku_prompt_set_secondary_text (prompt, text);
	g_free (text);

	gku_prompt_hide_widget (prompt, "name_area");
	gku_prompt_hide_widget (prompt, "confirm_area");
	gku_prompt_show_widget (prompt, "details_area");
	gku_prompt_show_widget (prompt, "password_area");
	gku_prompt_show_widget (prompt, "options_area");

	/* TODO: After string freeze need to add a reason */
	if (!gkm_wrap_login_is_usable ())
		gku_prompt_set_unlock_sensitive (prompt, GCR_UNLOCK_OPTION_ALWAYS, FALSE, NULL);
}
Ejemplo n.º 3
0
static void
prepare_unlock_keyring_other (GkmWrapPrompt *self, const gchar *label)
{
	GkuPrompt *prompt;
	gchar *text;

	g_assert (GKM_WRAP_IS_PROMPT (self));

	prompt = GKU_PROMPT (self);

	gku_prompt_set_title (prompt, _("Unlock Keyring"));

	text = g_markup_printf_escaped (_("Enter password for keyring '%s' to unlock"), label);
	gku_prompt_set_primary_text (prompt, text);
	g_free (text);

	text = g_markup_printf_escaped (_("An application wants access to the keyring '%s', but it is locked"), label);
	gku_prompt_set_secondary_text (prompt, text);
	g_free (text);

	gku_prompt_hide_widget (prompt, "name_area");
	gku_prompt_hide_widget (prompt, "confirm_area");
	gku_prompt_show_widget (prompt, "details_area");
	gku_prompt_show_widget (prompt, "password_area");
	gku_prompt_show_widget (prompt, "options_area");

	if (!gkm_wrap_login_is_usable ())
		gku_prompt_set_unlock_sensitive (prompt, GCR_UNLOCK_OPTION_ALWAYS, FALSE, NULL);
}
Ejemplo n.º 4
0
static void
setup_unlock_token (GkmWrapPrompt *self,
                    CK_TOKEN_INFO_PTR tinfo)
{
	GcrPrompt *prompt;
	const gchar *choice;
	gchar *label;
	gchar *text;

	g_assert (GKM_IS_WRAP_PROMPT (self));
	prompt = GCR_PROMPT (self);

	label = g_strndup ((gchar*)tinfo->label, sizeof (tinfo->label));
	g_strchomp (label);

	/* Build up the prompt */
	gcr_prompt_set_title (prompt, _("Unlock certificate/key storage"));
	gcr_prompt_set_message (prompt, _("Enter password to unlock the certificate/key storage"));

	/* TRANSLATORS: The storage is locked, and needs unlocking before the application can use it. */
	text = g_strdup_printf (_("An application wants access to the certificate/key storage “%s”, but it is locked"), label);
	gcr_prompt_set_description (prompt, text);
	g_free (text);

	choice = NULL;
	if (gkm_wrap_login_is_usable ())
		choice = _("Automatically unlock whenever I’m logged in");
	gcr_prompt_set_choice_label (prompt, choice);

	gcr_prompt_set_continue_label (prompt, _("Unlock"));

	g_free (label);
}
Ejemplo n.º 5
0
static void
setup_unlock_object (GkmWrapPrompt *self,
                     const gchar *label,
                     CK_OBJECT_CLASS klass)
{
	GcrPrompt *prompt;
	const gchar *choice;
	gchar *text;

	g_assert (GKM_IS_WRAP_PROMPT (self));
	prompt = GCR_PROMPT (self);

	gcr_prompt_set_title (prompt, calc_unlock_object_title (klass));
	gcr_prompt_set_message (prompt, calc_unlock_object_primary (klass));

	text = calc_unlock_object_secondary (klass, label);
	gcr_prompt_set_description (prompt, text);
	g_free (text);

	choice = NULL;
	if (gkm_wrap_login_is_usable ())
		choice = calc_unlock_object_choice (klass);
	gcr_prompt_set_choice_label (prompt, choice);
	gcr_prompt_set_continue_label (prompt, _("Unlock"));
}
Ejemplo n.º 6
0
static void
setup_unlock_keyring_other (GkmWrapPrompt *self,
                            const gchar *label)
{
	GcrPrompt *prompt;
	const gchar *choice;
	gchar *text;

	g_assert (GKM_IS_WRAP_PROMPT (self));
	prompt = GCR_PROMPT (self);

	gcr_prompt_set_title (prompt, _("Unlock Keyring"));

	text = _("Enter password to unlock");
	gcr_prompt_set_message (prompt, text);

	text = g_markup_printf_escaped (_("An application wants access to the keyring “%s”, but it is locked"), label);
	gcr_prompt_set_description (prompt, text);
	g_free (text);

	choice = NULL;
	if (gkm_wrap_login_is_usable ())
		choice = _("Automatically unlock this keyring whenever I’m logged in");
	gcr_prompt_set_choice_label (prompt, choice);
	gcr_prompt_set_continue_label (prompt, _("Unlock"));
}