mail[Wesnoth-commits] r44264 - in /trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin: ./ action/ handlers/ utils/ wizards/generator/ wiza...


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by timotei_cluj on July 17, 2010 - 22:10:
Author: timotei
Date: Sat Jul 17 22:10:01 2010
New Revision: 44264

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44264&view=rev
Log:
eclipse plugin: add proper icons to messages boxes + fix editor starting when 
no map specified

Modified:
    trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/WesnothProjectReport.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/ReloadFilesHandler.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/ExternalToolInvoker.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GUIUtils.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GameUtils.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/generator/WizardGeneratorPageTag.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/MoveTypeWizard.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/RaceWizard.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitTypePage1.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitsPage0.java

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java 
(original)
+++ trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java 
Sat Jul 17 22:10:01 2010
@@ -57,7 +57,7 @@
                        log("Logging started.");
                } catch (IOException e)
                {
-                       GUIUtils.showMessageBox("There was an error trying to 
open the log." +
+                       GUIUtils.showErrorMessageBox("There was an error 
trying to open the log." +
                                        e.getMessage());
                        e.printStackTrace();
                }
@@ -157,6 +157,6 @@
        public void log(String message, String guiMessage)
        {
                log(message,IStatus.INFO);
-               GUIUtils.showMessageBox(guiMessage);
+               GUIUtils.showInfoMessageBox(guiMessage);
        }
 }

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/WesnothProjectReport.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/WesnothProjectReport.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/WesnothProjectReport.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/WesnothProjectReport.java
 Sat Jul 17 22:10:01 2010
@@ -35,7 +35,7 @@
                IProject project = WorkspaceUtils.getSelectedProject();
                if (project == null)
                {
-                       GUIUtils.showMessageBox("Please select a project 
first.");
+                       GUIUtils.showWarnMessageBox("Please select a project 
first.");
                        return;
                }
 

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/ReloadFilesHandler.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/ReloadFilesHandler.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/ReloadFilesHandler.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/ReloadFilesHandler.java
 Sat Jul 17 22:10:01 2010
@@ -23,7 +23,7 @@
                SchemaParser.getInstance().parseSchema(true);
                TemplateProvider.getInstance().loadTemplates();
 
-               GUIUtils.showMessageBox("Files reloaded.");
+               GUIUtils.showInfoMessageBox("Files reloaded.");
                return null;
        }
 }

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/ExternalToolInvoker.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/ExternalToolInvoker.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/ExternalToolInvoker.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/ExternalToolInvoker.java
 Sat Jul 17 22:10:01 2010
@@ -18,6 +18,7 @@
 
 import wesnoth_eclipse_plugin.Logger;
 
+//TODO: add tail on windows for wesnoth.exe
 public class ExternalToolInvoker
 {
        private Process process_;

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GUIUtils.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GUIUtils.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GUIUtils.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GUIUtils.java
 Sat Jul 17 22:10:01 2010
@@ -21,14 +21,36 @@
 public class GUIUtils
 {
        /**
-        * Shows a message box with the specified message (thread-safe)
+        * Shows an information message box with the specified message 
(thread-safe)
         *
         * @param window the window where to show the message box
         * @param message the message to print
         */
-       public static void showMessageBox(final String message)
+       public static void showInfoMessageBox(final String message)
        {
-               showMessageBox(WorkspaceUtils.getWorkbenchWindow(), message, 
SWT.DEFAULT);
+               showMessageBox(WorkspaceUtils.getWorkbenchWindow(), message, 
SWT.ICON_INFORMATION);
+       }
+
+       /**
+        * Shows an information message box with the specified message 
(thread-safe)
+        *
+        * @param window the window where to show the message box
+        * @param message the message to print
+        */
+       public static void showWarnMessageBox(final String message)
+       {
+               showMessageBox(WorkspaceUtils.getWorkbenchWindow(), message, 
SWT.ICON_WARNING);
+       }
+
+       /**
+        * Shows an error message box with the specified message (thread-safe)
+        *
+        * @param window the window where to show the message box
+        * @param message the message to print
+        */
+       public static void showErrorMessageBox(final String message)
+       {
+               showMessageBox(WorkspaceUtils.getWorkbenchWindow(), message, 
SWT.ICON_ERROR);
        }
 
        /**
@@ -50,7 +72,7 @@
         */
        public static void showMessageBox(final IWorkbenchWindow window, 
final String message)
        {
-               showMessageBox(window, message, SWT.DEFAULT);
+               showMessageBox(window, message, SWT.ICON_INFORMATION);
        }
 
        /**

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GameUtils.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GameUtils.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GameUtils.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/GameUtils.java
 Sat Jul 17 22:10:01 2010
@@ -36,7 +36,7 @@
        {
                if (WorkspaceUtils.getSelectedResource() == null)
                {
-                       GUIUtils.showMessageBox("Please select a directory or 
a resource inside the " +
+                       GUIUtils.showWarnMessageBox("Please select a 
directory or a resource inside the " +
                                        "campaign project before.");
                        return;
                }
@@ -47,7 +47,7 @@
                if (scenario &&
                        
!ProjectUtils.isScenarioFile(WorkspaceUtils.getPathRelativeToUserDir(selectedResource)))
                {
-                       GUIUtils.showMessageBox("This is not a valid scenario 
file.");
+                       GUIUtils.showErrorMessageBox("This is not a valid 
scenario file.");
                        return;
                }
 
@@ -59,7 +59,7 @@
 
                        if (campaignId == null)
                        {
-                               GUIUtils.showMessageBox("You need to have a 
valid campaign file" +
+                               GUIUtils.showErrorMessageBox("You need to 
have a valid campaign file" +
                                                " in your directory 
(_main.cfg) or selected.");
                                return;
                        }
@@ -83,7 +83,7 @@
                String wesnothExec = 
Preferences.getString(Constants.P_WESNOTH_EXEC_PATH);
                if (wesnothExec.isEmpty())
                {
-                       GUIUtils.showMessageBox("Please set the wesnoth's 
executable path first.");
+                       GUIUtils.showErrorMessageBox("Please set the 
wesnoth's executable path first.");
                        return;
                }
 
@@ -151,7 +151,8 @@
                List<String> args = new ArrayList<String>(3);
 
                args.add("-e");
-               args.add(mapName);
+               if (!(mapName.isEmpty()))
+                       args.add(mapName);
 
                if (!workingDir.isEmpty())
                {

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
 Sat Jul 17 22:10:01 2010
@@ -246,7 +246,7 @@
                {
                        if 
(Preferences.getString(Constants.P_WESNOTH_WMLTOOLS_DIR).equals(""))
                        {
-                               GUIUtils.showMessageBox("Please set the 
wmltools directory in the " +
+                               GUIUtils.showWarnMessageBox("Please set the 
wmltools directory in the " +
                                                "preferences before you use 
this feature.");
                                return false;
                        }
@@ -255,14 +255,14 @@
 
                        if (!wmlToolFile.exists())
                        {
-                               GUIUtils.showMessageBox(String.format("The 
file %s was not found",
+                               
GUIUtils.showErrorMessageBox(String.format("The file %s was not found",
                                                wmlToolFile));
                                return false;
                        }
                }
                if (filePath != null && (filePath.isEmpty() || !new 
File(filePath).exists()))
                {
-                       GUIUtils.showMessageBox("The file does not exist or 
is null");
+                       GUIUtils.showErrorMessageBox("The file does not exist 
or is null");
                        return false;
                }
 

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java
 Sat Jul 17 22:10:01 2010
@@ -193,7 +193,7 @@
                                        Activator.getShell(), 
"plugin_preferences", new String[0], null);
                        if (pref.open() == Window.CANCEL || 
!checkConditions(true))
                        {
-                               GUIUtils.showMessageBox("The workspace was 
not setup");
+                               GUIUtils.showErrorMessageBox("The workspace 
was not setup");
                                return;
                        }
                }
@@ -245,7 +245,7 @@
                } catch (Exception e)
                {
                        Logger.getInstance().logException(e);
-                       GUIUtils.showMessageBox("There was an error trying to 
setup the workspace.");
+                       GUIUtils.showErrorMessageBox("There was an error 
trying to setup the workspace.");
 
                        // let's remove the corrupted project
                        try
@@ -276,7 +276,7 @@
                        !validPath(wmltoolsDir) || !validPath(workingDir))
                {
                        if (displayWarning)
-                               GUIUtils.showMessageBox("Please set all 
plugin's preferences before using it.");
+                               GUIUtils.showWarnMessageBox("Please set all 
plugin's preferences before using it.");
                        return false;
                }
                return true;

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/generator/WizardGeneratorPageTag.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/generator/WizardGeneratorPageTag.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/generator/WizardGeneratorPageTag.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/generator/WizardGeneratorPageTag.java
 Sat Jul 17 22:10:01 2010
@@ -128,7 +128,7 @@
        {
                if (targetList.getSelectionCount() == 0 || 
targetList.getItemCount() == 0)
                {
-                       GUIUtils.showMessageBox("Please select an item before 
removing it.");
+                       GUIUtils.showWarnMessageBox("Please select an item 
before removing it.");
                        return;
                }
 

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/MoveTypeWizard.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/MoveTypeWizard.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/MoveTypeWizard.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/MoveTypeWizard.java
 Sat Jul 17 22:10:01 2010
@@ -252,7 +252,7 @@
                                return;
                        if (targetList.getSelectionCount() == 0)
                        {
-                               GUIUtils.showMessageBox("Please select an 
item before deleting it.");
+                               GUIUtils.showWarnMessageBox("Please select an 
item before deleting it.");
                                return;
                        }
                        targetList.remove(targetList.getSelectionIndex());

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/RaceWizard.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/RaceWizard.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/RaceWizard.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/RaceWizard.java
 Sat Jul 17 22:10:01 2010
@@ -249,7 +249,7 @@
                                return;
                        if (lstTrait_.getSelectionCount() == 0 || 
lstTrait_.getItems().length == 0)
                        {
-                               GUIUtils.showMessageBox("Please select a 
trait before deleting it.");
+                               GUIUtils.showWarnMessageBox("Please select a 
trait before deleting it.");
                                return;
                        }
                        traitsList_.remove(lstTrait_.getSelectionIndex());

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitTypePage1.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitTypePage1.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitTypePage1.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitTypePage1.java
 Sat Jul 17 22:10:01 2010
@@ -120,7 +120,7 @@
        {
                if (targetList.getItemCount() == 0 || 
targetList.getSelectionCount() == 0)
                {
-                       GUIUtils.showMessageBox("Please select an item before 
trying to remove it.");
+                       GUIUtils.showWarnMessageBox("Please select an item 
before trying to remove it.");
                        return;
                }
                ((java.util.List<String>) 
targetList.getData()).remove(targetList.getSelectionIndex());

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitsPage0.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitsPage0.java?rev=44264&r1=44263&r2=44264&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitsPage0.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/unit/UnitsPage0.java
 Sat Jul 17 22:10:01 2010
@@ -207,7 +207,7 @@
        {
                if (selectedList_ == null || 
selectedList_.getSelection().length == 0)
                {
-                       GUIUtils.showMessageBox("Please select an item from a 
list first.");
+                       GUIUtils.showWarnMessageBox("Please select an item 
from a list first.");
                        return;
                }
                if (selectedList_.getData() != null && 
selectedList_.getData() instanceof java.util.List<?>)
@@ -220,7 +220,7 @@
        {
                if (selectedList_ == null)
                {
-                       GUIUtils.showMessageBox("Please select a list 
first.");
+                       GUIUtils.showWarnMessageBox("Please select a list 
first.");
                        return;
                }
 
@@ -236,7 +236,7 @@
                else if (selectedList_.hashCode() == lstTraits_.hashCode())
                {
                        //wizard = new TraitWizard();
-                       GUIUtils.showMessageBox("Not implemented yet");
+                       GUIUtils.showWarnMessageBox("Not implemented yet");
                        return;
                }
                else if (selectedList_.hashCode() == lstUnitTypes_.hashCode())




Related Messages


Powered by MHonArc, Updated Sun Jul 18 03:40:11 2010