Esempio n. 1
0
void ShaderDialog::on_saveAsDefault_clicked(bool)
{
   qDebug() << "Setting Default Shader" << m_dialog.shaderCombo->currentText();
   qDebug() << getParametersFromDialog();
   qDebug() << "Setting Default Shader";
   qDebug() << getFilterParameters();
   Preferences::DefaultShader(m_dialog.shaderCombo->currentText());
   Preferences::DefaultShaderParameters(getParametersFromDialog());
   Preferences::DefaultFilterParameters(getFilterParameters());
}
Esempio n. 2
0
int BaseFilter::performAction()
{
    //check if selected entities are good
    int check_result = checkSelected();
    if (check_result != 1)
    {
        throwError(check_result);
        return check_result;
    }

    //if dialog is needed open the dialog
    int dialog_result = openInputDialog();
	if (dialog_result < 1)
	{
		if (dialog_result<0)
        throwError(dialog_result);
		else
			dialog_result = 1; //the operation is canceled by the user, no need to throw an error!
		return dialog_result;
	}

    //get the parameters from the dialog
    getParametersFromDialog();

    //are the given parameters ok?
    int par_status = checkParameters();
    if (par_status != 1)
    {
        throwError(par_status);
        return par_status;
    }

    //if so go ahead with start()
    int start_status = start();
    if (start_status != 1)
    {
        throwError(start_status);
        return start_status;
    }

    //if we have an output dialog is time to show it
    int out_dialog_result = openOutputDialog();
    if (out_dialog_result < 1)
    {
        if (out_dialog_result<0)
        throwError(out_dialog_result);
        else
            out_dialog_result = 1; //the operation is canceled by the user, no need to throw an error!
        return out_dialog_result; //maybe some filter could ask the user if he wants to ac
    }


	return 1;
}
Esempio n. 3
0
int BaseFilter::performAction()
{
    //check if selected entities are good
    int check_result = checkSelected();
    if (check_result != 1)
    {
        throwError(check_result);
        return check_result;
    }

    //if dialog is needed open the dialog
	int dialog_result = openDialog();
	if (dialog_result < 1)
	{
		if (dialog_result<0)
        throwError(dialog_result);
		else
			dialog_result = 1; //the operation is canceled by the user, no need to throw an error!
		return dialog_result;
	}

    //get the parameters from the dialog
    getParametersFromDialog();

    //are the given parameters ok?
    int par_status = checkParameters();
    if (par_status != 1)
    {
        throwError(par_status);
        return par_status;
    }

    //if so go ahead with start()
    int start_status = start();
    if (start_status != 1)
    {
        throwError(start_status);
        return start_status;
    }

	return 1;
}
Esempio n. 4
0
void ShaderDialog::installShaderParameters(int)
{
   QString name(m_dialog.shaderCombo->currentText());
   m_shaderLibrary.setUniformVariables(name, getParametersFromDialog());
   updated();
}