Changeset 629
- Timestamp:
- 02/03/10 17:50:05 (2 years ago)
- Location:
- trunk/LogicMail
- Files:
-
- 6 edited
-
res/org/logicprobe/LogicMail/LogicMail.rrc (modified) (2 diffs)
-
res/org/logicprobe/LogicMail/LogicMail.rrh (modified) (1 diff)
-
src/org/logicprobe/LogicMail/conf/GlobalConfig.java (modified) (7 diffs)
-
src/org/logicprobe/LogicMail/ui/ConfigScreen.java (modified) (4 diffs)
-
src/org/logicprobe/LogicMail/ui/MailboxScreen.java (modified) (2 diffs)
-
src/org/logicprobe/LogicMail/ui/MessageActions.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LogicMail/res/org/logicprobe/LogicMail/LogicMail.rrc
r625 r629 35 35 CONFIG_GLOBAL_CONNECTION_DEBUGGING#0="Connection debugging"; 36 36 CONFIG_GLOBAL_ENABLE_WIFI#0="Use WiFi if available"; 37 CONFIG_GLOBAL_EXPUNGE_ALWAYS#0="Always"; 38 CONFIG_GLOBAL_EXPUNGE_BEHAVIOR#0="Remove deleted messages?"; 39 CONFIG_GLOBAL_EXPUNGE_NEVER#0="Never"; 40 CONFIG_GLOBAL_EXPUNGE_PROMPT#0="Prompt"; 37 41 CONFIG_GLOBAL_HIDE_DELETED_MESSAGES#0="Hide deleted messages"; 38 42 CONFIG_GLOBAL_HOSTNAME#0="Hostname:"; … … 48 52 CONFIG_GLOBAL_NETWORK_TRANSPORT#0="Connection method:"; 49 53 CONFIG_GLOBAL_OVERRIDE_HOSTNAME#0="Override hostname"; 54 CONFIG_GLOBAL_PROMPT_ON_MESSAGE_DELETE#0="Prompt on message delete?"; 50 55 CONFIG_GLOBAL_SECTION_MESSAGE_DISPLAY#0="Message display"; 51 56 CONFIG_GLOBAL_SECTION_NETWORKING#0="Networking"; -
trunk/LogicMail/res/org/logicprobe/LogicMail/LogicMail.rrh
r625 r629 201 201 ERROR_UNABLE_TO_OPEN_CONNECTION#0=204; 202 202 MENUITEM_SAVE_DRAFT#0=205; 203 CONFIG_GLOBAL_PROMPT_ON_MESSAGE_DELETE#0=206; 204 CONFIG_GLOBAL_EXPUNGE_BEHAVIOR#0=207; 205 CONFIG_GLOBAL_EXPUNGE_PROMPT#0=208; 206 CONFIG_GLOBAL_EXPUNGE_ALWAYS#0=209; 207 CONFIG_GLOBAL_EXPUNGE_NEVER#0=210; -
trunk/LogicMail/src/org/logicprobe/LogicMail/conf/GlobalConfig.java
r628 r629 54 54 /** Global data storage settings. */ 55 55 public static final int CHANGE_TYPE_DATA = 0x02; 56 /** Global prompt settings. */ 57 public static final int CHANGE_TYPE_PROMPTS = 0x04; 56 58 /** Global other settings. */ 57 public static final int CHANGE_TYPE_OTHER = 0x0 4;59 public static final int CHANGE_TYPE_OTHER = 0x08; 58 60 59 61 /** Prefer plain text display for messages */ … … 62 64 public static final int MESSAGE_DISPLAY_HTML = 1; 63 65 66 public static final int EXPUNGE_PROMPT = 0; 67 public static final int EXPUNGE_ALWAYS = 1; 68 public static final int EXPUNGE_NEVER = 2; 69 64 70 /** language code to use for the UI, or null for system default */ 65 71 private String languageCode; … … 84 90 /** Local host name override */ 85 91 private String localHostname; 92 /** Whether to prompt on deleting messages. */ 93 private boolean promptOnDelete; 94 /** The expunge-related behavior when leaving a mailbox. */ 95 private int expungeMode; 86 96 87 97 public static String FILE_URL_PREFIX = "file:///"; … … 122 132 this.localHostname = ""; 123 133 this.localDataLocation = ""; 134 this.promptOnDelete = true; 135 this.expungeMode = GlobalConfig.EXPUNGE_PROMPT; 124 136 changeType = 0; 125 137 } … … 362 374 } 363 375 376 /** 377 * Gets whether to prompt on message delete. 378 * 379 * @return the prompt on delete setting 380 */ 381 public boolean getPromptOnDelete() { 382 return promptOnDelete; 383 } 384 385 /** 386 * Sets whether to prompt on message delete. 387 * 388 * @param promptOnDelete the new prompt on delete setting 389 */ 390 public void setPromptOnDelete(boolean promptOnDelete) { 391 if(this.promptOnDelete != promptOnDelete) { 392 this.promptOnDelete = promptOnDelete; 393 changeType |= CHANGE_TYPE_PROMPTS; 394 } 395 } 396 397 /** 398 * Gets the expunge mode. 399 * 400 * @return the expunge mode 401 */ 402 public int getExpungeMode() { 403 return expungeMode; 404 } 405 406 /** 407 * Sets the expunge mode. 408 * 409 * @param expungeMode the new expunge mode 410 */ 411 public void setExpungeMode(int expungeMode) { 412 if(this.expungeMode != expungeMode) { 413 this.expungeMode = expungeMode; 414 changeType |= CHANGE_TYPE_PROMPTS; 415 } 416 } 417 364 418 /* (non-Javadoc) 365 419 * @see org.logicprobe.LogicMail.util.Serializable#serialize(java.io.DataOutput) … … 381 435 table.put("global_hideDeletedMsg", new Boolean(hideDeletedMsg)); 382 436 table.put("global_localHostname", localHostname); 437 table.put("global_promptOnDelete", new Boolean(promptOnDelete)); 438 table.put("global_expungeMode", new Integer(expungeMode)); 383 439 384 440 table.serialize(output); … … 447 503 if (value instanceof String) { 448 504 localHostname = (String) value; 505 } 506 value = table.get("global_promptOnDelete"); 507 if(value instanceof Boolean) { 508 promptOnDelete = ((Boolean)value).booleanValue(); 509 } 510 value = table.get("global_expungeMode"); 511 if(value instanceof Integer) { 512 expungeMode = ((Integer)value).intValue(); 449 513 } 450 514 changeType = 0; -
trunk/LogicMail/src/org/logicprobe/LogicMail/ui/ConfigScreen.java
r628 r629 95 95 private ObjectChoiceField displayOrderChoiceField; 96 96 private CheckboxField hideDeletedMessagesCheckboxField; 97 private CheckboxField promptOnDeleteCheckboxField; 98 private ObjectChoiceField expungeModeChoiceField; 97 99 98 100 // Networking … … 336 338 existingGlobalConfig.getHideDeletedMsg()); 337 339 340 promptOnDeleteCheckboxField = new CheckboxField( 341 resources.getString(LogicMailResource.CONFIG_GLOBAL_PROMPT_ON_MESSAGE_DELETE), 342 existingGlobalConfig.getPromptOnDelete()); 343 344 expungeModeChoiceField = new ObjectChoiceField( 345 resources.getString(LogicMailResource.CONFIG_GLOBAL_EXPUNGE_BEHAVIOR), 346 new Object[] { 347 resources.getString(LogicMailResource.CONFIG_GLOBAL_EXPUNGE_PROMPT), 348 resources.getString(LogicMailResource.CONFIG_GLOBAL_EXPUNGE_ALWAYS), 349 resources.getString(LogicMailResource.CONFIG_GLOBAL_EXPUNGE_NEVER) 350 }, 351 existingGlobalConfig.getExpungeMode()); 352 338 353 messageDisplayFieldManager.add(new LabeledSeparatorField( 339 354 resources.getString(LogicMailResource.CONFIG_GLOBAL_SECTION_MESSAGE_DISPLAY), … … 343 358 messageDisplayFieldManager.add(displayOrderChoiceField); 344 359 messageDisplayFieldManager.add(hideDeletedMessagesCheckboxField); 360 messageDisplayFieldManager.add(promptOnDeleteCheckboxField); 361 messageDisplayFieldManager.add(expungeModeChoiceField); 345 362 messageDisplayFieldManager.add(new BlankSeparatorField(separatorHeight)); 346 363 add(messageDisplayFieldManager); … … 972 989 config.setHideDeletedMsg(hideDeletedMessagesCheckboxField.getChecked()); 973 990 991 config.setPromptOnDelete(promptOnDeleteCheckboxField.getChecked()); 992 config.setExpungeMode(expungeModeChoiceField.getSelectedIndex()); 993 974 994 config.setTransportType(getTransportSetting(networkTransportChoiceField.getSelectedIndex())); 975 995 -
trunk/LogicMail/src/org/logicprobe/LogicMail/ui/MailboxScreen.java
r615 r629 47 47 48 48 import org.logicprobe.LogicMail.LogicMailResource; 49 import org.logicprobe.LogicMail.conf.GlobalConfig; 49 50 import org.logicprobe.LogicMail.conf.MailSettings; 50 51 import org.logicprobe.LogicMail.model.MailboxNode; … … 248 249 if(mailboxNode.getParentAccount().hasExpunge() 249 250 && mailboxNode.hasDeletedMessages()) { 250 // Prompt for expunge if possible and supported 251 int choice = Dialog.ask( 252 Dialog.D_YES_NO, 253 resources.getString(LogicMailResource.MAILBOX_EXPUNGE_PROMPT), 254 Dialog.YES); 255 256 // Request expunge if desired 257 if(choice == Dialog.YES) { 251 int expungeMode = MailSettings.getInstance().getGlobalConfig().getExpungeMode(); 252 if(expungeMode == GlobalConfig.EXPUNGE_PROMPT) { 253 // Prompt for expunge if possible and supported 254 int choice = Dialog.ask( 255 Dialog.D_YES_NO, 256 resources.getString(LogicMailResource.MAILBOX_EXPUNGE_PROMPT), 257 Dialog.YES); 258 259 // Request expunge if desired 260 if(choice == Dialog.YES) { 261 mailboxNode.expungeDeletedMessages(); 262 } 263 } 264 else if(expungeMode == GlobalConfig.EXPUNGE_ALWAYS) { 258 265 mailboxNode.expungeDeletedMessages(); 259 266 } 260 267 } 261 268 262 269 // Close the screen 263 270 screen.close(); -
trunk/LogicMail/src/org/logicprobe/LogicMail/ui/MessageActions.java
r620 r629 328 328 */ 329 329 public void deleteMessage(MessageNode messageNode) { 330 if(Dialog.ask(Dialog.D_YES_NO, resources.getString(LogicMailResource.MAILBOX_DELETE_PROMPT)) == Dialog.YES) { 331 messageNode.deleteMessage(); 330 if(MailSettings.getInstance().getGlobalConfig().getPromptOnDelete()) { 331 if(Dialog.ask(Dialog.D_YES_NO, resources.getString(LogicMailResource.MAILBOX_DELETE_PROMPT)) == Dialog.YES) { 332 messageNode.deleteMessage(); 333 } 334 } 335 else { 336 messageNode.deleteMessage(); 332 337 } 333 338 }
Note: See TracChangeset
for help on using the changeset viewer.
