Commit graph

224 commits

Author SHA1 Message Date
Tor Lillqvist
4d038dc3e4 Bin commented-out #import
Change-Id: I2dc64b95b99d62816be78b3fdf302280714a26f4
2018-12-13 16:14:02 +02:00
Tor Lillqvist
8f1ed48145 Use the new LibreOfficeKit API to localise the template category headers
Change-Id: Icc91138cbe5de290103a746c8797e647259d5009
2018-12-10 22:41:55 +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
2768d8b9fd Bump CFBundleVersion
Change-Id: I0278c745924787fdf5f258bb7d334fa6eef14fc0
2018-12-07 15:28:11 +02:00
Tor Lillqvist
deb92ad3ba Finally figured out how to get 200x200 cells in the template collection
Change-Id: Idd977ccf52b2dd0e0aaae08f54f6d902791bcc6d
2018-12-07 11:20:15 +02:00
Tor Lillqvist
da45975a5a Make the template collection view look much better
Now it finally looks like I want, but oh boy was that a pain. I am not
sure at all I understand what I am doing in Xcode's Interface Builder.

I tried hard at first to use the cell size 200x220 for the cell size
of the UICollectionView, consisting of a 200x200 UIImageView and a
200x20 UILabel below. But that did not seem to work, it still used a
(default?) size of 150x150. Weird. Anyway, let's commit this state now
that seems to work.

Change-Id: I4021133619fbf62cd633392d93f19c2bbc81311a
2018-12-07 00:09:13 +02:00
Tor Lillqvist
8b106eb312 Look for thumbnails of the templates and show them in the template browser
Add such thumbnails. Rename the presentation templates to not have
colons in their name, as that seems to be problematic for macOS and/or
iOS, sigh. (Shadows of pre-OS X MacOS, where the coln was the path
component separator, not the slash.)

Hack on the storyboard scene for the template browser. More work is
needed there; the thumbnails aren't scaled down for some reason. I
need to make sure the aspect ratio is maintained, too. Maybe to get it
to look like I want I need to do some coding and not just tweak the
storyboard in the Xcode UI designer, sigh.

Change-Id: I959d051352c2f033c8563188155af5281961c7d8
2018-12-06 16:38:50 +02:00
Tor Lillqvist
4c8d0f2e25 Revert "Work in progress: Add .ott"
Using a template has been implemented to work in a way more
appropriate for the platform.

There is little reason to allow direct opening of a template in the
iOS app as long as it don't have any way to save it as an actual
document, based on the template, after editing, (with a different file
name) anyway.

This reverts commit f01a73fa92.

Change-Id: Iff4b2f299c6e6eda27c00e40a49374899af41cf0
2018-12-05 23:41:49 +02:00
Tor Lillqvist
1f0b0b6a0d Bin leftover dummy NSLog() call
Change-Id: I0597be90ff211dfb7f5fd2f321bfb36c9ec01308
2018-12-05 22:13:26 +02:00
Tor Lillqvist
296e0eb803 More work on template selection for a new document
It took quite some time for me to understand how to do it. Not sure if
this is The Right Way, but at least it now works better.

The trick was to store the importHandler block as a property of the
TemplateCollectionViewController and call it when the right template
has been selected.

There is no need to call the importHandler already in the
documentBrowser:didRequestDocumentCreationWithHandler: instance method
and it would not be possible anyway as there apparently is no way to
have the presentViewController:animated:completion: method work in a
truly modal way, so that it would not return until the selection has
been done.

Change-Id: Ia229500c181844fcd99f1f099b2e6744c22b5266
2018-12-05 22:02:59 +02:00
Tor Lillqvist
a3b44f2b8b Work in progress on document creation using templates in the iOS app
When the "Create Document" button in the document browser is pressed,
we scan a set of ODF templates in the Templates subfolder of the app
bundle, and we display that list as a collection view. (So far that
view is not interactive, i.e. once it is displayed, you are stuck
there.)

Eventually, when the user chooses one of the templates, we will open
that and immediately, before the user has done any edits, do a Save As
of it as a real (not template) document in the app's document folder.
What name to use for it is unclear yet. Further saves will thus don't
need any dialog to choose the document name.

More work will be needed on i18n of the template support. Should we
have localised templates? At least localised template names. Etc.

Change-Id: I5675779a5b16bc4c70a943109aa0dd53cf4bd903
2018-12-04 22:12:39 +02:00
Tor Lillqvist
f01a73fa92 Work in progress: Add .ott
Still need to figure out how to ask the user where to save the
documemnt and under what name when closing it.

Or actually, should ask right away, as iOS apps are supposed to be
crash-proof, there shouldn't be any need for any separate "save" or
"close" operation by the user, right?

Change-Id: I6d6b9933f5e21f7793837c7ed65049b82853a183
2018-12-04 00:58:53 +02:00
Tor Lillqvist
e4ddfa313c Bump CFBundleVersion
Change-Id: Idee621d0fa41dd5a65157267da35e245405c125c
2018-11-29 21:13:21 +02:00
Tor Lillqvist
e7ef0c29f9 Fix a problem when taking a photo to insert in a document in the iOS app
It turns out that the view of the DocumentViewController object is
removed from the view hierarchy when the camera is displayed, and
re-added after you choose to use the taken photo. Thus the
viewWillAppear: method is called again at that stage. The Document
object is stil quite intact, though. We should not call the Document
object's openWithCompletionHandler: method again, as that will cause
horrible brokenness.

Change-Id: Ib79bd8f292b01a19866278c4d95a2e816dcd9235
2018-11-29 19:21:49 +02:00
Tor Lillqvist
b4e3110d7b Truncate for logging at a bit higher limit
Change-Id: I352ef6476a9cde767b4076ad9a2ab8cf3c9bdf2b
2018-11-29 01:07:03 +02:00
Tor Lillqvist
efb883b21c Truncate received message string for logging if necessary
Change-Id: Id71968227236993e4d181370e68523f2bf6118a7
2018-11-29 01:07:03 +02:00
Tor Lillqvist
d361c00937 Append an ellipsis if the JS string was truncated for logging
Change-Id: I0bc2efff31e5c8d448e07e2457588fc638fb7a8f
2018-11-29 01:02:28 +02:00
Tor Lillqvist
3ad5ca0167 Bump CFBundleVersion
Change-Id: I0f7aada06d3161abb012292d54d326128411e233
2018-11-28 19:07:04 +02:00
Tor Lillqvist
3c046b0548 Add --with-iosapp-fonts option to bundle some 3rd-party fonts in the app
Propagate the font files found in that folder to Info.plist and to the
app bundle.

Change-Id: I2c38b0d7d21dbdf3b7ffd3b4ae98e47b9ad74758
2018-11-27 17:06:22 +02:00
Tor Lillqvist
4f37dcaa81 Include the Liberation fonts
Change-Id: I016e158c650a8ae57b7e0b17a763f997d5532abc
2018-11-27 15:33:29 +02:00
Tor Lillqvist
a2e1f383b9 Implement document saving properly to make saving to NextCloud work
Even if the LO core code, as called by the Online code, already has
saved the document back to the file from which it was loaded, in order
for a file provider extension like NextCloud to notice that, it is
essential to call saveToURL:forSaveOperation:completionHandler:. The
contentsForType:error: method can just return a NSFileWrapper for the
same, already saved, file, though.

Change-Id: Ic063c8603ca38930083866d973e500336cad517e
2018-11-27 13:55:39 +02:00
Tor Lillqvist
b0673178b8 Bump CFBundleVersion
Change-Id: Ie2e9349c99bd9f6f3e87191469c6ee39f3fb92ca
2018-11-26 19:47:32 +02:00
Tor Lillqvist
24e09f4edd Bump CFBundleVersion
Change-Id: I0ca058c14a78074eafaf585373694f36164146e0
2018-11-26 19:07:33 +02:00
Tor Lillqvist
a6eadf4e81 Move the iOS app to the ios folder
Change-Id: I46e0722b027e93f90b5cd6a74cd7dc46f6c8cea2
2018-11-22 16:50:57 +02:00