Commit 335a1b3f authored by Andrea Scarpino's avatar Andrea Scarpino

Display password in cover

Rethink UI
parent d34a73f9
......@@ -27,7 +27,11 @@ import Sailfish.Silica 1.0
import "pages"
ApplicationWindow {
id: appWindow
property string password: ""
initialPage: Component { MainPage { } }
cover: Qt.resolvedUrl("cover/CoverPage.qml")
}
......@@ -28,7 +28,7 @@ import Sailfish.Silica 1.0
CoverBackground {
CoverPlaceholder {
text: "SailHN"
text: appWindow.password.length > 0 ? appWindow.password : "MPW"
icon.source: "/usr/share/icons/hicolor/86x86/apps/harbour-mpw.png"
}
}
......@@ -112,33 +112,39 @@ Page {
EnterKey.onClicked: getPassword()
}
TextField {
id: siteCounter
Row {
width: parent.width
text: "1"
inputMethodHints: Qt.ImhDigitsOnly
validator: RegExpValidator { regExp: /^[0-9]+$/ }
placeholderText: qsTr("Counter")
spacing: Theme.paddingMedium
ComboBox {
id: sitePwdType
label: qsTr("Type")
currentIndex: 1
width: parent.width - siteCounter.width
menu: ContextMenu {
MenuItem { text: qsTr("Maximum") }
MenuItem { text: qsTr("Long") }
MenuItem { text: qsTr("Medium") }
MenuItem { text: qsTr("Basic") }
MenuItem { text: qsTr("Short") }
MenuItem { text: qsTr("PIN") }
MenuItem { text: qsTr("Name") }
MenuItem { text: qsTr("Phrase") }
}
}
EnterKey.enabled: siteUrl.text.length > 0 && siteCounter.text.length > 0
EnterKey.onClicked: getPassword()
TextField {
id: siteCounter
text: "1"
width: 200
inputMethodHints: Qt.ImhDigitsOnly
validator: RegExpValidator { regExp: /^[0-9]+$/ }
placeholderText: qsTr("Counter")
}
EnterKey.enabled: siteUrl.text.length > 0 && siteCounter.text.length > 0
EnterKey.onClicked: getPassword()
ComboBox {
id: sitePwdType
label: qsTr("Password type")
currentIndex: 1
menu: ContextMenu {
MenuItem { text: qsTr("Maximum") }
MenuItem { text: qsTr("Long") }
MenuItem { text: qsTr("Medium") }
MenuItem { text: qsTr("Basic") }
MenuItem { text: qsTr("Short") }
MenuItem { text: qsTr("PIN") }
MenuItem { text: qsTr("Name") }
MenuItem { text: qsTr("Phrase") }
}
}
......@@ -166,9 +172,11 @@ Page {
}
function getPassword() {
password.text = manager.getPassword(siteUrl.text, sitePwdType.currentIndex, siteCounter.text);
var pwd = manager.getPassword(siteUrl.text, sitePwdType.currentIndex, siteCounter.text);
password.text = pwd;
clearPwd.enabled = true;
copy.enabled = true;
appWindow.password = pwd;
}
}
......@@ -54,6 +54,12 @@ Page {
width: parent.width
text: manager.getName
placeholderText: qsTr("Full name")
onTextChanged: {
if (text.length > 0 && password.text.length > 0) {
save.enabled = true;
}
}
}
TextField {
......@@ -61,6 +67,12 @@ Page {
width: parent.width
placeholderText: qsTr("Master password")
echoMode: TextInput.Password
onTextChanged: {
if (text.length > 0 && name.text.length > 0) {
save.enabled = true;
}
}
}
ComboBox {
......@@ -85,15 +97,14 @@ Page {
Button {
id: save
text: qsTr("Save");
text: qsTr("Generate");
anchors.horizontalCenter: parent.horizontalCenter
enabled: false
onClicked: {
if (name.text.length > 0 && password.text.length > 0) {
name.enabled = password.enabled = version.enabled = false;
busy.visible = busy.running = true;
manager.generateMasterKey(name.text, password.text, version.currentIndex);
}
enabled = name.enabled = password.enabled = version.enabled = false;
busy.visible = busy.running = true;
manager.generateMasterKey(name.text, password.text, version.currentIndex);
}
}
}
......
......@@ -51,7 +51,7 @@ ListItem {
siteCounter.text = counter;
if (masterKey) {
password.text = "";
getPassword();
}
}
......
* Tue Jun 07 2016 Andrea Scarpino <me@andreascarpino.it> 0.2.0-1
- Store sites and their preferences
- Show password in cover page
* Sat Jun 04 2016 Andrea Scarpino <me@andreascarpino.it> 0.1.3-1
- Store name and algorithm version
......
......@@ -13,7 +13,7 @@ Name: harbour-mpw
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: MasterPassword client
Version: 0.1.3
Version: 0.2.0
Release: 1
Group: Qt/Qt
License: MIT
......
Name: harbour-mpw
Summary: MasterPassword client
Version: 0.1.3
Version: 0.2.0
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
......
......@@ -19,52 +19,47 @@
<translation>Sito web (google.com, ...)</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="121"/>
<location filename="../qml/pages/MainPage.qml" line="143"/>
<source>Counter</source>
<translation>Contatore</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Password type</source>
<translation>Tipologia password</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="139"/>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<source>PIN</source>
<translation>PIN</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="151"/>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<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>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="155"/>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<source>Sites</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="138"/>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Short</source>
<translation>Corta</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="137"/>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Basic</source>
<translation>Semplice</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="136"/>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<source>Medium</source>
<translation>Media</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="135"/>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<source>Long</source>
<translation>Lunga</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="134"/>
<location filename="../qml/pages/MainPage.qml" line="126"/>
<source>Maximum</source>
<translation>Massima</translation>
</message>
......@@ -79,12 +74,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="140"/>
<location filename="../qml/pages/MainPage.qml" line="121"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<source>Name</source>
<translation>Nome</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="141"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Phrase</source>
<translation>Frase</translation>
</message>
......@@ -102,39 +102,39 @@
<translation>Nome completo</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="62"/>
<location filename="../qml/pages/Settings.qml" line="68"/>
<source>Master password</source>
<translation>Master password</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="68"/>
<location filename="../qml/pages/Settings.qml" line="80"/>
<source>Algorithm version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="73"/>
<location filename="../qml/pages/Settings.qml" line="85"/>
<source>V0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="74"/>
<location filename="../qml/pages/Settings.qml" line="86"/>
<source>V1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="75"/>
<location filename="../qml/pages/Settings.qml" line="87"/>
<source>V2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="76"/>
<location filename="../qml/pages/Settings.qml" line="88"/>
<source>V3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="88"/>
<source>Save</source>
<translation>Salva</translation>
<location filename="../qml/pages/Settings.qml" line="100"/>
<source>Generate</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
......
......@@ -19,52 +19,47 @@
<translation>Sidnamn (ex. google.com)</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="121"/>
<location filename="../qml/pages/MainPage.qml" line="143"/>
<source>Counter</source>
<translation>Räknare</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Password type</source>
<translation>Lösenordstyp</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="139"/>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<source>PIN</source>
<translation>PIN</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="151"/>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<source>Please fill your name and master password in the Settings page!</source>
<translation>Ange ditt namn och huvudlösenord i inställningar!</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="155"/>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<source>Sites</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="138"/>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Short</source>
<translation>Kort</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="137"/>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Basic</source>
<translation>Enkelt</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="136"/>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<source>Medium</source>
<translation>Medium</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="135"/>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<source>Long</source>
<translation>Långt</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="134"/>
<location filename="../qml/pages/MainPage.qml" line="126"/>
<source>Maximum</source>
<translation>Maximalt</translation>
</message>
......@@ -79,12 +74,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="140"/>
<location filename="../qml/pages/MainPage.qml" line="121"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<source>Name</source>
<translation>Namn</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="141"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Phrase</source>
<translation>Fras</translation>
</message>
......@@ -102,39 +102,39 @@
<translation>Fullständigt namn</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="62"/>
<location filename="../qml/pages/Settings.qml" line="68"/>
<source>Master password</source>
<translation>Huvudlösenord</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="68"/>
<location filename="../qml/pages/Settings.qml" line="80"/>
<source>Algorithm version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="73"/>
<location filename="../qml/pages/Settings.qml" line="85"/>
<source>V0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="74"/>
<location filename="../qml/pages/Settings.qml" line="86"/>
<source>V1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="75"/>
<location filename="../qml/pages/Settings.qml" line="87"/>
<source>V2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="76"/>
<location filename="../qml/pages/Settings.qml" line="88"/>
<source>V3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="88"/>
<source>Save</source>
<translation>Spara</translation>
<location filename="../qml/pages/Settings.qml" line="100"/>
<source>Generate</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
......
......@@ -19,52 +19,47 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="121"/>
<location filename="../qml/pages/MainPage.qml" line="143"/>
<source>Counter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Password type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="139"/>
<location filename="../qml/pages/MainPage.qml" line="131"/>
<source>PIN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="151"/>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<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="155"/>
<location filename="../qml/pages/MainPage.qml" line="161"/>
<source>Sites</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="138"/>
<location filename="../qml/pages/MainPage.qml" line="130"/>
<source>Short</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="137"/>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Basic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="136"/>
<location filename="../qml/pages/MainPage.qml" line="128"/>
<source>Medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="135"/>
<location filename="../qml/pages/MainPage.qml" line="127"/>
<source>Long</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="134"/>
<location filename="../qml/pages/MainPage.qml" line="126"/>
<source>Maximum</source>
<translation type="unfinished"></translation>
</message>
......@@ -79,12 +74,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="140"/>
<location filename="../qml/pages/MainPage.qml" line="121"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="141"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Phrase</source>
<translation type="unfinished"></translation>
</message>
......@@ -102,38 +102,38 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="62"/>
<location filename="../qml/pages/Settings.qml" line="68"/>
<source>Master password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="68"/>
<location filename="../qml/pages/Settings.qml" line="80"/>
<source>Algorithm version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="73"/>
<location filename="../qml/pages/Settings.qml" line="85"/>
<source>V0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="74"/>
<location filename="../qml/pages/Settings.qml" line="86"/>
<source>V1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="75"/>
<location filename="../qml/pages/Settings.qml" line="87"/>
<source>V2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="76"/>
<location filename="../qml/pages/Settings.qml" line="88"/>
<source>V3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="88"/>
<source>Save</source>
<location filename="../qml/pages/Settings.qml" line="100"/>
<source>Generate</source>
<translation type="unfinished"></translation>
</message>
</context>
......
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