[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - 2 commits - loleaflet/src wsd/DocumentBroker.cpp
Pranav Kant
pranavk at collabora.co.uk
Thu Jun 22 11:10:40 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 03b5192e1c745d803f8829a369ef8a8ebe886c0a
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
(cherry picked from commit dce714efb8b23e8ef59d3663f87cd0a557c70c9f)
Reviewed-on: https://gerrit.libreoffice.org/38532
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index fe01c979..d1ad267b 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -626,6 +626,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 460437304b73bf63454d85215e4b910d2be87d32
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
(cherry picked from commit 9f535580a6590bcb6f77d4227ff685f8185cdf2d)
Reviewed-on: https://gerrit.libreoffice.org/38531
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index cbb9f523..8abb1898 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -273,6 +273,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;
@@ -361,6 +365,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 5ac07a4d..0405102b 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -845,7 +845,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