Bug 9493: Title is now set to console title when starting scilab 56/14056/4
Pierre-Aime Agnel [Tue, 18 Mar 2014 11:02:18 +0000 (12:02 +0100)]
Change-Id: Ibceb95a96e342fd16fcfe13047f294d63e80c069

scilab/CHANGES_5.5.X
scilab/modules/gui/src/c/InitializeGUI.c
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/BarUpdater.java

index 497d8bd..4d1ee48 100644 (file)
@@ -352,6 +352,8 @@ Scilab Bug Fixes
 
 * Bug #9444 fixed - with_embedded_jre function removed.
 
+* Bug #9493 fixed - Title is now correctly set when starting Scilab and focus is set on Console
+
 * Bug #9627 fixed - Arguments checking added in optimsimplex_* functions.
 
 * Bug #9697 fixed - Displayed information for optim "qn" and "gc" with bounds and imp=1 fixed.
index 3e6d90c..c420b4f 100644 (file)
@@ -25,23 +25,12 @@ BOOL InitializeGUI(void)
 {
     if (getScilabMode() == SCILAB_STD)
     {
-        char *title = NULL;
 
         // TODO why this line since already done above
         // createSwingView();
 #ifdef _MSC_VER
         WindowShow();
 #endif
-
-        title = buildMainWindowTitle();
-        if (title)
-        {
-            BOOL bOK = setMainWindowTitle(title);
-
-            FREE(title);
-            title = NULL;
-            return bOK;
-        }
     }
     else
     {
index 72a7480..5bc924c 100644 (file)
@@ -76,19 +76,20 @@ public final class BarUpdater implements PropertyChangeListener {
         SwingScilabWindow parentWindow = SwingScilabWindow.allScilabWindows.get(parentWindowsID);
         if (parentWindow != null && !parentWindow.isRestoring()) {
             boolean same = parentWindow.compareMenuBar(newMenuBar) && parentWindow.compareToolBar(newToolBar) && parentWindow.compareInfoBar(newInfoBar);
+            //Forcing update of title and icon
+            parentWindow.setTitle(newWindowTitle);
+            if (newIcon != null) {
+                parentWindow.setIconImage(newIcon);
+            }
             if (!same) {
                 parentWindow.addMenuBar(newMenuBar);
                 parentWindow.addToolBar(newToolBar);
                 parentWindow.addInfoBar(newInfoBar);
-                parentWindow.setTitle(newWindowTitle);
                 /** The following line is used to update the menubar, toolbar, ... displayed on screen */
                 parentWindow.getRootPane().revalidate();
                 if (OS.get() == OS.MAC) { /* Fix bug #11787 */
                     parentWindow.repaint();
                 }
-                if (newIcon != null) {
-                    parentWindow.setIconImage(newIcon);
-                }
             }
         }
     }
@@ -106,20 +107,21 @@ public final class BarUpdater implements PropertyChangeListener {
     public static void forceUpdateBars(String parentWindowsID, MenuBar newMenuBar, ToolBar newToolBar, TextBox newInfoBar, String newWindowTitle, Image newIcon) {
         SwingScilabWindow parentWindow = SwingScilabWindow.allScilabWindows.get(parentWindowsID);
         if (parentWindow != null) {
+            //Forcing update of title and icon
+            parentWindow.setTitle(newWindowTitle);
+            if (newIcon != null) {
+                parentWindow.setIconImage(newIcon);
+            }
             boolean same = parentWindow.compareMenuBar(newMenuBar) && parentWindow.compareToolBar(newToolBar) && parentWindow.compareInfoBar(newInfoBar);
             if (!same) {
                 parentWindow.addMenuBar(newMenuBar);
                 parentWindow.addToolBar(newToolBar);
                 parentWindow.addInfoBar(newInfoBar);
-                parentWindow.setTitle(newWindowTitle);
                 /** The following line is used to update the menubar, toolbar, ... displayed on screen */
                 parentWindow.getRootPane().revalidate();
                 if (OS.get() == OS.MAC) { /* Fix bug #11787 */
                     parentWindow.repaint();
                 }
-                if (newIcon != null) {
-                    parentWindow.setIconImage(newIcon);
-                }
             }
         }
     }