Index: XWord/AddinSettingsForm.cs
===================================================================
--- XWord/AddinSettingsForm.cs (revision 18302)
+++ XWord/AddinSettingsForm.cs (working copy)
@@ -112,6 +112,15 @@
Addin.password = Password;
LoginData loginData = new LoginData();
Addin.Client = new XWikiHTTPClient(ServerURL, UserName, Password);
+ // if the login fails, then disables the ribbon buttons
+ // which allows the user to work with the documents from XWiki server
+ // else enbles them
+ if (!Addin.Client.LoggedIn)
+ Globals.Ribbons.XWikiRibbon.disableAllConnectionNeededButtons();
+ else
+ Globals.Ribbons.XWikiRibbon.enableAllConnectionNeededButtons();
+
+
//TODO if login fails then...
//AddTaskPanes(); TODO: Sync all taskpanes
if (Addin.XWikiTaskPane != null)
Index: XWord/XWikiAddIn.cs
===================================================================
--- XWord/XWikiAddIn.cs (revision 18302)
+++ XWord/XWikiAddIn.cs (working copy)
@@ -537,6 +537,10 @@
if (result == DialogResult.OK)
{
Client = new XWikiHTTPClient(serverURL, username, password);
+ // if the login fails, then disables the ribbon buttons
+ // which allows the user to work with the documents from XWiki server
+ if (!Client.LoggedIn)
+ Globals.Ribbons.XWikiRibbon.disableAllConnectionNeededButtons();
AddTaskPanes();
}
}
@@ -586,6 +590,11 @@
username = credentials[1];
password = credentials[2];
client = new XWikiHTTPClient(serverURL, username, password);
+ // if the login fails, then disables the ribbon buttons
+ // which allows the user to work with the documents from XWiki server
+ if (!client.IsLoggedIn)
+ Globals.Ribbons.XWikiRibbon.disableAllConnectionNeededButtons();
+
AddTaskPanes();
}
return canAutoLogin;
Index: XWord/XWikiRibbon.cs
===================================================================
--- XWord/XWikiRibbon.cs (revision 18302)
+++ XWord/XWikiRibbon.cs (working copy)
@@ -36,7 +36,43 @@
{
}
+ ///
+ /// Disables all the buttons from the ribbon, that need a connection to a XWiki server
+ /// in order to be functional
+ /// The uploadAtt and downloadAtt options, are special, they don;t need only a connection
+ /// so they are not treated here
+ ///
+ public void disableAllConnectionNeededButtons()
+ {
+ //XEGroup.Visible = false;
+
+ btnNewPage.Visible = false;
+ btnPublishDocument.Visible = false;
+ AttachmentsGroup.Visible = false;
+ selectionOptionsGroup.Visible = false;
+ MyActivityGroup.Visible = false;
+ TeamActivityGroup.Visible = false;
+ }
+ ///
+ /// Enables all the buttons from the ribbon, that need a connection to a XWiki server
+ /// in order to be functional
+ /// The uploadAtt and downloadAtt options, are special, they don;t need only a connection
+ /// so they are not treated here
+ ///
+ public void enableAllConnectionNeededButtons()
+ {
+
+ btnNewPage.Visible = true;
+ btnPublishDocument.Visible = true;
+ AttachmentsGroup.Visible = true;
+ selectionOptionsGroup.Visible = true;
+
+ MyActivityGroup.Visible = true;
+ TeamActivityGroup.Visible = true;
+
+ }
+
private void SyncSaving_Click(object sender, RibbonControlEventArgs e)
{
if (syncSaving.Checked)