Exemplo n.º 1
0
void Filmstrip::hideEvent(QHideEvent *) {
  TApp *app                    = TApp::instance();
  TXshLevelHandle *levelHandle = app->getCurrentLevel();
  disconnect(levelHandle, SIGNAL(xshLevelSwitched(TXshLevel *)), this,
             SLOT(onLevelSwitched(TXshLevel *)));
  disconnect(levelHandle, SIGNAL(xshLevelChanged()), this,
             SLOT(onLevelChanged()));
  disconnect(TApp::instance()->getPaletteController()->getCurrentLevelPalette(),
             SIGNAL(colorStyleChangedOnMouseRelease()), this,
             SLOT(onLevelChanged()));

  disconnect(levelHandle, SIGNAL(xshLevelTitleChanged()), this,
             SLOT(onLevelChanged()));

  disconnect(m_frameArea->verticalScrollBar(), SIGNAL(valueChanged(int)), this,
             SLOT(onSliderMoved(int)));

  TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene();
  disconnect(sceneHandle, SIGNAL(sceneSwitched()), this,
             SLOT(updateChooseLevelComboItems()));
  disconnect(sceneHandle, SIGNAL(castChanged()), this,
             SLOT(updateChooseLevelComboItems()));

  disconnect(TApp::instance()->getCurrentXsheet(), SIGNAL(xsheetChanged()),
             this, SLOT(updateChooseLevelComboItems()));

  disconnect(TApp::instance()->getCurrentFrame(), SIGNAL(frameSwitched()), this,
             SLOT(onFrameSwitched()));
}
Exemplo n.º 2
0
void FilmstripFrames::showEvent(QShowEvent *) {
  TApp *app = TApp::instance();

  // cambiamenti al livello
  TXshLevelHandle *levelHandle = app->getCurrentLevel();
  connect(levelHandle, SIGNAL(xshLevelSwitched(TXshLevel *)), this,
          SLOT(onLevelSwitched(TXshLevel *)));
  connect(levelHandle, SIGNAL(xshLevelChanged()), this, SLOT(onLevelChanged()));
  connect(levelHandle, SIGNAL(xshLevelViewChanged()), this,
          SLOT(onLevelChanged()));

  // al frame corrente
  connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this,
          SLOT(onFrameSwitched()));
  connect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this,
          SLOT(update()));

  // iconcine
  connect(IconGenerator::instance(), SIGNAL(iconGenerated()), this,
          SLOT(update()));

  // onion skin
  connect(app->getCurrentOnionSkin(), SIGNAL(onionSkinMaskChanged()), this,
          SLOT(update()));

  // enable navigator link with the Viewer in the InknPaint page
  ComboViewerPanel *inknPaintViewerPanel = app->getInknPaintViewerPanel();
  if (inknPaintViewerPanel) {
    SceneViewer *viewer = inknPaintViewerPanel->getSceneViewer();
    if (viewer) {
      connect(viewer, SIGNAL(onZoomChanged()), this, SLOT(update()));
      connect(viewer, SIGNAL(refreshNavi()), this, SLOT(update()));
    }
  }
}
Exemplo n.º 3
0
void SchematicScenePanel::hideEvent(QHideEvent *e) {
  TApp *app = TApp::instance();
  disconnect(m_schematicViewer, SIGNAL(showPreview(TFxP)), this,
             SLOT(onShowPreview(TFxP)));
  disconnect(m_schematicViewer, SIGNAL(doCollapse(const QList<TFxP> &)), this,
             SLOT(onCollapse(const QList<TFxP> &)));
  disconnect(m_schematicViewer, SIGNAL(doCollapse(QList<TStageObjectId>)), this,
             SLOT(onCollapse(QList<TStageObjectId>)));
  disconnect(m_schematicViewer, SIGNAL(doExplodeChild(const QList<TFxP> &)),
             this, SLOT(onExplodeChild(const QList<TFxP> &)));
  disconnect(m_schematicViewer, SIGNAL(doExplodeChild(QList<TStageObjectId>)),
             this, SLOT(onExplodeChild(QList<TStageObjectId>)));
  disconnect(m_schematicViewer, SIGNAL(editObject()), this,
             SLOT(onEditObject()));
  disconnect(app->getCurrentLevel(), SIGNAL(xshLevelChanged()),
             m_schematicViewer, SLOT(updateScenes()));
  disconnect(app->getCurrentObject(), SIGNAL(objectSwitched()),
             m_schematicViewer, SLOT(updateScenes()));
  disconnect(app->getCurrentXsheet(), SIGNAL(xsheetSwitched()),
             m_schematicViewer, SLOT(updateSchematic()));
  disconnect(app->getCurrentXsheet(), SIGNAL(xsheetChanged()),
             m_schematicViewer, SLOT(updateSchematic()));
  disconnect(app->getCurrentScene(), SIGNAL(sceneSwitched()), m_schematicViewer,
             SLOT(onSceneSwitched()));
}
Exemplo n.º 4
0
void SchematicScenePanel::showEvent(QShowEvent *e) {
  if (m_schematicViewer->isStageSchematicViewed())
    setWindowTitle("Stage Schematic");
  else
    setWindowTitle("Fx Schematic");

  TApp *app = TApp::instance();
  connect(m_schematicViewer, SIGNAL(showPreview(TFxP)), this,
          SLOT(onShowPreview(TFxP)));
  connect(m_schematicViewer, SIGNAL(doCollapse(const QList<TFxP> &)), this,
          SLOT(onCollapse(const QList<TFxP> &)));
  connect(m_schematicViewer, SIGNAL(doCollapse(QList<TStageObjectId>)), this,
          SLOT(onCollapse(QList<TStageObjectId>)));
  connect(m_schematicViewer, SIGNAL(doExplodeChild(const QList<TFxP> &)), this,
          SLOT(onExplodeChild(const QList<TFxP> &)));
  connect(m_schematicViewer, SIGNAL(doExplodeChild(QList<TStageObjectId>)),
          this, SLOT(onExplodeChild(QList<TStageObjectId>)));
  connect(m_schematicViewer, SIGNAL(editObject()), this, SLOT(onEditObject()));
  connect(app->getCurrentLevel(), SIGNAL(xshLevelChanged()), m_schematicViewer,
          SLOT(updateScenes()));
  connect(app->getCurrentObject(), SIGNAL(objectSwitched()), m_schematicViewer,
          SLOT(updateScenes()));
  connect(app->getCurrentXsheet(), SIGNAL(xsheetSwitched()), m_schematicViewer,
          SLOT(updateSchematic()));
  connect(app->getCurrentXsheet(), SIGNAL(xsheetChanged()), m_schematicViewer,
          SLOT(updateSchematic()));
  connect(app->getCurrentScene(), SIGNAL(sceneSwitched()), m_schematicViewer,
          SLOT(onSceneSwitched()));
  m_schematicViewer->updateSchematic();
}
Exemplo n.º 5
0
void BinarizePopup::showEvent(QShowEvent *e)
{
	TApp *app = TApp::instance();

	TPixel32 col1, col2;
	Preferences::instance()->getChessboardColors(col1, col2);
	m_viewer->setBgColor(col1, col2);

	bool ret = true;
	ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this, SLOT(fetchSample()));
	ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(fetchSample()));
	ret = ret && connect(app->getCurrentColumn(), SIGNAL(columnIndexSwitched()), this, SLOT(fetchSample()));
	ret = ret && connect(app->getCurrentLevel(), SIGNAL(xshLevelSwitched(TXshLevel *)), this, SLOT(onLevelSwitched(TXshLevel *)));
	ret = ret && connect(app->getCurrentLevel(), SIGNAL(xshLevelChanged()), this, SLOT(fetchSample()));
	assert(ret);
	m_previewChk->setChecked(false);
	fetchSample();
}
Exemplo n.º 6
0
void Filmstrip::showEvent(QShowEvent *) {
  TApp *app                    = TApp::instance();
  TXshLevelHandle *levelHandle = app->getCurrentLevel();
  bool ret = connect(levelHandle, SIGNAL(xshLevelSwitched(TXshLevel *)),
                     SLOT(onLevelSwitched(TXshLevel *)));
  ret = ret &&
        connect(levelHandle, SIGNAL(xshLevelChanged()), SLOT(onLevelChanged()));

  // updateWindowTitle is called in the onLevelChanged
  ret = ret && connect(app->getPaletteController()->getCurrentLevelPalette(),
                       SIGNAL(colorStyleChangedOnMouseRelease()),
                       SLOT(onLevelChanged()));
  ret = ret && connect(levelHandle, SIGNAL(xshLevelTitleChanged()),
                       SLOT(onLevelChanged()));

  ret =
      ret && connect(m_frameArea->verticalScrollBar(),
                     SIGNAL(valueChanged(int)), this, SLOT(onSliderMoved(int)));

  TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene();
  ret = ret && connect(sceneHandle, SIGNAL(sceneSwitched()), this,
                       SLOT(updateChooseLevelComboItems()));
  ret = ret && connect(sceneHandle, SIGNAL(castChanged()), this,
                       SLOT(updateChooseLevelComboItems()));

  ret = ret &&
        connect(TApp::instance()->getCurrentXsheet(), SIGNAL(xsheetChanged()),
                this, SLOT(updateChooseLevelComboItems()));

  ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this,
                       SLOT(onFrameSwitched()));

  assert(ret);

  updateChooseLevelComboItems();
  onFrameSwitched();
  onLevelSwitched(0);
}
Exemplo n.º 7
0
TApp::TApp()
    : m_currentScene(0)
    , m_currentXsheet(0)
    , m_currentFrame(0)
    , m_currentColumn(0)
    , m_currentLevel(0)
    , m_currentTool(0)
    , m_currentObject(0)
    , m_currentSelection(0)
    , m_currentOnionSkinMask(0)
    , m_currentFx(0)
    , m_mainWindow(0)
    , m_autosaveTimer(0)
    , m_autosaveSuspended(false)
    , m_isStarting(false)
    , m_isPenCloseToTablet(false) {
  m_currentScene         = new TSceneHandle();
  m_currentXsheet        = new TXsheetHandle();
  m_currentFrame         = new TFrameHandle();
  m_currentColumn        = new TColumnHandle();
  m_currentLevel         = new TXshLevelHandle();
  m_currentTool          = new ToolHandle();
  m_currentObject        = new TObjectHandle();
  m_currentOnionSkinMask = new TOnionSkinMaskHandle();
  m_currentFx            = new TFxHandle();
  m_currentSelection     = TSelectionHandle::getCurrent();

  m_paletteController = new PaletteController();

  bool ret = true;

  ret = ret && QObject::connect(m_currentXsheet, SIGNAL(xsheetChanged()), this,
                                SLOT(onXsheetChanged()));

  ret = ret && QObject::connect(m_currentXsheet, SIGNAL(xsheetSoundChanged()),
                                this, SLOT(onXsheetSoundChanged()));

  ret = ret && QObject::connect(m_currentScene, SIGNAL(sceneSwitched()), this,
                                SLOT(onSceneSwitched()));

  ret = ret && QObject::connect(m_currentScene, SIGNAL(sceneChanged()), this,
                                SLOT(onSceneChanged()));

  ret = ret && QObject::connect(m_currentXsheet, SIGNAL(xsheetSwitched()), this,
                                SLOT(onXsheetSwitched()));

  ret = ret && QObject::connect(m_currentFrame, SIGNAL(frameSwitched()), this,
                                SLOT(onFrameSwitched()));

  ret = ret && QObject::connect(m_currentFrame, SIGNAL(frameSwitched()), this,
                                SLOT(onImageChanged()));

  ret = ret && QObject::connect(m_currentFx, SIGNAL(fxSwitched()), this,
                                SLOT(onFxSwitched()));

  ret = ret && QObject::connect(m_currentColumn, SIGNAL(columnIndexSwitched()),
                                this, SLOT(onColumnIndexSwitched()));

  ret = ret && QObject::connect(m_currentColumn, SIGNAL(columnIndexSwitched()),
                                this, SLOT(onImageChanged()));

  ret = ret &&
        QObject::connect(m_currentLevel, SIGNAL(xshLevelSwitched(TXshLevel *)),
                         this, SLOT(onImageChanged()));

  ret = ret &&
        QObject::connect(m_currentLevel, SIGNAL(xshLevelSwitched(TXshLevel *)),
                         this, SLOT(onXshLevelSwitched(TXshLevel *)));

  ret = ret && QObject::connect(m_currentLevel, SIGNAL(xshLevelChanged()), this,
                                SLOT(onXshLevelChanged()));

  ret = ret && QObject::connect(m_currentObject, SIGNAL(objectSwitched()), this,
                                SLOT(onObjectSwitched()));

  ret = ret && QObject::connect(m_currentObject, SIGNAL(splineChanged()), this,
                                SLOT(onSplineChanged()));

  ret = ret && QObject::connect(m_paletteController->getCurrentLevelPalette(),
                                SIGNAL(paletteChanged()), this,
                                SLOT(onPaletteChanged()));

  ret = ret && QObject::connect(m_paletteController->getCurrentLevelPalette(),
                                SIGNAL(colorStyleSwitched()), this,
                                SLOT(onLevelColorStyleSwitched()));

  ret = ret && QObject::connect(m_paletteController->getCurrentLevelPalette(),
                                SIGNAL(colorStyleChangedOnMouseRelease()), this,
                                SLOT(onLevelColorStyleChanged()));

  ret = ret && QObject::connect(m_paletteController->getCurrentCleanupPalette(),
                                SIGNAL(paletteChanged()), m_currentScene,
                                SIGNAL(sceneChanged()));

  TMeasureManager::instance()->addCameraMeasures(getCurrentCameraSize);

  m_autosaveTimer = new QTimer(this);
  ret             = ret &&
        connect(m_autosaveTimer, SIGNAL(timeout()), this, SLOT(autosave()));

  Preferences *preferences = Preferences::instance();

  if (preferences->isRasterOptimizedMemory()) {
    if (!TBigMemoryManager::instance()->init(
            (int)(/*15*1024*/ TSystem::getFreeMemorySize(true) * .8)))
      DVGui::warning(tr("Error allocating memory: not enough memory."));
  }
  ret = ret &&
        connect(preferences, SIGNAL(stopAutoSave()), SLOT(onStopAutoSave()));
  ret = ret &&
        connect(preferences, SIGNAL(startAutoSave()), SLOT(onStartAutoSave()));
  ret = ret && connect(m_currentTool, SIGNAL(toolEditingFinished()),
                       SLOT(onToolEditingFinished()));

  if (preferences->isAutosaveEnabled())
    m_autosaveTimer->start(preferences->getAutosavePeriod() * 1000 * 60);

  UnitParameters::setCurrentDpiGetter(getCurrentDpi);
  assert(ret);
}