Exemplo n.º 1
0
void 
pcl::modeler::MainWindow::connectFileMenuActions()
{
  connect(this->ui_->actionOpenPointCloud, SIGNAL(triggered()), this, SLOT(slotOpenPointCloud()));
  connect(this->ui_->actionImportPointCloud, SIGNAL(triggered()), this, SLOT(slotImportPointCloud()));
  connect(this->ui_->actionSavePointCloud, SIGNAL(triggered()), this, SLOT(slotSavePointCloud()));
  connect(this->ui_->actionClosePointCloud, SIGNAL(triggered()), this, SLOT(slotClosePointCloud()));
  createRecentPointCloudActions();

  connect(this->ui_->actionOpenProject, SIGNAL(triggered()), this, SLOT(slotOpenProject()));
  connect(this->ui_->actionSaveProject, SIGNAL(triggered()), this, SLOT(slotSaveProject()));
  connect(this->ui_->actionCloseProject, SIGNAL(triggered()), this, SLOT(slotCloseProject()));
  createRecentProjectActions();

  connect(this->ui_->actionExit, SIGNAL(triggered()), this, SLOT(slotExit()));
}
Exemplo n.º 2
0
/*! Constructor
 * \brief This class implements the project management
 *
 * This also handles the mouse and keyboad events, and sends
 * when appropiate, the file names to be opened by the parent.
 *
 * \param parent Parent of the widget.
 */
Project::Project(QWidget *parent) : QWidget(parent)
{
    projectLibrary = 0;
    m_libraryFileName = "";
    m_libraryName = "";

    QVBoxLayout *layout = new QVBoxLayout(this);

    QToolBar *toolbar = new QToolBar;

    QToolButton *projNew = new QToolButton();
    projNew->setIcon(QIcon(Qucs::bitmapDirectory() + "project-new.png"));
    projNew->setStatusTip(tr("Creates a new project"));
    projNew->setToolTip(tr("Creates a new project"));
    projNew->setWhatsThis(tr("New Project\n\nCreates a new project"));

    QToolButton *projOpen = new QToolButton();
    projOpen->setIcon(QIcon(Qucs::bitmapDirectory() + "fileopen.png"));
    projOpen->setStatusTip(tr("Opens an existing project"));
    projOpen->setToolTip(tr("Opens an existing project"));
    projOpen->setWhatsThis(tr("Open Project\n\nOpens an existing project"));

    QToolButton *addToProj = new QToolButton();
    addToProj->setIcon(QIcon(Qucs::bitmapDirectory() + "filenew.png"));
    addToProj->setStatusTip(tr("Adds a file to current project"));
    addToProj->setToolTip(tr("Adds a file to current project"));
    addToProj->setWhatsThis(tr("Add File to Project\n\nAdds a file to current project"));

    QToolButton *projDel = new QToolButton();
    projDel->setIcon(QIcon(Qucs::bitmapDirectory() + "fileclose.png"));
    projDel->setStatusTip(tr("Removes a file from current project"));
    projDel->setToolTip(tr("Removes a file from current project"));
    projDel->setWhatsThis(tr("Remove from Project\n\nRemoves a file from current project"));

    QToolButton *projClose = new QToolButton();
    projClose->setIcon(QIcon(Qucs::bitmapDirectory() + "project-close.png"));
    projClose->setStatusTip(tr("Closes the current project"));
    projClose->setToolTip(tr("Closes the current project"));
    projClose->setWhatsThis(tr("Close Project\n\nCloses the current project"));

    connect(projNew, SIGNAL(clicked()), this, SLOT(slotNewProject()));
    connect(projOpen, SIGNAL(clicked()), this, SLOT(slotOpenProject()));
    connect(addToProj, SIGNAL(clicked()), this, SLOT(slotAddToProject()));
    connect(projDel, SIGNAL(clicked()), this, SLOT(slotRemoveFromProject()));
    connect(projClose, SIGNAL(clicked()), this, SLOT(slotCloseProject()));

    toolbar->addWidget(projNew);
    toolbar->addWidget(projOpen);
    toolbar->addWidget(addToProj);
    toolbar->addWidget(projDel);
    toolbar->addWidget(projClose);

    m_projectsSidebar = new ComponentsSidebar(this);
    connect(m_projectsSidebar, SIGNAL(itemClicked(const QString&, const QString&)), this,
            SLOT(slotOnClicked(const QString&, const QString&)));
    connect(m_projectsSidebar, SIGNAL(itemDoubleClicked(const QString&, const QString&)), this,
            SLOT(slotOnDoubleClicked(const QString&, const QString&)));


    layout->addWidget(toolbar);
    layout->addWidget(m_projectsSidebar);

    setWindowTitle(tr("Project View"));
}