mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-16 17:57:43 +00:00
make windows open over the top of what opened them.
This commit is contained in:
parent
8a57c8fb96
commit
0660bd0a54
@ -19,6 +19,7 @@
|
||||
package org.sleuthkit.autopsy.casemodule;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
@ -29,6 +30,7 @@ import javax.swing.filechooser.FileFilter;
|
||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
import org.openide.windows.WindowManager;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.Version;
|
||||
@ -71,8 +73,8 @@ public final class CaseOpenAction implements ActionListener {
|
||||
*/
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int retval = fc.showOpenDialog((Component) e.getSource());
|
||||
|
||||
int retval = fc.showOpenDialog(WindowManager.getDefault().getMainWindow());
|
||||
|
||||
if (retval == JFileChooser.APPROVE_OPTION) {
|
||||
String path = fc.getSelectedFile().getPath();
|
||||
String dirPath = fc.getSelectedFile().getParent();
|
||||
|
@ -25,10 +25,13 @@ import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.KeyStroke;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
@ -209,8 +212,12 @@ public class CueBannerPanel extends javax.swing.JPanel {
|
||||
int h = recentCasesWindow.getSize().height;
|
||||
|
||||
// set the location of the popUp Window on the center of the screen
|
||||
recentCasesWindow.setLocation((screenDimension.width - w)/2, (screenDimension.height - h)/2);
|
||||
|
||||
recentCasesWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
|
||||
recentCasesWindow.setLocationRelativeTo(this);
|
||||
recentCasesWindow.getRootPane().registerKeyboardAction(e -> {
|
||||
recentCasesWindow.dispose();
|
||||
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
|
||||
|
||||
OpenRecentCasePanel welcomeWindow = OpenRecentCasePanel.getInstance();
|
||||
|
||||
// add the command to close the window to the button on the Volume Detail Panel
|
||||
|
@ -62,6 +62,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa
|
||||
|
||||
// set the location of the popUp Window on the center of the screen
|
||||
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
|
||||
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
|
||||
|
||||
welcomeWindow = new CueBannerPanel();
|
||||
|
||||
@ -83,6 +84,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa
|
||||
@Override
|
||||
public void open() {
|
||||
welcomeWindow.refresh();
|
||||
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ import java.awt.Toolkit;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JFrame;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
/**
|
||||
* File search dialog
|
||||
@ -48,6 +49,7 @@ import javax.swing.JFrame;
|
||||
double w = getSize().getWidth();
|
||||
double h = getSize().getHeight();
|
||||
setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
|
||||
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
|
||||
fileSearchPanel1.addListenerToAll(new ActionListener() {
|
||||
|
||||
@Override
|
||||
|
@ -24,9 +24,12 @@ import java.awt.Dialog;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.KeyStroke;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
@ -43,6 +46,7 @@ public final class IngestProgressSnapshotDialog extends JDialog {
|
||||
*/
|
||||
public IngestProgressSnapshotDialog() {
|
||||
this((Window) WindowManager.getDefault().getMainWindow(), false);
|
||||
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -77,6 +81,9 @@ public final class IngestProgressSnapshotDialog extends JDialog {
|
||||
int w = this.getSize().width;
|
||||
int h = this.getSize().height;
|
||||
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
|
||||
this.getRootPane().registerKeyboardAction(e -> {
|
||||
this.dispose();
|
||||
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
|
||||
add(new IngestProgressSnapshotPanel(this));
|
||||
pack();
|
||||
setResizable(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user