sailfish-safe

Sailfish frontend for safe(1)
git clone git://git.z3bra.org/sailfish-safe.git
Log | Files | Refs | README | LICENSE

GeneratePasswordDialog.qml (2129B)


      1 /*
      2  *   Copyright (C) 2019  Daniel Vrátil <dvratil@kde.org>
      3  *
      4  *   This program is free software: you can redistribute it and/or modify
      5  *   it under the terms of the GNU General Public License as published by
      6  *   the Free Software Foundation, either version 3 of the License, or
      7  *   (at your option) any later version.
      8  *
      9  *   This program is distributed in the hope that it will be useful,
     10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12  *   GNU General Public License for more details.
     13  *
     14  *   You should have received a copy of the GNU General Public License
     15  *   along with this program.  If not, see <https://www.gnu.org/licenses/>.
     16  */
     17 
     18 import QtQuick 2.2
     19 import QtQml.Models 2.2
     20 import Sailfish.Silica 1.0
     21 
     22 Dialog {
     23 
     24     property alias passLen : passLenSlider.value
     25     property alias allowSymbols: symbolsSwitch.checked
     26 
     27     DialogHeader {
     28         id: header
     29         width: parent.width
     30     }
     31 
     32     SilicaFlickable {
     33         anchors {
     34             top: header.bottom
     35             left: parent.left
     36             right: parent.right
     37             bottom: parent.bottom
     38         }
     39 
     40         clip: true
     41         contentHeight: column.height
     42 
     43         Column {
     44             id: column
     45 
     46             anchors {
     47                 left: parent.left
     48                 right: parent.right
     49                 leftMargin: Theme.horizontalPageMargin
     50                 rightMargin: Theme.horizontalPageMargin
     51             }
     52 
     53             spacing: Theme.paddingMedium
     54 
     55             Label {
     56                 text: qsTr("Password Length")
     57                 width: parent.width
     58             }
     59 
     60             Slider {
     61                 id: passLenSlider
     62                 width: parent.width
     63 
     64                 minimumValue: 6
     65                 maximumValue: 64
     66                 stepSize: 1
     67                 value: 20
     68                 valueText: value
     69             }
     70 
     71             TextSwitch {
     72                 id: symbolsSwitch
     73                 width: parent.width
     74 
     75                 text: qsTr("Allow non-alphanumeric characters")
     76                 checked: true
     77             }
     78         }
     79     }
     80 }