示例#1
0
 public void itemStateChanged(Item item) {
   TabbedForm f = null;
   // #if true
   // # f = (TabbedForm)mView;
   // #endif
   switch (f.getActiveTab()) {
     case GENERAL_TAB:
       itemStateChangedGeneralTab(item);
       break;
     case DISPLAY_TAB:
       itemStateChangedDisplayTab(item);
       break;
     case SHORTCUTS_TAB:
       itemStateChangedShortcutsTab(item);
       break;
   }
 }
示例#2
0
  private void initTabContent(int tabIdx) {
    TabbedForm f = null;
    // #if true
    // # f = (TabbedForm)mView;
    // #endif

    switch (tabIdx) {
      case GENERAL_TAB:
        initGeneralTab();
        f.removeCommand(DELETE);
        break;
      case DISPLAY_TAB:
        initDisplayTab();
        f.removeCommand(DELETE);
        break;
      case SHORTCUTS_TAB:
        initShortcutsTab();
        f.addCommand(DELETE);
        break;
    }
  }
示例#3
0
  public SettingsView(ZimbraME midlet, Settings settings) {
    super(midlet);

    mSettings = settings;

    // #style SettingsView
    TabbedForm f =
        new TabbedForm(
            Locale.get("main.Settings"),
            new String[] {
              Locale.get("settings.General"),
              Locale.get("settings.Display"),
              // Locale.get("settings.Mail"),
              Locale.get("settings.Shortcuts")
            },
            null);

    // #if true
    // # mView = f;
    // #endif

    f.setItemStateListener(this);
    f.setTabbedFormListener(this);

    createGeneralTab();
    createDisplayTab();
    createShortcutsTab();

    f.addCommand(SAVE);
    f.setCommandListener(this);
    f.setItemStateListener(this);
  }
示例#4
0
  private void createGeneralTab() {
    TabbedForm f = null;
    // #if true
    // # f = (TabbedForm)mView;
    // #endif

    // #style ChoiceGroup
    mKeepSignedInCG = new ChoiceGroup("", ChoiceGroup.MULTIPLE);
    // #style ChoiceItem
    mKeepSignedInCG.append(Locale.get("login.KeepSignedIn"), null);
    f.append(GENERAL_TAB, mKeepSignedInCG);

    // #style ChoiceGroup
    mCacheContactsCG = new ChoiceGroup("", ChoiceGroup.MULTIPLE);
    // #style ChoiceItem
    mCacheContactsCG.append(Locale.get("settings.CacheContacts"), null);
    /* TODO Add this in later
    	f.append(GENERAL_TAB, mCacheContactsCG);
    */

    // ========== Preload Contacts

    // #style ChoiceGroup
    mPreloadContactsCG = new ChoiceGroup("", ChoiceGroup.MULTIPLE);
    // #style ChoiceItem
    mPreloadContactsCG.append(Locale.get("settings.PreloadContacts"), null);
    f.append(GENERAL_TAB, mPreloadContactsCG);

    // ========== Delete w/o confirmation

    boolean delWOC = mSettings.getDelWOConf();
    // #style ChoiceGroupOffset
    mDelWOConfCG = new ChoiceGroup("", ChoiceGroup.MULTIPLE);
    // #style ChoiceItem
    mDelWOConfCG.append(Locale.get("settings.DelWOConf"), null);
    mDelWOConfCG.setSelectedIndex(0, delWOC);
    f.append(GENERAL_TAB, mDelWOConfCG);

    // #style ChoiceGroupIndented
    mDelWOConfSubCG = new ChoiceGroup("", ChoiceGroup.MULTIPLE);
    // #style ChoiceItem
    mDWOCConvCI = new ChoiceItem(Locale.get("settings.Conversations"), null, Choice.MULTIPLE);
    // #style ChoiceItem
    mDWOCMsgCI = new ChoiceItem(Locale.get("settings.Messages"), null, Choice.MULTIPLE);
    f.append(GENERAL_TAB, mDelWOConfSubCG);

    // TODO remove when Polish fixes bug that causes layout/highlighting weirdness if the below is
    // removed
    // #style Spacer
    StringItem s = new StringItem(null, "");
    f.append(GENERAL_TAB, s);
  }
示例#5
0
  private void createShortcutsTab() {
    TabbedForm f = null;
    // #if true
    // # f = (TabbedForm)mView;
    // #endif

    // #style ChoiceGroup
    mShortcutList = new de.enough.polish.ui.ListItem(null);
    Shortcut[] shortcuts = mSettings.getShortcuts();
    Shortcut firstUnused = null;
    for (int i = 0; i < shortcuts.length; i++) {
      if (!shortcuts[i].isConfigured()) {
        firstUnused = shortcuts[i];
        break;
      }
    }

    ChoiceItem ci = null;
    if (firstUnused != null) {
      // #style ChoiceItem
      ci = new ShortcutItem(Locale.get("settings.NewShortcut"), null, List.IMPLICIT, firstUnused);
      mShortcutList.append(ci);
    }
    for (int i = 0; i < shortcuts.length; i++) {
      if (!shortcuts[i].isConfigured()) continue;
      // #style ChoiceItem
      ci = new ShortcutItem(shortcuts[i].toString(), null, List.IMPLICIT, shortcuts[i]);
      mShortcutList.append(ci);
    }

    f.deleteAll(SHORTCUTS_TAB);
    f.removeCommand(OK);
    f.removeCommand(CANCEL);
    f.addCommand(SAVE);
    f.addCommand(DELETE);
    f.append(SHORTCUTS_TAB, mShortcutList);
    mShortcutList.setItemCommandListener(this);
    mShortcutList.setDefaultCommand(List.SELECT_COMMAND);
  }
示例#6
0
  private void createDisplayTab() {
    TabbedForm f = null;
    // #if true
    // # f = (TabbedForm)mView;
    // #endif

    // #style SpanningLabel
    StringItem s = new StringItem(null, Locale.get("settings.ShowTickersFor"));
    f.append(DISPLAY_TAB, s);

    // #style ChoiceGroupIndented
    mTickerCG = new ChoiceGroup("", ChoiceGroup.MULTIPLE);
    // #style ChoiceItem
    mTickerCG.append(Locale.get("settings.Conversations"), null);
    // #style ChoiceItem
    mTickerCG.append(Locale.get("settings.Messages"), null);
    // #style ChoiceItem
    mTickerCG.append(Locale.get("settings.Appointments"), null);
    f.append(DISPLAY_TAB, mTickerCG);

    // ========== Ticker Speed

    // #style SpanningLabel
    s = new StringItem(null, Locale.get("settings.TickerSpeed"));
    f.append(DISPLAY_TAB, s);

    // #style ChoiceGroupIndented
    mTickerSpeedCG = new ChoiceGroup(null, ChoiceGroup.EXCLUSIVE);
    // #style ChoiceItem
    mTickerSpeedCG.append(Locale.get("settings.Slow"), null);
    // #style ChoiceItem
    mTickerSpeedCG.append(Locale.get("settings.Medium"), null);
    // #style ChoiceItem
    mTickerSpeedCG.append(Locale.get("settings.Fast"), null);
    f.append(DISPLAY_TAB, mTickerSpeedCG);

    // TODO remove when Polish fixes bug that causes layout/highlighting weirdness if the below is
    // removed
    // #style Spacer
    s = new StringItem(null, "");
    f.append(DISPLAY_TAB, s);
  }
示例#7
0
  private void createShortcutEditTab(ShortcutItem si) {
    TabbedForm f = null;
    // #if true
    // # f = (TabbedForm)mView;
    // #endif

    mSelectedShortcut = new ShortcutItem(si);
    int selectedIndex;
    switch (mSelectedShortcut.shortcut.action) {
      case Shortcut.ACTION_MOVE_TO_FOLDER:
      default:
        selectedIndex = SHORTCUT_FOLDER;
        break;
      case Shortcut.ACTION_TAG:
        selectedIndex = SHORTCUT_TAG;
        break;
      case Shortcut.ACTION_RUN_SAVED_SEARCH:
        selectedIndex = SHORTCUT_SEARCH;
        break;
    }

    mShortcutEditScreen = new de.enough.polish.ui.ListItem(Locale.get("settings.EditShortcut"));

    // #style SpanningLabel
    Item item = new StringItem(null, Locale.get("settings.Button"));
    mShortcutEditScreen.append(item);

    // #style ChoiceGroupPopup
    mShortcutButtonCG = new ChoiceGroup(null, Choice.POPUP);
    for (int i = 0; i < 10; i++) {
      // #style ChoiceItemPopup
      mShortcutButtonCG.append("# " + i, null);
    }

    mShortcutButtonCG.setSelectedIndex(mSelectedShortcut.shortcut.button, true);
    mShortcutEditScreen.append(mShortcutButtonCG);

    // #style SpanningLabel
    item = new StringItem(null, Locale.get("settings.Action"));
    mShortcutEditScreen.append(item);

    // #style ChoiceGroupIndented
    mShortcutActionCG = new ChoiceGroup(null, ChoiceGroup.EXCLUSIVE);
    // #style ChoiceItem
    mShortcutActionCG.append(
        mSelectedShortcut.shortcut.toString(false, Shortcut.ACTION_MOVE_TO_FOLDER), null);
    // #style ChoiceItem
    mShortcutActionCG.append(mSelectedShortcut.shortcut.toString(false, Shortcut.ACTION_TAG), null);
    // #style ChoiceItem
    mShortcutActionCG.append(
        mSelectedShortcut.shortcut.toString(false, Shortcut.ACTION_RUN_SAVED_SEARCH), null);
    mShortcutEditScreen.append(mShortcutActionCG);

    mShortcutActionCG.setSelectedIndex(selectedIndex, true);
    f.removeCommand(SAVE);
    f.removeCommand(DELETE);
    f.addCommand(OK);
    f.addCommand(CANCEL);
    f.deleteAll(SHORTCUTS_TAB);
    f.append(SHORTCUTS_TAB, mShortcutEditScreen);
  }