diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2008-02-13 11:05:55 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2008-02-13 11:05:55 +0000 |
commit | 2c06f16dccb0325220ab29d4acb811a216d293d1 (patch) | |
tree | 485fd2812003477809f379386af90b3f2b7b0cd2 /swext/mediawiki/src/com | |
parent | 20865907304e831c85e603df169f2df4afd85c8a (diff) |
fix the edit box; let the save password checkbox remember the state
Diffstat (limited to 'swext/mediawiki/src/com')
-rw-r--r-- | swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java | 26 | ||||
-rw-r--r-- | swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java | 17 |
2 files changed, 33 insertions, 10 deletions
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java index 7b6112a70cf3..4161724ed68c 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java @@ -4,9 +4,9 @@ * * $RCSfile: WikiEditSettingDialog.java,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: mav $ $Date: 2008-02-11 12:44:22 $ + * last change: $Author: mav $ $Date: 2008-02-13 12:05:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -68,7 +68,7 @@ public class WikiEditSettingDialog extends WikiDialog InsertThrobber( 184, 20, 10, 10 ); InitStrings( xContext ); - InitSaveCheckbox( xContext ); + InitSaveCheckbox( xContext, false ); } public WikiEditSettingDialog( XComponentContext xContext, String DialogURL, Hashtable ht, boolean bAllowURLChange ) @@ -76,14 +76,24 @@ public class WikiEditSettingDialog extends WikiDialog super( xContext, DialogURL ); super.setMethods( Methods ); setting = ht; + + boolean bInitSaveCheckBox = false; + try { XPropertySet xUrlField = GetPropSet( "UrlField" ); xUrlField.setPropertyValue( "Text", ht.get( "Url" ) ); - GetPropSet( "UsernameField" ).setPropertyValue( "Text", ht.get( "Username" )); - // the password should be entered or the Cancel should be pressed + GetPropSet( "UsernameField" ).setPropertyValue( "Text", ht.get( "Username" ) ); + + if ( Helper.PasswordStoringIsAllowed( m_xContext ) ) + { + String[] pPasswords = Helper.GetPasswordsForURLAndUser( m_xContext, (String)ht.get( "Url" ), (String)ht.get( "Username" ) ); + bInitSaveCheckBox = ( pPasswords != null && pPasswords.length > 0 && pPasswords[0].equals( (String)ht.get( "Password" ) ) ); + } + + // the password should be entered by the user or the Cancel should be pressed // GetPropSet( "PasswordField" ).setPropertyValue( "Text", ht.get( "Password" )); } catch ( Exception ex ) @@ -96,7 +106,7 @@ public class WikiEditSettingDialog extends WikiDialog InsertThrobber( 184, 20, 10, 10 ); InitStrings( xContext ); - InitSaveCheckbox( xContext ); + InitSaveCheckbox( xContext, bInitSaveCheckBox ); } public boolean show( ) @@ -158,12 +168,12 @@ public class WikiEditSettingDialog extends WikiDialog } } - private void InitSaveCheckbox( XComponentContext xContext ) + private void InitSaveCheckbox( XComponentContext xContext, boolean bInitSaveCheckBox ) { XPropertySet xSaveCheck = GetPropSet( "SaveBox" ); try { - xSaveCheck.setPropertyValue( "State", new Short( (short)0 ) ); + xSaveCheck.setPropertyValue( "State", new Short( bInitSaveCheckBox ? (short)1 : (short)0 ) ); xSaveCheck.setPropertyValue( "Enabled", new Boolean( Helper.PasswordStoringIsAllowed( xContext ) ) ); } catch( Exception e ) diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java index 4e53a95ca497..dea17b8e3bb4 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java @@ -4,9 +4,9 @@ * * $RCSfile: WikiPropDialog.java,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: mav $ $Date: 2008-02-12 18:41:06 $ + * last change: $Author: mav $ $Date: 2008-02-13 12:05:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -80,6 +80,19 @@ public class WikiPropDialog extends WikiDialog{ InitStrings( xContext ); InitShowBrowser( xContext ); + InitControls( xContext ); + } + + private void InitControls( XComponentContext xContext ) + { + try + { + GetPropSet( "CommentText" ).setPropertyValue( "AutoVScroll", Boolean.TRUE ); + } + catch( Exception e ) + { + e.printStackTrace(); + } } private void InitStrings( XComponentContext xContext ) |