mirror of
https://github.com/seiichiro0185/sailotp.git
synced 2024-12-22 03:32:30 +00:00
commit
3ffea61fbe
1 changed files with 11 additions and 3 deletions
|
@ -41,6 +41,7 @@ Page {
|
||||||
// This holds the time of the last update of the page as Unix Timestamp (in Milliseconds)
|
// This holds the time of the last update of the page as Unix Timestamp (in Milliseconds)
|
||||||
property double lastUpdated: 0
|
property double lastUpdated: 0
|
||||||
property double seconds_global: 0
|
property double seconds_global: 0
|
||||||
|
property string searchTerm: ""
|
||||||
|
|
||||||
// Reload the List of OTPs from storage
|
// Reload the List of OTPs from storage
|
||||||
function refreshOTPList() {
|
function refreshOTPList() {
|
||||||
|
@ -79,10 +80,16 @@ Page {
|
||||||
lastUpdated = curDate.getTime();
|
lastUpdated = curDate.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reload OTP List on Return to the Page (to e.g. accomodate changed scd ettings)
|
// Reload OTP List on Return to the Page (to e.g. accomodate changed settings)
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
if (status === PageStatus.Activating) {
|
if (status === PageStatus.Activating) {
|
||||||
refreshOTPList();
|
refreshOTPList();
|
||||||
|
|
||||||
|
if (searchTerm != "") {
|
||||||
|
for (var i = 0; i < appWin.listModel.count; i++) {
|
||||||
|
appWin.listModel.get(i).itemVisible = appWin.listModel.get(i).title.toString().toLowerCase().indexOf(searchTerm.toLowerCase()) > -1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,6 +177,7 @@ Page {
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText // Qt.ImhPreferUppercase | Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoPredictiveText // Qt.ImhPreferUppercase | Qt.ImhNoAutoUppercase
|
||||||
placeholderText: qsTr("Search")
|
placeholderText: qsTr("Search")
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
|
searchTerm = searchField.text
|
||||||
for (var i = 0; i < appWin.listModel.count; i++) {
|
for (var i = 0; i < appWin.listModel.count; i++) {
|
||||||
appWin.listModel.get(i).itemVisible = appWin.listModel.get(i).title.toString().toLowerCase().indexOf(searchField.text.toLowerCase()) > -1
|
appWin.listModel.get(i).itemVisible = appWin.listModel.get(i).title.toString().toLowerCase().indexOf(searchField.text.toLowerCase()) > -1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue