Commit 2c1e5877 authored by Andrea Scarpino's avatar Andrea Scarpino

Enable url and list when there's a master key

parent 39edcda7
......@@ -37,7 +37,6 @@ Page {
onGeneratedMasterKey: {
masterKey = true;
siteUrl.enabled = true;
password.text = "";
}
}
......@@ -107,7 +106,7 @@ Page {
inputMethodHints: Qt.ImhUrlCharactersOnly
placeholderText: qsTr("Site name (e.g. google.com)")
validator: RegExpValidator { regExp: /^[\w\.-]*$/ }
enabled: false
enabled: masterKey
EnterKey.enabled: siteUrl.text.length > 0 && siteCounter.text.length > 0
EnterKey.onClicked: getPassword()
......@@ -122,6 +121,7 @@ Page {
label: qsTr("Type")
currentIndex: 1
width: parent.width - siteCounter.width
enabled: masterKey
menu: ContextMenu {
MenuItem { text: qsTr("Maximum") }
......@@ -133,6 +133,8 @@ Page {
MenuItem { text: qsTr("Name") }
MenuItem { text: qsTr("Phrase") }
}
onValueChanged: getPassword()
}
TextField {
......@@ -142,6 +144,7 @@ Page {
inputMethodHints: Qt.ImhDigitsOnly
validator: RegExpValidator { regExp: /^[0-9]+$/ }
placeholderText: qsTr("Counter")
enabled: masterKey
EnterKey.enabled: siteUrl.text.length > 0 && siteCounter.text.length > 0
EnterKey.onClicked: getPassword()
......@@ -165,6 +168,7 @@ Page {
Repeater {
id: sites
model: recentSites
enabled: masterKey
delegate: SiteDelegate {}
}
}
......@@ -173,11 +177,13 @@ Page {
}
function getPassword() {
var pwd = manager.getPassword(siteUrl.text, sitePwdType.currentIndex, siteCounter.text);
password.text = pwd;
clearPwd.enabled = true;
copy.enabled = true;
appWindow.password = pwd;
if (masterKey) {
var pwd = manager.getPassword(siteUrl.text, sitePwdType.currentIndex, siteCounter.text);
password.text = pwd;
clearPwd.enabled = true;
copy.enabled = true;
appWindow.password = pwd;
}
}
}
......@@ -49,10 +49,7 @@ ListItem {
siteUrl.text = site;
sitePwdType.currentIndex = typeIndexFromString(type);
siteCounter.text = counter;
if (masterKey) {
getPassword();
}
getPassword();
}
function typeIndexFromString(type) {
......
......@@ -4,72 +4,72 @@
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="52"/>
<location filename="../qml/pages/MainPage.qml" line="51"/>
<source>Settings</source>
<translation>Impostazioni</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="86"/>
<location filename="../qml/pages/MainPage.qml" line="85"/>
<source>Copy to clipboard</source>
<translation>Copia negli appunti</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="108"/>
<location filename="../qml/pages/MainPage.qml" line="107"/>
<source>Site name (e.g. google.com)</source>
<translation>Sito web (google.com, ...)</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="143"/>
<location filename="../qml/pages/MainPage.qml" line="146"/>
<source>Counter</source>
<translation>Contatore</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<source>PIN</source>
<translation>PIN</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<source>Please fill your name and master password in the Settings page!</source>
<translation>Perfavore immetti il tuo nome e password nella pagina Impostazioni!</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<location filename="../qml/pages/MainPage.qml" line="165"/>
<source>Sites</source>
<translation>Siti</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<source>Short</source>
<translation>Corta</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Basic</source>
<translation>Semplice</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Medium</source>
<translation>Media</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<source>Long</source>
<translation>Lunga</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="126"/>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<source>Maximum</source>
<translation>Massima</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="59"/>
<location filename="../qml/pages/MainPage.qml" line="58"/>
<source>Clear sites</source>
<translation>Cancella siti</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="74"/>
<location filename="../qml/pages/MainPage.qml" line="73"/>
<source>Clear password</source>
<translation>Cancella password</translation>
</message>
......@@ -79,12 +79,12 @@
<translation>Tipo</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Name</source>
<translation>Nome</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<location filename="../qml/pages/MainPage.qml" line="134"/>
<source>Phrase</source>
<translation>Frase</translation>
</message>
......@@ -145,7 +145,7 @@
<translation>Cancella</translation>
</message>
<message>
<location filename="../qml/pages/SiteDelegate.qml" line="79"/>
<location filename="../qml/pages/SiteDelegate.qml" line="76"/>
<source>Deleting</source>
<translation>Sto cancellando...</translation>
</message>
......
......@@ -4,72 +4,72 @@
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="52"/>
<location filename="../qml/pages/MainPage.qml" line="51"/>
<source>Settings</source>
<translation>Inställningar</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="86"/>
<location filename="../qml/pages/MainPage.qml" line="85"/>
<source>Copy to clipboard</source>
<translation>Kopiera till urklipp</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="108"/>
<location filename="../qml/pages/MainPage.qml" line="107"/>
<source>Site name (e.g. google.com)</source>
<translation>Sidnamn (ex. google.com)</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="143"/>
<location filename="../qml/pages/MainPage.qml" line="146"/>
<source>Counter</source>
<translation>Räknare</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<source>PIN</source>
<translation>PIN</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<source>Please fill your name and master password in the Settings page!</source>
<translation>Ange ditt namn och huvudlösenord i inställningar!</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<location filename="../qml/pages/MainPage.qml" line="165"/>
<source>Sites</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<source>Short</source>
<translation>Kort</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Basic</source>
<translation>Enkelt</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Medium</source>
<translation>Medium</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<source>Long</source>
<translation>Långt</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="126"/>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<source>Maximum</source>
<translation>Maximalt</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="59"/>
<location filename="../qml/pages/MainPage.qml" line="58"/>
<source>Clear sites</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="74"/>
<location filename="../qml/pages/MainPage.qml" line="73"/>
<source>Clear password</source>
<translation type="unfinished"></translation>
</message>
......@@ -79,12 +79,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Name</source>
<translation>Namn</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<location filename="../qml/pages/MainPage.qml" line="134"/>
<source>Phrase</source>
<translation>Fras</translation>
</message>
......@@ -145,7 +145,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/SiteDelegate.qml" line="79"/>
<location filename="../qml/pages/SiteDelegate.qml" line="76"/>
<source>Deleting</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -4,72 +4,72 @@
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="52"/>
<location filename="../qml/pages/MainPage.qml" line="51"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="86"/>
<location filename="../qml/pages/MainPage.qml" line="85"/>
<source>Copy to clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="108"/>
<location filename="../qml/pages/MainPage.qml" line="107"/>
<source>Site name (e.g. google.com)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="143"/>
<location filename="../qml/pages/MainPage.qml" line="146"/>
<source>Counter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<source>PIN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<source>Please fill your name and master password in the Settings page!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<location filename="../qml/pages/MainPage.qml" line="165"/>
<source>Sites</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<source>Short</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Basic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<source>Long</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="126"/>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<source>Maximum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="59"/>
<location filename="../qml/pages/MainPage.qml" line="58"/>
<source>Clear sites</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="74"/>
<location filename="../qml/pages/MainPage.qml" line="73"/>
<source>Clear password</source>
<translation type="unfinished"></translation>
</message>
......@@ -79,12 +79,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<location filename="../qml/pages/MainPage.qml" line="134"/>
<source>Phrase</source>
<translation type="unfinished"></translation>
</message>
......@@ -145,7 +145,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/SiteDelegate.qml" line="79"/>
<location filename="../qml/pages/SiteDelegate.qml" line="76"/>
<source>Deleting</source>
<translation type="unfinished"></translation>
</message>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment