コード例 #1
0
ServerWiget::ServerWiget(QWidget *parent) :
    QWidget(parent)
{

    server=new NetServer();
     port = 1988;
    peers=new PeerWidget();
    m_grLayout=new QGridLayout(this);
    listWidget_peerList =new QListWidget();
    listWidget_Log=new QListWidget();

    peer_count=new QLCDNumber();
    peer_count->setSegmentStyle(QLCDNumber::Filled);

    m_hbLayout=new QHBoxLayout();
    m_hbLayout->addWidget(new QLabel("<span style=\"color:#0f615b;\">" + tr("Clients:") + "</span>"),Qt::AlignLeft);
    m_hbLayout->addStretch(50);
    m_hbLayout->addWidget(peer_count,Qt::AlignRight);
    server_Parameters=new QWidget();
    sp_gboxLayout=new QGridLayout();
     sp_gboxLayout->addWidget(new QLabel("<span style=\"color:#31cd69;\">" + tr("Server Info:") + "</span>"),0,0,1,2,Qt::AlignCenter);
    sp_gboxLayout->addLayout(m_hbLayout,1,0,1,2,Qt::AlignCenter);
    labelServerIP=new QLabel("<span style=\"color:#2343b3;\">" + getServerIP(2) + "</span>");
     labelServerIP2=new QLabel("<span style=\"color:#2343b3;\">" + getServerIP(4) + "</span>");
    sp_gboxLayout->addWidget(new QLabel("<span style=\"color:#0f615b;\">" + tr("Server IP:") + "</span>"),2,0,2,1,Qt::AlignLeft);
    sp_gboxLayout->addWidget(labelServerIP,2,1 ,Qt::AlignRight);
    sp_gboxLayout->addWidget(labelServerIP2,3,1 ,Qt::AlignRight);
        sp_gboxLayout->addWidget(new QLabel("<span style=\"color:#0f615b;\">" + tr("Port:") + "</span>"),4,0,1,1,Qt::AlignLeft);
    labelServerPort=new QLabel ("<span style=\"color:#2343b3;\">" + QString::number(port) + "</span>");
    sp_gboxLayout->addWidget(labelServerPort,4,1 ,Qt::AlignRight);
    UpdateServerInfo=new QPushButton("&Update info");
       sp_gboxLayout->addWidget(UpdateServerInfo,5,0,1,3,Qt::AlignCenter);
    sp_gboxLayout->setColumnStretch(1,2.0);
    server_Parameters->setLayout(sp_gboxLayout);
    m_grLayout->addWidget(listWidget_peerList,0,0,1,1,Qt::AlignLeft);
    m_grLayout->setColumnStretch(0,1);
    m_grLayout->setRowStretch(0,3.0);
    m_grLayout->setRowStretch(1,1);
    m_grLayout->addWidget(peers,0,1,1,1);
    m_grLayout->addWidget(listWidget_Log,1,1,1,1);
    m_grLayout->addWidget(server_Parameters,1,0);
    m_grLayout->setColumnStretch(1,4);
    labelServerStatus=new QLabel(tr("Server: ") + "<span style=\"color:#000088;\">" + tr("stopped") + "</span>");
    connect(UpdateServerInfo,SIGNAL(clicked()),this,SLOT(updateServerInfo()));
    connect(listWidget_peerList,SIGNAL(clicked(QModelIndex)),this,SLOT(on_listWidget_peerList_clicked(QModelIndex)));
    this->setLayout(m_grLayout);
    qDebug()<<"Server Widget created";
}
コード例 #2
0
ファイル: TestRunnerMobile.cpp プロジェクト: Atlante45/hifi
void TestRunnerMobile::runInterface() {
#if defined Q_OS_WIN || defined Q_OS_MAC
    if (!_adbInterface) {
        _adbInterface = new AdbInterface();
    }

    _statusLabel->setText("Starting Interface");

    QString testScript = (_runFullSuite->isChecked())
        ? QString("https://raw.githubusercontent.com/") + nitpick->getSelectedUser() + "/hifi_tests/" + nitpick->getSelectedBranch() + "/tests/testRecursive.js"
        : _scriptURL->text();
 
    // Quest and Android have different commands to run interface
    QString startCommand;
    if (_modelName == "Quest") {
        startCommand = "io.highfidelity.questInterface/.PermissionsChecker";
    } else {
        startCommand = "io.highfidelity.hifiinterface/.PermissionChecker";
    }

    QString serverIP { getServerIP() };
    if (serverIP == NETWORK_NOT_FOUND) {
        _runInterfacePushbutton->setEnabled(false);
        return;
    }

    QString command = _adbInterface->getAdbCommand() +
        " shell am start -n " + startCommand +
        " --es args \\\"" +
        " --url hifi://" + serverIP + "/0,0,0"
        " --no-updater" +
        " --no-login-suggestion" +
        " --testScript " + testScript + " quitWhenFinished" +
        " --testResultsLocation /sdcard/snapshots" +
        "\\\"";

    appendLog(command);
    system(command.toStdString().c_str());
    _statusLabel->setText("Interface started");
#endif
}