Skip to content

Commit

Permalink
[FIX][E] #32 Balloon after saving partial sharing selection is too big
Browse files Browse the repository at this point in the history
This fixes issue #32. Changed the default anchor as my current testing
did not produce the result shown in the picture of the issue entry, e.g
the notification was shown outside of the WizardPage.
  • Loading branch information
srossbach committed Aug 5, 2019
1 parent 9d4eae0 commit c39f2c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions eclipse/src/saros/ui/BalloonNotification.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static void showNotification(Control control, String title, String text)
new BalloonWindow(
control != null ? control.getShell() : null, SWT.NO_FOCUS | SWT.TOOL | SWT.TITLE);

window.setAnchor(SWT.LEFT | SWT.BOTTOM);
windows.add(window);
/*
* Note: if you add SWT.CLOSE to the style of the BalloonWindow, it will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,22 @@ public void run() {
if (savedSelectionPresetsCombo.getItemCount() == 0) {
SarosView.showNotification(
"No stored selections yet",
"You do not have any stored selections yet. Make a selection in the tree above, enter a name here, and press 'Save' to save a selection for easy reusing",
"You do not have any stored selections yet.\n"
+ "Make a selection in the tree above, enter a name here.\n"
+ "Then press 'Save' to save a selection for easy reusing.",
savedSelectionPresetsCombo);
} else {
SarosView.showNotification(
"Error while restoring a selection",
"Could not restore a selection because there is none with the name you entered",
"Could not restore a selection because there is none with the name you entered.",
savedSelectionPresetsCombo);
}

} else {
SarosView.showNotification(
"Selection was restored",
"Your saved selection was successfully restored",
checkboxTreeViewer.getControl());
"Your saved selection was successfully restored.",
savedSelectionPresetsCombo);
}
}
});
Expand All @@ -250,7 +252,7 @@ public void widgetSelected(SelectionEvent e) {
if (theName.isEmpty()) {
SarosView.showNotification(
"Name missing",
"Please enter a name for the selection first to save it",
"Please enter a name for the selection first to save it.",
savedSelectionPresetsCombo);
return;
}
Expand All @@ -269,11 +271,12 @@ public void widgetSelected(SelectionEvent e) {
savedSelectionPresetsCombo.setItems(
selectionNames.toArray(new String[selectionNames.size()]));
savedSelectionPresetsCombo.setText(theName);

SarosView.showNotification(
"Selection was remembered",
"The current selection was remembered with name '"
+ theName
+ "'. You can restore this selection from now on for a quick session startup, even with complicated partial sharing.",
+ "'.\nYou can restore this selection from now on for a quick session startup.",
savedSelectionPresetsCombo);
}
});
Expand Down Expand Up @@ -314,7 +317,7 @@ public void widgetSelected(SelectionEvent e) {
savedSelectionPresetsCombo.setText("");
SarosView.showNotification(
"Selection was removed",
"The selection with name '" + theName + "' was removed",
"The selection with name '" + theName + "' was removed.",
savedSelectionPresetsCombo);
}
});
Expand Down

0 comments on commit c39f2c7

Please sign in to comment.