Exemple #1
0
void PBSystemTab::ProgramInit()
{
    //Grab the username
    username = QString::fromLocal8Bit(getenv("SUDO_USER")); //since the app is always run as root with sudo
    if(username.isEmpty()){ username = QString::fromLocal8Bit(getenv("LOGNAME")); } //in case SUDO_USER is not set
    //qDebug() << "Username:"******"hw.model").simplified());
    
    //Get & Set RAM
    labelMemory->setText(pcbsd::Utils::bytesToHumanReadable(pcbsd::Utils::sysctlAsInt("hw.physmem")));

    //Load Misc tab data
    loadMiscData();


    // Connect our various buttons
    connect(buttonGenerate, SIGNAL(clicked()), this, SLOT(startGenerateSheet()) );

    connect(pushMiscSave, SIGNAL( clicked() ), this, SLOT( slotMiscSave() ) );

    connect(fetchSourceBut, SIGNAL( clicked() ), this, SLOT( fetchSourcePressed() ) );
    connect(fetchPortsBut, SIGNAL( clicked() ), this, SLOT( fetchPortsPressed() ) );
    connect(push_close, SIGNAL(clicked()), this, SLOT(close()) );
    
    cmdDlg = new CMDDialog(this);
    cmdDlg->hide();
}
Exemple #2
0
void PBSystemTab::ProgramInit()
{
    //Grab the username
    username = QString::fromLocal8Bit(getenv("LOGNAME"));
    
    // Set the Uname on the General Tab
    CheckUname();
    // Set the PC-BSD Version on the General Tab
    CheckPBVer();

    // See if we need to setup a proxy
    checkProxy();
    
    //Get & Set CPU Type
    labelCPU->setText(pcbsd::Utils::sysctl("hw.model").simplified());
    
    //Get & Set RAM
    labelMemory->setText(pcbsd::Utils::bytesToHumanReadable(pcbsd::Utils::sysctlAsInt("hw.physmem")));
    
    // Read any kernel settings
    LoadKernSettings();

    // Read any rc.conf settings
    //loadServSettings();

    //Load boot screen data
    loadBootData();

    // Connect our various buttons
    connect(buttonGenerate, SIGNAL(clicked()), this, SLOT(startGenerateSheet()) );
    connect(showBootCheck, SIGNAL(clicked()), this, SIGNAL(changed()));
    connect(splashSelect, SIGNAL(activated(int)), this, SIGNAL(changed()));
    connect(pushMiscSave, SIGNAL( clicked() ), this, SLOT( slotMiscSave() ) );

    connect(fetchSourceBut, SIGNAL( clicked() ), this, SLOT( fetchSourcePressed() ) );
    connect(fetchPortsBut, SIGNAL( clicked() ), this, SLOT( fetchPortsPressed() ) );
}