コード例 #1
0
    /** Triggered in threaded like logic when the user selects an option. */
    public void run() {
      // Whenever an alert choice is selected by the user the related
      // action related to the dismiss alert must be removed and must be
      // redefined run through this thread
      displayManager.removePostDismissSelectionDialogAction(displayManager.FIRST_SYNC_DIALOG_ID);

      // Dismiss the first sync selection dialog passing the command to
      // reset the sync all button on the home screen if and only if the
      // dialog is the latest to be shown to the user. The dismiss action
      // must rely on the DisplayManager implementation.
      displayManager.dismissSelectionDialog(displayManager.FIRST_SYNC_DIALOG_ID);
      HomeScreenController hsCont = controller.getHomeScreenController();

      // We don't want to show the alert twice. Even if the user postpones
      // the sync, we consider the source as synced just when nan active
      // response has been given to the alert (yes/no). In case the alert
      // is dismissed for any reason the client will display the alert
      // next time the sync is requested.
      appSourceList[sourceIndex].getConfig().setSynced(true);
      appSourceList[sourceIndex].getConfig().commit();

      if (getValue() == 0) {
        // User says "Sync Now"
        // add the given app source to the next sync request vector
        filteredSources.addElement(appSourceList[sourceIndex]);
      }
      hsCont.redraw();

      if (sourceIndex >= questionCounter - 1) {
        if (!hsCont.isSynchronizing()) {
          hsCont.changeSyncLabelsOnSyncEnded();
        }
        // Last sync question reached. Synchronization must start now. If
        // the filteredSources param is empty, then the sync is
        // terminated
        hsCont.continueSynchronizationAfterFirstSyncDialog(
            syncType, filteredSources, refresh, direction, delay, fromOutside, true);
      } else {
        // There are more sources that require this alert to be displayed
        sourceIndex++;
        showFirstSyncDialog(
            screen,
            appSourceList,
            syncType,
            filteredSources,
            refresh,
            direction,
            delay,
            fromOutside,
            questionCounter,
            sourceIndex);
      }
    }
コード例 #2
0
    /** Triggered in threaded like logic when the user selects an option. */
    public void run() {
      displayManager.removePostDismissSelectionDialogAction(displayManager.NO_WIFI_AVAILABLE_ID);
      displayManager.dismissSelectionDialog(displayManager.NO_WIFI_AVAILABLE_ID);
      HomeScreenController hsCont = controller.getHomeScreenController();

      if (getValue() == 0) {
        if (!hsCont.isSynchronizing()) {
          hsCont.changeSyncLabelsOnSyncEnded();
        }

        hsCont.continueSynchronizationAfterBandwithSaverDialog(
            syncType, filteredSources, refresh, direction, delay, fromOutside, true);
      } else {
        hsCont.continueSynchronizationAfterBandwithSaverDialog(
            syncType, new Vector(), refresh, direction, delay, fromOutside, false);
      }
    }