Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-19 Thread Jenkins Bot
Review: Approve continuous-integration


-- 
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
Your team Ubuntu File Manager Developers is subscribed to branch 
lp:ubuntu-filemanager-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-19 Thread Bill Filler
The proposal to merge lp:~renatofilho/ubuntu-filemanager-app/import-contact 
into lp:ubuntu-filemanager-app has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
-- 
Your team Ubuntu File Manager Developers is subscribed to branch 
lp:ubuntu-filemanager-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-19 Thread Bill Filler
Review: Approve

works as expected
-- 
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
Your team Ubuntu File Manager Developers is subscribed to branch 
lp:ubuntu-filemanager-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-16 Thread Carlos Jose Mazieri
Review: Approve

The code looks OK to me. Thanks.
-- 
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
Your team Ubuntu File Manager Developers is subscribed to branch 
lp:ubuntu-filemanager-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-15 Thread Ken VanDine
Review: Approve

Looks good.  I don't know much about the filemanager code base, but at least 
the content-hub portions look fine.
-- 
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
Your team Ubuntu File Manager Developers is subscribed to branch 
lp:ubuntu-filemanager-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-15 Thread Renato Araujo Oliveira Filho
The proposal to merge lp:~renatofilho/ubuntu-filemanager-app/import-contact 
into lp:ubuntu-filemanager-app has been updated.

Commit Message changed to:

Implemented support for importing any kind of file.

For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed 
merge of lp:~renatofilho/ubuntu-filemanager-app/import-contact into 
lp:ubuntu-filemanager-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-14 Thread Renato Araujo Oliveira Filho
The proposal to merge lp:~renatofilho/ubuntu-filemanager-app/import-contact 
into lp:ubuntu-filemanager-app has been updated.

Commit Message changed to:

Implemented support for contact importing.

Save contact on disk.

For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed 
merge of lp:~renatofilho/ubuntu-filemanager-app/import-contact into 
lp:ubuntu-filemanager-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-touch-coreapps-reviewers] [Merge] lp:~renatofilho/ubuntu-filemanager-app/import-contact into lp:ubuntu-filemanager-app

2016-07-14 Thread Renato Araujo Oliveira Filho
Renato Araujo Oliveira Filho has proposed merging 
lp:~renatofilho/ubuntu-filemanager-app/import-contact into 
lp:ubuntu-filemanager-app.

Requested reviews:
  Ubuntu File Manager Developers (ubuntu-filemanager-dev)

For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/import-contact/+merge/300087
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed 
merge of lp:~renatofilho/ubuntu-filemanager-app/import-contact into 
lp:ubuntu-filemanager-app.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2016-03-10 22:37:45 +
+++ CMakeLists.txt	2016-07-14 15:05:34 +
@@ -18,7 +18,7 @@
 set(ICON_FILE filemanager64.png)
 set(AUTOPILOT_DIR ${APP_NAME})
 set(EXEC "${APP_NAME}")
-set(CONTENT_HUB_EXPORTER hub-exporter.json)
+set(CONTENT_HUB_JSON content-hub.json)
 set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
 
 # global FILE definitions for stat system call, it works for any sub module
@@ -71,7 +71,7 @@
 
 add_custom_target(com_ubuntu_calendar_CLICKFiles ALL SOURCES ${CLICK_FILES})
 
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json filemanager.apparmor ${CONTENT_HUB_EXPORTER} DESTINATION ${CMAKE_INSTALL_PREFIX})
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json filemanager.apparmor ${CONTENT_HUB_JSON} DESTINATION ${CMAKE_INSTALL_PREFIX})
 
 set(UPSTREAM_LIBS_DIR ${CMAKE_BINARY_DIR}/upstream-libs)
 

=== renamed file 'hub-exporter.json' => 'content-hub.json'
--- hub-exporter.json	2014-10-30 21:20:11 +
+++ content-hub.json	2016-07-14 15:05:34 +
@@ -1,4 +1,10 @@
 {
+"destination": [
+"contacts"
+],
+"share": [
+"contacts"
+],
 "source": [
 "pictures",
 "documents",

=== modified file 'manifest.json.in'
--- manifest.json.in	2016-04-07 17:27:53 +
+++ manifest.json.in	2016-07-14 15:05:34 +
@@ -7,7 +7,7 @@
 "filemanager": {
 "apparmor": "filemanager.apparmor",
 "desktop": "com.ubuntu.filemanager.desktop",
-"content-hub": "hub-exporter.json"
+"content-hub": "content-hub.json"
 }
 },
 "icon": "filemanager64.png",

=== modified file 'src/app/qml/filemanager.qml'
--- src/app/qml/filemanager.qml	2016-03-16 16:15:41 +
+++ src/app/qml/filemanager.qml	2016-07-14 15:05:34 +
@@ -58,6 +58,7 @@
 id: fileSelector
 property var activeTransfer: null
 property var fileSelectorComponent: null
+property bool importMode: false
 }
 
 Component {
@@ -101,8 +102,9 @@
 tabs.selectedTabIndex = 0
 }
 
-function openFileSelector() {
-pageStack.push(fileSelectorComponent, { fileSelectorMode: true} )
+function openFileSelector(selectFolderMode) {
+fileSelector.fileSelectorComponent = pageStack.push(fileSelectorComponent, { fileSelectorMode: !selectFolderMode,
+ folderSelectorMode: selectFolderMode })
 }
 
 function cancelFileSelector() {
@@ -114,29 +116,60 @@
 
 function acceptFileSelector(fileUrls) {
 console.log("accept file selector " + fileUrls)
-var results = fileUrls.map(function(fileUrl) {
+if (fileSelector.importMode) {
+importFiles(fileSelector.activeTransfer, fileUrls[0])
+}
+else
+{
+exportFiles(fileSelector.activeTransfer, fileUrls)
+}
+}
+
+function openLocalFile(filePath) {
+pageStack.push(Qt.resolvedUrl("content-hub/FileOpener.qml"), { fileUrl: "file://" + filePath} )
+}
+
+function startImport(activeTransfer) {
+if (activeTransfer.state === ContentTransfer.Charged) {
+fileSelector.activeTransfer = activeTransfer
+fileSelector.importMode = true
+openFileSelector(true)
+}
+}
+
+function importFiles(activeTransfer, destDir) {
+for(var i=0; i < activeTransfer.items.length; i++) {
+var item = activeTransfer.items[i]
+var uniqueName = fileSelector.fileSelectorComponent.newFileUniqueName(destDir,
+  fileSelector.fileSelectorComponent.basename(String(item.url)))
+console.log("Move file to:" + destDir + " with name: " + uniqueName)
+activeTransfer.items[i].move(destDir, uniqueName)
+}
+finishImport(destDir)
+}
+
+function exportFiles(activeTransfer, filesUrls) {
+var results = filesUrls.map(function(fileUrl) {
 return fileSelectorResultComponent.createObject(mainView, {"url": fileUrl})
 })
 
-if (fileSelector.activeTransfer !== null) {
-fileSelector.activeTransfer.items = results
-fileSelector.activeTransfer.state = ContentTransfer.Charged
+if (activeTransfer !== null) {
+