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 | 51b4add091457d4bb5fcc5e457945e30c2b7493d (patch) | |
tree | 066f8a9636007dd15618c4a6bcb487012e328c90 /swext | |
parent | 2ecad260deafa068ffb08790b398c06c23a79f66 (diff) |
fix the edit box; let the save password checkbox remember the state
Diffstat (limited to 'swext')
3 files changed, 36 insertions, 13 deletions
diff --git a/swext/mediawiki/dialogs/SendToMediaWiki.xdl b/swext/mediawiki/dialogs/SendToMediaWiki.xdl index 6e34b56..0e472c4 100644 --- a/swext/mediawiki/dialogs/SendToMediaWiki.xdl +++ b/swext/mediawiki/dialogs/SendToMediaWiki.xdl @@ -5,9 +5,9 @@ * * $RCSfile: SendToMediaWiki.xdl,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: mav $ $Date: 2008-02-11 14:48:12 $ + * 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. @@ -45,7 +45,7 @@ <dlg:combobox dlg:id="ArticleText" dlg:tab-index="3" dlg:left="75" dlg:top="36" dlg:width="160" dlg:height="14" dlg:spin="true" dlg:help-url="com.sun.star.wiki.MediaWiki.SendToMediaWiki.ArticleText"> <script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.UNO:ArticleTextChange" script:language="UNO"/> </dlg:combobox> - <dlg:textfield dlg:id="CommentText" dlg:tab-index="5" dlg:left="75" dlg:top="55" dlg:width="160" dlg:height="48" dlg:multiline="true" dlg:help-url="com.sun.star.wiki.MediaWiki.SendToMediaWiki.CommentText" dlg:vscroll="true"/> + <dlg:textfield dlg:id="CommentText" dlg:tab-index="5" dlg:left="75" dlg:top="55" dlg:width="160" dlg:height="48" dlg:multiline="true" dlg:help-url="com.sun.star.wiki.MediaWiki.SendToMediaWiki.CommentText"/> <dlg:button dlg:id="AddButton" dlg:tab-index="6" dlg:left="195" dlg:top="6" dlg:width="40" dlg:height="14" dlg:value="TOREPLACE" dlg:help-url="com.sun.star.wiki.MediaWiki.SendToMediaWiki.AddButton"> <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.UNO:AddWiki" script:language="UNO"/> </dlg:button> diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java index bd9f0f7..104c70d 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 f2346a2..cd28daa 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,8 +80,21 @@ 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 ) { try |