[Libreoffice-commits] core.git: 3 commits - ios/LibreOfficeLight
jan Iversen
jani at libreoffice.org
Sun Oct 29 18:47:02 UTC 2017
ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj | 14 ---
ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift | 7 -
ios/LibreOfficeLight/LibreOfficeLight/DocumentActions.swift | 2
ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift | 41 ++++++----
ios/LibreOfficeLight/LibreOfficeLight/Info.plist | 7 +
ios/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings | 2
ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard | 7 +
7 files changed, 45 insertions(+), 35 deletions(-)
New commits:
commit fb88fbbe2b6bb62c4525659299b05aa0964229c5
Author: jan Iversen <jani at libreoffice.org>
Date: Sun Oct 29 19:43:49 2017 +0100
iOS, problem with menu control
storyboard and code had diverted.
Change-Id: I39d3db81f2c133a355c961a24cf7ed1409630b83
diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index ef0f743c8309..c0552f230cea 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -31,7 +31,6 @@
39B08BD91E5F0BB600682A59 /* services.rdb in Resources */ = {isa = PBXBuildFile; fileRef = 39B085241E5F0BB400682A59 /* services.rdb */; };
39B091CD1E5F0BB800682A59 /* udkapi.rdb in Resources */ = {isa = PBXBuildFile; fileRef = 39B08B9B1E5F0BB600682A59 /* udkapi.rdb */; };
39B091CE1E5F0BB800682A59 /* unorc in Resources */ = {isa = PBXBuildFile; fileRef = 39B08B9C1E5F0BB600682A59 /* unorc */; };
- 39EE81541FA644E800B73AB8 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 39EE81531FA644E800B73AB8 /* Info.plist */; };
39EF4E2F1FA500C9001914AC /* PropertiesController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39EF4E2E1FA500C9001914AC /* PropertiesController.swift */; };
/* End PBXBuildFile section */
@@ -86,7 +85,6 @@
3911D89F1E5993600050D6BC /* Support files */ = {
isa = PBXGroup;
children = (
- 39EE81531FA644E800B73AB8 /* Info.plist */,
39ACF4181F8A317600DA7334 /* loApp.xcconfig */,
39B092501E5F3DEA00682A59 /* LibreOfficeLight-Prefix.pch */,
397275391E77D9F1006ACDCC /* LibreOfficeLight.entitlements */,
@@ -129,6 +127,7 @@
397E08FC1E597BD8001374E0 /* LibreOfficeLight */ = {
isa = PBXGroup;
children = (
+ 39EE81531FA644E800B73AB8 /* Info.plist */,
39503A6F1F94C4AC00F19C78 /* lokit-Bridging-Header.h */,
39284DB01FA5E150006F43E4 /* dummyLOkit.c */,
397E08FD1E597BD8001374E0 /* AppDelegate.swift */,
@@ -232,7 +231,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 39EE81541FA644E800B73AB8 /* Info.plist in Resources */,
397E09081E597BD8001374E0 /* Assets.xcassets in Resources */,
39B08BD71E5F0BB600682A59 /* rc in Resources */,
39B08B9E1E5F0BB600682A59 /* offapi.rdb in Resources */,
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentActions.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentActions.swift
index 96f9d3216633..dddb3b22d3b0 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentActions.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentActions.swift
@@ -17,6 +17,8 @@ class DocumentActions: UITableViewController
// Pointer to callback class (in reality instance of DocumentController)
var delegate : MenuDelegate?
+
+
// set by DocumentController before invoking the menu
// the variable is used to control which menu entries are active
var isDocActive : Bool = false
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
index 5034d46533c1..ddfd77d2c301 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
@@ -19,15 +19,11 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// this is normal functions every controller must implement
+
// called once controller is loaded
override func viewDidLoad()
{
super.viewDidLoad()
- //FIXME
- // we should load the document types, so we can use them for the open call
- // let path = Bundle.main.path(forResource: "Info", ofType: "plist")
- // let dict = NSDictionary(contentsOfFile: path!)
- // let tableData = dict!.object(forKey: "CFBundleDocumentTypes")
}
@@ -192,12 +188,11 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// Load document into LibreOfficeKit and present it
internal func startOpenDocument()
{
- //FIXME
-
- // let openMenu = UIDocumentPickerViewController(documentTypes: ["public.data"], in: .open)
let openMenu = UIDocumentBrowserViewController()
- //penMenu.allowsDocumentCreation = true
- // UIDocumentBrowserViewController.ImportMode = UIDocumentBrowserViewController.ImportMode.none // copy, move
+ openMenu.allowsDocumentCreation = true
+
+ //FIXME
+ //UIDocumentBrowserViewController.ImportMode = UIDocumentBrowserViewController.ImportMode.none // copy, move
//openMenu.InterfaceStyle = UIDocumentPickerViewController.dark
openMenu.delegate = self
self.present(openMenu, animated: true, completion: nil)
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
index 936c0620eb13..338597acbbc9 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
+++ b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
@@ -357,6 +357,9 @@
<bool key="isElement" value="NO"/>
</accessibility>
<state key="normal" title="Close"/>
+ <connections>
+ <action selector="actionMenuSelect:" destination="IER-X5-Ax8" eventType="touchUpInside" id="lIq-w7-Yr5"/>
+ </connections>
</button>
</subviews>
</tableViewCellContentView>
@@ -440,11 +443,11 @@
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="134" height="210"/>
<connections>
- <outlet property="buttonClose" destination="6vH-aM-aYe" id="zNg-Rc-hcL"/>
+ <outlet property="buttonClose" destination="95N-Hk-rcU" id="hJo-Qc-Wgv"/>
<outlet property="buttonOpen" destination="myk-zs-md7" id="xQK-I1-pDl"/>
<outlet property="buttonPrint" destination="tvH-WR-c61" id="4YU-p2-Fim"/>
<outlet property="buttonProperties" destination="b90-ja-Wm0" id="scY-Fn-fss"/>
- <outlet property="buttonSave" destination="b90-ja-Wm0" id="Sdz-lq-s3S"/>
+ <outlet property="buttonSave" destination="m45-MR-Gca" id="UZw-LX-Bco"/>
<outlet property="buttonSaveAs" destination="6vH-aM-aYe" id="4KY-Zi-iH4"/>
<outlet property="buttonSaveAsPDF" destination="apE-3B-lUt" id="AZL-ON-v2Y"/>
</connections>
commit 64f9ae5510fa8f17e2ecb93525c413dd25f041b3
Author: jan Iversen <jani at libreoffice.org>
Date: Sun Oct 29 18:21:55 2017 +0100
iOS, added missing link to Info.plist
Added Info.plist to project file, interesting that
even without a reference xCode uses the file, only
it cannot be edited
Change-Id: I16094fe8f32f79eb2ea4fe7c758745619b0eb04e
diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index d51d49ea88f1..ef0f743c8309 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -11,7 +11,6 @@
39022C1D1EDC2A2C00100066 /* services in Resources */ = {isa = PBXBuildFile; fileRef = 39022C1C1EDC2A2C00100066 /* services */; };
39022C1F1EDC2AB000100066 /* share in Resources */ = {isa = PBXBuildFile; fileRef = 39022C1E1EDC2AB000100066 /* share */; };
39022C211EDC2D0800100066 /* icudt59l.dat in Resources */ = {isa = PBXBuildFile; fileRef = 39022C201EDC2D0800100066 /* icudt59l.dat */; };
- 39022C241EDC303200100066 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 39022C221EDC303200100066 /* InfoPlist.strings */; };
39284DB11FA5E150006F43E4 /* dummyLOkit.c in Sources */ = {isa = PBXBuildFile; fileRef = 39284DB01FA5E150006F43E4 /* dummyLOkit.c */; };
39284DB31FA5F207006F43E4 /* DocumentActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39284DB21FA5F207006F43E4 /* DocumentActions.swift */; };
392ED9B31E5E4B03005C8435 /* ViewPrintManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392ED9B21E5E4B03005C8435 /* ViewPrintManager.swift */; };
@@ -32,6 +31,7 @@
39B08BD91E5F0BB600682A59 /* services.rdb in Resources */ = {isa = PBXBuildFile; fileRef = 39B085241E5F0BB400682A59 /* services.rdb */; };
39B091CD1E5F0BB800682A59 /* udkapi.rdb in Resources */ = {isa = PBXBuildFile; fileRef = 39B08B9B1E5F0BB600682A59 /* udkapi.rdb */; };
39B091CE1E5F0BB800682A59 /* unorc in Resources */ = {isa = PBXBuildFile; fileRef = 39B08B9C1E5F0BB600682A59 /* unorc */; };
+ 39EE81541FA644E800B73AB8 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 39EE81531FA644E800B73AB8 /* Info.plist */; };
39EF4E2F1FA500C9001914AC /* PropertiesController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39EF4E2E1FA500C9001914AC /* PropertiesController.swift */; };
/* End PBXBuildFile section */
@@ -40,7 +40,6 @@
39022C1C1EDC2A2C00100066 /* services */ = {isa = PBXFileReference; lastKnownFileType = folder; name = services; path = ../generated/resources/services; sourceTree = "<group>"; };
39022C1E1EDC2AB000100066 /* share */ = {isa = PBXFileReference; lastKnownFileType = folder; name = share; path = ../generated/resources/share; sourceTree = "<group>"; };
39022C201EDC2D0800100066 /* icudt59l.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = icudt59l.dat; path = ../generated/resources/icudt59l.dat; sourceTree = "<group>"; };
- 39022C231EDC303200100066 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
39284DB01FA5E150006F43E4 /* dummyLOkit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dummyLOkit.c; sourceTree = "<group>"; };
39284DB21FA5F207006F43E4 /* DocumentActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentActions.swift; sourceTree = "<group>"; };
392ED9B21E5E4B03005C8435 /* ViewPrintManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewPrintManager.swift; path = LibreOfficeLight/ViewPrintManager.swift; sourceTree = SOURCE_ROOT; };
@@ -66,6 +65,7 @@
39B08B9B1E5F0BB600682A59 /* udkapi.rdb */ = {isa = PBXFileReference; lastKnownFileType = file; name = udkapi.rdb; path = ../generated/resources/udkapi.rdb; sourceTree = SOURCE_ROOT; };
39B08B9C1E5F0BB600682A59 /* unorc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = unorc; path = ../generated/resources/unorc; sourceTree = SOURCE_ROOT; };
39B092501E5F3DEA00682A59 /* LibreOfficeLight-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LibreOfficeLight-Prefix.pch"; sourceTree = "<group>"; };
+ 39EE81531FA644E800B73AB8 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
39EF4E2E1FA500C9001914AC /* PropertiesController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PropertiesController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -86,8 +86,8 @@
3911D89F1E5993600050D6BC /* Support files */ = {
isa = PBXGroup;
children = (
+ 39EE81531FA644E800B73AB8 /* Info.plist */,
39ACF4181F8A317600DA7334 /* loApp.xcconfig */,
- 39022C221EDC303200100066 /* InfoPlist.strings */,
39B092501E5F3DEA00682A59 /* LibreOfficeLight-Prefix.pch */,
397275391E77D9F1006ACDCC /* LibreOfficeLight.entitlements */,
397E09071E597BD8001374E0 /* Assets.xcassets */,
@@ -232,8 +232,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 39EE81541FA644E800B73AB8 /* Info.plist in Resources */,
397E09081E597BD8001374E0 /* Assets.xcassets in Resources */,
- 39022C241EDC303200100066 /* InfoPlist.strings in Resources */,
39B08BD71E5F0BB600682A59 /* rc in Resources */,
39B08B9E1E5F0BB600682A59 /* offapi.rdb in Resources */,
39022C211EDC2D0800100066 /* icudt59l.dat in Resources */,
@@ -271,14 +271,6 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
- 39022C221EDC303200100066 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- 39022C231EDC303200100066 /* en */,
- );
- name = InfoPlist.strings;
- sourceTree = "<group>";
- };
397868D81E59A3EA007F9248 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/Info.plist b/ios/LibreOfficeLight/LibreOfficeLight/Info.plist
index 4d613161e5b4..56f55ab5f6b1 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/Info.plist
+++ b/ios/LibreOfficeLight/LibreOfficeLight/Info.plist
@@ -1,5 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+This file is part of the LibreOffice project.
+
+This Source Code Form is subject to the terms of the Mozilla Public
+License, v. 2.0. If a copy of the MPL was not distributed with this
+file, You can obtain one at http://mozilla.org/MPL/2.0/.
+-->
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings
deleted file mode 100644
index 477b28ff8f86..000000000000
--- a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Localized versions of Info.plist keys */
-
commit c8d1c4350b6828f64121ff4a443700a5b9035e9d
Author: jan Iversen <jani at libreoffice.org>
Date: Sun Oct 29 14:16:19 2017 +0100
iOS, tested document open from 3rd party app.
This patch allows integration of 3rd party app.
if e.g. in mail and clicking on a OO document, LibreOfficeLight will
open and present the document
Change-Id: I86c77cd3af3aac41fda441b7c5625a2063343971
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
index 31da9986b9f3..766aa4976a29 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
@@ -24,8 +24,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
// remark if the app is not started it will be started first
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
{
- // called when started from another Application.
- //FIXME
+ let document = window?.rootViewController?.childViewControllers[0] as! DocumentController
+ document.doOpen(url)
return true
}
@@ -102,7 +102,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
// Saves changes in the application's managed object context before the application terminates.
func applicationWillTerminate(_ application: UIApplication)
{
- // Jan to be done (terminate LO)
+ let document = window?.rootViewController?.childViewControllers[0] as! DocumentController
+ document.Hipernate()
}
}
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
index a6c4a0b26f82..5034d46533c1 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
@@ -67,6 +67,8 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// The PropertiesController is a left sidebar, that will scroll in when activated
// The Controller handles manipulation of properties in the document
+
+
// Activate/Deactivate PropertiesController (from navigationController, see storyboard)
@IBAction func doProperties(_ sender: UIBarButtonItem)
{
@@ -155,10 +157,10 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
switch tag
{
case 1: // Open...
- doOpenDocument()
+ startOpenDocument()
case 2: // Properties
- doProperties()
+ showProperties()
case 3: // Save
doSave()
@@ -173,7 +175,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
doSaveAsPDF()
case 6: // Print...
- doPrint()
+ startPrint()
default: // should not happen
print("unknown menu" + String(tag))
@@ -188,7 +190,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// Load document into LibreOfficeKit and present it
- internal func doOpenDocument()
+ internal func startOpenDocument()
{
//FIXME
@@ -205,7 +207,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// Show document properties (new overloaded page)
- internal func doProperties()
+ internal func showProperties()
{
//FIXME
print("menu Properties to be done")
@@ -250,7 +252,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// print current document
- internal func doPrint()
+ internal func startPrint()
{
//FIXME
print("menu Print... to be done")
@@ -297,6 +299,18 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
internal func documentBrowser(_ controller: UIDocumentBrowserViewController,
didPickDocumentURLs documentURLs: [URL])
{
+ doOpen(documentURLs[0])
+ }
+
+
+
+ // *** Handling of document (open/print)
+
+
+
+ // Real open and presentation of document
+ public func doOpen(_ docURL : URL)
+ {
//FIXME
//BridgeLOkit_open(documentURLs);
}
More information about the Libreoffice-commits
mailing list