|
@@ -28,10 +28,8 @@ import com.dmdirc.addons.dcc.TransferContainer;
|
28
|
28
|
import com.dmdirc.addons.dcc.io.DCCTransfer;
|
29
|
29
|
import com.dmdirc.addons.ui_swing.UIUtilities;
|
30
|
30
|
import com.dmdirc.addons.ui_swing.components.frames.SwingFrameComponent;
|
31
|
|
-import com.dmdirc.events.UserErrorEvent;
|
32
|
31
|
import com.dmdirc.interfaces.Connection;
|
33
|
32
|
import com.dmdirc.interfaces.WindowModel;
|
34
|
|
-import com.dmdirc.logger.ErrorLevel;
|
35
|
33
|
import com.dmdirc.parser.events.SocketCloseEvent;
|
36
|
34
|
import com.dmdirc.parser.interfaces.Parser;
|
37
|
35
|
import com.dmdirc.util.DateUtils;
|
|
@@ -49,8 +47,13 @@ import javax.swing.JProgressBar;
|
49
|
47
|
|
50
|
48
|
import net.miginfocom.swing.MigLayout;
|
51
|
49
|
|
|
50
|
+import org.slf4j.Logger;
|
|
51
|
+import org.slf4j.LoggerFactory;
|
|
52
|
+
|
52
|
53
|
import net.engio.mbassy.listener.Handler;
|
53
|
54
|
|
|
55
|
+import static com.dmdirc.util.LogUtils.USER_ERROR;
|
|
56
|
+
|
54
|
57
|
/**
|
55
|
58
|
* A panel for displaying the progress of DCC transfers.
|
56
|
59
|
*
|
|
@@ -59,6 +62,7 @@ import net.engio.mbassy.listener.Handler;
|
59
|
62
|
public class TransferPanel extends JPanel implements ActionListener,
|
60
|
63
|
DCCTransferHandler, SwingFrameComponent {
|
61
|
64
|
|
|
65
|
+ private static final Logger LOG = LoggerFactory.getLogger(TransferPanel.class);
|
62
|
66
|
/** A version number for this class. */
|
63
|
67
|
private static final long serialVersionUID = 1L;
|
64
|
68
|
/** Parent container. */
|
|
@@ -150,19 +154,17 @@ public class TransferPanel extends JPanel implements ActionListener,
|
150
|
154
|
try {
|
151
|
155
|
Desktop.getDesktop().open(file);
|
152
|
156
|
} catch (IllegalArgumentException ex) {
|
153
|
|
- errorBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, ex,
|
154
|
|
- "Unable to open file: " + file, ""));
|
|
157
|
+ LOG.info(USER_ERROR, "Unable to open file {}", file.getAbsolutePath(), ex);
|
155
|
158
|
openButton.setEnabled(false);
|
156
|
159
|
} catch (IOException ex) {
|
157
|
160
|
try {
|
158
|
161
|
Desktop.getDesktop().open(file.getParentFile());
|
159
|
162
|
} catch (IllegalArgumentException ex1) {
|
160
|
|
- errorBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, ex1, "Unable to open folder: "
|
161
|
|
- + file.getParentFile(), ""));
|
|
163
|
+ LOG.info(USER_ERROR, "Unable to open folder: {}",
|
|
164
|
+ file.getParentFile().getAbsolutePath(), ex1);
|
162
|
165
|
openButton.setEnabled(false);
|
163
|
166
|
} catch (IOException ex1) {
|
164
|
|
- errorBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, ex1,
|
165
|
|
- "No associated handler to open file or directory.", ""));
|
|
167
|
+ LOG.info(USER_ERROR, "No associated handler to open file or directory.", ex1);
|
166
|
168
|
openButton.setEnabled(false);
|
167
|
169
|
}
|
168
|
170
|
}
|