@@ -98,8 +98,8 @@ public class Controller {
9898 private boolean editingPresets = false ;
9999 private boolean choosingRunInBackground = false ;
100100
101- static DropShadow errorBorder = new DropShadow ();
102- private static DropShadow borderGlow = new DropShadow ();
101+ static DropShadow errorBorder = new DropShadow (9.5 , 0f , 0f , Color . RED );
102+ private static DropShadow borderGlow = new DropShadow (9.5 , 0f , 0f , Color . DARKCYAN );
103103
104104 static Controller INSTANCE ;
105105
@@ -117,19 +117,6 @@ static void afterStageShowing() {
117117 @ FXML
118118 public void initialize () {
119119 INSTANCE = this ;
120- // create effects
121- borderGlow .setOffsetY (0f );
122- borderGlow .setOffsetX (0f );
123- borderGlow .setColor (Color .DARKCYAN );
124- borderGlow .setWidth (20 );
125- borderGlow .setHeight (20 );
126- errorBorder .setOffsetY (0f );
127- errorBorder .setOffsetX (0f );
128- errorBorder .setColor (Color .RED );
129- errorBorder .setWidth (20 );
130- errorBorder .setHeight (20 );
131-
132- deviceTypeChoiceBox .setItems (FXCollections .observableArrayList (Devices .getDeviceTypes ()));
133120
134121 deviceTypeChoiceBox .getSelectionModel ().selectedItemProperty ().addListener ((x , y , newValue ) -> {
135122 deviceTypeChoiceBox .setEffect (null );
@@ -170,20 +157,8 @@ public void initialize() {
170157 presetButtons = new ArrayList <>(Arrays .asList (preset1Button , preset2Button , preset3Button , preset4Button , preset5Button , preset6Button , preset7Button , preset8Button , preset9Button , preset10Button ));
171158 presetButtons .forEach (btn -> btn .setOnAction (this ::presetButtonHandler ));
172159
173- // the following is to set the path to save blobs to the correct location
174- String path = Main .jarDirectory .getAbsolutePath ();
175- if (path .endsWith ("blobsaver.app/Contents/Java" )) {
176- path = path .replaceAll ("blobsaver\\ .app/Contents/Java" , "" );
177- }
178- if (path .contains ("\\ Program Files" ) || path .contains ("/Applications" )) {
179- path = System .getProperty ("user.home" );
180- }
181- if (path .endsWith (System .getProperty ("file.separator" ))) {
182- path = path + "Blobs" ;
183- } else {
184- path = path + System .getProperty ("file.separator" ) + "Blobs" ;
185- }
186- pathField .setText (path );
160+
161+ pathField .setText (new File (System .getProperty ("user.home" ), "Blobs" ).getAbsolutePath ());
187162
188163
189164 if (PlatformUtil .isMac ()) {
@@ -250,7 +225,6 @@ public void versionCheckBoxHandler() {
250225 versionField .setText ("" );
251226 } else {
252227 versionField .setEffect (borderGlow );
253-
254228 versionField .setDisable (false );
255229 }
256230 }
@@ -367,12 +341,12 @@ private void presetButtonHandler(ActionEvent evt) {
367341 if (presetsToSaveFor .isEmpty ()) {
368342 appPrefs .putBoolean ("Background setup" , false );
369343 }
370- log ("removed " + preset + " from list" );
344+ System . out . println ("removed " + preset + " from list" );
371345 backgroundSettingsButton .fire ();
372346 } else {
373347 presetsToSaveFor .add (Integer .toString (preset ));
374348 appPrefs .putBoolean ("Background setup" , true );
375- log ("added preset" + preset + " to list" );
349+ System . out . println ("added preset" + preset + " to list" );
376350 Alert alert = new Alert (Alert .AlertType .INFORMATION , "If it doesn't work, please remove it, fix the error, and add it back" );
377351 alert .setTitle ("Testing preset " + preset );
378352 alert .setHeaderText ("Testing preset" );
@@ -657,7 +631,7 @@ private void useMacOSMenuBar() {
657631
658632 // needs to be run with Platform.runLater(), otherwise the application menu doesn't show up
659633 Platform .runLater (() -> tk .setGlobalMenuBar (macOSMenuBar ));
660- log ("using macOS menu bar" );
634+ System . out . println ("using macOS menu bar" );
661635 }
662636
663637 public void backgroundSettingsHandler () {
@@ -733,11 +707,9 @@ public void chooseTimeToRunHandler() {
733707 alert .getDialogPane ().setContent (hBox );
734708 alert .showAndWait ();
735709 if ((alert .getResult () != null ) && !ButtonType .CANCEL .equals (alert .getResult ()) && !"" .equals (textField .getText ()) && (choiceBox .getValue () != null )) {
736- log ("info given" );
737710 appPrefs .putInt ("Time to run" , Integer .parseInt (textField .getText ()));
738711 appPrefs .put ("Time unit for background" , choiceBox .getValue ());
739712 } else {
740- log ("alert menu canceled" );
741713 backgroundSettingsButton .fire (); //goes back to main menu
742714 return ;
743715 }
@@ -797,8 +769,6 @@ public void resetAppHandler() {
797769 prefs .clear ();
798770 prefs .removeNode ();
799771 prefs .flush ();
800- File blobsaver_bin = new File (System .getProperty ("user.home" ), ".blobsaver_bin" );
801- deleteFolder (blobsaver_bin );
802772 Alert applicationCloseAlert = new Alert (Alert .AlertType .INFORMATION , "The application data and files have been removed. If you are running Windows, you still will need to run the uninstall .exe. Otherwise, you can just delete the .app or .jar file.\n The application will now exit." , ButtonType .OK );
803773 applicationCloseAlert .showAndWait ();
804774 Platform .exit ();
@@ -807,22 +777,6 @@ public void resetAppHandler() {
807777 }
808778 }
809779
810- @ SuppressWarnings ("ResultOfMethodCallIgnored" )
811- private static void deleteFolder (File folder ) {
812- if (folder .exists ()) {
813- File [] files = folder .listFiles ();
814- if (files != null ) {
815- Arrays .asList (files ).forEach (file -> {
816- if (file .isDirectory ()) {
817- deleteFolder (file );
818- } else {
819- file .delete ();
820- }
821- });
822- }
823- }
824- }
825-
826780 public void debugLogHandler () {
827781 if (DebugWindow .isShowing ()) {
828782 DebugWindow .hide ();
@@ -907,8 +861,6 @@ public void readInfo() {
907861
908862 public void donate () { openURL ("https://www.paypal.me/airsqrd" ); }
909863
910- private static void log (String msg ) { System .out .println (msg ); }
911-
912864 @ SuppressWarnings ("Duplicates" )
913865 public void goButtonHandler () {
914866 boolean doReturn = false ;
@@ -928,22 +880,20 @@ public void goButtonHandler() {
928880 doReturn = doReturn || isTextFieldInvalid (!versionCheckBox .isSelected (), versionField );
929881 doReturn = doReturn || isTextFieldInvalid (betaCheckBox , buildIDField );
930882 doReturn = doReturn || isTextFieldInvalid (betaCheckBox , ipswField );
931- if (doReturn ) {
932- return ;
933- }
883+ if (doReturn ) return ;
884+
934885 String deviceModel = (String ) deviceModelChoiceBox .getValue ();
935886 if ("" .equals (deviceModel )) {
936887 String identifierText = identifierField .getText ();
937888 try {
938889 if (identifierText .startsWith ("iPad" ) || identifierText .startsWith ("iPod" ) || identifierText .startsWith ("iPhone" ) || identifierText .startsWith ("AppleTV" )) {
939890 TSSChecker .run (identifierText );
940- } else {
941- identifierField .setEffect (errorBorder );
942- newUnreportableError ("\" " + identifierText + "\" is not a valid identifier" );
891+ return ;
943892 }
944- } catch (StringIndexOutOfBoundsException e ) {
945- newUnreportableError ("\" " + identifierText + "\" is not a valid identifier" );
893+ } catch (StringIndexOutOfBoundsException ignored ) {
946894 }
895+ identifierField .setEffect (errorBorder );
896+ newUnreportableError ("\" " + identifierText + "\" is not a valid identifier" );
947897 } else {
948898 TSSChecker .run (textToIdentifier (deviceModel ));
949899 }
0 commit comments