void DkPaintViewPort::init() { panning = false; cancelTriggered = false; isOutside = false; defaultCursor = Qt::CrossCursor; setCursor(defaultCursor); pen = QColor(0,0,0); pen.setCapStyle(Qt::RoundCap); pen.setJoinStyle(Qt::RoundJoin); pen.setWidth(1); paintToolbar = new DkPaintToolBar(tr("Paint Toolbar"), this); connect(paintToolbar, SIGNAL(colorSignal(QColor)), this, SLOT(setPenColor(QColor)), Qt::UniqueConnection); connect(paintToolbar, SIGNAL(widthSignal(int)), this, SLOT(setPenWidth(int)), Qt::UniqueConnection); connect(paintToolbar, SIGNAL(panSignal(bool)), this, SLOT(setPanning(bool)), Qt::UniqueConnection); connect(paintToolbar, SIGNAL(cancelSignal()), this, SLOT(discardChangesAndClose()), Qt::UniqueConnection); connect(paintToolbar, SIGNAL(undoSignal()), this, SLOT(undoLastPaint()), Qt::UniqueConnection); connect(paintToolbar, SIGNAL(applySignal()), this, SLOT(applyChangesAndClose()), Qt::UniqueConnection); loadSettings(); paintToolbar->setPenColor(pen.color()); paintToolbar->setPenWidth(pen.width()); }
void UndoManager::undo(int steps) { if (!undoEnabled_) return; emit undoRedoBegin(); setUndoEnabled(false); stacks_[currentDoc_].undo(steps, currentUndoObjectId_); setUndoEnabled(true); emit undoSignal(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 }
/* Menu Edit */ void MainWindow::on_actionPrevious_triggered() { m_bAllModifSaved = false; emit undoSignal(); }
void DkPaintToolBar::on_undoAction_triggered() { emit undoSignal(); }