Browse Source

Support for new action versioning

Issue 3943

Change-Id: I9f769f243178022528da65fe4c15abbd62d9e49c
Depends-On: I1419fa74d8da7f3f5d96a00dea559329db008b0e
Reviewed-on: http://gerrit.dmdirc.com/1046
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
Automatic-Compile: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.4
Chris Smith 14 years ago
parent
commit
64451f9439

+ 3
- 3
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionGroupInformationPanel.java View File

@@ -112,12 +112,12 @@ public final class ActionGroupInformationPanel extends JPanel {
112 112
         if (shouldDisplay()) {
113 113
             infoLabel.setText(group.getDescription());
114 114
             author.setText(group.getAuthor());
115
-            version.setText(Integer.toString(group.getVersion()));
115
+            version.setText(group.getVersion() == null ? "" : group.getVersion().toString());
116 116
 
117 117
             author.setVisible(group.getAuthor() != null);
118
-            version.setVisible(group.getVersion() != -1);
118
+            version.setVisible(group.getVersion() != null);
119 119
             authorLabel.setVisible(group.getAuthor() != null);
120
-            versionLabel.setVisible(group.getVersion() != -1);
120
+            versionLabel.setVisible(group.getVersion() != null);
121 121
         } else {
122 122
             infoLabel.setText("");
123 123
             author.setText("");

+ 4
- 3
test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionGroupInformationPanelTest.java View File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.dialogs.actionsmanager;
24 24
 
25 25
 import com.dmdirc.actions.ActionGroup;
26
+import com.dmdirc.updater.Version;
26 27
 import org.junit.Test;
27 28
 import org.uispec4j.Panel;
28 29
 import org.uispec4j.UISpecTestCase;
@@ -53,7 +54,7 @@ public class ActionGroupInformationPanelTest extends UISpecTestCase {
53 54
     public void testAllLabels() {
54 55
         final ActionGroup group = mock(ActionGroup.class);
55 56
         when(group.getDescription()).thenReturn("description");
56
-        when(group.getVersion()).thenReturn(17);
57
+        when(group.getVersion()).thenReturn(new Version(17));
57 58
         when(group.getAuthor()).thenReturn("foo <bar@baz>");
58 59
         
59 60
         final Panel panel = new Panel(new ActionGroupInformationPanel(group));
@@ -71,7 +72,7 @@ public class ActionGroupInformationPanelTest extends UISpecTestCase {
71 72
     public void testNoAuthor() {
72 73
         final ActionGroup group = mock(ActionGroup.class);
73 74
         when(group.getDescription()).thenReturn("description");
74
-        when(group.getVersion()).thenReturn(17);
75
+        when(group.getVersion()).thenReturn(new Version(17));
75 76
 
76 77
         final Panel panel = new Panel(new ActionGroupInformationPanel(group));
77 78
 
@@ -86,7 +87,7 @@ public class ActionGroupInformationPanelTest extends UISpecTestCase {
86 87
     public void testNoVersion() {
87 88
         final ActionGroup group = mock(ActionGroup.class);
88 89
         when(group.getDescription()).thenReturn("description");
89
-        when(group.getVersion()).thenReturn(-1);
90
+        when(group.getVersion()).thenReturn(null);
90 91
         when(group.getAuthor()).thenReturn("foo <bar@baz>");
91 92
 
92 93
         final Panel panel = new Panel(new ActionGroupInformationPanel(group));

Loading…
Cancel
Save