~nskaggs/ubuntu-filemanager-app/fix-ap-item-renames

« back to all changes in this revision

Viewing changes to src/app/qml/ui/FolderListPage.qml

Bug 1347010: UI for only displaying files in MTP directories. For now, "Show all files" is always visible at start and non-MTP directories are not viewable. After clicking "Show all files", all files are shown.

TODO:
 - "Show all files" only when user has set PIN/password, if not all files are automatically shown
 - When "Show all files" clicked query PIN/password from user and if it's valid only then display all files

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        id: pageModel
87
87
        path: folderListPage.folder
88
88
        enableExternalFSWatcher: true
 
89
        showNonMTPPaths: false
89
90
 
90
91
        // Properties to emulate a model entry for use by FileDetailsPopover
91
92
        property bool isDir: true
355
356
            left: sidebar.right
356
357
            right: parent.right
357
358
        }
358
 
        height: fileSelectorMode ? bottomBarFileSelectorButtons.height : 0
 
359
        height: bottomBarButtons.visible ? bottomBarButtons.height : 0
359
360
        visible: fileSelectorMode
360
 
 
361
361
    }
362
362
 
363
363
    Row {
364
 
        id: bottomBarFileSelectorButtons
 
364
        id: bottomBarButtons
365
365
        anchors.horizontalCenter: parent.horizontalCenter
366
366
        anchors.bottom: bottomBar.bottom
367
367
        spacing: units.gu(5)
368
 
        visible: fileSelectorMode
 
368
        visible: fileSelectorMode || !pageModel.showNonMTPPaths
369
369
 
370
370
        Button {
371
371
            text: i18n.tr("Select")
372
372
            enabled: selectionManager.counter > 0
 
373
            visible: fileSelectorMode
373
374
            onClicked: {
374
375
               var selectedAbsPaths = selectionManager.selectedAbsFilePaths();
375
376
               // For now support only selection in filesystem
383
384
        }
384
385
        Button {
385
386
           text: i18n.tr("Cancel")
 
387
           visible: fileSelectorMode
386
388
           onClicked: {
387
389
               console.log("FileSelector cancelled")
388
390
               cancelFileSelector()
389
391
           }
390
392
        }
 
393
        Button {
 
394
            text: i18n.tr("Show all files")
 
395
            visible: !pageModel.showNonMTPPaths
 
396
            onClicked: {
 
397
               console.log("Show all files clicked")
 
398
               pageModel.showNonMTPPaths = true
 
399
           }
 
400
        }
391
401
    }
392
402
 
393
 
 
394
403
    FolderIconView {
395
404
        id: folderIconView
396
405