Package com.salas.bb.service.sync

Examples of com.salas.bb.service.sync.SyncOut$SyncOutStats


     */
    private void syncOutOnExit()
    {
        if (!getConnectionState().isServiceAccessible()) return;

        SyncOut syncOut = new SyncOut(model);
        if (syncOut.isSyncTime())
        {
            GuidesSet set = model.getGuidesSet();
            ServicePreferences servicePreferences = model.getServicePreferences();

            int feedsCount = set.countFeeds();
            int lastSyncOutFeedsCount = servicePreferences.getLastSyncOutFeedsCount();
            boolean synchronizedBefore = servicePreferences.getLastSyncOutDate() != null;

            boolean doSync = feedsCount > 0 || synchronizedBefore;
            if (doSync && isSuspiciousDifference(feedsCount, lastSyncOutFeedsCount))
            {
                String message;
                if (feedsCount == 0)
                {
                    message = Strings.message("synconexit.clear.the.list.of.your.saved.subscriptions");
                } else
                {
                    message = MessageFormat.format(Strings.message("synconexit.make.a.large.change.0.1"),
                        lastSyncOutFeedsCount, feedsCount);
                }

                int result = JOptionPane.showConfirmDialog(getMainFrame(),
                    MessageFormat.format(Strings.message("synconexit.suspicious.sync.text.0"), message),
                    Strings.message("synconexit.suspicious.sync.title"), JOptionPane.YES_NO_OPTION,
                    JOptionPane.INFORMATION_MESSAGE);

                doSync = result == JOptionPane.YES_OPTION;
            }

            if (doSync && canSynchronize()) syncOut.doSynchronization(null, false);
        }
    }
View Full Code Here

TOP

Related Classes of com.salas.bb.service.sync.SyncOut$SyncOutStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.