Commit Graph

24 Commits (0002fdfd6c21655bcba3fb69b291af4d3801ad79)

Author SHA1 Message Date
Andras Timar 0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +02:00
Tor Lillqvist 377e9266c9 tdf#134832: Clear the cache directory if it is for another version of the app
We don't want to use cached scaled icons (and other stuff that might
be in the cache?) if from a potentially incompatible version of the
app. Store the core and online hashes in files in the cache to be able
to compare.

Change-Id: I593ece5dae71f91f204d4c040bd9f744b3bc498f
2020-07-23 19:18:55 +03:00
Tor Lillqvist ef7e79a20b Use LOG_INF_NOFILE() for the FakeSocket logging callbacks
(Why not call LOG_INF directly in FakeSocket.cpp instead? Good
question. I guess my idea was originally to keep FakeSocket separately
testable without all the Online logging stuff.)

Change-Id: I1e6b730a9742ad653d431774d88fec6a36d98850
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98736
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-07-14 16:55:12 +02:00
Tor Lillqvist 3edc4d2201 Move the setupKitEnvironment() function into a file of its own
A small re-factoring to help planned re-plumbing of the iOS app.

Change-Id: I21f09216a7c5adf965179765a75f5a0d521cd7f3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97771
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-07-03 08:40:49 +02:00
Szymon Kłos 11965d083e notebookbar: early init
- read settings from loolwsd.xml
- in case of notebookbar activated send :notebookbar parameter
- for mobile apps I left empty parameter in setupKitEnvironment calls

Change-Id: I5813589564b37eecc1e77c5d0eb737eca5f92f04
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97233
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2020-06-30 08:15:25 +02:00
Tor Lillqvist 7f25109f72 tdf#128502: Chunk of work to enable "multi-tasking" in the iOS app
Seems to not cause any serious regressions in the iOS app or in "make
run", but of course I am not able to run a comprehensive check of all
functionality.

Change-Id: I44a0e8d60bdbc0a885db88475961575c5e95ce88
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93037
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-06-26 13:09:51 +02:00
Tor Lillqvist fe9edb5e8b Bin leftover unused variable
Change-Id: I21eaec0f070698db119d396f4b24c6d3b785c1f3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93107
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-28 22:13:16 +02:00
Tor Lillqvist 95de5a74cc Rename our Objective-C Document class to CODocument
There are already several classes called Document on the C++ side.
Let's reduce confusion a bit. (Also, we might need to use the
Objective-C Document class from some of the Online C++ code (which is
actually compiled as Objective-C++).)

Change-Id: I34347ba0161c067b14bb125c3410eefd89bbca31
2020-04-04 00:07:35 +03:00
Michael Meeks 6bdf561049 Share the Kit environment setup code.
Particularly configuration layers so we can tweak mobile config
easily.

Add core source files from configmgr for breakpointing convenience in
the iOS project. Add loolkitconfig.xcu to the iOS app bundle. Use
${BRAND_BASE_DIR} instead of a compile-time LOOLWSD_CONFIGDIR literal
on iOS (because there is no compile-time constant path to the app
bundle). No "registry" directory directly in the app bundle any longer
on iOS, a corresponding change in core.git moved that stuff to be
under "share", like on other platforms.

Change-Id: I6672efc0505abf27297c4758118a20992b10ceb3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88765
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-02-17 14:49:06 +01:00
Tor Lillqvist 9d6c174462 tdf#128577: Close an already open document when asked to open a new one
Add a "singleton" class method to DocumentViewController to return the
(as for now) singleton DocumentViewController.

Change-Id: I0b8a8def558cfe7f9469b6062a86311dfa63f549
Reviewed-on: https://gerrit.libreoffice.org/82007
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit 2807f907d9)
Reviewed-on: https://gerrit.libreoffice.org/82021
2019-11-04 15:25:54 +01:00
Tor Lillqvist 07986199ad Just call lok_init_2() and LibreOfficeKit::setLanguageTag() once on iOS
... when the app starts.

Change-Id: Icac4a9e1074fb6c5f3c9b5282e20a4513717a323
Reviewed-on: https://gerrit.libreoffice.org/80881
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-10-16 13:16:42 +02:00
Tor Lillqvist 39ddc5242d tdf#126974: When we are about to be killed, just exit bluntly
Letting the system call exit() will cause destructors of global C++
objects to be called, and doing that at an arbitrary point in time
will cause a crash. So just call std::_Exit() in the AppDelegate's
applicationWillTerminate: method.

Change-Id: I15d7a761db931a6b7aed588bb407fa0d3b4a9465
(cherry picked from commit 4c2cb838ff)
2019-10-09 14:30:20 +03:00
Tor Lillqvist ae88fc1052 tdf#124930: Look for settings also in the managed configuration thing
Could not test whether it works, but it is not complicated, so
hopefully yes. Followed the examples from
https://developer.apple.com/videos/play/wwdc2013/301/ and
https://developer.apple.com/library/archive/samplecode/sc2279/Introduction/Intro.html .

The Mobile.plist file is a sample only.

Note that here in the master branch there is no on-disk tile cache, so
no setting for emptying that or not.

Change-Id: I0b8cf8d35930cdf60808d14361378f050cf41037
2019-05-30 11:45:02 +03:00
Tor Lillqvist bf520d5fa5 Log the timestamp of the template file at its site and of its cached version 2019-04-26 12:04:28 +03:00
Tor Lillqvist db9208d364 tdf#124918: Don't crash on invalid URLs in the template list file 2019-04-26 12:04:20 +03:00
Tor Lillqvist d550944053 tdf#124918: More logging in template download error situations 2019-04-26 12:04:09 +03:00
Tor Lillqvist 4e2ad4d2bc tdf#124918: Allow empty lines in the template list file 2019-04-26 12:04:01 +03:00
Tor Lillqvist 824834dfa8 Turn on Unipoll for the iOS app, too
Change-Id: Ib0b7ac53b7c936e75446004c4581ace415b1dd5c
2019-04-24 13:24:53 +03:00
Tor Lillqvist e2f48faf14 tdf#123742: Fix lifecycle issues for the "Office" object
Because of the use of std::shared_ptr in lokit_main(), the (singleton)
lok::Office (or LibLibreOffice_Impl) object gets destroyed when
lokit_main() exits. We shouldn't keep our own copy of a raw pointer to
it around. Just call lok_init_2() to get the pointer where we need it.
We don't need to call lok_init_2() already in -[AppDelegate
application:didFinishLaunchingWithOptions:].
2019-03-28 17:28:26 +02:00
Tor Lillqvist 73ad6c300a Bin some boilerplate comments
Change-Id: Ida0a8279f081d5b9c5d963d7d721e4c7c01f3a9e
2019-02-25 09:14:14 +02:00
Tor Lillqvist 3ec92f137e Be less fragile in case of missing resources when downloading templates
It is not enough ot look at the NSError* parameter. Need to check the
HTTP status code, too.

Change-Id: I8db146c77626d4080ef6606999d27e6bb845876c
2018-12-19 13:38:43 +02:00
Tor Lillqvist 61bd04fefb Add a way to have templates specific to a customer deployment
Add two settings: One setting "Template list URL" is a string that
should either be empty (the typical case for a random user of the
app), or contain a https: URL. If this setting is empty, only the
templates bundled in the app are provided.

If the "Template list URL" is non-empty, it should be a https: URL
pointing to a text file (or dynamically generated text resource). That
file is downloaded and read when the app starts. Each line in the file
should either be a comment (starting with a hash '#'), or a https: URL
pointing to a template document, that is of type .ott, .ots, or .otp.
That document is downloaded if it hasn't been downloaded already, or
if its time stamp is newer than that of the already downloaded copy.
Also a thumbnail image for the template, formed by appending ".png" to
its URL, is downloaded, if available.

Any previously downloaded templates that aren't mentioned in the list
file are removed.

The intent is that in some managed mass deployment environment, the
mobile device management software would set up this setting, so that
the end-user devices would see the same templates.

Obviously, this URL does not have to point to a static file on a web
server, but could point to some dynamically generated resource on a
web server, that enumerates the templates available on the server and
returns their URLs as a text document.

Another setting is "Empty tile cache next time". This is a toggle. If
toggled on, the next time a document is opened in the app, the tile
cache is emptied (and the toggle is reset off). This is mostly for
potential problem solving, and might be removd later.

Various refactoring to support the new functionality.

Change-Id: Ie2ebf032acb9e43bb1c6f7ae4d0c449ae66eaa05
2018-12-17 22:56:14 +02:00
Tor Lillqvist c65f3e43a1 Fetch the locale already in the AppDelegate's didFinishLaunchingWithOptions
It will be needed by code that runs before the Document object is
created.

Change-Id: I5c4646e08c670b88b6d3a4d38450cc80e11ec402
2018-12-10 22:41:55 +02:00
Tor Lillqvist a6eadf4e81 Move the iOS app to the ios folder
Change-Id: I46e0722b027e93f90b5cd6a74cd7dc46f6c8cea2
2018-11-22 16:50:57 +02:00