View | Details | Raw Unified | Return to bug 61635
Collapse All | Expand All

(-)src/core/org/apache/jmeter/gui/action/Restart.java (-1 / +17 lines)
Lines 65-71 Link Here
65
    @Override
65
    @Override
66
    public void doAction(ActionEvent e) {
66
    public void doAction(ActionEvent e) {
67
        try {
67
        try {
68
            restartApplication(null);
68
        	ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY));
69
            if (GuiPackage.getInstance().isDirty()) {
70
                int chosenOption = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils
71
                        .getResString("cancel_exit_to_save"), // $NON-NLS-1$
72
                        JMeterUtils.getResString("save?"), // $NON-NLS-1$
73
                        JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
74
                if (chosenOption == JOptionPane.NO_OPTION) {
75
                	restartApplication(null);
76
                } else if (chosenOption == JOptionPane.YES_OPTION) {
77
                    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
78
                    if (!GuiPackage.getInstance().isDirty()) {
79
                    	restartApplication(null);
80
                    }
81
                }
82
            } else {
83
            	restartApplication(null);
84
            }            
69
        } catch (Exception ex) {
85
        } catch (Exception ex) {
70
            log.error("Error trying to restart: {}", ex.getMessage(), ex);
86
            log.error("Error trying to restart: {}", ex.getMessage(), ex);
71
            JOptionPane.showMessageDialog(GuiPackage.getInstance().getMainFrame(), 
87
            JOptionPane.showMessageDialog(GuiPackage.getInstance().getMainFrame(), 

Return to bug 61635