コード例 #1
0
SecurityLabel::SecurityLabel(
        QWidget *parent, QString _xmlDesc) :
    _Tab(parent), xmlDesc(_xmlDesc)
{
    setObjectName("Security-High");

    restorePanel = new RestorePanel(this);
    secLabels = new SecLabels(this);
    commonLayout = new QVBoxLayout(this);
    commonLayout->addWidget(restorePanel, 0, Qt::AlignRight);
    commonLayout->addWidget(secLabels);
    commonLayout->addStretch(-1);
    setLayout(commonLayout);
    readXMLDesciption();
    // dataChanged connections
    connect(secLabels, SIGNAL(dataChanged()),
            this, SLOT(stateChanged()));
    connect(this, SIGNAL(dataChanged()),
            restorePanel, SLOT(stateChanged()));
    // action connections
    connect(restorePanel, SIGNAL(resetData()),
            this, SLOT(resetData()));
    connect(restorePanel, SIGNAL(revertData()),
            this, SLOT(revertData()));
    connect(restorePanel, SIGNAL(saveData()),
            this, SLOT(saveData()));
}
コード例 #2
0
ファイル: cpu.cpp プロジェクト: Dravigon/qt-virt-manager
CPU::CPU(QWidget *parent, QString _caps, QString _xmlDesc) :
    _Tab(parent), capabilities(_caps), xmlDesc(_xmlDesc)
{
    setObjectName("CPU");
    logicCPULabel = new LogicalHostCPU(this, capabilities);
    cpuAlloc = new CPU_Allocation(this, capabilities);
    cpuModel = new CPU_Model(this);
    cpuTopology = new CPU_Topology(this);
    scrolledLayout = new QVBoxLayout(this);
    scrolledLayout->addWidget(logicCPULabel);
    scrolledLayout->addWidget(cpuAlloc);
    scrolledLayout->addWidget(cpuModel);
    scrolledLayout->addWidget(cpuTopology);
    scrolledLayout->addStretch(-1);
    scrolled = new QWidget(this);
    scrolled->setLayout(scrolledLayout);
    restorePanel = new RestorePanel(this);
    commonWdg = new QScrollArea(this);
    commonWdg->setWidget(scrolled);
    commonWdg->setWidgetResizable(true);
    commonLayout = new QVBoxLayout(this);
    commonLayout->addWidget(restorePanel, 0, Qt::AlignRight);
    commonLayout->addWidget(commonWdg);
    setLayout(commonLayout);
    readXMLDesciption();
    connect(cpuAlloc, SIGNAL(currentVCPU(int)),
            logicCPULabel, SLOT(changeInfoVisibility(int)));
    connect(cpuModel, SIGNAL(cpuUseElements(bool)),
            cpuTopology, SLOT(setUsage(bool)));
    connect(cpuTopology, SIGNAL(valueChanged(int)),
            cpuAlloc, SLOT(setMaxVCPU(int)));
    connect(cpuTopology, SIGNAL(useTopology(bool)),
            cpuAlloc->vcpu, SLOT(setDisabled(bool)));
    // dataChanged connections
    connect(cpuAlloc, SIGNAL(dataChanged()),
            this, SIGNAL(dataChanged()));
    connect(cpuModel, SIGNAL(dataChanged()),
            this, SIGNAL(dataChanged()));
    connect(cpuTopology, SIGNAL(dataChanged()),
            this, SIGNAL(dataChanged()));
    connect(this, SIGNAL(dataChanged()),
            restorePanel, SLOT(stateChanged()));
    // action connections
    connect(restorePanel, SIGNAL(resetData()),
            this, SLOT(resetData()));
    connect(restorePanel, SIGNAL(revertData()),
            this, SLOT(revertData()));
    connect(restorePanel, SIGNAL(saveData()),
            this, SLOT(saveData()));
}
コード例 #3
0
RestorePanel::RestorePanel(QWidget *parent) :
    QWidget(parent)
{
    save = new QPushButton(QIcon::fromTheme("document-save"), "", this);
    save->setToolTip("Save current page state");
    revert = new QPushButton(QIcon::fromTheme("document-revert"), "", this);
    revert->setToolTip("Revert to previous page state");
    restoreMenu = new DeviceRestoreMenu(this);
    restoreMenu->revertData->setEnabled(false);
    revert->setMenu(restoreMenu);
    panelLayout = new QHBoxLayout(this);
    panelLayout->addWidget(save);
    panelLayout->addWidget(revert);
    panelLayout->addStretch(-1);
    setLayout(panelLayout);
    connect(save, SIGNAL(clicked()),
            this, SIGNAL(saveData()));
    connect(restoreMenu->revertData, SIGNAL(triggered()),
            this, SIGNAL(revertData()));
    connect(restoreMenu->resetData, SIGNAL(triggered()),
            this, SIGNAL(resetData()));
}
コード例 #4
0
OS_Booting::OS_Booting(
        QWidget *parent, QString _xmlDesc) :
    _QWidget(parent), xmlDesc(_xmlDesc)
{
    setObjectName("OS_Booting");
    // workaround
    editor = new QTextEdit(this);
    //
    scrolledLayout = new QVBoxLayout(this);
    scrolledLayout->addWidget(editor);
    scrolledLayout->addStretch(-1);
    scrolled = new QWidget(this);
    scrolled->setLayout(scrolledLayout);
    restorePanel = new RestorePanel(this);
    commonWdg = new QScrollArea(this);
    commonWdg->setWidget(scrolled);
    commonWdg->setWidgetResizable(true);
    commonLayout = new QVBoxLayout(this);
    commonLayout->addWidget(restorePanel, 0, Qt::AlignRight);
    commonLayout->addWidget(commonWdg);
    commonLayout->addStretch(-1);
    setLayout(commonLayout);
    readXMLDesciption();
    // dataChanged connections
    connect(editor, SIGNAL(textChanged()),
            this, SIGNAL(dataChanged()));
    connect(this, SIGNAL(dataChanged()),
            restorePanel, SLOT(stateChanged()));
    // action connections
    connect(restorePanel, SIGNAL(resetData()),
            this, SLOT(resetSecData()));
    connect(restorePanel, SIGNAL(revertData()),
            this, SLOT(revertSecData()));
    connect(restorePanel, SIGNAL(saveData()),
            this, SLOT(saveSecData()));
}
コード例 #5
0
ファイル: os_booting.cpp プロジェクト: F1ash/qt-virt-manager
OS_Booting::OS_Booting(
        QWidget *parent,
        QString _caps,
        QString _xmlDesc) :
    _Tab(parent), capabilities(_caps), xmlDesc(_xmlDesc)
{
    setObjectName("OS_Booting");
    readCapabilities();
    bootType = new BootType(this);
    bootSet = new QStackedWidget(this);
    bootSet->addWidget(new BIOS_Boot(this, capabilities));
    bootSet->addWidget(new Host_Boot(this));
    bootSet->addWidget(new Direct_Kernel_Boot(this));
    bootSet->addWidget(new LXC_OSBooting(this, capabilities));
    bootSet->widget(0)->setEnabled(type.toLower().compare("lxc")!=0);
    bootSet->widget(1)->setEnabled(type.toLower().compare("lxc")!=0);
    bootSet->widget(2)->setEnabled(type.toLower().compare("lxc")!=0);
    bootSet->widget(3)->setEnabled(type.toLower().compare("lxc")==0);
    bootType->osType->setEnabled(type.toLower().compare("lxc")!=0);
    connect(bootType->bootType, SIGNAL(currentIndexChanged(int)),
            bootSet, SLOT(setCurrentIndex(int)));
    connect(bootType->bootType, SIGNAL(currentIndexChanged(int)),
            this, SLOT(changeBootType()));
    //scrolledLayout = new QVBoxLayout(this);
    //scrolledLayout->addWidget(bootType);
    //scrolledLayout->addWidget(bootSet);
    //scrolledLayout->addStretch(-1);
    //scrolled = new QWidget(this);
    //scrolled->setLayout(scrolledLayout);
    restorePanel = new RestorePanel(this);
    //commonWdg = new QScrollArea(this);
    //commonWdg->setWidget(scrolled);
    //commonWdg->setWidgetResizable(true);
    commonLayout = new QVBoxLayout(this);
    commonLayout->addWidget(restorePanel, 0, Qt::AlignRight);
    //commonLayout->addWidget(commonWdg);
    commonLayout->addWidget(bootType);
    commonLayout->addWidget(bootSet);
    commonLayout->addStretch(-1);
    setLayout(commonLayout);
    readXMLDesciption();
    // dataChanged connections
    connect(this, SIGNAL(dataChanged()),
            restorePanel, SLOT(stateChanged()));
    connect(bootType->osType, SIGNAL(textEdited(QString)),
            this, SLOT(stateChanged()));
    // action connections
    connect(restorePanel, SIGNAL(resetData()),
            this, SLOT(resetData()));
    connect(restorePanel, SIGNAL(revertData()),
            this, SLOT(revertData()));
    connect(restorePanel, SIGNAL(saveData()),
            this, SLOT(saveData()));
    for (int i=0; i<bootSet->count(); i++) {
        connect(bootSet->widget(i), SIGNAL(domainType(const QString&)),
                this, SIGNAL(domainType(const QString&)));
        connect(bootSet->widget(i), SIGNAL(osType(const QString&)),
                this, SLOT(changeOSType(const QString&)));
        connect(bootSet->widget(i), SIGNAL(emulatorType(const QString&)),
                this, SIGNAL(emulatorType(const QString&)));
        connect(bootSet->widget(i), SIGNAL(dataChanged()),
                this, SLOT(stateChanged()));
    };
    BIOS_Boot *wdg = static_cast<BIOS_Boot*>(bootSet->widget(0));
    connect(wdg->architecture, SIGNAL(maxVCPU(const QString&)),
            this, SIGNAL(maxVCPU(const QString&)));
    connect(wdg->architecture, SIGNAL(archType(const QString&)),
            this, SIGNAL(archChanged(const QString&)));
}
コード例 #6
0
SICALLBACK ToonixLighter_BeginEvaluate( ICENodeContext& in_ctxt )
{
	TXLight* light = NULL;
	CValue userData = in_ctxt.GetUserData();

	if(userData.IsEmpty())
	{
		// Build a new Light Object
		light = new TXLight();

		// Get the input TXGeometry
		CDataArrayCustomType ToonixData( in_ctxt, ID_IN_ToonixData );

		CDataArrayCustomType::TData* pBufferToonixData;
		ULONG nSizeToonixData;
		ToonixData.GetData( 0,(const CDataArrayCustomType::TData**)&pBufferToonixData, nSizeToonixData );
		TXData* data = (TXData*)pBufferToonixData;
		light->_geom = data->_geom;


		in_ctxt.PutUserData((CValue::siPtrType)light);
	}
	else
	{
		light = (TXLight*)(CValue::siPtrType)in_ctxt.GetUserData( );
	}

	if(GetLighterDirtyState(in_ctxt))
	{
		//Application().LogMessage(L"Toonix Lighter >State Dirty...");
		// Get lights positions used for light detection
		light->_lights.clear();
		
		siICENodeDataType inPortType;
		siICENodeStructureType inPortStruct;
		siICENodeContextType inPortContext;

		in_ctxt.GetPortInfo( ID_IN_LightPosition, inPortType, inPortStruct, inPortContext );
		if ( inPortStruct == XSI::siICENodeStructureSingle )
		{
			//Application().LogMessage(L"ONE Light");
			CDataArrayVector3f lightPointData( in_ctxt, ID_IN_LightPosition );
			light->_lights.push_back(lightPointData[0]);
			light->_nbl = 1;
		}
		else if ( inPortStruct == XSI::siICENodeStructureArray )
		{
			//Application().LogMessage(L"MULTI Lights");
			CDataArray2DVector3f lightPointsData( in_ctxt, ID_IN_LightPosition );
			CDataArray2DVector3f::Accessor lightPointData = lightPointsData[0];
			light->_nbl = lightPointData.GetCount();

			for(LONG l=0;l<light->_nbl;l++)
			{
				light->_lights.push_back(lightPointData[l]);
			}
		}

		light->_bias.resize(light->_nbl);

		in_ctxt.GetPortInfo( ID_IN_LightBias, inPortType, inPortStruct, inPortContext );
		if ( inPortStruct == XSI::siICENodeStructureSingle )
		{
			CDataArrayFloat lightBiasData( in_ctxt, ID_IN_LightBias );
			light->_bias[0] = lightBiasData[0];
		}
		else if ( inPortStruct == XSI::siICENodeStructureArray )
		{
			CDataArray2DFloat lightPointsData( in_ctxt, ID_IN_LightBias );
			CDataArray2DFloat::Accessor lightPointData = lightPointsData[0];
			ULONG nbl = lightPointData.GetCount();

			for(LONG l=0;l<nbl&&l<light->_nbl;l++)
			{
				light->_bias[l] = lightPointData[l];
			}
		}

		light->_distance.resize(light->_nbl);

		in_ctxt.GetPortInfo( ID_IN_LightDistance, inPortType, inPortStruct, inPortContext );
		if ( inPortStruct == XSI::siICENodeStructureSingle )
		{
			CDataArrayFloat lightDistanceData( in_ctxt, ID_IN_LightDistance );
			light->_distance[0] = lightDistanceData[0];
		}
		else if ( inPortStruct == XSI::siICENodeStructureArray )
		{
			CDataArray2DFloat lightDistancesData( in_ctxt, ID_IN_LightDistance );
			CDataArray2DFloat::Accessor lightDistanceData = lightDistancesData[0];
			ULONG nbl = lightDistanceData.GetCount();

			for(LONG l=0;l<nbl&&l<light->_nbl;l++)
			{
				light->_distance[l] = lightDistanceData[l];
			}
		}

		CDataArrayBool revertData( in_ctxt, ID_IN_Revert );
		light->_reverse = revertData[0];
		CDataArrayFloat pushData( in_ctxt, ID_IN_Push );
		light->_push = pushData[0];

		CDataArrayVector3f viewData( in_ctxt, ID_IN_ViewPosition );
		light->_view = viewData[0];

		light->Build();

		in_ctxt.PutUserData((CValue::siPtrType)light);
	}
	return CStatus::OK;
}
コード例 #7
0
SecurityLabel::SecurityLabel(
        QWidget *parent, QString _xmlDesc) :
    _QWidget(parent), xmlDesc(_xmlDesc)
{
    setObjectName("Security-High");

    modelLabel = new QLabel("Model:", this);
    model = new QComboBox(this);
    model->addItems(QStringList()<<"SELinux"<<"AppArmor"<<"DAC");
    labelTypeLabel = new QComboBox(this);
    labelTypeLabel->addItems(QStringList()<<"Label"<<"BaseLabel"<<"ImageLabel");
    label = new QLineEdit(this);
    relabelLabel = new QLabel("Relabel:", this);
    relabel = new QComboBox(this);
    relabel->addItems(QStringList()<<"Default"<<"Yes"<<"No");
    baseLayout = new QGridLayout();
    baseLayout->addWidget(modelLabel, 0, 0);
    baseLayout->addWidget(model, 0, 1);
    baseLayout->addWidget(labelTypeLabel, 1, 0);
    baseLayout->addWidget(label, 1, 1);
    baseLayout->addWidget(relabelLabel, 2, 0);
    baseLayout->addWidget(relabel, 2, 1);
    baseWdg = new QWidget(this);
    baseWdg->setLayout(baseLayout);
    baseWdg->setVisible(false);

    useSecLabel = new QCheckBox("Use Security Label", this);
    typeLabel = new QLabel("Type:", this);
    type = new QComboBox(this);
    type->addItems(QStringList()<<"None"<<"Dynamic"<<"Static");
    typeLayout = new QHBoxLayout(this);
    typeLayout->addWidget(typeLabel);
    typeLayout->addWidget(type);
    typeWdg = new QWidget(this);
    typeWdg->setLayout(typeLayout);

    add = new QPushButton(QIcon::fromTheme("list-add"), "", this);
    del = new QPushButton(QIcon::fromTheme("list-remove"), "", this);
    list = new QListWidget(this);
    listLayout = new QGridLayout();
    listLayout->addWidget(add, 0, 0);
    listLayout->addWidget(del, 0, 3);
    listLayout->addWidget(list, 1, 0, 2, 4);
    listWdg = new QWidget(this);
    listWdg->setLayout(listLayout);

    restorePanel = new RestorePanel(this);
    commonLayout = new QVBoxLayout(this);
    commonLayout->addWidget(restorePanel, 0, Qt::AlignRight);
    commonLayout->addWidget(useSecLabel);
    commonLayout->addWidget(typeWdg);
    commonLayout->addWidget(baseWdg);
    commonLayout->addWidget(listWdg);
    commonLayout->addStretch(-1);
    setLayout(commonLayout);
    usedStateChanged(false);
    connect(useSecLabel, SIGNAL(toggled(bool)),
            this, SLOT(usedStateChanged(bool)));
    connect(type, SIGNAL(currentIndexChanged(QString)),
            this, SLOT(securityTypeChanged(QString)));
    connect(model, SIGNAL(currentIndexChanged(QString)),
            this, SLOT(modelTypeChanged(QString)));
    connect(add, SIGNAL(clicked()),
            this, SLOT(addSecLabel()));
    connect(del, SIGNAL(clicked()),
            this, SLOT(delSecLabel()));
    readXMLDesciption();
    // dataChanged connections
    connect(model, SIGNAL(currentIndexChanged(int)),
            this, SLOT(stateChanged()));
    connect(label, SIGNAL(textEdited(QString)),
            this, SLOT(stateChanged()));
    connect(labelTypeLabel, SIGNAL(currentIndexChanged(int)),
            this, SLOT(stateChanged()));
    connect(relabel, SIGNAL(currentIndexChanged(int)),
            this, SLOT(stateChanged()));
    connect(type, SIGNAL(currentIndexChanged(int)),
            this, SLOT(stateChanged()));
    connect(useSecLabel, SIGNAL(toggled(bool)),
            this, SLOT(stateChanged()));
    connect(this, SIGNAL(dataChanged()),
            restorePanel, SLOT(stateChanged()));
    // action connections
    connect(restorePanel, SIGNAL(resetData()),
            this, SLOT(resetSecData()));
    connect(restorePanel, SIGNAL(revertData()),
            this, SLOT(revertSecData()));
    connect(restorePanel, SIGNAL(saveData()),
            this, SLOT(saveSecData()));
}