Ejemplo n.º 1
0
void EditorTool::setToolSettings(EditorToolSettings* const settings)
{
    d->settings = settings;
    d->settings->setToolIcon(toolIcon());
    d->settings->setToolName(toolName());

    connect(d->settings, SIGNAL(signalOkClicked()),
            this, SLOT(slotOk()));

    connect(d->settings, SIGNAL(signalCancelClicked()),
            this, SLOT(slotCancel()));

    connect(d->settings, SIGNAL(signalDefaultClicked()),
            this, SLOT(slotResetSettings()));

    connect(d->settings, SIGNAL(signalSaveAsClicked()),
            this, SLOT(slotSaveAsSettings()));

    connect(d->settings, SIGNAL(signalLoadClicked()),
            this, SLOT(slotLoadSettings()));

    connect(d->settings, SIGNAL(signalTryClicked()),
            this, SLOT(slotPreview()));

    connect(d->settings, SIGNAL(signalChannelChanged()),
            this, SLOT(slotChannelChanged()));

    connect(d->settings, SIGNAL(signalScaleChanged()),
            this, SLOT(slotScaleChanged()));

    // Will be unblocked in slotInit()
    // This will prevent signals emit during tool init.
    d->settings->blockSignals(true);
}
Ejemplo n.º 2
0
void HistogramBox::setChannel(ChannelType channel)
{
    int id = d->channelCB->findData(QVariant(channel));
    d->channelCB->setCurrentIndex(id);
    slotChannelChanged();
}
Ejemplo n.º 3
0
void SequenceEditor::setDevice(t_device_id id)
{
  Device* device = _app->doc()->device(id);
  assert(device);

  m_channels = device->deviceClass()->channels()->count();

  if (m_tempValues) delete [] m_tempValues;
  m_tempValues = new SceneValue[m_channels];

  QHBoxLayout* hbl = new QHBoxLayout(m_sliderContainer);

  ConsoleChannel* unit = NULL;
  for (t_channel ch = 0; ch < m_channels; ch++)
    {
      // Set current values to noset
      m_tempValues[ch].value = 0;
      m_tempValues[ch].type = Scene::NoSet;

      QString s;

      s.sprintf("%.3d", ch + 1);
      m_list->addColumn(s);

      unit = new ConsoleChannel(m_sliderContainer);
      unit->setDevice(id);
      unit->setChannel(ch);
      unit->setFadeStatusEnabled(false);
      m_unitList.append(unit);
      unit->update();
      
      // Channel updates to scene editor
      connect(unit, SIGNAL(changed(t_channel, t_value, Scene::ValueType)),
	      this, SLOT(slotChannelChanged(t_channel, t_value, 
					    Scene::ValueType)));

      connect(this, SIGNAL(sceneActivated(SceneValue*, t_channel)),
	      unit, SLOT(slotSceneActivated(SceneValue*, t_channel)));

      // Add the unit to the layout
      hbl->addWidget(unit);
      
      // Add a spacer between all consolechannel units
      // QT deletes spacers automagically
      QSpacerItem* sp = new QSpacerItem(m_list->header()->sectionSize(ch) 
					- 35, 0, QSizePolicy::Minimum);
      hbl->addItem(sp);
      m_spacerList.append(sp);
      
    }

  // Add a spacer that has the size of the listview's scrollbar
  QSpacerItem* sp = new QSpacerItem(m_list->verticalScrollBar()->width(), 
				    0, QSizePolicy::Fixed);
  hbl->addItem(sp);

  m_list->setResizeMode(QListView::AllColumns);
  m_list->setSorting(-1);

  m_sliderContainer->hide();
}
Ejemplo n.º 4
0
void FixtureConsole::setFixture(t_fixture_id id)
{
	unsigned int i = 0;
	Fixture* fxi = NULL;
	ConsoleChannel* unit = NULL;
	
	m_fixture = id;

	fxi = _app->doc()->fixture(m_fixture);
	assert(fxi);

	// Set an icon
	setIcon(QPixmap(PIXMAPS + QString("/console.png")));

	// Set the main horizontal layout
	m_layout = new QHBoxLayout(this);
	m_layout->setAutoAdd(true);

	// Create scene editor widget
	if (m_sceneEditor) delete m_sceneEditor;
	m_sceneEditor = new SceneEditor(this);
	m_sceneEditor->setFixture(m_fixture);
	m_sceneEditor->show();

	// Catch function add signals
	connect(_app->doc(), SIGNAL(functionAdded(t_function_id)),
		m_sceneEditor, SLOT(slotFunctionAdded(t_function_id)));

	// Catch function remove signals
	connect(_app->doc(), SIGNAL(functionRemoved(t_function_id)),
		m_sceneEditor, SLOT(slotFunctionRemoved(t_function_id)));

	// Catch function change signals
	connect(_app->doc(), SIGNAL(functionChanged(t_function_id)),
		m_sceneEditor, SLOT(slotFunctionChanged(t_function_id)));

	// Create channel units
	for (i = 0; i < fxi->channels(); i++)
	{
		unit = new ConsoleChannel(this, m_fixture, i);
		unit->init();
		unit->update();

		// Channel updates to scene editor
		connect(unit, 
			SIGNAL(changed(t_channel, t_value, Scene::ValueType)),
			m_sceneEditor,
			SLOT(slotChannelChanged(t_channel, t_value, Scene::ValueType)));

		// Scene editor updates to channels
		connect(m_sceneEditor,
			SIGNAL(sceneActivated(SceneValue*, t_channel)),
			unit, 
			SLOT(slotSceneActivated(SceneValue*, t_channel)));

		m_unitList.append(unit);
	}

	/* Resize the console to some sensible proportions if at least
	   one channel unit was inserted */
	if (unit != NULL)
		resize(m_sceneEditor->width() + 
		       (fxi->channels() * unit->width()), 250);

	// Update scene editor (also causes an update to channelunits)
	m_sceneEditor->update();
}