summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--swext/mediawiki/dialogs/EditSetting.xdl7
-rw-r--r--swext/mediawiki/dialogs/SendToMediaWiki.xdl7
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/Helper.java49
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java40
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java46
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java37
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java12
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiOptionsEventHandlerImpl.java8
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java57
9 files changed, 170 insertions, 93 deletions
diff --git a/swext/mediawiki/dialogs/EditSetting.xdl b/swext/mediawiki/dialogs/EditSetting.xdl
index 22833559f446..4b75c1866adc 100644
--- a/swext/mediawiki/dialogs/EditSetting.xdl
+++ b/swext/mediawiki/dialogs/EditSetting.xdl
@@ -5,9 +5,9 @@
*
* $RCSfile: EditSetting.xdl,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mav $ $Date: 2008-01-21 12:57:52 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -43,8 +43,7 @@
<dlg:button dlg:id="OkButton" dlg:tab-index="12" dlg:left="77" dlg:top="139" dlg:width="50" dlg:height="14" dlg:help-url="HID:31700" dlg:default="true" dlg:value="TOREPLACE">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.UNO:OK" script:language="UNO"/>
</dlg:button>
- <dlg:button dlg:id="CancelButton" dlg:tab-index="13" dlg:left="130" dlg:top="139" dlg:width="50" dlg:height="14" dlg:help-url="HID:31701" dlg:value="TOREPLACE">
- <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.UNO:Cancel" script:language="UNO"/>
+ <dlg:button dlg:id="CancelButton" dlg:tab-index="13" dlg:left="130" dlg:top="139" dlg:width="50" dlg:height="14" dlg:help-url="HID:31701" dlg:button-type="cancel">
</dlg:button>
<dlg:button dlg:id="HelpButton" dlg:tab-index="11" dlg:left="6" dlg:top="139" dlg:width="50" dlg:height="14" dlg:help-url="HID:31702" dlg:value="TOREPLACE">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.UNO:Help" script:language="UNO"/>
diff --git a/swext/mediawiki/dialogs/SendToMediaWiki.xdl b/swext/mediawiki/dialogs/SendToMediaWiki.xdl
index 80bbbc222b61..dfb9b9e1032b 100644
--- a/swext/mediawiki/dialogs/SendToMediaWiki.xdl
+++ b/swext/mediawiki/dialogs/SendToMediaWiki.xdl
@@ -5,9 +5,9 @@
*
* $RCSfile: SendToMediaWiki.xdl,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mav $ $Date: 2008-01-30 14:29:25 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -52,8 +52,7 @@
<dlg:checkbox dlg:id="MinorCheck" dlg:tab-index="7" dlg:left="73" dlg:top="66" dlg:width="142" dlg:height="10" dlg:value="TOREPLACE" dlg:checked="false"/>
<dlg:checkbox dlg:id="BrowserCheck" dlg:tab-index="8" dlg:left="73" dlg:top="79" dlg:width="142" dlg:height="10" dlg:value="TOREPLACE" dlg:checked="false"/>
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="9" dlg:left="-5" dlg:top="100" dlg:width="294" dlg:height="4"/>
- <dlg:button dlg:id="CancelButton" dlg:tab-index="10" dlg:left="219" dlg:top="108" dlg:width="63" dlg:height="16" dlg:value="TOREPLACE">
- <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.UNO:Cancel" script:language="UNO"/>
+ <dlg:button dlg:id="CancelButton" dlg:tab-index="10" dlg:left="219" dlg:top="108" dlg:width="63" dlg:height="16" dlg:button-type="cancel">
</dlg:button>
<dlg:button dlg:id="SendButton" dlg:tab-index="11" dlg:disabled="true" dlg:left="153" dlg:top="108" dlg:width="63" dlg:height="16" dlg:value="TOREPLACE" dlg:default="true">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.UNO:Send" script:language="UNO"/>
diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
index a62bf189bcd5..2e0c1fb4c30f 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
@@ -4,9 +4,9 @@
*
* $RCSfile: Helper.java,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: mav $ $Date: 2008-01-30 19:02:16 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -58,6 +58,7 @@ import com.sun.star.io.XSeekable;
import com.sun.star.io.XStream;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XComponent;
import com.sun.star.system.SystemShellExecuteFlags;
import com.sun.star.system.XSystemShellExecute;
import com.sun.star.task.UrlRecord;
@@ -95,7 +96,7 @@ public class Helper
public final static int NOURL_ERROR = 5;
public final static int DLG_SENDTITLE = 6;
- public final static int DLG_CANCEL = 7;
+ // number 7 is RESERVED
public final static int DLG_NO = 8;
public final static int DLG_OK = 9;
public final static int DLG_YES = 10;
@@ -131,7 +132,7 @@ public class Helper
"InvalidURL",
"NoURL",
"Dlg_SendTitle",
- "Dlg_Cancel",
+ null, // reserved
"Dlg_No",
"Dlg_OK",
"Dlg_Yes",
@@ -184,7 +185,10 @@ public class Helper
String[] pStrings = new String[STRINGS_NUM];
for ( int nInd = 0; nInd < STRINGS_NUM; nInd++ )
- pStrings[nInd] = AnyConverter.toString( xNameAccess.getByName( m_pEntryNames[nInd] ) );
+ if ( m_pEntryNames[nInd] != null )
+ pStrings[nInd] = AnyConverter.toString( xNameAccess.getByName( m_pEntryNames[nInd] ) );
+ else
+ pStrings[nInd] = "";
m_pConfigStrings = pStrings;
}
@@ -930,9 +934,10 @@ public class Helper
if ( xParentPeer != null )
{
+ XMessageBoxFactory xMBFactory = null;
+ XMessageBox xMB = null;
try
{
- XMessageBoxFactory xMBFactory = null;
XMultiComponentFactory xFactory = xContext.getServiceManager();
if ( xFactory != null )
xMBFactory = (XMessageBoxFactory)UnoRuntime.queryInterface(
@@ -941,7 +946,6 @@ public class Helper
if ( xMBFactory != null )
{
- XMessageBox xMB = null;
if ( bQuery )
{
xMB = xMBFactory.createMessageBox(
@@ -973,18 +977,10 @@ public class Helper
{
e.printStackTrace();
}
- }
-
- if ( !bShown )
- {
- try
- {
- ErrorDialog xDialog = new ErrorDialog( xContext, "vnd.sun.star.script:WikiEditor.Error?location=application", sError );
- MainThreadDialogExecutor.Show( xContext, xDialog );
- }
- catch( Exception e )
+ finally
{
- e.printStackTrace();
+ if ( xMB != null )
+ Dispose( xMB );
}
}
}
@@ -1074,5 +1070,22 @@ public class Helper
return false;
}
+
+ public static void Dispose( Object oObject )
+ {
+ if ( oObject != null )
+ {
+ try
+ {
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface( XComponent.class, oObject );
+ if ( xComp != null )
+ xComp.dispose();
+ }
+ catch( Exception e )
+ {
+ e.printStackTrace();
+ }
+ }
+ }
}
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
index 732682e7151c..8197cd18abc4 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
@@ -4,9 +4,9 @@
*
* $RCSfile: WikiArticle.java,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mav $ $Date: 2008-01-30 19:02:16 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -102,24 +102,32 @@ public class WikiArticle
while( bLogin && !bGotLogin && !Login() )
{
- // TODO: be sure that this is no main thread
- WikiEditSettingDialog wd = new WikiEditSettingDialog(m_xContext, "vnd.sun.star.script:WikiEditor.EditSetting?location=application", wikiSettings, false );
+ WikiEditSettingDialog aDialog = null;
+ try
+ {
+ aDialog = new WikiEditSettingDialog(m_xContext, "vnd.sun.star.script:WikiEditor.EditSetting?location=application", wikiSettings, false );
- if ( aPropDialog != null )
- aPropDialog.SetThrobberActive( false );
+ if ( aPropDialog != null )
+ aPropDialog.SetThrobberActive( false );
- if ( MainThreadDialogExecutor.Show( xContext, wd ) )
- {
- m_sWikiUser = (String) wikiSettings.get("Username");
- m_sWikiPass = (String) wikiSettings.get("Password");
- }
- else
- throw new WikiCancelException();
+ if ( MainThreadDialogExecutor.Show( xContext, aDialog ) )
+ {
+ m_sWikiUser = (String) wikiSettings.get("Username");
+ m_sWikiPass = (String) wikiSettings.get("Password");
+ }
+ else
+ throw new WikiCancelException();
- if ( aPropDialog != null )
+ if ( aPropDialog != null )
+ {
+ aPropDialog.SetThrobberActive( true );
+ Thread.yield();
+ }
+ }
+ finally
{
- aPropDialog.SetThrobberActive( true );
- Thread.yield();
+ if ( aDialog != null )
+ aDialog.DisposeDialog();
}
}
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java
index d424f7c0d323..6635fd813d91 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java
@@ -4,9 +4,9 @@
*
* $RCSfile: WikiDialog.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mav $ $Date: 2008-01-21 12:57:53 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -44,10 +44,12 @@ import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
+import com.sun.star.awt.XTopWindow;
+import com.sun.star.awt.XTopWindowListener;
+import com.sun.star.lang.EventObject;
-public class WikiDialog implements XDialogEventHandler
+public class WikiDialog implements XDialogEventHandler, XTopWindowListener
{
-
XComponentContext m_xContext;
XControlContainer m_xControlContainer;
XDialog m_xDialog;
@@ -69,7 +71,10 @@ public class WikiDialog implements XDialogEventHandler
XDialogProvider2 xDialogProvider = (XDialogProvider2) UnoRuntime.queryInterface( XDialogProvider2.class, obj );
m_xDialog = xDialogProvider.createDialogWithHandler( DialogURL, this );
- m_xControlContainer = (XControlContainer)UnoRuntime.queryInterface(XControlContainer.class, m_xDialog );
+ m_xControlContainer = (XControlContainer)UnoRuntime.queryInterface( XControlContainer.class, m_xDialog );
+ XTopWindow xTopWindow = (XTopWindow)UnoRuntime.queryInterface( XTopWindow.class, m_xDialog );
+ if ( xTopWindow != null )
+ xTopWindow.addTopWindowListener( this );
}
catch (com.sun.star.uno.Exception ex)
{
@@ -77,7 +82,6 @@ public class WikiDialog implements XDialogEventHandler
}
}
-
protected void setMethods (String [] Methods)
{
this.m_aMethods = Methods;
@@ -177,4 +181,34 @@ public class WikiDialog implements XDialogEventHandler
return xResult;
}
+
+ public void DisposeDialog()
+ {
+ Helper.Dispose( m_xDialog );
+ }
+
+ public void windowOpened( EventObject e )
+ {}
+
+ public void windowClosing( EventObject e )
+ {}
+
+ public void windowClosed( EventObject e )
+ {}
+
+ public void windowMinimized( EventObject e )
+ {}
+
+ public void windowNormalized( EventObject e )
+ {}
+
+ public void windowActivated( EventObject e )
+ {}
+
+ public void windowDeactivated( EventObject e )
+ {}
+
+ public void disposing( EventObject e )
+ {}
}
+
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java
index 359de8193dc5..ebdad860c75f 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.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: mav $ $Date: 2008-02-01 13:58:15 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -40,6 +40,7 @@ import com.sun.star.awt.XWindowPeer;
import com.sun.star.beans.XPropertySet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
+import com.sun.star.lang.EventObject;
import java.util.Hashtable;
import javax.net.ssl.SSLException;
@@ -50,14 +51,14 @@ public class WikiEditSettingDialog extends WikiDialog
{
private final String sOKMethod = "OK";
- private final String sCancelMethod = "Cancel";
private final String sHelpMethod = "Help";
String[] Methods =
- {sOKMethod, sCancelMethod, sHelpMethod};
+ {sOKMethod, sHelpMethod};
private Hashtable setting;
private boolean addMode;
private boolean m_bAllowURLChange = true;
+ private Thread m_aLoginThread;
public WikiEditSettingDialog( XComponentContext xContext, String DialogURL )
{
@@ -136,7 +137,6 @@ public class WikiEditSettingDialog extends WikiDialog
GetPropSet( "SaveBox" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_EDITSETTING_SAVEBOX ) );
GetPropSet( "OkButton" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_OK ) );
GetPropSet( "HelpButton" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_HELP ) );
- GetPropSet( "CancelButton" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_CANCEL ) );
}
catch( Exception e )
{
@@ -328,7 +328,7 @@ public class WikiEditSettingDialog extends WikiDialog
final XDialog xDialogForThread = xDialog;
// the thread name is used to allow the error dialogs
- Thread aLoginThread = new Thread( "com.sun.star.thread.WikiEditorSendingThread" )
+ m_aLoginThread = new Thread( "com.sun.star.thread.WikiEditorSendingThread" )
{
public void run()
{
@@ -347,7 +347,7 @@ public class WikiEditSettingDialog extends WikiDialog
}
};
- aLoginThread.start();
+ m_aLoginThread.start();
}
else
{
@@ -366,12 +366,6 @@ public class WikiEditSettingDialog extends WikiDialog
return true;
}
- else if ( MethodName.equals( sCancelMethod ) )
- {
- Helper.AllowConnection( false );
- xDialog.endExecute();
- return true;
- }
else if ( MethodName.equals( sHelpMethod ) )
{
return true;
@@ -380,5 +374,22 @@ public class WikiEditSettingDialog extends WikiDialog
return false;
}
+ public void windowClosed( EventObject e )
+ {
+ if ( m_aLoginThread != null )
+ {
+ Helper.AllowConnection( false );
+ try
+ {
+ m_aLoginThread.join();
+ }
+ catch( Exception ex )
+ {
+ ex.printStackTrace();
+ }
+ m_aLoginThread = null;
+ Helper.AllowConnection( true );
+ }
+ }
}
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
index c35791ea196c..9b3f03a04e4f 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
@@ -4,9 +4,9 @@
*
* $RCSfile: WikiEditorImpl.java,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mav $ $Date: 2008-02-01 13:58:15 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -312,6 +312,7 @@ public final class WikiEditorImpl extends WeakBase
{
if ( m_xFrame != null )
{
+ WikiPropDialog aSendDialog = null;
try
{
if ( m_xModel == null )
@@ -340,7 +341,7 @@ public final class WikiEditorImpl extends WeakBase
m_aSettings.loadConfiguration(); // throw away all the noncommited changes
// show the send dialog
- WikiPropDialog aSendDialog = new WikiPropDialog( m_xContext, "vnd.sun.star.script:WikiEditor.SendToMediaWiki?location=application", this );
+ aSendDialog = new WikiPropDialog( m_xContext, "vnd.sun.star.script:WikiEditor.SendToMediaWiki?location=application", this );
aSendDialog.fillWikiList();
aSendDialog.SetWikiTitle( Helper.GetDocTitle( m_xModel ) );
aSendDialog.show(); // triggers the sending
@@ -351,6 +352,11 @@ public final class WikiEditorImpl extends WeakBase
// TODO: Error handling here
e.printStackTrace();
}
+ finally
+ {
+ if ( aSendDialog != null )
+ aSendDialog.DisposeDialog();
+ }
}
}
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiOptionsEventHandlerImpl.java b/swext/mediawiki/src/com/sun/star/wiki/WikiOptionsEventHandlerImpl.java
index 010aab0044e0..df827e62aace 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiOptionsEventHandlerImpl.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiOptionsEventHandlerImpl.java
@@ -4,9 +4,9 @@
*
* $RCSfile: WikiOptionsEventHandlerImpl.java,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mav $ $Date: 2008-02-01 13:58:15 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -136,6 +136,8 @@ public final class WikiOptionsEventHandlerImpl extends WeakBase
WikiEditSettingDialog aSettingDialog = new WikiEditSettingDialog( m_xContext, "vnd.sun.star.script:WikiEditor.EditSetting?location=application" );
if ( aSettingDialog.show() )
RefreshView();
+
+ aSettingDialog.DisposeDialog();
}
private void EditSetting()
@@ -162,6 +164,8 @@ public final class WikiOptionsEventHandlerImpl extends WeakBase
WikiEditSettingDialog aSettingDialog = new WikiEditSettingDialog(m_xContext, "vnd.sun.star.script:WikiEditor.EditSetting?location=application", ht, true );
if ( aSettingDialog.show() )
RefreshView();
+
+ aSettingDialog.DisposeDialog();
}
}
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java
index b515ee2bbece..63d6367eb6d3 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.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: mav $ $Date: 2008-01-30 19:02:16 $
+ * last change: $Author: mav $ $Date: 2008-02-04 08:52:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -46,6 +46,7 @@ import com.sun.star.container.XNameContainer;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.EventObject;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
@@ -54,14 +55,13 @@ public class WikiPropDialog extends WikiDialog{
WikiEditorImpl m_aWikiEditor;
private final String sSendMethod = "Send";
- private final String sCancelMethod = "Cancel";
private final String sHelpMethod = "Help";
private final String sLoadMethod = "Load";
private final String sWikiListMethod = "WikiListChange";
private final String sArticleTextMethod = "ArticleTextChange";
private final String sAddWikiMethod = "AddWiki";
- String[] m_pMethods = {sSendMethod, sCancelMethod, sHelpMethod, sLoadMethod, sWikiListMethod, sArticleTextMethod, sAddWikiMethod};
+ String[] m_pMethods = {sSendMethod, sHelpMethod, sLoadMethod, sWikiListMethod, sArticleTextMethod, sAddWikiMethod};
private String m_sWikiTitle = "";
protected String m_sWikiEngineURL = "";
@@ -97,7 +97,6 @@ public class WikiPropDialog extends WikiDialog{
GetPropSet( "MinorCheck" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_SENDTOMEDIAWIKI_MINORCHECK ) );
GetPropSet( "BrowserCheck" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_SENDTOMEDIAWIKI_BROWSERCHECK ) );
GetPropSet( "HelpButton" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_HELP ) );
- GetPropSet( "CancelButton" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_CANCEL ) );
GetPropSet( "AddButton" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_ADDBUTTON ) );
GetPropSet( "SendButton" ).setPropertyValue( "Label", Helper.GetLocalizedString( xContext, Helper.DLG_SENDBUTTON ) );
}
@@ -315,28 +314,6 @@ public class WikiPropDialog extends WikiDialog{
xDialog.endExecute();
return true;
}
- else if ( MethodName.equals( sCancelMethod ) )
- {
- // disallow any connection till the dialog is closed
- Helper.AllowConnection( false );
-
- if ( m_aSendingThread == null )
- {
- m_bAction = false;
- xDialog.endExecute();
- }
- else
- {
- Helper.ShowError( m_xContext,
- m_xDialog,
- Helper.DLG_SENDTITLE,
- Helper.CANCELSENDING_ERROR,
- null,
- false );
- }
-
- return true;
- }
else if ( MethodName.equals( sHelpMethod ) )
{
m_bAction = false;
@@ -360,12 +337,38 @@ public class WikiPropDialog extends WikiDialog{
if ( xAddDialog.show() )
fillWikiList();
+ xAddDialog.DisposeDialog();
+
return true;
}
return false;
}
+ public void windowClosed( EventObject e )
+ {
+ if ( m_aSendingThread != null )
+ {
+ Helper.AllowConnection( false );
+ try {
+ m_aSendingThread.join();
+ } catch ( Exception ex )
+ {
+ ex.printStackTrace();
+ }
+
+ m_aSendingThread = null;
+ Helper.AllowConnection( true );
+
+ Helper.ShowError( m_xContext,
+ m_xDialog,
+ Helper.DLG_SENDTITLE,
+ Helper.CANCELSENDING_ERROR,
+ null,
+ false );
+ }
+ }
+
private void InsertThrobber()
{
try