PaletteController::PaletteController()
	: QObject(), m_currentLevelPalette(0), m_currentCleanupPalette(0), m_originalCurrentPalette(0), m_currentPalette(0), m_colorAutoApplyEnabled(true), m_colorSample()
{
	m_currentLevelPalette = new TPaletteHandle;
	m_currentCleanupPalette = new TPaletteHandle;
	m_currentPalette = new TPaletteHandle;

	QObject::connect(m_currentCleanupPalette, SIGNAL(paletteSwitched()), this, SLOT(editCleanupPalette()));
	QObject::connect(m_currentCleanupPalette, SIGNAL(colorStyleSwitched()), this, SLOT(editCleanupPalette()));

	QObject::connect(m_currentLevelPalette, SIGNAL(paletteSwitched()), this, SLOT(editLevelPalette()));
	QObject::connect(m_currentLevelPalette, SIGNAL(colorStyleSwitched()), this, SLOT(editLevelPalette()));
	//QObject::connect(m_currentLevelPalette, SIGNAL(colorStyleSwitched()), this, SLOT(setColorCheckIndex()));

	QObject::connect(m_currentLevelPalette, SIGNAL(paletteLockChanged()), this, SLOT(editLevelPalette()));
}
Beispiel #2
0
StudioPaletteViewerPanel::StudioPaletteViewerPanel(QWidget *parent)
    : TPanel(parent) {
  m_studioPaletteHandle = new TPaletteHandle();
  connect(m_studioPaletteHandle, SIGNAL(colorStyleSwitched()),
          SLOT(onColorStyleSwitched()));
  connect(m_studioPaletteHandle, SIGNAL(paletteSwitched()),
          SLOT(onPaletteSwitched()));

  connect(m_studioPaletteHandle, SIGNAL(paletteLockChanged()),
          SLOT(onPaletteSwitched()));

  TApp *app             = TApp::instance();
  m_studioPaletteViewer = new StudioPaletteViewer(
      this, m_studioPaletteHandle,
      app->getPaletteController()->getCurrentLevelPalette(),
      app->getCurrentFrame(), app->getCurrentXsheet(), app->getCurrentLevel());
  setWidget(m_studioPaletteViewer);
}