From e841358fe703b5d76007c756fbcc6115e6a04954 Mon Sep 17 00:00:00 2001 From: baydam Date: Sat, 10 Sep 2016 21:03:22 +0000 Subject: [PATCH] Update "Undo stack" to "Undo history" --- MM.h | 2 +- MainWindow.cpp | 40 ++++++++++++++++++++-------------------- MainWindow.h | 6 +++--- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/MM.h b/MM.h index 4c02a06..85e83cb 100644 --- a/MM.h +++ b/MM.h @@ -77,7 +77,7 @@ public: static const bool DISPLAY_OUTPUT_WINDOW = false; static const bool DISPLAY_CONTROLS = true; static const bool DISPLAY_ALL_CONTROLS = true; - static const bool DISPLAY_UNDO_STACK = false; + static const bool DISPLAY_UNDO_HISTORY = false; static const bool DISPLAY_ZOOM_TOOLBAR = true; static const bool DISPLAY_MENU_BAR = true; static const bool STICKY_VERTICES = true; diff --git a/MainWindow.cpp b/MainWindow.cpp index 91eff3f..a51849f 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -712,7 +712,7 @@ void MainWindow::updateStatusBar() currentMessageLabel->setText(statusBar()->currentMessage()); sourceZoomLabel->setText("Source: " + QString::number(int(sourceCanvas->getZoomFactor() * 100)).append(QChar('%'))); destinationZoomLabel->setText("Destination: " + QString::number(int(destinationCanvas->getZoomFactor() * 100)).append(QChar('%'))); - undoLabel->setText(undoStack->text(undoStack->count() - 1)); + lastActionLabel->setText(undoStack->text(undoStack->count() - 1)); } void MainWindow::showMenuBar(bool shown) @@ -1812,15 +1812,15 @@ void MainWindow::createActions() connect(displayTestSignalAction, SIGNAL(toggled(bool)), outputWindow, SLOT(setDisplayTestSignal(bool))); // connect(displayTestSignalAction, SIGNAL(toggled(bool)), this, SLOT(update())); - // Toggle display of Undo Stack - displayUndoStackAction = new QAction(tr("Display &Undo Stack"), this); - displayUndoStackAction->setShortcut(Qt::ALT + Qt::Key_U); - displayUndoStackAction->setCheckable(true); - displayUndoStackAction->setChecked(_displayUndoStack); - displayUndoStackAction->setShortcutContext(Qt::ApplicationShortcut); - addAction(displayUndoStackAction); - // Manage show/hide of Undo Stack - connect(displayUndoStackAction, SIGNAL(toggled(bool)), this, SLOT(displayUndoStack(bool))); + // Toggle display of Undo History + displayUndoHistoryAction = new QAction(tr("Display &Undo History"), this); + displayUndoHistoryAction->setShortcut(Qt::ALT + Qt::Key_U); + displayUndoHistoryAction->setCheckable(true); + displayUndoHistoryAction->setChecked(_displayUndoStack); + displayUndoHistoryAction->setShortcutContext(Qt::ApplicationShortcut); + addAction(displayUndoHistoryAction); + // Manage show/hide of Undo History + connect(displayUndoHistoryAction, SIGNAL(toggled(bool)), this, SLOT(displayUndoHistory(bool))); // Toggle display of Console output openConsoleAction = new QAction(tr("Open Conso&le"), this); @@ -1991,7 +1991,7 @@ void MainWindow::createMenus() #ifdef Q_OS_WIN32 toolBarsMenu->addAction(showMenuBarAction); #endif - windowMenu->addAction(displayUndoStackAction); + windowMenu->addAction(displayUndoHistoryAction); windowMenu->addAction(displayZoomToolAction); windowMenu->addSeparator(); // Perspectives @@ -2107,10 +2107,10 @@ void MainWindow::createStatusBar() sourceZoomLabel = new QLabel(statusBar()); sourceZoomLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); sourceZoomLabel->setContentsMargins(2, 0, 0, 0); - // Undoview statut - undoLabel = new QLabel(statusBar()); - undoLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); - undoLabel->setContentsMargins(2, 0, 0, 0); + // last action taking statut + lastActionLabel = new QLabel(statusBar()); + lastActionLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); + lastActionLabel->setContentsMargins(2, 0, 0, 0); // Standard message currentMessageLabel = new QLabel(statusBar()); currentMessageLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); @@ -2126,7 +2126,7 @@ void MainWindow::createStatusBar() // Add permanently into the statut bar statusBar()->addPermanentWidget(currentMessageLabel, 5); - statusBar()->addPermanentWidget(undoLabel, 4); + statusBar()->addPermanentWidget(lastActionLabel, 4); statusBar()->addPermanentWidget(mousePosLabel, 3); statusBar()->addPermanentWidget(sourceZoomLabel, 1); statusBar()->addPermanentWidget(destinationZoomLabel, 1); @@ -2163,7 +2163,7 @@ void MainWindow::readSettings() updateRecentVideoActions(); // new in 0.3.2 - displayUndoStackAction->setChecked(settings.value("displayUndoStack", MM::DISPLAY_UNDO_STACK).toBool()); + displayUndoHistoryAction->setChecked(settings.value("displayUndoStack", MM::DISPLAY_UNDO_HISTORY).toBool()); displayZoomToolAction->setChecked(settings.value("zoomToolBar", MM::DISPLAY_ZOOM_TOOLBAR).toBool()); showMenuBarAction->setChecked(settings.value("showMenuBar", MM::DISPLAY_MENU_BAR).toBool()); @@ -2192,7 +2192,7 @@ void MainWindow::writeSettings() settings.setValue("displayControls", displayControlsAction->isChecked()); settings.setValue("displayAllControls", displayPaintControlsAction->isChecked()); settings.setValue("oscListeningPort", oscListeningPort); - settings.setValue("displayUndoStack", displayUndoStackAction->isChecked()); + settings.setValue("displayUndoStack", displayUndoHistoryAction->isChecked()); settings.setValue("zoomToolBar", displayZoomToolAction->isChecked()); settings.setValue("showMenuBar", showMenuBarAction->isChecked()); settings.setValue("stickyVertices", stickyVerticesAction->isChecked()); @@ -2934,7 +2934,7 @@ void MainWindow::enableDisplayPaintControls(bool display) updateCanvases(); } -void MainWindow::displayUndoStack(bool display) +void MainWindow::displayUndoHistory(bool display) { _displayUndoStack = display; @@ -2942,7 +2942,7 @@ void MainWindow::displayUndoStack(bool display) undoView = new QUndoView(getUndoStack(), this); if (display) { - contentTab->addTab(undoView, tr("Undo stack")); + contentTab->addTab(undoView, tr("Undo history")); } else { contentTab->removeTab(2); } diff --git a/MainWindow.h b/MainWindow.h index 36276f9..07ea959 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -236,7 +236,7 @@ public slots: void enableDisplayControls(bool display); void enableDisplayPaintControls(bool display); void enableStickyVertices(bool display); - void displayUndoStack(bool display); + void displayUndoHistory(bool display); // Show Mapping Context Menu void showMappingContextMenu(const QPoint &point); @@ -393,7 +393,7 @@ private: QAction *displayPaintControlsAction; QAction *displayTestSignalAction; QAction *stickyVerticesAction; - QAction *displayUndoStackAction; + QAction *displayUndoHistoryAction; QAction *displayZoomToolAction; QAction *openConsoleAction; QAction *showMenuBarAction; @@ -517,7 +517,7 @@ private: // Labels for status bar QLabel *destinationZoomLabel; QLabel *sourceZoomLabel; - QLabel *undoLabel; + QLabel *lastActionLabel; QLabel *currentMessageLabel; QLabel *mousePosLabel; QLabel *trueFramesPerSecondsLabel;