fabric/porteditordialog.h

fabric/porteditordialog.h

fabric/porteditordialog.h

Namespaces

Name
Ui
Syntalos

Classes

Name
classPortEditorDialog

Source code

/*
 * Copyright (C) 2019-2024 Matthias Klumpp <matthias@tenstral.net>
 *
 * Licensed under the GNU Lesser General Public License Version 3
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the license, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include <QDialog>
#include <set>

#include "datactl/datatypes.h"

namespace Ui
{
class PortEditorDialog;
}
namespace Syntalos
{
class AbstractModule;
}

using namespace Syntalos;

class PortEditorDialog : public QDialog
{
    Q_OBJECT

public:
    explicit PortEditorDialog(AbstractModule *mod, QWidget *parent = nullptr);
    ~PortEditorDialog();

    void setAllowedInputTypes(const std::set<BaseDataType::TypeId> &types);
    void setAllowedOutputTypes(const std::set<BaseDataType::TypeId> &types);

    void updatePortLists();

private slots:
    void on_tbAddInputPort_clicked();
    void on_tbAddOutputPort_clicked();
    void on_tbRemoveInputPort_clicked();
    void on_lwInputPorts_currentRowChanged(int currentRow);
    void on_lwOutputPorts_currentRowChanged(int currentRow);
    void on_tbRemoveOutputPort_clicked();

private:
    Ui::PortEditorDialog *ui;
    AbstractModule *m_mod;

    std::set<BaseDataType::TypeId> m_allowedInputTypes;
    std::set<BaseDataType::TypeId> m_allowedOutputTypes;
};

Updated on 2024-09-05 at 17:39:59 +0000