Commit 3975092a authored by Allison Vacanti's avatar Allison Vacanti Committed by Kitware Robot
Browse files

Merge topic 'add-reset-to-toolbar'

33b8f711 Update Reset Server icon.
7c7bdd2f Add shortcut to new Reset Server functionality.
3296a51a

 add reset session to main toolbar
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: default avatarDavid E. DeMarle <dave.demarle@kitware.com>
Merge-request: !2072
parents fcb23037 33b8f711
Pipeline #84122 passed with stage
in 0 seconds
......@@ -113,6 +113,10 @@
</property>
</action>
<action name="actionDelete_All">
<property name="icon">
<iconset resource="../../../Components/Resources/pqComponents.qrc">
<normaloff>:/pqWidgets/Icons/pqReset24.png</normaloff>:/pqWidgets/Icons/pqReset24.png</iconset>
</property>
<property name="text">
<string>Reset Session</string>
</property>
......
......@@ -130,11 +130,30 @@
<string>Load a color palette</string>
</property>
</action>
<action name="actionDelete">
<property name="icon">
<iconset resource="../../../Components/Resources/pqComponents.qrc">
<normaloff>:/pqWidgets/Icons/pqReset24.png</normaloff>:/pqWidgets/Icons/pqReset24.png</iconset>
</property>
<property name="text">
<string>ResetSession</string>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
</property>
<property name="toolTip">
<string>Reset Session</string>
</property>
<property name="statusTip">
<string>Reset Session</string>
</property>
</action>
<addaction name="actionOpenData"/>
<addaction name="actionSaveData"/>
<addaction name="separator"/>
<addaction name="actionServerConnect"/>
<addaction name="actionServerDisconnect"/>
<addaction name="actionDelete"/>
<addaction name="separator"/>
<addaction name="actionUndo"/>
<addaction name="actionRedo"/>
......
......@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqActiveObjects.h"
#include "pqAnimationManager.h"
#include "pqAnimationScene.h"
#include "pqCoreUtilities.h"
#include "pqObjectBuilder.h"
#include "pqOutputPort.h"
#include "pqPVApplicationCore.h"
......@@ -53,6 +54,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkSMViewProxy.h"
#include <QDebug>
#include <QMessageBox>
#include <QSet>
//-----------------------------------------------------------------------------
......@@ -315,3 +317,23 @@ void pqDeleteReaction::aboutToDelete(pqPipelineSource* source)
}
//---------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
void pqDeleteReaction::onTriggered()
{
if (this->DeleteAll)
{
if (pqCoreUtilities::promptUser("pqDeleteReaction::onTriggered", QMessageBox::Question,
"Delete All?", tr("The current visualization will be reset \n"
"and the state will be discarded.\n\n"
"Are you sure you want to continue?"),
QMessageBox::Yes | QMessageBox::No | QMessageBox::Save))
{
pqDeleteReaction::deleteAll();
}
}
else
{
pqDeleteReaction::deleteSelected();
}
}
......@@ -82,17 +82,7 @@ protected:
/**
* Called when the action is triggered.
*/
void onTriggered() override
{
if (this->DeleteAll)
{
pqDeleteReaction::deleteAll();
}
else
{
pqDeleteReaction::deleteSelected();
}
}
void onTriggered() override;
private:
Q_DISABLE_COPY(pqDeleteReaction)
......
......@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqAutoApplyReaction.h"
#include "pqDataQueryReaction.h"
#include "pqDeleteReaction.h"
#include "pqLoadDataReaction.h"
#include "pqLoadPaletteReaction.h"
#include "pqSaveDataReaction.h"
......@@ -52,6 +53,7 @@ void pqMainControlsToolbar::constructor()
new pqSaveDataReaction(ui.actionSaveData);
new pqServerConnectReaction(ui.actionServerConnect);
new pqServerDisconnectReaction(ui.actionServerDisconnect);
new pqDeleteReaction(ui.actionDelete, true);
new pqUndoRedoReaction(ui.actionUndo, true);
new pqUndoRedoReaction(ui.actionRedo, false);
new pqAutoApplyReaction(ui.actionAutoApply);
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment