void UndoManager::redo(int steps) { if (!undoEnabled_) return; emit undoRedoBegin(); setUndoEnabled(false); stacks_[currentDoc_].redo(steps, currentUndoObjectId_); setUndoEnabled(true); emit redoSignal(steps); emit undoRedoDone(); setTexts(); }
void MainWindow::initialize() { //Initial Project Status m_bAllModifSaved = true; ui->actionPrevious->setDisabled(true); ui->actionNext->setDisabled(true); //History m_GlobalHistory = new History(HISTORY_LENGTH); //Insert all other element that needs to be connected to history here connect(m_GlobalHistory, SIGNAL(newElementInHistory()), this, SLOT(modificationUnsaved())); connect(m_GlobalHistory, SIGNAL(enableUndoButton(bool)), this, SLOT(enableUndo(bool))); connect(m_GlobalHistory, SIGNAL(enableRedoButton(bool)), this, SLOT(enableRedo(bool))); connect(this, SIGNAL(undoSignal()), m_GlobalHistory, SLOT(undo())); connect(this, SIGNAL(redoSignal()), m_GlobalHistory, SLOT(redo())); //Lights Available m_LightsAvailable = new LightsAvailable(PATH_TO_LIGHTS_AVAILABLE); if(m_LightsAvailable->getNumOfFixturesAvailable() < 0){ QMessageBox::warning(this, "Warning", tr("No Fixtures were found. \n")+ tr("Verify that the script \"") + PATH_TO_LIGHTS_AVAILABLE + tr("\" exits and that its syntax is correct.")); } else if(m_LightsAvailable->getNumOfFixturesAvailable() == 0){ QMessageBox::warning(this, "Warning", tr("No Fixtures are available.\n")+ tr("You can add some by editing the script located at \"") + PATH_TO_LIGHTS_AVAILABLE + tr("\".")); } else{ fixturesWindow.setLightsAvailable(m_LightsAvailable); groupsWindows.setLightsAvailable(m_LightsAvailable); fadersWindows.setLightsAvailable(m_LightsAvailable); timingWindows.setLightsAvailable(m_LightsAvailable); //Insert all other element that needs to know which lights are available here } fadersWindows.setSerialPort(&serialPortWindow); // Set access to faders fixturesWindow.setFaders(&fadersWindows); groupsWindows.setFaders(&fadersWindows); scenesWindows.setFaders(&fadersWindows); timingWindows.setFaders(&fadersWindows); //Insert all other element that needs to have access to faders here }
void MainWindow::on_actionNext_triggered() { m_bAllModifSaved = false; emit redoSignal(); }