-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BoardAutoCreator
should not prompt for save if there is no need to #1461
#1462
Conversation
@xinan Hey xinan, can you resolve the conflicts with mater branch? |
BoardAutoCreator
should not prompt for save if there is no need toBoardAutoCreator
should not prompt for save if there is no need to #1461
7fbc3f0
to
538394e
Compare
if (isSaveBoardDialogResponsePositive(boardName)) ui.getMenuControl().saveBoardAs(); | ||
private void saveBoardAfterUserConfirmationIfNeeded(String boardName) { | ||
boolean isNeeded = !prefs.getLastOpenBoardPanelInfos().isPresent() | ||
|| !prefs.getLastOpenBoardPanelInfos().get().equals(panelControl.getCurrentPanelInfos()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a more accurate name is isOpenBoardDifferentFromSavedBoard
or something like that, because that's what the condition seems to be checking.
@@ -1,5 +1,7 @@ | |||
package prefs; | |||
|
|||
import java.util.Objects; | |||
|
|||
public class PanelInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a change in this PR, but can you help adding the header comment for this class?
@@ -126,11 +132,20 @@ private boolean isNewBoardCreationDialogConfirmed() { | |||
response.get().getButtonData() == ButtonData.OK_DONE; | |||
} | |||
|
|||
/** | |||
* Called upon the Boards > Save being clicked | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
import java.util.Objects; | ||
|
||
/** | ||
* Represents the information about a Panel. Contains two String attributes {@code name} and {@code filter}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2nd sentence is unnecessary and easily outdated.
Can merge after removing the comment text mentioned. |
Fixes #1461
Now it will only prompt for save if current board is dirty, or current board has not been saved before.
If current board is a dirty saved board, it will trigger
Save
.If current board has not been saved before, it will trigger
Save as
.