Commits

Aleš Erjavec committed 35c2d4a

added main-welcome patch

Comments (0)

Files changed (3)

+# HG changeset patch
+# User Ales Erjavec <ales.erjavec@fri.uni-lj.si>
+# Date 1369665761 -7200
+#      Mon May 27 16:42:41 2013 +0200
+# Node ID e70d4ac91ab25113787b70ad2069e47a9df3d435
+# Parent  0d11c6062e58096df6a05ea7835632cc9ecf2fe8
+imported patch main-welcome
+
+diff --git a/Orange/OrangeCanvas/main.py b/Orange/OrangeCanvas/main.py
+--- a/Orange/OrangeCanvas/main.py
++++ b/Orange/OrangeCanvas/main.py
+@@ -16,7 +16,7 @@ from contextlib import nested
+ import pkg_resources
+ 
+ from PyQt4.QtGui import QFont, QColor
+-from PyQt4.QtCore import Qt, QDir
++from PyQt4.QtCore import Qt, QDir, QTimer
+ 
+ from Orange import OrangeCanvas
+ from Orange.OrangeCanvas.application.application import CanvasApplication
+@@ -205,6 +205,10 @@ def main(argv=None):
+         widget_registry.register_widget
+     )
+ 
++    want_welcome = \
++        settings.value("startup/show-welcome-screen", True, type=bool) \
++        and not options.no_welcome
++
+     want_splash = \
+         settings.value("startup/show-splash-screen", True, type=bool) and \
+         not options.no_splash
+@@ -239,22 +243,9 @@ def main(argv=None):
+     canvas_window.show()
+     canvas_window.raise_()
+ 
+-    want_welcome = \
+-        settings.value("startup/show-welcome-screen", True, type=bool) \
+-        and not options.no_welcome
+-
+-    # Process events to make sure the canvas_window layout has
+-    # a chance to activate (the welcome dialog is modal and will
+-    # block the event queue, plus we need a chance to receive open file
+-    # signals when running without a splash screen)
+-    app.processEvents()
+-
+     app.fileOpenRequest.connect(canvas_window.open_scheme_file)
+ 
+-    if want_welcome and not args and not open_requests:
+-        canvas_window.welcome_dialog()
+-
+-    elif args:
++    if args:
+         log.info("Loading a scheme from the command line argument %r",
+                  args[0])
+         canvas_window.load_scheme(args[0])
+@@ -263,6 +254,9 @@ def main(argv=None):
+                  open_requests[-1])
+         canvas_window.load_scheme(open_requests[-1].toLocalFile())
+ 
++    if want_welcome and not args and not open_requests:
++        QTimer.singleShot(0, canvas_window.welcome_action.trigger)
++
+     stdout_redirect = \
+         settings.value("output/redirect-stdout", True, type=bool)
+ 
-bundle-link-paths
+main-welcome
 log-view
 window-file-path
 cat-menu-test