=== modified file 'syncany/src/org/syncany/Application.java' --- syncany/src/org/syncany/Application.java 2011-06-12 13:07:30 +0000 +++ syncany/src/org/syncany/Application.java 2011-06-22 07:07:31 +0000 @@ -102,7 +102,10 @@ // Do NOT change the order of these method calls! // They strongly depend on each other. initDependencies(); - initUI(); + + if (!config.isHeadless()){ + initUI(); + } // This is done in a thread, so the application can finish @@ -111,8 +114,12 @@ @Override public void run() { // a. Launch first time wizard - if (config.getProfiles().list().isEmpty()) { - initFirstTimeWizard(); + if (config.getProfiles().list().isEmpty()) { + if (!config.isHeadless()){ + initFirstTimeWizard(); + } else { + logger.log(Level.SEVERE, "Invalid configuration. No profile defined in headless mode"); + } } // b. Activate profiles (Index files, then start local/remote watcher) === modified file 'syncany/src/org/syncany/Constants.java' --- syncany/src/org/syncany/Constants.java 2011-06-05 21:26:56 +0000 +++ syncany/src/org/syncany/Constants.java 2011-06-22 07:25:37 +0000 @@ -60,6 +60,8 @@ public static final boolean DEFAULT_AUTOSTART_ENABLED = true; public static final boolean DEFAULT_NOTIFICATIONS_ENABLED = true; + + public static final boolean DEFAULT_HEADLESSMODE_ENABLED = false; public static final Locale DEFAULT_LOCALE = new Locale("en_US"); === modified file 'syncany/src/org/syncany/config/Config.java' --- syncany/src/org/syncany/config/Config.java 2011-06-05 21:26:56 +0000 +++ syncany/src/org/syncany/config/Config.java 2011-06-22 07:25:37 +0000 @@ -67,6 +67,9 @@ private boolean serviceEnabled; private boolean autostart; private boolean notificationsEnabled; + + private boolean headless; + private ResourceBundle resourceBundle; private File resDir; @@ -85,6 +88,9 @@ userImageType = UserImageType.System; machineName = null; serviceEnabled = true; + + headless = false; + resourceBundle = ResourceBundle.getBundle(Constants.RESOURCE_BUNDLE, Constants.DEFAULT_LOCALE); /* @@ -192,6 +198,14 @@ public boolean isNotificationsEnabled() { return notificationsEnabled; } + + public void setHeadless(boolean headless) { + this.headless = headless; + } + + public boolean isHeadless() { + return headless; + } public void setNotificationsEnabled(boolean notificationsEnabled) { this.notificationsEnabled = notificationsEnabled; @@ -338,7 +352,8 @@ machineName = node.getProperty("machinename", env.getMachineName()); serviceEnabled = node.getBoolean("service-enabled", true); autostart = node.getBoolean("autostart", Constants.DEFAULT_AUTOSTART_ENABLED); - notificationsEnabled = node.getBoolean("notifications", Constants.DEFAULT_NOTIFICATIONS_ENABLED); + notificationsEnabled = node.getBoolean("notifications", Constants.DEFAULT_NOTIFICATIONS_ENABLED); + headless = node.getBoolean("headless", Constants.DEFAULT_HEADLESSMODE_ENABLED); if (userName.isEmpty()) { userName = env.getUserName(); @@ -399,6 +414,7 @@ node.setProperty("service-enabled", serviceEnabled); node.setProperty("autostart", autostart); node.setProperty("notifications", notificationsEnabled); + node.setProperty("headless", headless); // User Image switch (userImageType) { === modified file 'syncany/src/org/syncany/repository/Uploader.java' --- syncany/src/org/syncany/repository/Uploader.java 2011-06-01 23:49:53 +0000 +++ syncany/src/org/syncany/repository/Uploader.java 2011-06-22 07:07:56 +0000 @@ -109,7 +109,7 @@ } private void processRequest(CloneFile file) { - if (tray.getStatusIcon() != Tray.StatusIcon.UPDATING) { + if ((!config.isHeadless()) && tray.getStatusIcon() != Tray.StatusIcon.UPDATING) { tray.setStatusIcon(Tray.StatusIcon.UPDATING); } @@ -173,7 +173,7 @@ touch(file, SyncStatus.UPTODATE); - if (queue.isEmpty()) { + if ((!config.isHeadless()) && queue.isEmpty()) { tray.setStatusIcon(Tray.StatusIcon.UPTODATE); } } === modified file 'syncany/src/org/syncany/watch/remote/ChangeManager.java' --- syncany/src/org/syncany/watch/remote/ChangeManager.java 2011-06-01 23:49:53 +0000 +++ syncany/src/org/syncany/watch/remote/ChangeManager.java 2011-06-22 07:08:08 +0000 @@ -438,7 +438,9 @@ } // Q empty!! - tray.setStatusIcon(Tray.StatusIcon.UPTODATE); + if (!config.isHeadless()){ + tray.setStatusIcon(Tray.StatusIcon.UPTODATE); + } if (!newUpdatesMap.isEmpty()) { showNotification(newUpdatesMap);