Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Artikulate
Commits
bd1f434a
Commit
bd1f434a
authored
Jul 10, 2013
by
Andreas Cord-Landwehr
Browse files
Close phrase editor when unit is closed.
parent
b6f93d7b
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/qml/PhraseEditor.qml
View file @
bd1f434a
...
...
@@ -47,6 +47,12 @@ Item {
}
}
function
close
()
{
root
.
phrase
=
null
editorClosed
()
}
function
applyChanges
()
{
root
.
phrase
.
type
=
root
.
__changedPhraseType
...
...
@@ -81,11 +87,14 @@ Item {
anchors.verticalCenter
:
inputLine
.
verticalCenter
onTextChanged
:
root
.
__changedPhraseText
=
text
onPhraseChanged
:
{
text
=
root
.
phrase
.
text
if
(
root
.
phrase
!=
null
)
text
=
root
.
phrase
.
text
else
text
=
""
}
onAccepted
:
{
applyChanges
()
editorC
lose
d
()
c
lose
()
}
}
PlasmaComponents.ToolButton
{
...
...
@@ -96,7 +105,7 @@ Item {
iconSource
:
"
dialog-ok-apply
"
onClicked
:
{
applyChanges
()
editorC
lose
d
()
c
lose
()
}
}
PlasmaComponents.ToolButton
{
...
...
@@ -109,16 +118,17 @@ Item {
phraseInput
.
text
=
root
.
phrase
.
text
phraseEditStateSetter
.
updateCheckedStates
()
phraseTypeSetter
.
updateCheckedStates
()
editorC
lose
d
()
c
lose
()
}
}
}
Row
{
id
:
originalPhraseInfo
property
string
originalPhrase
:
(
root
.
phrase
!=
null
)
?
root
.
phrase
.
i18nText
:
""
spacing
:
10
visible
:
{
root
.
phrase
.
i18nText
!=
""
}
visible
:
{
root
.
phrase
!=
null
&&
originalPhrase
!=
""
}
Text
{
text
:
i18n
(
"
Original Phrase:
"
)
+
"
<i>
"
+
root
.
phrase
.
i18nText
+
"
</i>
"
text
:
i18n
(
"
Original Phrase:
"
)
+
"
<i>
"
+
originalPhraseInfo
.
originalPhrase
+
"
</i>
"
width
:
root
.
width
-
70
wrapMode
:
Text
.
WordWrap
}
...
...
@@ -150,7 +160,7 @@ Item {
width
:
100
text
:
model
.
title
checkable
:
true
checked
:
phrase
.
hasPhoneme
(
model
.
dataRole
)
checked
:
{
phrase
!=
null
&&
phrase
.
hasPhoneme
(
model
.
dataRole
)
}
onClicked
:
{
//TODO this button has no undo operation yet
if
(
checked
)
{
phrase
.
addPhoneme
(
model
.
dataRole
)
...
...
@@ -169,7 +179,10 @@ Item {
height
:
30
*
count
/
columns
+
60
cellWidth
:
100
cellHeight
:
30
model
:
PhonemeModel
{
language
:
root
.
phrase
.
unit
.
course
.
language
}
model
:
PhonemeModel
{
language
:
{
(
phrase
!=
null
)
?
root
.
phrase
.
unit
.
course
.
language
:
null
}
}
delegate
:
phonemeItem
}
}
...
...
src/qml/PhraseEditorEditStateComponent.qml
View file @
bd1f434a
...
...
@@ -38,11 +38,16 @@ Item {
onPhraseChanged
:
{
updateCheckedStates
();
selectedState
=
phrase
.
editState
if
(
phrase
!=
null
)
{
selectedState
=
phrase
.
editState
}
}
function
updateCheckedStates
()
{
if
(
root
.
phrase
==
null
)
{
return
;
}
switch
(
root
.
phrase
.
editState
)
{
case
Phrase.Unknown
:
buttonUnknown
.
checked
=
true
;
...
...
src/qml/PhraseEditorSoundComponent.qml
View file @
bd1f434a
...
...
@@ -50,11 +50,11 @@ Item {
text
:
i18n
(
"
Existing Recording:
"
)
}
PlasmaComponents.ToolButton
{
property
int
soundState
:
phrase
.
playbackSoundState
property
int
soundState
:
(
phrase
!=
null
)
?
phrase
.
playbackSoundState
:
Phrase
.
StoppedState
anchors.verticalCenter
:
parent
.
verticalCenter
iconSource
:
"
artikulate-media-playback-start
"
enabled
:
phrase
.
isSound
enabled
:
{
phrase
!=
null
&&
phrase
.
isSound
}
onClicked
:
{
if
(
soundState
==
Phrase
.
PlayingState
)
{
...
...
@@ -82,7 +82,7 @@ Item {
text
:
i18n
(
"
Create New Recording:
"
)
}
PlasmaComponents.ToolButton
{
property
int
recordingState
:
phrase
.
r
ecordingState
property
int
recordingState
:
(
root
.
phrase
!=
null
)
?
root
.
phrase
.
recordingState
:
Phrase
.
NotR
ecordingState
property
bool
recording
:
true
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
@@ -110,7 +110,7 @@ Item {
}
}
PlasmaComponents.ToolButton
{
property
int
soundState
:
phrase
.
playbackNativeSoundBufferState
property
int
soundState
:
(
phrase
!=
null
)
?
phrase
.
playbackNativeSoundBufferState
:
Phrase
.
StoppedState
anchors.verticalCenter
:
parent
.
verticalCenter
iconSource
:
"
artikulate-media-playback-start
"
...
...
src/qml/PhraseEditorTypeComponent.qml
View file @
bd1f434a
...
...
@@ -38,11 +38,16 @@ Item {
onPhraseChanged
:
{
updateCheckedStates
()
root
.
selectedType
=
phrase
.
type
if
(
phrase
!=
null
)
{
root
.
selectedType
=
phrase
.
type
}
}
function
updateCheckedStates
()
{
if
(
root
.
phrase
==
null
)
{
return
;
}
switch
(
root
.
phrase
.
type
)
{
case
Phrase.Word
:
buttonWord
.
checked
=
true
;
...
...
src/qml/UnitEditor.qml
View file @
bd1f434a
...
...
@@ -124,6 +124,7 @@ Item {
font.pointSize
:
20
;
onClicked
:
{
closeUnit
()
phraseEditor
.
close
()
}
}
Text
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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