Still working, little progress

I’m still working on Bug 227760. As mentioned earlier in the description of the bug, the save dialogue is prompted twice. Once, where mentioned earlier, and the second place I found is, in the “org.eclipse.debug.ui”, in the “org.eclipse.debug.internal.ui”. The file getting called is the “SaveScopeREsourcesHandler.java” and the prompt occurs in the handle status method.
The dialogue gets called in this condition:

if (projects != null) {
            IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
            String save = store.getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
            int ret = showSaveDialog(projects, !save.equals(MessageDialogWithToggle.NEVER), save.equals(MessageDialogWithToggle.PROMPT));
            if(ret == IDialogConstants.OK_ID) {
            	doSave();
            	return Boolean.TRUE;
            }
            return Boolean.FALSE;
        }
        else {
            boolean cancel = DebugUIPlugin.preLaunchSave();
            return Boolean.valueOf(cancel);
        }

The DebugUIPlugin.java class is called in the else condition, which invokes the second dialogue.The DebugUIPlugin class has the method that checks and calls the save prompt:

public static boolean preLaunchSave() {
        String saveDirty = getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
        if (saveDirty.equals(MessageDialogWithToggle.NEVER)) {
            return true;
        }
        return saveAllEditors(saveDirty.equals(MessageDialogWithToggle.PROMPT));
    }

Playing around with this code, for example disabling the “.PROMPT”, did not display the message. Therefore, we may be dealing with the “saveDirty”. Someone worked on a similar saveDirty dialogue in the class, and I will ask him & look into his blog for help on this. Will update again soon.

Advertisements

One Response to “Still working, little progress”

  1. hi Nabeel,

    I just realized we are working on the very same bug 🙂 (even though the bug number is different). You are a few steps a head of me though. I’m still struggling tracking down the second prompt :(. Anyway, I think I can catch up with you from here since you already found the second prompt.

    Cheers,
    Kevin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: