|
@@ -32,6 +32,7 @@ import com.dmdirc.actions.CoreActionType;
|
32
|
32
|
import com.dmdirc.actions.interfaces.ActionType;
|
33
|
33
|
import com.dmdirc.addons.dcc.kde.KFileChooser;
|
34
|
34
|
import com.dmdirc.addons.dcc.actions.DCCActions;
|
|
35
|
+import com.dmdirc.addons.ui_swing.SwingController;
|
35
|
36
|
import com.dmdirc.commandparser.CommandManager;
|
36
|
37
|
import com.dmdirc.config.Identity;
|
37
|
38
|
import com.dmdirc.config.IdentityManager;
|
|
@@ -46,6 +47,7 @@ import com.dmdirc.logger.Logger;
|
46
|
47
|
import com.dmdirc.parser.interfaces.ClientInfo;
|
47
|
48
|
import com.dmdirc.parser.interfaces.Parser;
|
48
|
49
|
import com.dmdirc.plugins.Plugin;
|
|
50
|
+import com.dmdirc.plugins.PluginManager;
|
49
|
51
|
import com.dmdirc.ui.WindowManager;
|
50
|
52
|
|
51
|
53
|
import java.io.File;
|
|
@@ -54,7 +56,6 @@ import java.net.InetAddress;
|
54
|
56
|
import java.net.UnknownHostException;
|
55
|
57
|
|
56
|
58
|
import javax.swing.JFileChooser;
|
57
|
|
-import javax.swing.JFrame;
|
58
|
59
|
import javax.swing.JOptionPane;
|
59
|
60
|
|
60
|
61
|
/**
|
|
@@ -131,7 +132,9 @@ public final class DCCPlugin extends Plugin implements ActionListener {
|
131
|
132
|
if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "receive.autoaccept")) {
|
132
|
133
|
result = JFileChooser.APPROVE_OPTION;
|
133
|
134
|
} else {
|
134
|
|
- result = jc.showSaveDialog((JFrame) Main.getUI().getMainWindow());
|
|
135
|
+ result = jc.showSaveDialog(((SwingController) PluginManager
|
|
136
|
+ .getPluginManager().getPluginInfoByName("ui_swing")
|
|
137
|
+ .getPlugin()).getMainFrame());
|
135
|
138
|
}
|
136
|
139
|
if (result == JFileChooser.APPROVE_OPTION) {
|
137
|
140
|
send.setFileName(jc.getSelectedFile().getPath());
|
|
@@ -141,7 +144,10 @@ public final class DCCPlugin extends Plugin implements ActionListener {
|
141
|
144
|
if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "receive.autoaccept")) {
|
142
|
145
|
return;
|
143
|
146
|
} else {
|
144
|
|
- JOptionPane.showMessageDialog((JFrame) Main.getUI().getMainWindow(), "This file has already been completed, or is longer than the file you are receiving.\nPlease choose a different file.", "Problem with selected file", JOptionPane.ERROR_MESSAGE);
|
|
147
|
+ JOptionPane.showMessageDialog(
|
|
148
|
+ ((SwingController) PluginManager
|
|
149
|
+ .getPluginManager().getPluginInfoByName("ui_swing")
|
|
150
|
+ .getPlugin()).getMainFrame(), "This file has already been completed, or is longer than the file you are receiving.\nPlease choose a different file.", "Problem with selected file", JOptionPane.ERROR_MESSAGE);
|
145
|
151
|
saveFile(nickname, send, parser, reverse, sendFilename, token);
|
146
|
152
|
return;
|
147
|
153
|
}
|
|
@@ -149,7 +155,10 @@ public final class DCCPlugin extends Plugin implements ActionListener {
|
149
|
155
|
if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "receive.autoaccept")) {
|
150
|
156
|
resume = true;
|
151
|
157
|
} else {
|
152
|
|
- result = JOptionPane.showConfirmDialog((JFrame) Main.getUI().getMainWindow(), "This file exists already, do you want to resume an exisiting download?", "Resume Download?", JOptionPane.YES_NO_OPTION);
|
|
158
|
+ result = JOptionPane.showConfirmDialog(
|
|
159
|
+ ((SwingController) PluginManager
|
|
160
|
+ .getPluginManager().getPluginInfoByName("ui_swing")
|
|
161
|
+ .getPlugin()).getMainFrame(), "This file exists already, do you want to resume an exisiting download?", "Resume Download?", JOptionPane.YES_NO_OPTION);
|
153
|
162
|
resume = (result == JOptionPane.YES_OPTION);
|
154
|
163
|
}
|
155
|
164
|
}
|