Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Datovka projects
mobile Datovka
Commits
1358c874
Commit
1358c874
authored
Oct 17, 2017
by
Karel Slaný
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Found boxes are automatically selected if already listed as recipients.
parent
f7c123e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
24 deletions
+33
-24
qml/pages/PageDataboxSearch.qml
qml/pages/PageDataboxSearch.qml
+28
-19
qml/pages/PageSendMessage.qml
qml/pages/PageSendMessage.qml
+5
-5
No files found.
qml/pages/PageDataboxSearch.qml
View file @
1358c874
...
...
@@ -40,8 +40,8 @@ Item {
property
var
pageView
property
var
statusBar
property
string
userName
//
sendMsgRecipientModel
holds recipient list f
rom
send message page
(can be NULL)
property
var
sendMsgRecipient
Model
:
null
//
recipBoxModel (if not null)
holds recipient list
o
f send message page
property
var
recipBox
Model
:
null
/* These properties remember choice of ComboBoxes */
property
string
searchType
:
"
GENERAL
"
...
...
@@ -55,10 +55,10 @@ Item {
Component.onCompleted
:
{
searchPhraseText
.
forceActiveFocus
()
proxyDataboxModel
.
setSourceModel
(
datab
oxModel
)
proxyDataboxModel
.
setSourceModel
(
foundB
oxModel
)
}
DataboxListModel
{
id
:
datab
oxModel
id
:
foundB
oxModel
Component.onCompleted
:
{
}
}
...
...
@@ -249,7 +249,10 @@ Item {
if
(
page
>
0
)
{
page
=
page
-
1
}
isds
.
findDataboxFulltext
(
userName
,
databoxModel
,
searchTextTmp
,
searchTypeTmp
,
searchScopeTmp
,
page
)
isds
.
findDataboxFulltext
(
userName
,
foundBoxModel
,
searchTextTmp
,
searchTypeTmp
,
searchScopeTmp
,
page
)
if
(
recipBoxModel
!=
null
)
{
foundBoxModel
.
selectEntries
(
recipBoxModel
.
boxIds
(),
true
)
}
}
}
}
...
...
@@ -283,7 +286,10 @@ Item {
anchors.fill
:
parent
onClicked
:
{
page
=
page
+
1
isds
.
findDataboxFulltext
(
userName
,
databoxModel
,
searchTextTmp
,
searchTypeTmp
,
searchScopeTmp
,
page
)
isds
.
findDataboxFulltext
(
userName
,
foundBoxModel
,
searchTextTmp
,
searchTypeTmp
,
searchScopeTmp
,
page
)
if
(
recipBoxModel
!=
null
)
{
foundBoxModel
.
selectEntries
(
recipBoxModel
.
boxIds
(),
true
)
}
}
}
}
// Rectangle
...
...
@@ -309,30 +315,30 @@ Item {
width
:
parent
.
width
interactive
:
true
model
:
proxyDataboxModel
canDetailBoxes
:
sendMsgRecipient
Model
==
null
canSelectBoxes
:
sendMsgRecipient
Model
!=
null
canDeselectBoxes
:
sendMsgRecipient
Model
!=
null
canDetailBoxes
:
recipBox
Model
==
null
canSelectBoxes
:
recipBox
Model
!=
null
canDeselectBoxes
:
recipBox
Model
!=
null
onBoxSelect
:
{
var
boxEntry
=
datab
oxModel
.
entry
(
boxId
)
var
boxEntry
=
foundB
oxModel
.
entry
(
boxId
)
statusBar
.
visible
=
false
if
(
sendMsgRecipient
Model
!=
null
)
{
datab
oxModel
.
selectEntry
(
boxEntry
.
dbID
,
true
)
sendMsgRecipient
Model
.
addEntry
(
boxEntry
)
if
(
recipBox
Model
!=
null
)
{
foundB
oxModel
.
selectEntry
(
boxEntry
.
dbID
,
true
)
recipBox
Model
.
addEntry
(
boxEntry
)
}
}
onBoxDeselect
:
{
statusBar
.
visible
=
false
if
(
sendMsgRecipient
Model
!=
null
)
{
datab
oxModel
.
selectEntry
(
boxId
,
false
)
sendMsgRecipient
Model
.
removeEntry
(
boxId
)
if
(
recipBox
Model
!=
null
)
{
foundB
oxModel
.
selectEntry
(
boxId
,
false
)
recipBox
Model
.
removeEntry
(
boxId
)
}
}
onBoxDetail
:
{
var
boxEntry
=
datab
oxModel
.
entry
(
boxId
)
var
boxEntry
=
foundB
oxModel
.
entry
(
boxId
)
statusBar
.
visible
=
false
if
(
sendMsgRecipient
Model
==
null
)
{
if
(
recipBox
Model
==
null
)
{
pageView
.
push
(
pageDataboxDetail
,
{
"
pageView
"
:
pageView
,
"
statusBar
"
:
statusBar
,
...
...
@@ -354,7 +360,10 @@ Item {
searchTextTmp
=
searchPhraseText
.
text
searchTypeTmp
=
searchType
searchScopeTmp
=
searchScope
emptyList
.
visible
=
(
isds
.
findDataboxFulltext
(
userName
,
databoxModel
,
searchPhraseText
.
text
,
searchType
,
searchScope
,
page
)
<=
0
)
emptyList
.
visible
=
(
isds
.
findDataboxFulltext
(
userName
,
foundBoxModel
,
searchPhraseText
.
text
,
searchType
,
searchScope
,
page
)
<=
0
)
if
(
recipBoxModel
!=
null
)
{
foundBoxModel
.
selectEntries
(
recipBoxModel
.
boxIds
(),
true
)
}
}
}
Connections
{
...
...
qml/pages/PageSendMessage.qml
View file @
1358c874
...
...
@@ -99,7 +99,7 @@ Item {
/* Holds send message recipent list model */
DataboxListModel
{
id
:
sendMsgRecipient
Model
id
:
recipBox
Model
Component.onCompleted
:
{
}
}
...
...
@@ -163,7 +163,7 @@ Item {
/* Enable send message button if all required fields are filled */
function
areReguiredFieldsFilled
()
{
actionButton
.
enabled
=
(
dmAnnotation
.
text
.
toString
()
!=
""
&&
(
sendMsgRecipient
Model
.
rowCount
()
>
0
)
&&
(
sendMsgAttachmentModel
.
rowCount
()
>
0
))
actionButton
.
enabled
=
(
dmAnnotation
.
text
.
toString
()
!=
""
&&
(
recipBox
Model
.
rowCount
()
>
0
)
&&
(
sendMsgAttachmentModel
.
rowCount
()
>
0
))
}
TabBar
{
...
...
@@ -270,7 +270,7 @@ Item {
"
pageView
"
:
pageView
,
"
statusBar
"
:
statusBar
,
"
userName
"
:
userName
,
"
sendMsgRecipientModel
"
:
sendMsgRecipient
Model
"
recipBoxModel
"
:
recipBox
Model
},
StackView
.
Immediate
)
}
}
...
...
@@ -287,13 +287,13 @@ Item {
width
:
parent
.
width
height
:
600
interactive
:
true
model
:
sendMsgRecipient
Model
model
:
recipBox
Model
canRemoveBoxes
:
true
onCountChanged
:
{
mainPanel
.
areReguiredFieldsFilled
()
}
onBoxRemove
:
{
sendMsgRecipient
Model
.
removeEntry
(
boxId
)
recipBox
Model
.
removeEntry
(
boxId
)
}
}
// DataboxList
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment