Просмотр исходного кода

Merge pull request #440 from csmith/web2

Support for core topic date changes.
pull/442/head
Greg Holmes 8 лет назад
Родитель
Сommit
3ce9cd2757

+ 2
- 2
logging/src/com/dmdirc/addons/logging/LoggingManager.java Просмотреть файл

280
 
280
 
281
         appendLine(filename, "*** Topic is: %s", event.getTopic().getTopic());
281
         appendLine(filename, "*** Topic is: %s", event.getTopic().getTopic());
282
         appendLine(filename, "*** Set at: %s on %s by %s",
282
         appendLine(filename, "*** Set at: %s on %s by %s",
283
-                timeFormat.format(1000 * event.getTopic().getTime()),
284
-                dateFormat.format(1000 * event.getTopic().getTime()),
283
+                timeFormat.format(event.getTopic().getDate()),
284
+                dateFormat.format(event.getTopic().getDate()),
285
                         event.getTopic().getClient()
285
                         event.getTopic().getClient()
286
                                 .map(GroupChatUser::getNickname).orElse("Unknown"));
286
                                 .map(GroupChatUser::getNickname).orElse("Unknown"));
287
     }
287
     }

+ 1
- 2
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicDisplayPane.java Просмотреть файл

41
 import java.awt.Color;
41
 import java.awt.Color;
42
 import java.awt.datatransfer.Clipboard;
42
 import java.awt.datatransfer.Clipboard;
43
 import java.awt.event.KeyEvent;
43
 import java.awt.event.KeyEvent;
44
-import java.util.Date;
45
 import java.util.Optional;
44
 import java.util.Optional;
46
 
45
 
47
 import javax.swing.JLabel;
46
 import javax.swing.JLabel;
164
         if (topic.isPresent()) {
163
         if (topic.isPresent()) {
165
             topicWho.setText("Topic set by " + topic.get().getClient()
164
             topicWho.setText("Topic set by " + topic.get().getClient()
166
                     .map(GroupChatUser::getNickname).orElse("Unknown")
165
                     .map(GroupChatUser::getNickname).orElse("Unknown")
167
-                    + "<br> on " + new Date(1000 * topic.get().getTime()));
166
+                    + "<br> on " + topic.get().getDate());
168
             topicText.setText(topic.get().getTopic());
167
             topicText.setText(topic.get().getTopic());
169
         } else {
168
         } else {
170
             topicWho.setText("No topic set.");
169
             topicWho.setText("No topic set.");

+ 1
- 4
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicLabel.java Просмотреть файл

29
 import com.dmdirc.interfaces.GroupChatUser;
29
 import com.dmdirc.interfaces.GroupChatUser;
30
 
30
 
31
 import java.awt.Color;
31
 import java.awt.Color;
32
-import java.util.Date;
33
 
32
 
34
 import javax.swing.JEditorPane;
33
 import javax.swing.JEditorPane;
35
 import javax.swing.JPanel;
34
 import javax.swing.JPanel;
49
 
48
 
50
     /** A version number for this class. */
49
     /** A version number for this class. */
51
     private static final long serialVersionUID = 1;
50
     private static final long serialVersionUID = 1;
52
-    /** How many milliseconds in a second. */
53
-    private static final int MILLIS_IN_SECOND = 1000;
54
     /** Topic this label represents. */
51
     /** Topic this label represents. */
55
     private final Topic topic;
52
     private final Topic topic;
56
     /** The group chat to which this label belongs. */
53
     /** The group chat to which this label belongs. */
138
         }
135
         }
139
         add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
136
         add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
140
 
137
 
141
-        label = new TextLabel("on " + new Date(topic.getTime() * MILLIS_IN_SECOND));
138
+        label = new TextLabel("on " + topic.getDate());
142
         add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
139
         add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
143
 
140
 
144
         add(new JSeparator(), "newline, span, growx, pushx");
141
         add(new JSeparator(), "newline, span, growx, pushx");

Загрузка…
Отмена
Сохранить