Revision: 3745
Author: [email protected]
Date: Fri Jul 16 08:37:22 2010
Log: Re-enabled the welcome screen.
http://code.google.com/p/power-architect/source/detail?r=3745

Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/ArchitectSwingSessionContextImpl.java

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/ArchitectSwingSessionContextImpl.java Mon Jul 12 14:17:47 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/ArchitectSwingSessionContextImpl.java Fri Jul 16 08:37:22 2010
@@ -429,6 +429,35 @@
     public void registerFrame(final ArchitectFrame frame) {
         frames.add(frame);

+        if (frames.size() == 1) {
+            frame.addWindowListener(new WindowListener() {
+                @Override
+                public void windowActivated(WindowEvent e) {
+                    showWelcomeScreen(frame);
+                    frame.removeWindowListener(this);
+                }
+                @Override
+                public void windowClosed(WindowEvent e) {
+                }
+                @Override
+                public void windowClosing(WindowEvent e) {
+                }
+                @Override
+                public void windowDeactivated(WindowEvent e) {
+                }
+                @Override
+                public void windowDeiconified(WindowEvent e) {
+                }
+                @Override
+                public void windowIconified(WindowEvent e) {
+                }
+                @Override
+                public void windowOpened(WindowEvent e) {
+                }
+
+            });
+        }
+
         if (windowLifecycleListener != null) {
windowLifecycleListener.sessionOpening(new SessionLifecycleEvent<ArchitectFrame>(frame));
         }
@@ -502,7 +531,6 @@
     }

     private void showWelcomeScreen(Component dialogOwner) {
-        // should almost certainly move this into the swing context
if (getUserSettings().getSwingSettings().getBoolean(ArchitectSwingUserSettings.SHOW_WELCOMESCREEN, true)) {
             WelcomeScreen ws = new WelcomeScreen(this);
             ws.showWelcomeDialog(dialogOwner);

Reply via email to