예제 #1
0
EditToolBar::EditToolBar(QWidget *parent) :
    QDialog(parent)
{
    //configure u
    ui.setupUi(this);

    //no search made yet
    searchMade = false;

    //icons size - copied from kedittoolbar class, in kdelibs
    iconSize = this->style()->pixelMetric(QStyle::PM_SmallIconSize);

    //separator item
    separatorItem = new QListWidgetItem(QString("--- %1 ---").arg(tr("Separator")));
    separatorItem->setData(32, "_separator");

    //setup icons
    ui.okButton->setIcon(QIcon::fromTheme("dialog-ok"));
    ui.applyButton->setIcon(QIcon::fromTheme("dialog-ok-apply"));
    ui.cancelButton->setIcon(QIcon::fromTheme("dialog-cancel"));
    ui.clearButton1->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl"));
    ui.clearButton2->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl"));
    ui.addButton->setIcon(QIcon::fromTheme("go-next"));
    ui.removeButton->setIcon(QIcon::fromTheme("go-previous"));
    ui.moveDownButton->setIcon(QIcon::fromTheme("go-down"));
    ui.moveUpButton->setIcon(QIcon::fromTheme("go-up"));
    ui.setDefaultsButton->setIcon(QIcon::fromTheme("document-revert"));

    //connections
    connect(this, SIGNAL(actionsListChanged()), this, SLOT(updateButtons()));
    connect(ui.currentActions, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
    connect(ui.availableActions, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
    connect(this, SIGNAL(actionsListChanged()), this, SLOT(actionsChangedSlot()));
    connect(ui.okButton, SIGNAL(clicked()), this, SLOT(okSlot()));
    connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applySlot()));
    connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addAction()));
    connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeAction()));
    connect(ui.moveDownButton, SIGNAL(clicked()), this, SLOT(moveDownAction()));
    connect(ui.moveUpButton, SIGNAL(clicked()), this, SLOT(moveUpAction()));
    connect(ui.currentFilter, SIGNAL(textChanged(QString)), this, SLOT(searchInCurrentActionsSlot(QString)));
    connect(ui.availableFilter, SIGNAL(textChanged(QString)), this, SLOT(searchInAvailableActionsSlot(QString)));
    connect(ui.setDefaultsButton, SIGNAL(clicked()), this, SLOT(setDefaults()));

    this->setWindowTitle(tr("Configure toolbar"));
}
예제 #2
0
void MainWindow::createActions()
{

	connect(m_ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAbout()));
	connect(m_ui->actionDocumentation, SIGNAL(triggered()), this, SLOT(showDocumentation()));
	connect(m_ui->actionExport, SIGNAL(triggered()), this, SLOT(exportToKME()));
	connect(m_ui->actionGraph, SIGNAL(triggered()), this, SLOT(viewGraph()));
	connect(m_ui->actionJoints, SIGNAL(triggered()), this, SLOT(viewJoints()));
	connect(m_ui->actionNao_Academics, SIGNAL(triggered()), this, SLOT(setNaoAcademics()));
	connect(m_ui->actionNao_RC_Edition, SIGNAL(triggered()), this, SLOT(setNaoRC()));
	connect(m_ui->actionNew, SIGNAL(triggered()), this, SLOT(newFile()));
	connect(m_ui->actionOpen, SIGNAL(triggered()), this, SLOT(openFile()));
	connect(m_ui->actionOpen_Robot, SIGNAL(triggered()), this, SLOT(loadNewRobot()));
	connect(m_ui->actionQuit, SIGNAL(triggered()), this, SLOT(close()));

	connect(dlg, SIGNAL(slidersClosed(bool)),m_ui->actionJoints, SLOT(setChecked(bool)));
	connect(m_ui->poseEditor, SIGNAL(cellChanged(int, int)), this, SLOT(somethingChanged()));

	//Pose Editor
	connect(m_ui->moveUpPoseButton, SIGNAL(clicked()), this, SLOT(moveUpAction()));
	connect(m_ui->moveDownPoseButton, SIGNAL(clicked()), this, SLOT(moveDownAction()));
	connect(m_ui->swapPoseButton, SIGNAL(clicked()), this, SLOT(swapAction()));
	connect(m_ui->removePoseButton, SIGNAL(clicked()), this, SLOT(removeAction()));
	connect(m_ui->storePoseButton, SIGNAL(clicked()), this, SLOT(storePoseAction()));
	connect(m_ui->insertPoseButton, SIGNAL(clicked()), this, SLOT(insertPoseAction()));

	//Play Motion
	connect(m_ui->gotoPoseButton, SIGNAL(clicked()), this, SLOT(gotoPoseAction()));
	connect(m_ui->stepPoseButton, SIGNAL(clicked()), this, SLOT(stepPoseAction()));
	connect(m_ui->playMotionButton, SIGNAL(clicked()), this, SLOT(playMotionAction()));
	connect(m_ui->stiffOn, SIGNAL(clicked()), this, SLOT(stiffOnAction()));
	connect(m_ui->stiffOff, SIGNAL(clicked()), this, SLOT(stiffOffAction()));

	//Networking
	connect(m_ui->connectButton, SIGNAL(clicked()), this, SLOT(connectAction()));

	//Sliders
	connect(dlg->jointsUI, SIGNAL(poseChanged()), this, SLOT(sendPose()));

}