Skip to content

Commit

Permalink
Alle Datei Speichern Dialog mit einer Rückfrage versehen, falls die D…
Browse files Browse the repository at this point in the history
…atei schon vorhanden ist
  • Loading branch information
DominikHolzapfel authored and buchen committed May 21, 2017
1 parent 3e3b161 commit 1e2e587
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
Expand Up @@ -398,6 +398,7 @@ private void createBackup(File file, String suffix)
public void doSaveAs(MPart part, Shell shell, String extension, String encryptionMethod) // NOSONAR
{
FileDialog dialog = new FileDialog(shell, SWT.SAVE);
dialog.setOverwrite(true);

// if an extension is given, make sure the file name proposal has the
// right extension in the save as dialog
Expand Down
Expand Up @@ -25,6 +25,7 @@ public void export(String fileName)
{
FileDialog dialog = new FileDialog(getControl().getShell(), SWT.SAVE);
dialog.setFileName(fileName);
dialog.setOverwrite(true);
String name = dialog.open();
if (name == null)
return;
Expand Down
Expand Up @@ -198,6 +198,7 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte
dialog.setFileName(label);
dialog.setFilterExtensions(EXTENSIONS);
dialog.setFilterIndex(lastUsedFileExtension);
dialog.setOverwrite(true);

String filename = dialog.open();
if (filename == null)
Expand Down
Expand Up @@ -140,6 +140,7 @@ public void run()
{
FileDialog fileDialog = new FileDialog(Display.getDefault().getActiveShell(), SWT.SAVE);
fileDialog.setFileName(security.getName() + ".csv"); //$NON-NLS-1$
fileDialog.setOverwrite(true);
String fileName = fileDialog.open();

if (fileName == null)
Expand Down
Expand Up @@ -148,6 +148,7 @@ else if (exportItem instanceof String)
name = (String) exportItem;

FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
dialog.setOverwrite(true);
if (name != null)
dialog.setFileName(name + ".csv"); //$NON-NLS-1$
String fileName = dialog.open();
Expand Down

0 comments on commit 1e2e587

Please sign in to comment.