/*
 * type determines whether if dialog is for killing process or renice.
 * type == PROCMAN_ACTION_KILL,   extra_value -> signal to send
 * type == PROCMAN_ACTION_RENICE, extra_value -> new priority.
 */
gboolean
procdialog_create_root_password_dialog(ProcmanActionType type,
				       ProcData *procdata,
				       gint pid,
				       gint extra_value)
{
	char * command;
	gboolean ret = FALSE;

	command = procman_action_to_command(type, pid, extra_value);

	procman_debug("Trying to run '%s' as root", command);

	if (procman_has_gksu())
		ret = procman_gksu_create_root_password_dialog(command);
	else if (procman_has_matesu())
		ret = procman_matesu_create_root_password_dialog(command);

	g_free(command);
	return ret;
}
/*
 * type determines whether if dialog is for killing process or renice.
 * type == PROCMAN_ACTION_KILL,   extra_value -> signal to send
 * type == PROCMAN_ACTION_RENICE, extra_value -> new priority.
 */
gboolean
procdialog_create_root_password_dialog(ProcmanActionType type,
                                       GsmApplication *app,
                                       gint pid,
                                       gint extra_value)
{
    char * command;
    gboolean ret = FALSE;

    command = procman_action_to_command(type, pid, extra_value);

    procman_debug("Trying to run '%s' as root", command);

    if (procman_has_pkexec())
        ret = gsm_pkexec_create_root_password_dialog(command);
    else if (procman_has_gksu())
        ret = gsm_gksu_create_root_password_dialog(command);
    else if (procman_has_gnomesu())
        ret = gsm_gnomesu_create_root_password_dialog(command);

    g_free(command);
    return ret;
}