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()));
}
Example #2
0
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()));
}
Example #3
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()));
}
Example #4
0
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&)));
}
Example #5
0
void OS_Booting::readXMLDesciption()
{
    currentDeviceXMLDesc = xmlDesc;
    readXMLDesciption(currentDeviceXMLDesc);
}
/* private slots */
void SecurityLabel::readXMLDesciption()
{
    currentDeviceXMLDesc = xmlDesc;
    readXMLDesciption(currentDeviceXMLDesc);
}
void SecurityLabel::setDataDescription(QString &_xmlDesc)
{
    currentDeviceXMLDesc = _xmlDesc;
    readXMLDesciption(currentDeviceXMLDesc);
}
Example #8
0
void OS_Booting::resetSecData()
{
    readXMLDesciption();
    currentStateSaved = true;
    restorePanel->stateChanged(false);
}
Example #9
0
/* private slots */
void CPU::readXMLDesciption()
{
    currentDeviceXMLDesc = xmlDesc;
    readXMLDesciption(currentDeviceXMLDesc);
}
void SecurityLabel::revertSecData()
{
    readXMLDesciption(currentDeviceXMLDesc);
    currentStateSaved = true;
    restorePanel->stateChanged(false);
}
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()));
}