Skip to content

Commit

Permalink
extract attach to process strings
Browse files Browse the repository at this point in the history
  • Loading branch information
GraxCode committed May 11, 2018
1 parent d81e16e commit 5562fac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/me/grax/jbytemod/ui/MyMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ protected void openProcessSelection() {
VirtualMachine vm = null;
try {
if (list.isEmpty()) {
String pid = JOptionPane.showInputDialog("Couldn't find any VM's! Enter your process id.");
String pid = JOptionPane.showInputDialog(JByteMod.res.getResource("no_vm_found"));
if (pid != null && !pid.isEmpty()) {
vm = AttachUtils.getVirtualMachine(Integer.parseInt(pid));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/grax/jbytemod/utils/task/AttachTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected Void doInBackground() throws Exception {

File self = new File(JByteMod.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
if (self.getAbsolutePath().endsWith(".jar")) {
JOptionPane.showMessageDialog(null, "Injecting... this could take a while.");
JOptionPane.showMessageDialog(null, JByteMod.res.getResource("injecting_msg"));
JarFile jbytemod = new JarFile(self);
double size = countFiles(jbytemod);
ZipOutputStream output = new ZipOutputStream(new FileOutputStream(temp));
Expand Down Expand Up @@ -75,7 +75,7 @@ protected Void doInBackground() throws Exception {
vm.loadAgent(temp.getAbsolutePath(), self.getParent());
temp.deleteOnExit();
} else {
JOptionPane.showMessageDialog(null, "Couldn't find itself as jar!");
JOptionPane.showMessageDialog(null, JByteMod.res.getResource("no_jar_found"));
}
publish(100);
return null;
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/locale/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,8 @@
<string name="max_redundant_input">Max inputs for redundant blocks</string>
<string name="set_py_path">Please try setting the python path</string>
<string name="python_path">Python path</string>
<string name="injecting_msg">Injecting... this could take a while.</string>
<string name="no_jar_found">Couldn't find itself as jar!</string>
<string name="no_vm_found">Couldn't find any VM's! Enter your process id.</string>
</resources>

0 comments on commit 5562fac

Please sign in to comment.