Skip to content

Commit 5122279

Browse files
committed
Fixed Statics.dragDropBool
1 parent ac9759f commit 5122279

File tree

8 files changed

+24
-25
lines changed

8 files changed

+24
-25
lines changed

src/main/java/com/i_comit/windows/AES.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ public static void AESQuery(List<Path> paths, File dirFile, boolean AESBool, int
209209
} catch (IOException ex) {
210210
ex.printStackTrace();
211211
}
212+
} else {
213+
GUI.resetProgressBar(jProgressBar1);
212214
}
213-
GUI.resetProgressBar(jProgressBar1);
214215
}
215216
break;
216217
case 1:

src/main/java/com/i_comit/windows/DragDrop.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class DragDrop implements DropTargetListener {
3737
@Override
3838
public void drop(DropTargetDropEvent event) {
3939
boolean b = false;
40+
Statics.resetStaticInts();
4041
event.acceptDrop(DnDConstants.ACTION_COPY);
4142
// Get the transfer which can provide the dropped item data
4243
Transferable transferable = event.getTransferable();
@@ -120,7 +121,6 @@ public void drop(DropTargetDropEvent event) {
120121
jProgressBar1.setString("0% | 0/" + files.size());
121122
AES.AESThread(paths, Statics.directory, false, 0);
122123
}
123-
Statics.dragDropBool = false;
124124
b = true;
125125
}
126126
}
@@ -211,7 +211,9 @@ public static synchronized void resetProgressBar(int encFiles, int decFiles) {
211211
try {
212212
Thread.sleep(400);
213213
AudioPlayer.audioPlayerThread("ding-sfx.wav");
214-
GUI.labelCutterThread(jAlertLabel, decFiles + " encrypted | " + encFiles + " decrypted", 15, 30, 300, false);
214+
GUI.labelCutterThread(jAlertLabel, decFiles + " encrypted | " + encFiles + " decrypted", 15, 30, 600, false);
215+
Main.jTextArea1.append("--------------------------------------------\n\n");
216+
Main.jTextArea1.setCaretPosition(Main.jTextArea1.getText().length());
215217

216218
Thread.sleep(300);
217219

@@ -223,8 +225,6 @@ public static synchronized void resetProgressBar(int encFiles, int decFiles) {
223225
}
224226
}
225227
if (jProgressBar1.getValue() == 0) {
226-
Statics.fileIter = 0;
227-
Statics.fileCount = 0;
228228
jProgressBar1.setValue(Statics.fileIter);
229229
jProgressBar1.setStringPainted(false);
230230
jProgressBar1.setVisible(false);

src/main/java/com/i_comit/windows/Folder.java

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public static void prepareZipFile() throws IOException {
4040
Main.dragDrop.setVisible(true);
4141
Statics.resetStaticInts();
4242
GUI.getGB();
43+
Main.refreshTreeView(Statics.sendFolder, TreeView.sendCaretPos);
4344
}
4445

4546
public static String firstLastChar(String username) {

src/main/java/com/i_comit/windows/GUI.java

+15-8
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,21 @@ public static void resetProgressBar(JProgressBar progressBar) {
197197
Main.jTextArea1.append("decrypted " + Statics.fileIter + " files at " + LocalTime.now().format(DateTimeFormatter.ofPattern("hh:ss a")) + "\n\n");
198198
break;
199199
}
200+
Main.jTextArea1.setCaretPosition(Main.jTextArea1.getText().length());
200201
Thread.sleep(150);
201202
if (Statics.fileIter <= 100) {
202203
for (int x = progressBar.getMaximum(); x >= 0; x--) {
203204
Thread.sleep(4);
204205
progressBar.setValue(x);
205-
if (x == 1) {
206+
if (x <= 1) {
206207
Main.progressbarBool = true;
207208
}
208209
}
209210
} else {
210211
for (int x = progressBar.getMaximum(); x >= 0; x--) {
211212
Thread.sleep(2);
212213
progressBar.setValue(x);
213-
if (x == 1) {
214+
if (x <= 1) {
214215
Main.progressbarBool = true;
215216
}
216217
}
@@ -240,22 +241,27 @@ public static void resetProgressBar(JProgressBar progressBar) {
240241
if (progressBar == Main.jProgressBar2) {
241242
try {
242243
Thread.sleep(50);
244+
AudioPlayer.audioPlayerThread("ding-sfx.wav");
245+
Main.jTextArea1.append("--------------------------------------------\n");
243246
String fileName = new File(Folder.sendFolderStr).getName();
244247
if (Statics.toolMode == 2) {
245248
GUI.t.interrupt();
246-
GUI.labelCutterThread(jAlertLabel, "packaged " + fileName + ".i-cc", 10, 25, 500, false);
247-
Main.jTextArea1.append("packaged " + fileName + ".i-cc at " + LocalTime.now().format(DateTimeFormatter.ofPattern("hh:ss a")) + "\n");
249+
GUI.labelCutterThread(jAlertLabel, "packaged " + fileName + ".i-cc", 10, 15, 300, false);
250+
Main.jTextArea1.append("packaged " + fileName + ".i-cc at " + LocalTime.now().format(DateTimeFormatter.ofPattern("hh:ss a")) + "\n\n");
248251
}
249252
if (Statics.toolMode == 1) {
250253
GUI.t.interrupt();
251-
GUI.labelCutterThread(jAlertLabel, "unpacked " + fileName + ".i-cc", 10, 25, 500, false);
252-
Main.jTextArea1.append("unpacked " + fileName + ".i-cc at " + LocalTime.now().format(DateTimeFormatter.ofPattern("hh:ss a")) + "\n");
254+
GUI.labelCutterThread(jAlertLabel, "unpacked " + fileName + ".i-cc", 10, 15, 300, false);
255+
Main.jTextArea1.append("unpacked " + fileName + ".i-cc at " + LocalTime.now().format(DateTimeFormatter.ofPattern("hh:ss a")) + "\n\n");
253256
}
254-
Thread.sleep(600);
257+
Main.jTextArea1.setCaretPosition(Main.jTextArea1.getText().length());
258+
progressBar = Main.jProgressBar1;
259+
Thread.sleep(200);
255260
if (Statics.fileIter <= 100) {
256261
for (int x = progressBar.getMaximum(); x >= 0; x--) {
257262
Thread.sleep(4);
258263
progressBar.setValue(x);
264+
Main.jProgressBar2.setValue(x);
259265
if (x == 1) {
260266
Main.progressbarBool = true;
261267
}
@@ -271,6 +277,7 @@ public static void resetProgressBar(JProgressBar progressBar) {
271277
}
272278
if (progressBar.getValue() == 0) {
273279
progressBar.setStringPainted(false);
280+
Main.jProgressBar2.setStringPainted(false);
274281
if (!Main.mouseOverLog) {
275282
Main.jTabbedPane1.setSelectedIndex(0);
276283
}
@@ -366,7 +373,7 @@ public static void logger_T(File outputFile, int toolMode) {
366373
if (!Statics.dragDropBool) {
367374
Main.jTextArea1.append(outputFile.getAbsolutePath().substring(20, outputFile.getPath().length()) + "\n");
368375
} else {
369-
Main.jTextArea1.append(outputFile.getAbsolutePath() + "\n");
376+
Main.jTextArea1.append(outputFile.getName() + "\n");
370377
}
371378
Main.jTextArea1.setCaretPosition(Main.jTextArea1.getText().length());
372379
} catch (InterruptedException ex) {

src/main/java/com/i_comit/windows/Hasher.java

-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package com.i_comit.windows;
22

3-
import static com.i_comit.windows.Statics.username;
4-
import java.io.BufferedReader;
5-
import java.io.FileNotFoundException;
6-
import java.io.FileReader;
7-
import java.io.IOException;
83
import java.util.Random;
94
import java.io.UnsupportedEncodingException;
105

@@ -24,7 +19,6 @@ public class Hasher {
2419
public static String getHash(String hash, boolean hashBool) {
2520
String hash2 = finalizeHash(hash, hashBool);
2621
int firstHashIndex = (hash.length() + 5);
27-
// System.out.println("GET HASH " + firstHashIndex);
2822

2923
int secondHashIndex = (15 - hash.length()) + (hash.length() * 16) + 9;
3024
String[] hashIndices = {
@@ -40,7 +34,6 @@ public static String getHash(String hash, boolean hashBool) {
4034
public static String readKey(String hash, String loginString) {
4135
int firstHashIndex = (loginString.length() + 5);
4236
int secondHashIndex = (15 - loginString.length()) + (loginString.length() * 16) + 9;
43-
// System.out.println("READ KEY " + firstHashIndex);
4437

4538
String[] hashIndices = {
4639
hash.substring(0, 4).trim(),
@@ -79,8 +72,6 @@ public static String finalizeHash(String hash, boolean hashBool) {
7972
}
8073
}
8174
sb.append(parts[3]);
82-
// System.out.println("REAL HASH "+ s1);
83-
// System.out.println(sb + "\n OF " + hash);
8475
} catch (UnsupportedEncodingException ex) {
8576
}
8677
return sb.toString().trim();

src/main/java/com/i_comit/windows/Login.java

-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ public static boolean verifySendKey(String zipFileN) {
217217
String usernameRead1 = Hasher.readKey(brTest1.readLine(), username);
218218
//
219219
if (usernameRead.equals(usernameRead1)) {
220-
System.out.println(passwordRead);
221-
System.out.println(Hasher.getHash(recipientPasswordStr, false));
222220
if (passwordRead.equals(Hasher.getHash(recipientPasswordStr, false))) {
223221
Hasher.hashedPassword = Hasher.getHash(recipientPasswordStr, false);
224222
resetStaticInts();

src/main/java/com/i_comit/windows/Main.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class Main extends javax.swing.JFrame {
3838
public static String root = "";
3939
public static final String masterFolder = "'--------'" + File.separator;
4040

41-
private final String appVer = "1.8.3";
41+
private final String appVer = "1.8.4";
4242
private final String latestDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("MM/dd/yyyy"));
4343
public static final int year = Year.now().getValue();
4444

src/main/java/com/i_comit/windows/Statics.java

+1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ public static void stopFunction(Main main) {
258258
jTextArea1.append("decryption of " + fileIter + " files stopped at " + LocalTime.now().format(DateTimeFormatter.ofPattern("hh:ss a")) + "\n\n");
259259
break;
260260
}
261+
Main.jTextArea1.setCaretPosition(Main.jTextArea1.getText().length());
261262
}
262263
resetStaticInts();
263264
}

0 commit comments

Comments
 (0)