예제 #1
0
    void SelectionController::
            setupGui()
    {
        Ui::SaweMainWindow* main = _model->project()->mainWindow();
        Ui::MainWindow* ui = main->getItems();

        //connect(ui->actionActionAdd_selection, SIGNAL(triggered()), SLOT(receiveAddSelection()));
        connect(ui->actionActionRemove_selection, SIGNAL(triggered()), SLOT(receiveAddClearSelection()));
        connect(ui->actionCropSelection, SIGNAL(triggered()), SLOT(receiveCropSelection()));
        //connect(ui->actionMoveSelection, SIGNAL(toggled(bool)), SLOT(receiveMoveSelection(bool)));
        //connect(ui->actionMoveSelectionTime, SIGNAL(toggled(bool)), SLOT(receiveMoveSelectionInTime(bool)));

        ui->actionActionAdd_selection->setEnabled( false );
        ui->actionActionRemove_selection->setEnabled( true );
        ui->actionCropSelection->setEnabled( true );
        ui->actionMoveSelection->setEnabled( false );
        ui->actionMoveSelectionTime->setEnabled( false );

        Support::ToolBar* toolBarTool = new Support::ToolBar(main);
        toolBarTool->setObjectName(QString::fromUtf8("toolBarSelectionController"));
        toolBarTool->setEnabled(true);
        toolBarTool->setContextMenuPolicy(Qt::NoContextMenu);
        toolBarTool->setToolButtonStyle(Qt::ToolButtonIconOnly);
        main->addToolBar(Qt::TopToolBarArea, toolBarTool);

        connect(ui->actionToggleSelectionToolBox, SIGNAL(toggled(bool)), toolBarTool, SLOT(setVisible(bool)));
        connect(toolBarTool, SIGNAL(visibleChanged(bool)), ui->actionToggleSelectionToolBox, SLOT(setChecked(bool)));

        selectionComboBox_ = new Ui::ComboBoxAction();
        toolBarTool->addWidget( selectionComboBox_ );
        toolBarTool->addAction( ui->actionActionRemove_selection );
        toolBarTool->addAction( ui->actionCropSelection );
        toolBarTool->setVisible( true );

        connect(_model, SIGNAL(selectionChanged()), SLOT(onSelectionChanged()));
        //connect(_model->project()->head.get(), SIGNAL(headChanged()), SLOT(tryHeadAsSelection()));
        connect(selectionComboBox_, SIGNAL(toggled(bool)), SLOT(selectionComboBoxToggled()));
        connect(this, SIGNAL(enabledChanged(bool)), selectionComboBox_, SLOT(setChecked(bool)));

        deselect_action_ = new QAction(this);
        connect(deselect_action_, SIGNAL(triggered()), SLOT(deselect()));
        deselect_action_->setShortcut(Qt::Key_Escape);
        addAction(deselect_action_);


        setCurrentSelection(Signal::OperationDesc::ptr());

        toolfactory();

        renderview_tool_selector->default_tool = this;

#ifdef TARGET_hast
        ui->actionActionRemove_selection->setVisible(false);
        ui->actionCropSelection->setVisible(false);
#endif

    }
예제 #2
0
HarmonicsInfoForm::HarmonicsInfoForm(
        Sawe::Project*project,
        TooltipController* harmonicscontroller,
        RenderView* render_view)
            :
    ui(new Ui::HarmonicsInfoForm),
    project(project),
    harmonicscontroller(harmonicscontroller),
    render_view(render_view),
    rebuilding(0)
{
    ui->setupUi(this);

    Ui::SaweMainWindow* MainWindow = project->mainWindow();
    dock = new QDockWidget(MainWindow);
    dock->setObjectName(QString::fromUtf8("dockWidgetHarmonicsInfoForm"));
    dock->setMinimumSize(QSize(42, 79));
    dock->setMaximumSize(QSize(524287, 524287));
    dock->resize(123, 150);
    dock->setContextMenuPolicy(Qt::NoContextMenu);
    dock->setFeatures(QDockWidget::AllDockWidgetFeatures);
    dock->setAllowedAreas(Qt::AllDockWidgetAreas);
    dock->setEnabled(true);
    dock->setWidget(this);
    dock->setWindowTitle("Harmonics info");

    deleteRow = new QAction( this );
    deleteRow->setText("Delete row");
    ui->tableWidget->addAction(deleteRow);
    ui->tableWidget->setContextMenuPolicy( Qt::ActionsContextMenu );
    connect(deleteRow, SIGNAL(triggered()), SLOT(deleteCurrentRow()));

    actionHarmonics_info = new QAction( this );
    actionHarmonics_info->setObjectName("actionHarmonics_info");
    actionHarmonics_info->setText("Harmonics info");
    actionHarmonics_info->setCheckable( true );
    actionHarmonics_info->setChecked( true );

    MainWindow->getItems()->menu_Windows->addAction( actionHarmonics_info );

    connect(actionHarmonics_info, SIGNAL(toggled(bool)), dock, SLOT(setVisible(bool)));
    connect(actionHarmonics_info, SIGNAL(triggered()), dock, SLOT(raise()));
    connect(dock, SIGNAL(visibilityChanged(bool)), SLOT(checkVisibility(bool)));

    connect(harmonicscontroller, SIGNAL(tooltipChanged()), SLOT(harmonicsChanged()));
    connect(ui->tableWidget, SIGNAL(currentCellChanged(int,int,int,int)), SLOT(currentCellChanged()));

    harmonicsChanged();

    dock->setVisible( false );
    actionHarmonics_info->setChecked( false );
}
예제 #3
0
    void SelectionController::
            setCurrentSelectionCommand( Signal::OperationDesc::ptr selection )
    {
        _model->set_current_selection( selection );

        bool enabled_actions = (bool)selection;

        Ui::SaweMainWindow* main = _model->project()->mainWindow();
        Ui::MainWindow* ui = main->getItems();

        //ui->actionActionAdd_selection->setEnabled( enabled_actions );
        ui->actionActionRemove_selection->setEnabled( enabled_actions );
        ui->actionCropSelection->setEnabled( enabled_actions );
    }
void PlaybackMarkersController::
        setupGui()
{
    Ui::SaweMainWindow* main = render_view_->model->project()->mainWindow();
    Ui::MainWindow* ui = main->getItems();

    // Connect enabled/disable actions,
    connect(ui->actionSetPlayMarker, SIGNAL(toggled(bool)), SLOT(enableMarkerTool(bool)));
    connect(this, SIGNAL(enabledChanged(bool)), ui->actionSetPlayMarker, SLOT(setChecked(bool)));
    connect(ui->actionJumpForward, SIGNAL(triggered()), SLOT(receiveNextMarker()));
    connect(ui->actionJumpBackward, SIGNAL(triggered()), SLOT(receivePreviousMarker()));


    // Close this widget before the OpenGL context is destroyed to perform
    // proper cleanup of resources
    connect(render_view_, SIGNAL(destroying()), SLOT(close()));
}