~carlos-mazieri/ubuntu-filemanager-app/open-remote-files-02

« back to all changes in this revision

Viewing changes to src/app/qml/components/NetAuthenticationHandler.qml

  • Committer: Tarmac
  • Author(s): Carlos Mazieri
  • Date: 2015-09-20 20:28:26 UTC
  • mfrom: (457.4.3 samba-ui-05)
  • Revision ID: tarmac-20150920202826-fxdele1zfx7j9n31
Implemented a dialog for Authentication when remote locations requires user/password to access them.

Approved by Arto Jalkanen, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.3
 
2
import Ubuntu.Components 1.1
 
3
import "../ui"
 
4
 
 
5
Item  {
 
6
   id: netAuthenticatinHandler
 
7
   objectName: "netAuthenticatinHandler"
 
8
 
 
9
   property bool savePassword: true
 
10
   function showDialog(urlPath,user) {
 
11
       console.log("needsAuthenticationHandler::showDialog()")
 
12
       netAuthenticationDialog.showDialog(urlPath,user)
 
13
   }
 
14
 
 
15
   Timer {
 
16
       id: authTimer
 
17
       interval: 200
 
18
       repeat: false
 
19
       onTriggered:  {           
 
20
           pageModel.setPathWithAuthentication(
 
21
                         netAuthenticationDialog.currentPath,
 
22
                         netAuthenticationDialog.currentUserName,
 
23
                         netAuthenticationDialog.currentPassword,
 
24
                         netAuthenticatinHandler.savePassword
 
25
                        )
 
26
       }
 
27
   }
 
28
 
 
29
   NetAuthenticationDialog {
 
30
       id: netAuthenticationDialog
 
31
       onSavePasswordChanged: {
 
32
           savePassword = check
 
33
           console.log("NetAuthenticationHandler savePassword="+savePassword)
 
34
       }
 
35
       onOk: {
 
36
           if (!authTimer.running) {
 
37
               authTimer.start()
 
38
           }
 
39
       }
 
40
   }
 
41
}