
Replace TrayManager.getInstance() with constructor Pass Main to TrayManager Create WindowHandler in TrayManager Pass WindowHandler to RegisteredFrames Only create ItoopieHostnameVerifier once, in gui/Main Pass gui/Main to SettingsFrame Pass gui/Main to ItoopieHostnameVerifier and CertificateGui Sync on lock in ItoopieHostnameVerifier.clearRecentlyDenied() Comment out some main() and other test code Make some fields non-static Remove some static initializers Start gui/Main before the tray icon Fixed the tray icon on Gnome with a delay in TrayManager
65 lines
1.3 KiB
Java
65 lines
1.3 KiB
Java
package net.i2p.itoopie.gui.component;
|
|
|
|
import java.awt.event.WindowEvent;
|
|
import java.awt.event.WindowListener;
|
|
|
|
import javax.swing.JFrame;
|
|
|
|
import net.i2p.itoopie.gui.WindowHandler;
|
|
import net.i2p.itoopie.util.IconLoader;
|
|
|
|
public class RegisteredFrame extends JFrame implements WindowListener{
|
|
private static final long serialVersionUID = 3351260168651061327L;
|
|
private final WindowHandler windowHandler;
|
|
|
|
public RegisteredFrame(String name, WindowHandler wh) {
|
|
super(name);
|
|
super.addWindowListener(this);
|
|
windowHandler = wh;
|
|
windowHandler.register(this);
|
|
this.setIconImage(IconLoader.getIcon("itoopie", 128));
|
|
}
|
|
|
|
public void windowClosing(WindowEvent e) {
|
|
windowHandler.deRegister(this);
|
|
this.dispose();
|
|
}
|
|
|
|
@Override
|
|
public void windowActivated(WindowEvent e) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
public void windowDeactivated(WindowEvent e) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
public void windowDeiconified(WindowEvent e) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
public void windowIconified(WindowEvent e) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
public void windowOpened(WindowEvent e) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
public void windowClosed(WindowEvent e) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
}
|