diff --git a/.classpath b/.classpath index ea0749f..10ccd5b 100644 --- a/.classpath +++ b/.classpath @@ -4,7 +4,6 @@ - @@ -14,16 +13,17 @@ - - - - - - - - - - - + + + + + + + + + + + + diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..c0e891e --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,4 @@ +/cloudControllerInstances/ +/libraries/ +/resources/ +/application/ diff --git a/bin/application/CloudController$1.class b/bin/application/CloudController$1.class index 3c7a48e..85e08bc 100644 Binary files a/bin/application/CloudController$1.class and b/bin/application/CloudController$1.class differ diff --git a/bin/application/CloudController$2.class b/bin/application/CloudController$2.class index 67b3051..d205e9f 100644 Binary files a/bin/application/CloudController$2.class and b/bin/application/CloudController$2.class differ diff --git a/bin/application/CloudController$3.class b/bin/application/CloudController$3.class index 8b7aab4..b118468 100644 Binary files a/bin/application/CloudController$3.class and b/bin/application/CloudController$3.class differ diff --git a/bin/application/CloudController.class b/bin/application/CloudController.class index a1a35cc..887d6a8 100644 Binary files a/bin/application/CloudController.class and b/bin/application/CloudController.class differ diff --git a/bin/application/Main.class b/bin/application/Main.class index d5c8990..e5e066d 100644 Binary files a/bin/application/Main.class and b/bin/application/Main.class differ diff --git a/bin/application/MainWindowController$10.class b/bin/application/MainWindowController$10.class index 9617cdc..6fe2cbd 100644 Binary files a/bin/application/MainWindowController$10.class and b/bin/application/MainWindowController$10.class differ diff --git a/bin/application/MainWindowController$11.class b/bin/application/MainWindowController$11.class index 391d00c..f09d400 100644 Binary files a/bin/application/MainWindowController$11.class and b/bin/application/MainWindowController$11.class differ diff --git a/bin/application/MainWindowController$12.class b/bin/application/MainWindowController$12.class index 6fdddbe..b859565 100644 Binary files a/bin/application/MainWindowController$12.class and b/bin/application/MainWindowController$12.class differ diff --git a/bin/application/MainWindowController.class b/bin/application/MainWindowController.class index 486c768..f07acab 100644 Binary files a/bin/application/MainWindowController.class and b/bin/application/MainWindowController.class differ diff --git a/bin/cloudControllerInstances/GoogleDriveController.class b/bin/cloudControllerInstances/GoogleDriveController.class index 2a86644..b71ad25 100644 Binary files a/bin/cloudControllerInstances/GoogleDriveController.class and b/bin/cloudControllerInstances/GoogleDriveController.class differ diff --git a/bin/libraries/commons-logging-api-1.1.jar b/bin/libraries/commons-logging-api-1.1.jar deleted file mode 100644 index d1abcbb..0000000 Binary files a/bin/libraries/commons-logging-api-1.1.jar and /dev/null differ diff --git a/src/application/CloudController.java b/src/application/CloudController.java index c80c237..caf4c48 100644 --- a/src/application/CloudController.java +++ b/src/application/CloudController.java @@ -40,20 +40,26 @@ public class CloudController { private GoogleDriveController googleDriveController = new GoogleDriveController(); private static final Logger LOGGER = LogManager.getLogger(CloudController.class.getName()); - void initializeConnection(String cloudService, String cemuDirectory) { + boolean initializeConnection(String cloudService, String cemuDirectory) { + boolean success = false; LOGGER.info("sartting cloud initialisation ..."); + if(cloudService.equals("GoogleDrive")) { LOGGER.info("selected service is Google Drive"); try { googleDriveController.main(cemuDirectory); } catch (IOException e) { LOGGER.error("error while initialize connection", e); + return success; } + success = true; } + if(cloudService.equals("Dropbox")) { LOGGER.info("selected service is Dropbox"); } LOGGER.info("cloud initialisation done!"); + return success; } void stratupCheck(String cloudService, String cemuDirectory) { diff --git a/src/application/MainWindowController.java b/src/application/MainWindowController.java index 71950aa..1c7db15 100644 --- a/src/application/MainWindowController.java +++ b/src/application/MainWindowController.java @@ -858,9 +858,15 @@ public class MainWindowController { cloudSync = true; //TODO rework for other cloud services cloudService = "GoogleDrive"; - main.cloudController.initializeConnection(getCloudService(), getCemuPath()); - main.cloudController.sync(getCloudService(), getCemuPath()); - saveSettings(); + if (main.cloudController.initializeConnection(getCloudService(), getCemuPath())) { + main.cloudController.sync(getCloudService(), getCemuPath()); + saveSettings(); + } else { + cloudSyncToggleBtn.setSelected(false); + // TODO show error message + } + +// saveSettings(); dialog.close(); } }); diff --git a/src/cloudControllerInstances/GoogleDriveController.java b/src/cloudControllerInstances/GoogleDriveController.java index 9bcc3aa..ddc3195 100644 --- a/src/cloudControllerInstances/GoogleDriveController.java +++ b/src/cloudControllerInstances/GoogleDriveController.java @@ -104,11 +104,10 @@ public class GoogleDriveController { InputStream in = getClass().getClassLoader().getResourceAsStream("resources/client_secret.json"); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in)); - //FIXME Linux fails to open a new browser window, application crashes + //FIXME Linux fails to open a new browser window, application crashes, maybe a kde only bug // Build flow and trigger user authorization request. - GoogleAuthorizationCodeFlow flow = - new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES) - .setDataStoreFactory(DATA_STORE_FACTORY) + GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES) + .setDataStoreFactory(DATA_STORE_FACTORY) .setAccessType("offline") .build(); Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); diff --git a/src/libraries/commons-logging-1.1.1.jar b/src/libraries/commons-logging-1.1.1.jar new file mode 100644 index 0000000..1deef14 Binary files /dev/null and b/src/libraries/commons-logging-1.1.1.jar differ diff --git a/src/libraries/commons-logging-api-1.1.jar b/src/libraries/commons-logging-api-1.1.jar deleted file mode 100644 index d1abcbb..0000000 Binary files a/src/libraries/commons-logging-api-1.1.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-api-client-1.22.0.jar b/src/libraries/google_apis_old/google-api-client-1.22.0.jar deleted file mode 100644 index b9c2b2d..0000000 Binary files a/src/libraries/google_apis_old/google-api-client-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-api-services-drive-v2-rev263-1.22.0.jar b/src/libraries/google_apis_old/google-api-services-drive-v2-rev263-1.22.0.jar deleted file mode 100644 index 971a232..0000000 Binary files a/src/libraries/google_apis_old/google-api-services-drive-v2-rev263-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-api-services-drive-v3-rev68-1.22.0.jar b/src/libraries/google_apis_old/google-api-services-drive-v3-rev68-1.22.0.jar deleted file mode 100644 index 2949409..0000000 Binary files a/src/libraries/google_apis_old/google-api-services-drive-v3-rev68-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-http-client-1.22.0.jar b/src/libraries/google_apis_old/google-http-client-1.22.0.jar deleted file mode 100644 index a31a9b1..0000000 Binary files a/src/libraries/google_apis_old/google-http-client-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-http-client-jackson2-1.22.0.jar b/src/libraries/google_apis_old/google-http-client-jackson2-1.22.0.jar deleted file mode 100644 index 64f0c15..0000000 Binary files a/src/libraries/google_apis_old/google-http-client-jackson2-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-oauth-client-1.22.0.jar b/src/libraries/google_apis_old/google-oauth-client-1.22.0.jar deleted file mode 100644 index 93d284d..0000000 Binary files a/src/libraries/google_apis_old/google-oauth-client-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-oauth-client-java6-1.22.0.jar b/src/libraries/google_apis_old/google-oauth-client-java6-1.22.0.jar deleted file mode 100644 index 956f263..0000000 Binary files a/src/libraries/google_apis_old/google-oauth-client-java6-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/google-oauth-client-jetty-1.22.0.jar b/src/libraries/google_apis_old/google-oauth-client-jetty-1.22.0.jar deleted file mode 100644 index 25b5ac5..0000000 Binary files a/src/libraries/google_apis_old/google-oauth-client-jetty-1.22.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/jackson-core-2.8.8.jar b/src/libraries/google_apis_old/jackson-core-2.8.8.jar deleted file mode 100644 index 2a66a6f..0000000 Binary files a/src/libraries/google_apis_old/jackson-core-2.8.8.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/javax.servlet-api-3.1.0.jar b/src/libraries/google_apis_old/javax.servlet-api-3.1.0.jar deleted file mode 100644 index 6b14c3d..0000000 Binary files a/src/libraries/google_apis_old/javax.servlet-api-3.1.0.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/jetty-6.1.25.jar b/src/libraries/google_apis_old/jetty-6.1.25.jar deleted file mode 100644 index 50fd700..0000000 Binary files a/src/libraries/google_apis_old/jetty-6.1.25.jar and /dev/null differ diff --git a/src/libraries/google_apis_old/jetty-util-6.1.25.jar b/src/libraries/google_apis_old/jetty-util-6.1.25.jar deleted file mode 100644 index 70018d3..0000000 Binary files a/src/libraries/google_apis_old/jetty-util-6.1.25.jar and /dev/null differ