From: <ez...@us...> - 2008-08-27 03:03:14
|
Revision: 13437 http://jedit.svn.sourceforge.net/jedit/?rev=13437&view=rev Author: ezust Date: 2008-08-27 03:03:09 +0000 (Wed, 27 Aug 2008) Log Message: ----------- - New option in saving/backup: Suppress "file not saved" warning on Untitled buffers. Related to that, "file not saved" warning is no longer shown for buffers (untitled or not) with length=0. -- (request # 2068307 - Alan Ezust ) Modified Paths: -------------- jEdit/trunk/doc/CHANGES.txt jEdit/trunk/org/gjt/sp/jedit/gui/CloseDialog.java jEdit/trunk/org/gjt/sp/jedit/jEdit.java jEdit/trunk/org/gjt/sp/jedit/jedit_gui.props jEdit/trunk/org/gjt/sp/jedit/options/SaveBackupOptionPane.java Modified: jEdit/trunk/doc/CHANGES.txt =================================================================== --- jEdit/trunk/doc/CHANGES.txt 2008-08-27 02:32:08 UTC (rev 13436) +++ jEdit/trunk/doc/CHANGES.txt 2008-08-27 03:03:09 UTC (rev 13437) @@ -24,6 +24,12 @@ - Enabled reverse regex search. (SF.net patch #1923613 - Greg Merrill) NOTE: There is a known problem with "$". (SF.net bug #2069249) +- New option in saving/backup: Suppress "file not saved" warning + on Untitled buffers. Related to that, "file not saved" warning + is no longer shown for buffers (untitled or not) with length=0. + -- (request # 2068307 - Alan Ezust ) + + }}} {{{ Docker Plugin features merged into jEdit Core Modified: jEdit/trunk/org/gjt/sp/jedit/gui/CloseDialog.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/CloseDialog.java 2008-08-27 02:32:08 UTC (rev 13436) +++ jEdit/trunk/org/gjt/sp/jedit/gui/CloseDialog.java 2008-08-27 03:03:09 UTC (rev 13437) @@ -64,11 +64,14 @@ Buffer[] buffers = jEdit.getBuffers(); for(int i = 0; i < buffers.length; i++) { + Buffer buffer = buffers[i]; - if(buffer.isDirty()) - { - bufferModel.addElement(buffer.getPath()); - } + boolean addBuffer = buffer.isDirty(); + if (buffer.getLength() == 0) addBuffer = false; + if (buffer.isNewFile() && jEdit.getBooleanProperty("suppressNotSavedConfirmUntitled")) + addBuffer=false; + if(addBuffer) + bufferModel.addElement(buffer.getPath()); } centerPanel.add(BorderLayout.CENTER,new JScrollPane(bufferList)); Modified: jEdit/trunk/org/gjt/sp/jedit/jEdit.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2008-08-27 02:32:08 UTC (rev 13436) +++ jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2008-08-27 03:03:09 UTC (rev 13437) @@ -1698,7 +1698,13 @@ return false; } - if(buffer.isDirty()) + boolean showNotSaved = buffer.isDirty(); + if (buffer.getLength() == 0) showNotSaved = false; + if (buffer.isNewFile() && + jEdit.getBooleanProperty("suppressNotSavedConfirmUntitled")) + showNotSaved = false; + + if(showNotSaved) { Object[] args = { buffer.getName() }; int result = GUIUtilities.confirm(view,"notsaved",args, Modified: jEdit/trunk/org/gjt/sp/jedit/jedit_gui.props =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/jedit_gui.props 2008-08-27 02:32:08 UTC (rev 13436) +++ jEdit/trunk/org/gjt/sp/jedit/jedit_gui.props 2008-08-27 03:03:09 UTC (rev 13437) @@ -1935,6 +1935,7 @@ options.save-back.twoStageSave=Two-stage save (safer but resets file owner on Unix) options.save-back.confirmSaveAll="Save All Buffers" asks for confirmation options.save-back.autosaveUntitled=Autosave untitled buffers +options.save-back.suppressNotSavedConfirmUntitled=Suppress "not saved" confirm dialog for Untitled buffers #}}} #{{{ Shortcuts pane Modified: jEdit/trunk/org/gjt/sp/jedit/options/SaveBackupOptionPane.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/options/SaveBackupOptionPane.java 2008-08-27 02:32:08 UTC (rev 13436) +++ jEdit/trunk/org/gjt/sp/jedit/options/SaveBackupOptionPane.java 2008-08-27 03:03:09 UTC (rev 13437) @@ -70,10 +70,15 @@ /* Autosave untitled buffers */ autosaveUntitled = new JCheckBox(jEdit.getProperty( "options.save-back.autosaveUntitled")); + suppressNotSavedConfirmUntitled = new JCheckBox(jEdit.getProperty( + "options.save-back.suppressNotSavedConfirmUntitled")); + suppressNotSavedConfirmUntitled.setSelected( + jEdit.getBooleanProperty("suppressNotSavedConfirmUntitled")); + autosaveUntitled.setSelected(jEdit.getBooleanProperty("autosaveUntitled")); addComponent(autosaveUntitled); + addComponent(suppressNotSavedConfirmUntitled); - /* Backup count */ backups = new NumericTextField(jEdit.getProperty("backups"), true); addComponent(jEdit.getProperty("options.save-back.backups"),backups); @@ -122,7 +127,8 @@ boolean newAutosave = autosaveUntitled.isSelected(); boolean oldAutosave = jEdit.getBooleanProperty("autosaveUntitled"); jEdit.setBooleanProperty("autosaveUntitled", newAutosave); - + jEdit.setBooleanProperty("suppressNotSavedConfirmUntitled", + suppressNotSavedConfirmUntitled.isSelected() ); if ((!newAutosave || jEdit.getIntegerProperty("autosave",0) == 0) && oldAutosave) { Buffer[] buffers = jEdit.getBuffers(); @@ -141,6 +147,7 @@ private JCheckBox confirmSaveAll; private JTextField autosave; private JCheckBox autosaveUntitled; + private JCheckBox suppressNotSavedConfirmUntitled; private JTextField backups; private JTextField backupDirectory; private JTextField backupPrefix; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |