[Libreoffice-commits] online.git: 2 commits - loleaflet/src wsd/DocumentBroker.cpp
Pranav Kant
pranavk at collabora.co.uk
Thu Jun 1 15:45:27 UTC 2017
loleaflet/src/core/Socket.js | 13 +++++++++++++
loleaflet/src/map/Map.js | 2 +-
wsd/DocumentBroker.cpp | 2 ++
3 files changed, 16 insertions(+), 1 deletion(-)
New commits:
commit dce714efb8b23e8ef59d3663f87cd0a557c70c9f
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Jun 1 21:07:52 2017 +0530
Toggle this flag after a successfull save
Change-Id: Id1bf5bc5e32e24f68094f3020f4a7c4c4117f18a
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 981834fa..2aa10d21 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -627,6 +627,8 @@ bool DocumentBroker::saveToStorageInternal(const std::string& sessionId,
// So set _documentLastModifiedTime then
_documentLastModifiedTime = _storage->getFileInfo()._modifiedTime;
+ // After a successful save, we are sure that document in the storage is same as ours
+ _documentChangedInStorage = false;
LOG_DBG("Saved docKey [" << _docKey << "] to URI [" << uri << "] and updated tile cache. Document modified timestamp: " <<
Poco::DateTimeFormatter::format(Poco::DateTime(_documentLastModifiedTime),
commit 9f535580a6590bcb6f77d4227ff685f8185cdf2d
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Jun 1 21:07:21 2017 +0530
Close the dialog before showing a confirmation dialog
Change-Id: If7220c37f8456627181500d7428caf3657816a16
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 1d6b884f..b3b99f48 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -270,6 +270,10 @@ L.Socket = L.Class.extend({
var username = textMsg.substring('documentconflict '.length);
msg = _('%user asked to refresh the document. Document will now refresh automatically.').replace('%user', username);
+ // Detach all the handlers from current socket, otherwise _onSocketClose tries to reconnect again
+ // However, we want to reconnect manually here.
+ this.close();
+
// Reload the document
this._map._active = false;
map = this._map;
@@ -349,6 +353,15 @@ L.Socket = L.Class.extend({
else if (command.errorKind === 'documentconflict')
{
storageError = errorMessages.storage.documentconflict;
+
+ // TODO: We really really need to factor this out duplicate dialog code logic everywhere
+ // Close any open dialogs first.
+ if (vex.dialogID > 0) {
+ var id = vex.dialogID;
+ vex.dialogID = -1;
+ vex.close(id);
+ }
+
vex.dialog.confirm({
message: _('Document has been changed in storage. Do you want to refresh the page to load the new document ? Cancelling will continue editing and overwrite.'),
callback: L.bind(function(value) {
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 1e06bae5..32b07f73 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -842,7 +842,7 @@ L.Map = L.Evented.extend({
var options = $.extend({}, vex.defaultOptions, {
contentCSS: {'background':'rgba(0, 0, 0, 0)',
- 'font-size': 'xx-large',
+ 'font-size': 'xx-large',
'color': '#fff',
'text-align': 'center'},
content: _('Inactive document - please click to resume editing')
More information about the Libreoffice-commits
mailing list