This provides possibilities of more reliable testing and debugging.
See the comments in "docstate.js" file.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I28ba2098cbe7e206f363fb2b0acbf5c5c2bf155d
"socket" and "console" variables are used at initialization, so they are left in global.js file.
Debugging of window.app object's variables is now easier.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ic2811ff45ce845cb32d15018eaa2fa9e140202d7
Currently translated at 100.0% (442 of 442 strings)
Translated using Weblate (Portuguese)
Currently translated at 100.0% (441 of 441 strings)
Translated using Weblate (Czech)
Currently translated at 100.0% (441 of 441 strings)
Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.4% (432 of 439 strings)
Co-authored-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Co-authored-by: Pedro Silva <pedro.silva@collabora.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/cs/
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/pt/
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/pt_BR/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I72dfd49276dee8427404b63a1ae488df47e783aa
Remove the `as` from `Download as` because in here we have a dropdown,
it is already clear that the component is not an action in itself but a
dropdown to trigger more actions. If this was not a dropdown but
instead a toolitem that triggers a dialog, such as `Save as`, then it
would make sense to include `as`, but that is not the case
Related issue:
https://github.com/CollaboraOnline/online/issues/4564
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I65de9570800756e026d20534a84d52c29d4f8bd1
As discussed in https://github.com/CollaboraOnline/online/issues/4564
the current lc_downloadas2.svg is quite different form the surrounding
icons
- Remove and use new download icon more similar to colibre theme
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I5808af8a50c1f8025b38502ba5fcd2db3f98c9d5
The last burst of data arrives with POLLHUP.
If during the read we hit any errors, including
EAGAIN, for whatever reason, we may lose the
data if we don't attempt reading again later.
The only way to guarantee that we do not have
any more data to read, when we get POLLHUP,
is to poll until we either get no POLLIN or
read returns 0 indicating the socket is closed,
Oddly, read(2) sometimes returns 0 without
POLLHUP ever being set, and sometimes we
do get POLLHUP while POLLIN still set. This
implies that poll and read aren't consistent
in how they detect and report the close
condition. Luckily, with this patch we can
handle all cases without any complications.
This was caught through simulateSocketError,
which when it injects EAGAIN on the very
last read, when the socket is closed, causes
error as the response is partially or
completely lost (because we never read it).
The behavioral change should only be
observable with EnableExperimental.
Change-Id: I77260f98d5dd5050c5f9b202b9effd501191336b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The new helper corrects inconsistencies in
detecting writable sessions and improves
readability.
A writable session is one that is either
not read-only or can change comments
(in PDFs, which are otherwise read-only
documents).
Also fixes a bug in reusing the last editor
session to save. The condition should've
been !isReadOnly(), since sessions used
for saving cannot be read-only. Indeed,
the last editor couldn't possibly have
been read-only by definition.
Change-Id: I9860be287057050eca692568d43f77371964f80b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The inWaitDisconnected state is mutually exclusive
with isViewLoaded. So that check was completely
useless. Instead, we want to check if the session
is still connected to the client, since isViewLoaded
implies that we aren't disconnected from the Kit.
This moves this logic to a helper in ClientSession
and streamlines the implementation of
DocumentBroker::countActiveSessions().
Change-Id: I06459708e4c59566aa2e2f1febdfdfe8dd491c35
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The stop flag may be set through the callbacks
that the poll fires. In particular, errors
during socket plumbing can set the stop flag.
Since this flag is final and immediate, there
is no need to do the normal processing and
check it on the subsequent iteration of the
polling loop. This reduces the wait and we
clean up faster.
When we don't check for the stop condition,
we may end up uploading an extra time.
This is particularly problematic with
always_save_on_exit, which forces the
upload. Since it sets the stop flag
after it uploads, we should detect it as
soon as possible and no do extra poll.
The change is guarded by EnableExperimental
to avoid unexpected behavior.
Change-Id: I67815e70383caabaf29aa4921e0c421c3e5ff96c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This extends the detection of connection termination
for writes via ECONNRESET and EPIPE.
For some reason ECONNRESET was not detected.
This patch avoids extra polling to detect connection
termination and makes the cleanup faster.
The changes are guarded by EnableExperimental to avoid
any unexpected change of behavior.
Change-Id: I2ae3803f025d3cf756f86460e47aedc984249509
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Introduced in 71ef338dc5 and in
8e815bdff49154debcfb8a69816c89d71d01603d
this creative invention of new UNO commands is not the way to go.
We cannot invent uno command names and add them to unocommands.js, that
is a generated file, and generated from core. If we cannot pick the
desired string from unocommands.js, as last resort we can write out the
text, e.g. _('Column Width').
Affected:
.uno:ColumnWidthMenu,
.uno:RowHeightMenu,
.uno:ColumnFormatMenu,
.uno:RowFormatMenu
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I93adca8b416ae986171af2771adf4007d76d6422
Add new svg icon
Add menuitem to Layout tab with all the missing commands
Note: EditPrintArea was not be added because:
It triggers a dialog that is not async at the moment. When tested with
multiple users within the same server it does not work. If the one user
opens it the other one is not able to open it at the same time.
AddPrintArea was not added since it can also be problematic when multiple
users edit the same document.
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I276b6ab08b0f541aba9211d2595786a835d873b8
There was only one way to successfully set a print rage: by defining
name ranges first and then within the dialog the tick the checkbox
'print range' under `Range options` expander.
All the other expected top menu entries within format main menu were
missing, Add except EditPrintArea and AddPrintArea:
- DefinePrintArea
- DeletePrintArea
EditPrintArea couldn't be added:
It triggers a dialog that is not async at the moment. When tested with
multiple users within the same server it does not work. If the one user
opens it the other one is not able to open it at the same time.
AddPrintArea wans't added because it might also be problematic when
multiple users edit the same document
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I943e82a005b485130833cf46e4687dde6a3e6e3f
Luckily the UISceneOpenURLOptions has a property openInPlace that
seems to be good to use for this. If openInPlace is false, that means
we should open the document read-only.
This is a stopgap fix to avoid the situation where the user does
changes to a document that is an attachment in an email message. Those
changes won't be saved anywhere they could be found later. Better to
keep the document read-only.
The ideal solution would be to ask the user right away where they want
an editable copy of the document to be stored. Later.
Signed-off-by: Tor Lillqvist <tml@iki.fi>
Change-Id: Ifd7d824d4f73cbf458f8597cd0974cf171b35be7
We keep open documents in the view controller stack. If you already
have one document loaded into this app, and then in Mail select an
attachment or in Files select a document to be opened in this app, it
will be loaded so that when you close it, you will be back editing the
earlier document.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I921907a2cbf8220a45b6dc0f304ba7eaec0befbc
WhiteBoxTests.cpp is by far the slowest TU
to compile (taking minutes) and gcc started showing
'note: variable tracking size limit exceeded'
and recompiles, which doubles the time.
This moves the StringVector tests into a new
home, which reduces the size of WhiteBoxTests.
Change-Id: Ia4e8daa921fb941815ad7e68f4dbb964fb2cd93e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
In an attempt to reduce the size of Util.{c,h}pp
which has grown to contain all sorts of unrelated
helpers, we move StringVector helpers into
the StringVector.{c,h}pp files.
This makes the code better organized.
Change-Id: I152f341606807ae66253415b951bc9f89b09df57
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
And cleanup includes to reduce build time.
Change-Id: If2e242e6688b788b91d62351ef555b31aad1ecde
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
WhiteBoxTests.cpp is by far the slowest TU
to compile (taking minutes) and even gcc gives
'note: variable tracking size limit exceeded'
and recompiles, which doubles the time.
This extracts the RequestDetails tests into
its own file to better parallelize the build.
Change-Id: Ic8d54d06223a122bc1ccf73cfa216e2b3a8f32a5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Currently translated at 93.6% (428 of 457 strings)
Translated using Weblate (Greek)
Currently translated at 99.7% (437 of 438 strings)
Co-authored-by: Theo <tbousiou@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/help/el/
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/el/
Translation: Collabora Online/Help
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I0d1f890be83be35a44ad3b5d2991a65f9febc931
* Use unix line endings.
* Use tabs instead of spaces to indent.
* Remove eslint-disable flag.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ic7fe77097c0e1b652636e5771fd4835d547ffa90
Currently these options were only accessible via ontext menu
- Expose these row and columns format options (height and width) also
in the place user expects to find it (in classic mode): Format menu
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ib83c11345407394eef4d90d9c350a9e015291e93
Before we needed an exception for the StatisticsMenu, to position the
arrow. Now this is no longer needed. The component get well placed by
default
- Remove CSS exception and fix the inconsistency:
https://archive.org/download/cool-nb-bug-arrow-statistics/cool-nb-bug-arrow-statistics.png
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I7cf46c7c3d2593b571c91c0dedc197fdcae3a7ee