AvatarSelectionDialog::AvatarSelectionDialog(QWidget * par,const QString &szInitialPath) : QDialog(par) { setWindowTitle(__tr2qs_ctx("Choose Avatar - KVIrc","options")); QGridLayout * g = new QGridLayout(this); QString msg = "<center>"; msg += __tr2qs_ctx("Please select an avatar image. " \ "The full path to a local file or an image on the Web can be used.<br>" \ "If you wish to use a local image file, click the \"<b>Browse</b>\"" \ "button to browse local folders.<br>" \ "The full URL for an image (including <b>http://</b>) can be entered manually.","options"); msg += "</center><br>"; QLabel * l = new QLabel(msg,this); l->setMinimumWidth(250); g->addWidget(l,0,0,1,3); m_pLineEdit = new QLineEdit(this); m_pLineEdit->setText(szInitialPath); m_pLineEdit->setMinimumWidth(180); g->addWidget(m_pLineEdit,1,0,1,2); QPushButton * b = new QPushButton(__tr2qs_ctx("&Browse...","options"),this); connect(b,SIGNAL(clicked()),this,SLOT(chooseFileClicked())); g->addWidget(b,1,2); KviTalHBox * h = new KviTalHBox(this); h->setSpacing(8); g->addWidget(h,2,1,1,2); b = new QPushButton(__tr2qs_ctx("&OK","options"),h); b->setMinimumWidth(80); b->setDefault(true); connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); b = new QPushButton(__tr2qs_ctx("Cancel","options"),h); b->setMinimumWidth(80); connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); g->setRowStretch(0,1); g->setColumnStretch(0,1); }
PolycrankSaverDlg::PolycrankSaverDlg(QWidget *parent, World *world) : QDialog(parent) { Q0Label = new QLabel(tr("Q1")); Q1Label = new QLabel(tr("Q2")); Q2Label = new QLabel(tr("Q3")); Q3Label = new QLabel(tr("Q4")); Q4Label = new QLabel(tr("Q5")); Q5Label = new QLabel(tr("Q6")); Q6Label = new QLabel(tr("Q7")); dofLabel = new QLabel(tr("Q ")); DegreesLineEdit = new QLineEdit; DegreesLineEdit->setText("DEGREES"); DegreesLineEdit->setEnabled(false); Q0DegreesLineEdit = new QLineEdit; Q1DegreesLineEdit = new QLineEdit; Q2DegreesLineEdit = new QLineEdit; Q3DegreesLineEdit = new QLineEdit; Q4DegreesLineEdit = new QLineEdit; Q5DegreesLineEdit = new QLineEdit; Q6DegreesLineEdit = new QLineEdit; RadianLineEdit = new QLineEdit; RadianLineEdit->setText("RADIAN"); RadianLineEdit->setEnabled(false); Q0RadianLineEdit = new QLineEdit; Q1RadianLineEdit = new QLineEdit; Q2RadianLineEdit = new QLineEdit; Q3RadianLineEdit = new QLineEdit; Q4RadianLineEdit = new QLineEdit; Q5RadianLineEdit = new QLineEdit; Q6RadianLineEdit = new QLineEdit; Q0DegreesLineEdit->setReadOnly(true); Q1DegreesLineEdit->setReadOnly(true); Q2DegreesLineEdit->setReadOnly(true); Q3DegreesLineEdit->setReadOnly(true); Q4DegreesLineEdit->setReadOnly(true); Q5DegreesLineEdit->setReadOnly(true); Q6DegreesLineEdit->setReadOnly(true); Q0RadianLineEdit->setReadOnly(true); Q1RadianLineEdit->setReadOnly(true); Q2RadianLineEdit->setReadOnly(true); Q3RadianLineEdit->setReadOnly(true); Q4RadianLineEdit->setReadOnly(true); Q5RadianLineEdit->setReadOnly(true); Q6RadianLineEdit->setReadOnly(true); saverPositionsCheckBox = new QCheckBox(tr("&Save interpolation positions")); saverPositionsCheckBox->setEnabled(false);//hide chooseFileCheckBox = new QCheckBox(tr("&Choose file to save interpolation positions")); chooseFileCheckBox->setEnabled(true);//show QHBoxLayout *saverPositionsLayout = new QHBoxLayout; saverPositionsLayout->addWidget(saverPositionsCheckBox); saverPositionsLayout->addWidget(chooseFileCheckBox); connect(saverPositionsCheckBox, SIGNAL(clicked()),this, SLOT(saverPositionsClicked())); connect(chooseFileCheckBox, SIGNAL(clicked()),this, SLOT(chooseFileClicked())); QHBoxLayout *TitleLayout = new QHBoxLayout; TitleLayout->addWidget(dofLabel); TitleLayout->addWidget(DegreesLineEdit); TitleLayout->addWidget(RadianLineEdit); QHBoxLayout *Q0Layout = new QHBoxLayout; Q0Layout->addWidget(Q0Label); Q0Layout->addWidget(Q0DegreesLineEdit); Q0Layout->addWidget(Q0RadianLineEdit); QHBoxLayout *Q1Layout = new QHBoxLayout; Q1Layout->addWidget(Q1Label); Q1Layout->addWidget(Q1DegreesLineEdit); Q1Layout->addWidget(Q1RadianLineEdit); QHBoxLayout *Q2Layout = new QHBoxLayout; Q2Layout->addWidget(Q2Label); Q2Layout->addWidget(Q2DegreesLineEdit); Q2Layout->addWidget(Q2RadianLineEdit); QHBoxLayout *Q3Layout = new QHBoxLayout; Q3Layout->addWidget(Q3Label); Q3Layout->addWidget(Q3DegreesLineEdit); Q3Layout->addWidget(Q3RadianLineEdit); QHBoxLayout *Q4Layout = new QHBoxLayout; Q4Layout->addWidget(Q4Label); Q4Layout->addWidget(Q4DegreesLineEdit); Q4Layout->addWidget(Q4RadianLineEdit); QHBoxLayout *Q5Layout = new QHBoxLayout; Q5Layout->addWidget(Q5Label); Q5Layout->addWidget(Q5DegreesLineEdit); Q5Layout->addWidget(Q5RadianLineEdit); QHBoxLayout *Q6Layout = new QHBoxLayout; Q6Layout->addWidget(Q6Label); Q6Layout->addWidget(Q6DegreesLineEdit); Q6Layout->addWidget(Q6RadianLineEdit); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(saverPositionsLayout); mainLayout->addLayout(TitleLayout); mainLayout->addLayout(Q0Layout); mainLayout->addLayout(Q1Layout); mainLayout->addLayout(Q2Layout); mainLayout->addLayout(Q3Layout); mainLayout->addLayout(Q4Layout); mainLayout->addLayout(Q5Layout); mainLayout->addLayout(Q6Layout); setLayout(mainLayout); setWindowTitle(tr("Save Interpolation Positions")); tableRobots[0] = world->robotVec[0];//Polycrank //tableRobots[1] = world->robotVec[1];//Hand QString name = "PolycrankSaver"; tableRobots[0]->setName(name); std::cout<<"PolycrankSaverDlg::PolycrankSaverDlg() = "<<tableRobots[0]->getName().toStdString()<<"\n"; QObject::connect(this, SIGNAL(rejected ()), this, SLOT(XClicked())); }
PolycrankPlayerDlg::PolycrankPlayerDlg(QWidget *parent, World *world) : QDialog(parent) { Q0Label = new QLabel(tr("Q1")); Q1Label = new QLabel(tr("Q2")); Q2Label = new QLabel(tr("Q3")); Q3Label = new QLabel(tr("Q4")); Q4Label = new QLabel(tr("Q5")); Q5Label = new QLabel(tr("Q6")); Q6Label = new QLabel(tr("Q7")); dofLabel = new QLabel(tr("Q ")); DegreesLineEdit = new QLineEdit; DegreesLineEdit->setText("DEGREES"); DegreesLineEdit->setEnabled(false); Q0DegreesLineEdit = new QLineEdit; Q1DegreesLineEdit = new QLineEdit; Q2DegreesLineEdit = new QLineEdit; Q3DegreesLineEdit = new QLineEdit; Q4DegreesLineEdit = new QLineEdit; Q5DegreesLineEdit = new QLineEdit; Q6DegreesLineEdit = new QLineEdit; RadianLineEdit = new QLineEdit; RadianLineEdit->setText("RADIAN"); RadianLineEdit->setEnabled(false); Q0RadianLineEdit = new QLineEdit; Q1RadianLineEdit = new QLineEdit; Q2RadianLineEdit = new QLineEdit; Q3RadianLineEdit = new QLineEdit; Q4RadianLineEdit = new QLineEdit; Q5RadianLineEdit = new QLineEdit; Q6RadianLineEdit = new QLineEdit; Q0DegreesLineEdit->setReadOnly(true); Q1DegreesLineEdit->setReadOnly(true); Q2DegreesLineEdit->setReadOnly(true); Q3DegreesLineEdit->setReadOnly(true); Q4DegreesLineEdit->setReadOnly(true); Q5DegreesLineEdit->setReadOnly(true); Q6DegreesLineEdit->setReadOnly(true); Q0RadianLineEdit->setReadOnly(true); Q1RadianLineEdit->setReadOnly(true); Q2RadianLineEdit->setReadOnly(true); Q3RadianLineEdit->setReadOnly(true); Q4RadianLineEdit->setReadOnly(true); Q5RadianLineEdit->setReadOnly(true); Q6RadianLineEdit->setReadOnly(true); playerForwardTrajectoryCheckBox = new QCheckBox(tr("&Play Forward Trajectory")); playerForwardTrajectoryCheckBox->setEnabled(false);//hide chooseFileCheckBox = new QCheckBox(tr("&Open Trajectory File")); chooseFileCheckBox->setEnabled(true);//show QHBoxLayout *playerForwardTrajectoryLayout = new QHBoxLayout; playerForwardTrajectoryLayout->addWidget(playerForwardTrajectoryCheckBox); playerForwardTrajectoryLayout->addWidget(chooseFileCheckBox); connect(playerForwardTrajectoryCheckBox, SIGNAL(clicked()),this, SLOT(playerForwardTrajectoryClicked())); connect(chooseFileCheckBox, SIGNAL(clicked()),this, SLOT(chooseFileClicked())); playerBackwardTrajectoryCheckBox = new QCheckBox(tr("&Play Backward Trajectory")); playerBackwardTrajectoryCheckBox->setEnabled(false);//hide spinBox = new QSpinBox; spinBox->setRange(1, 100); spinBox->setEnabled(true); slider = new QSlider(Qt::Horizontal); slider->setRange(1, 100); slider->setEnabled(true); freqLabel = new QLabel(tr("Frequency [Hz]")); QHBoxLayout *playerBackwardTrajectoryLayout = new QHBoxLayout; playerBackwardTrajectoryLayout->addWidget(playerBackwardTrajectoryCheckBox); playerBackwardTrajectoryLayout->addWidget(spinBox); playerBackwardTrajectoryLayout->addWidget(freqLabel); connect(playerBackwardTrajectoryCheckBox, SIGNAL(clicked()),this, SLOT(playerBackwardTrajectoryClicked())); QObject::connect(spinBox, SIGNAL(valueChanged(int)), spinBox, SLOT(setValue(int))); spinBox->setValue(50); QHBoxLayout *sliderLayout = new QHBoxLayout; sliderLayout->addWidget(slider); QObject::connect(slider, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); slider->setValue(0); slider->setEnabled(false); QHBoxLayout *TitleLayout = new QHBoxLayout; TitleLayout->addWidget(dofLabel); TitleLayout->addWidget(DegreesLineEdit); TitleLayout->addWidget(RadianLineEdit); QHBoxLayout *Q0Layout = new QHBoxLayout; Q0Layout->addWidget(Q0Label); Q0Layout->addWidget(Q0DegreesLineEdit); Q0Layout->addWidget(Q0RadianLineEdit); QHBoxLayout *Q1Layout = new QHBoxLayout; Q1Layout->addWidget(Q1Label); Q1Layout->addWidget(Q1DegreesLineEdit); Q1Layout->addWidget(Q1RadianLineEdit); QHBoxLayout *Q2Layout = new QHBoxLayout; Q2Layout->addWidget(Q2Label); Q2Layout->addWidget(Q2DegreesLineEdit); Q2Layout->addWidget(Q2RadianLineEdit); QHBoxLayout *Q3Layout = new QHBoxLayout; Q3Layout->addWidget(Q3Label); Q3Layout->addWidget(Q3DegreesLineEdit); Q3Layout->addWidget(Q3RadianLineEdit); QHBoxLayout *Q4Layout = new QHBoxLayout; Q4Layout->addWidget(Q4Label); Q4Layout->addWidget(Q4DegreesLineEdit); Q4Layout->addWidget(Q4RadianLineEdit); QHBoxLayout *Q5Layout = new QHBoxLayout; Q5Layout->addWidget(Q5Label); Q5Layout->addWidget(Q5DegreesLineEdit); Q5Layout->addWidget(Q5RadianLineEdit); QHBoxLayout *Q6Layout = new QHBoxLayout; Q6Layout->addWidget(Q6Label); Q6Layout->addWidget(Q6DegreesLineEdit); Q6Layout->addWidget(Q6RadianLineEdit); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(playerForwardTrajectoryLayout); mainLayout->addLayout(playerBackwardTrajectoryLayout); mainLayout->addLayout(sliderLayout); mainLayout->addLayout(TitleLayout); mainLayout->addLayout(Q0Layout); mainLayout->addLayout(Q1Layout); mainLayout->addLayout(Q2Layout); mainLayout->addLayout(Q3Layout); mainLayout->addLayout(Q4Layout); mainLayout->addLayout(Q5Layout); mainLayout->addLayout(Q6Layout); setLayout(mainLayout); setWindowTitle(tr("Play Trajectory")); tableRobots[0] = world->robotVec[0];//Polycrank //tableRobots[1] = world->robotVec[1];//Hand QString name = "PolycrankPlayer"; tableRobots[0]->setName(name); std::cout<<"PolycrankPlayerDlg::PolycrankPlayerDlg() = "<<tableRobots[0]->getName().toStdString()<<"\n"; QObject::connect(this, SIGNAL(rejected ()), this, SLOT(XClicked())); }