Kaydet (Commit) 7f1c15e5 authored tarafından Mikhail Voitenko's avatar Mikhail Voitenko

adjust UI

üst 2659ded9
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: Helper.java,v $ * $RCSfile: Helper.java,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mav $ $Date: 2007-11-28 11:13:38 $ * last change: $Author: mav $ $Date: 2007-12-13 10:34:07 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -607,5 +607,44 @@ public class Helper ...@@ -607,5 +607,44 @@ public class Helper
return aHostConfig; return aHostConfig;
} }
private static XControl GetControlFromDialog( XDialog xDialog, String aControlName )
{
XControl xResult = null;
XControlContainer xControlCont = (XControlContainer) UnoRuntime.queryInterface( XControlContainer.class, xDialog );
if ( xControlCont != null )
{
Object oControl = xControlCont.getControl( aControlName );
xResult = ( XControl ) UnoRuntime.queryInterface( XControl.class, oControl );
}
return xResult;
}
private static XPropertySet GetSubControlPropSet( XDialog xDialog, String aControlName )
{
XControl xControl = GetControlFromDialog( xDialog, aControlName );
if ( xControl != null )
return ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xControl.getModel() );
return null;
}
private static void SetControlPropInDialog( XDialog xDialog, String aControlName, String aPropName, Object aPropValue )
{
if ( xDialog != null && aControlName != null && aPropName != null && aPropValue != null )
{
try
{
XPropertySet xPropSet = GetSubControlPropSet( xDialog, aControlName );
if ( xPropSet != null )
xPropSet.setPropertyValue( aPropName, aPropValue );
}
catch ( com.sun.star.uno.Exception e )
{
e.printStackTrace();
}
}
}
} }
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: WikiDialog.java,v $ * $RCSfile: WikiDialog.java,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mav $ $Date: 2007-11-28 11:14:46 $ * last change: $Author: mav $ $Date: 2007-12-13 10:34:07 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -97,6 +97,9 @@ public class WikiDialog implements XDialogEventHandler{ ...@@ -97,6 +97,9 @@ public class WikiDialog implements XDialogEventHandler{
protected XPropertySet getPropSet(String sControl) { protected XPropertySet getPropSet(String sControl) {
XControl xControl = m_xControlContainer.getControl(sControl); XControl xControl = m_xControlContainer.getControl(sControl);
XPropertySet xPS = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel() ); XPropertySet xPS = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel() );
if ( xPS == null )
throw new com.sun.star.uno.RuntimeException();
return xPS; return xPS;
} }
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: WikiEditSettingDialog.java,v $ * $RCSfile: WikiEditSettingDialog.java,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mav $ $Date: 2007-11-28 11:15:09 $ * last change: $Author: mav $ $Date: 2007-12-13 10:34:07 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -135,7 +135,7 @@ public class WikiEditSettingDialog extends WikiDialog ...@@ -135,7 +135,7 @@ public class WikiEditSettingDialog extends WikiDialog
if ( sRedirectURL.equals( "" ) ) if ( sRedirectURL.equals( "" ) )
{ {
// show error // show error
ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "This is not a Wiki Page!" ); ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "A connection to the MediaWiki system at '" + sRedirectURL + "' could not be created." );
ed.show(); ed.show();
} }
} }
...@@ -146,7 +146,7 @@ public class WikiEditSettingDialog extends WikiDialog ...@@ -146,7 +146,7 @@ public class WikiEditSettingDialog extends WikiDialog
{ {
// a wrong login information is provided // a wrong login information is provided
// show error // show error
ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "The login information is wrong! It should either be empty or correct." ); ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "User name or password is incorrect. Please try again, or leave the fields blank for an anonymous connection." );
ed.show(); ed.show();
} }
else else
...@@ -166,7 +166,7 @@ public class WikiEditSettingDialog extends WikiDialog ...@@ -166,7 +166,7 @@ public class WikiEditSettingDialog extends WikiDialog
{ {
// URL invalid // URL invalid
// show error // show error
ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "The URl is invalid!" ); ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "A connection could not be created, because the URL is invalid." );
ed.show(); ed.show();
} }
} }
...@@ -174,7 +174,7 @@ public class WikiEditSettingDialog extends WikiDialog ...@@ -174,7 +174,7 @@ public class WikiEditSettingDialog extends WikiDialog
{ {
// URL field empty // URL field empty
// show error // show error
ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "The URL field is empty!" ); ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "Specify a MediaWiki server by providing a URL." );
ed.show(); ed.show();
} }
...@@ -182,7 +182,7 @@ public class WikiEditSettingDialog extends WikiDialog ...@@ -182,7 +182,7 @@ public class WikiEditSettingDialog extends WikiDialog
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "Can not access the provided URL for any reason!" ); ErrorDialog ed = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "A connection to the MediaWiki system at '" + sRedirectURL + "' could not be created." );
ed.show(); ed.show();
ex.printStackTrace(); ex.printStackTrace();
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: WikiEditorImpl.java,v $ * $RCSfile: WikiEditorImpl.java,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mav $ $Date: 2007-11-28 11:14:58 $ * last change: $Author: mav $ $Date: 2007-12-13 10:34:07 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -75,6 +75,7 @@ public final class WikiEditorImpl extends WeakBase ...@@ -75,6 +75,7 @@ public final class WikiEditorImpl extends WeakBase
private final XComponentContext m_xContext; private final XComponentContext m_xContext;
private static final String m_implementationName = WikiEditorImpl.class.getName(); private static final String m_implementationName = WikiEditorImpl.class.getName();
private static final String[] m_serviceNames = {"com.sun.star.wiki.WikiEditor" }; private static final String[] m_serviceNames = {"com.sun.star.wiki.WikiEditor" };
private static final String m_sGeneralSendError = "The operation 'Send to MediaWiki' could not be completed successfully.";
// information needed for component registration // information needed for component registration
public static final String[] supportedServiceNames = {"com.sun.star.frame.ProtocolHandler"}; public static final String[] supportedServiceNames = {"com.sun.star.frame.ProtocolHandler"};
...@@ -399,7 +400,7 @@ public final class WikiEditorImpl extends WeakBase ...@@ -399,7 +400,7 @@ public final class WikiEditorImpl extends WeakBase
if ( m_aFilterName == null || m_aFilterName.length() == 0 ) if ( m_aFilterName == null || m_aFilterName.length() == 0 )
{ {
ErrorDialog ed = new ErrorDialog(m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "MediaWiki filter is requered to be able to export!"); ErrorDialog ed = new ErrorDialog(m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "The MediaWiki export filter cannot be found. Choose 'Tools-XML Filter Settings' to install the filter, or use the setup to install the component.");
ed.show(); ed.show();
throw new com.sun.star.uno.RuntimeException(); throw new com.sun.star.uno.RuntimeException();
} }
...@@ -441,6 +442,8 @@ public final class WikiEditorImpl extends WeakBase ...@@ -441,6 +442,8 @@ public final class WikiEditorImpl extends WeakBase
XDialog xDialog = WikiDialog.CreateSimpleDialog( m_xContext, "vnd.sun.star.script:WikiEditor.NewWikiPage?location=application" ); XDialog xDialog = WikiDialog.CreateSimpleDialog( m_xContext, "vnd.sun.star.script:WikiEditor.NewWikiPage?location=application" );
if ( xDialog != null ) if ( xDialog != null )
{ {
Helper.SetControlPropInDialog( xDialog, "Label1", "Label", "A wiki article with the title " + aSendDialog.m_sWikiTitle + " does not exist yet. Do you want to create a new article with that name?" );
aSendDialog.SetThrobberActive( false ); aSendDialog.SetThrobberActive( false );
bAllowSending = MainThreadDialogExecutor.Execute( m_xContext, xDialog ); bAllowSending = MainThreadDialogExecutor.Execute( m_xContext, xDialog );
aSendDialog.SetThrobberActive( true ); aSendDialog.SetThrobberActive( true );
...@@ -486,7 +489,7 @@ public final class WikiEditorImpl extends WeakBase ...@@ -486,7 +489,7 @@ public final class WikiEditorImpl extends WeakBase
} }
else else
{ {
ErrorDialog ed = new ErrorDialog(m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "Sending of the document has failed!"); ErrorDialog ed = new ErrorDialog(m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", m_sGeneralSendError );
MainThreadDialogExecutor.Show( m_xContext, ed ); MainThreadDialogExecutor.Show( m_xContext, ed );
} }
} }
...@@ -500,7 +503,7 @@ public final class WikiEditorImpl extends WeakBase ...@@ -500,7 +503,7 @@ public final class WikiEditorImpl extends WeakBase
if ( Helper.IsConnectionAllowed() ) if ( Helper.IsConnectionAllowed() )
{ {
// report the error only if sending was not cancelled // report the error only if sending was not cancelled
ErrorDialog ed = new ErrorDialog(m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "Sending of the document has failed!"); ErrorDialog ed = new ErrorDialog(m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", m_sGeneralSendError );
MainThreadDialogExecutor.Show( m_xContext, ed ); MainThreadDialogExecutor.Show( m_xContext, ed );
} }
e.printStackTrace(); e.printStackTrace();
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: WikiPropDialog.java,v $ * $RCSfile: WikiPropDialog.java,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mav $ $Date: 2007-11-28 11:15:31 $ * last change: $Author: mav $ $Date: 2007-12-13 10:34:07 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -305,7 +305,7 @@ public class WikiPropDialog extends WikiDialog{ ...@@ -305,7 +305,7 @@ public class WikiPropDialog extends WikiDialog{
} }
else else
{ {
ErrorDialog aED = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "The sending process has been stopped. But the wiki-page might be already changed!" ); ErrorDialog aED = new ErrorDialog( m_xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", "The transfer has been interrupted. Please check the integrity of the wiki article." );
aED.show(); aED.show();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment