fix(qml): correzioni Silica post-primo-test su device (v0.1.1)
Pagine non caricabili ("Impossibile caricare la pagina") per API
inesistenti nella Silica del kit Sailfish 5.1 / Qt 5.6 — verificate
sui docs ufficiali (pagine -members) e incrociate coi pattern
provati su device (tide/calibreweb/quill):
- TextField: rimosso onAccepted (segnale "accepted" inesistente)
-> EnterKey.enabled/.onClicked (LoginPage, ChatPage)
- Button: rimosso "highlighted" (inesistente su Button) dal mic
- ComboBox: menu con MenuItem espliciti (via Repeater non provato)
- Theme.highlightDimmerColor -> Theme.rgba(highlightBackgroundColor)
- Azioni nei menu instradate via funzioni della Page (pattern tide)
- SessionsPage: titolo delegato piu' robusto (no "undefined")
This commit is contained in:
+25
-7
@@ -55,21 +55,21 @@ Page {
|
||||
}
|
||||
MenuItem {
|
||||
text: appSettings.ttsAutoRead ? qsTr("Auto-read: on") : qsTr("Auto-read: off")
|
||||
onClicked: appSettings.ttsAutoRead = !appSettings.ttsAutoRead
|
||||
onClicked: page.toggleAutoRead()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Stop playback")
|
||||
visible: player.playing
|
||||
onClicked: player.stop()
|
||||
onClicked: page.stopPlayback()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Cancel run")
|
||||
visible: chat.busy
|
||||
onClicked: chat.cancel()
|
||||
onClicked: page.cancelRun()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Resync")
|
||||
onClicked: chat.resync()
|
||||
onClicked: page.resync()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ Page {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: page.kbHeight
|
||||
height: compCol.height + Theme.paddingMedium
|
||||
color: Theme.highlightDimmerColor
|
||||
color: Theme.rgba(Theme.highlightBackgroundColor, 0.15)
|
||||
|
||||
Column {
|
||||
id: compCol
|
||||
@@ -141,7 +141,7 @@ Page {
|
||||
Button {
|
||||
id: micBtn
|
||||
text: recorder.recording ? qsTr("Stop") : qsTr("Mic")
|
||||
highlighted: recorder.recording
|
||||
// Button non ha "highlighted": lo stato è nel testo (Mic/Stop)
|
||||
enabled: !api.transcribing && !chat.busy || recorder.recording
|
||||
onClicked: {
|
||||
if (recorder.recording)
|
||||
@@ -157,7 +157,9 @@ Page {
|
||||
id: input
|
||||
width: parent.width - micBtn.width - sendBtn.width - 2 * parent.spacing
|
||||
placeholderText: qsTr("Message…")
|
||||
onAccepted: page.doSend()
|
||||
// Invio con EnterKey (vedi LoginPage)
|
||||
EnterKey.enabled: text.length > 0
|
||||
EnterKey.onClicked: page.doSend()
|
||||
}
|
||||
|
||||
Button {
|
||||
@@ -226,6 +228,22 @@ Page {
|
||||
api.speak(t)
|
||||
}
|
||||
|
||||
function toggleAutoRead() {
|
||||
appSettings.ttsAutoRead = !appSettings.ttsAutoRead
|
||||
}
|
||||
|
||||
function stopPlayback() {
|
||||
player.stop()
|
||||
}
|
||||
|
||||
function cancelRun() {
|
||||
chat.cancel()
|
||||
}
|
||||
|
||||
function resync() {
|
||||
chat.resync()
|
||||
}
|
||||
|
||||
function showNotice(text) {
|
||||
page.noticeText = text
|
||||
noticeClear.restart()
|
||||
|
||||
@@ -36,7 +36,10 @@ Page {
|
||||
label: qsTr("Password")
|
||||
echoMode: TextInput.Password
|
||||
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
|
||||
onAccepted: page.doLogin()
|
||||
// Silica TextField NON ha il segnale "accepted": l'invio si gestisce
|
||||
// con la proprietà allegata EnterKey (pattern provato sul device).
|
||||
EnterKey.enabled: text.length > 0
|
||||
EnterKey.onClicked: page.doLogin()
|
||||
}
|
||||
|
||||
Button {
|
||||
|
||||
@@ -24,15 +24,15 @@ Page {
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Refresh")
|
||||
onClicked: api.refreshSessions()
|
||||
onClicked: page.refresh()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Settings")
|
||||
onClicked: pageStack.push(Qt.resolvedUrl("SettingsPage.qml"))
|
||||
onClicked: page.openSettings()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Sign out")
|
||||
onClicked: api.logout()
|
||||
onClicked: page.signOut()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ Page {
|
||||
width: parent.width
|
||||
truncationMode: TruncationMode.Fade
|
||||
color: item.highlighted ? Theme.highlightColor : Theme.primaryColor
|
||||
text: ("" + model.title).length > 0 ? model.title : model.session_id
|
||||
text: model.title ? model.title : model.session_id
|
||||
}
|
||||
|
||||
Label {
|
||||
@@ -97,6 +97,18 @@ Page {
|
||||
|
||||
Component.onCompleted: api.refreshSessions()
|
||||
|
||||
function refresh() {
|
||||
api.refreshSessions()
|
||||
}
|
||||
|
||||
function openSettings() {
|
||||
pageStack.push(Qt.resolvedUrl("SettingsPage.qml"))
|
||||
}
|
||||
|
||||
function signOut() {
|
||||
api.logout()
|
||||
}
|
||||
|
||||
function openSession(id) {
|
||||
expectNewSession = false
|
||||
pageStack.push(Qt.resolvedUrl("ChatPage.qml"), { sessionId: id })
|
||||
|
||||
+37
-16
@@ -43,13 +43,27 @@ Page {
|
||||
ComboBox {
|
||||
label: qsTr("Read-aloud voice")
|
||||
currentIndex: Math.max(0, page.voiceNames.indexOf(appSettings.ttsVoice))
|
||||
// MenuItems espliciti (no Repeater: pattern non provato sul kit 5.1)
|
||||
menu: ContextMenu {
|
||||
Repeater {
|
||||
model: page.voiceNames
|
||||
MenuItem {
|
||||
text: modelData
|
||||
onClicked: appSettings.ttsVoice = modelData
|
||||
}
|
||||
MenuItem {
|
||||
text: "it-IT-ElsaNeural"
|
||||
onClicked: appSettings.ttsVoice = "it-IT-ElsaNeural"
|
||||
}
|
||||
MenuItem {
|
||||
text: "it-IT-DiegoNeural"
|
||||
onClicked: appSettings.ttsVoice = "it-IT-DiegoNeural"
|
||||
}
|
||||
MenuItem {
|
||||
text: "it-IT-IsabellaNeural"
|
||||
onClicked: appSettings.ttsVoice = "it-IT-IsabellaNeural"
|
||||
}
|
||||
MenuItem {
|
||||
text: "it-IT-GiuseppeMultilingualNeural"
|
||||
onClicked: appSettings.ttsVoice = "it-IT-GiuseppeMultilingualNeural"
|
||||
}
|
||||
MenuItem {
|
||||
text: "en-US-AriaNeural"
|
||||
onClicked: appSettings.ttsVoice = "en-US-AriaNeural"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,12 +72,17 @@ Page {
|
||||
label: qsTr("TTS engine")
|
||||
currentIndex: Math.max(0, page.engineNames.indexOf(appSettings.ttsEngine))
|
||||
menu: ContextMenu {
|
||||
Repeater {
|
||||
model: page.engineNames
|
||||
MenuItem {
|
||||
text: modelData
|
||||
onClicked: appSettings.ttsEngine = modelData
|
||||
}
|
||||
MenuItem {
|
||||
text: "edge"
|
||||
onClicked: appSettings.ttsEngine = "edge"
|
||||
}
|
||||
MenuItem {
|
||||
text: "openai"
|
||||
onClicked: appSettings.ttsEngine = "openai"
|
||||
}
|
||||
MenuItem {
|
||||
text: "elevenlabs"
|
||||
onClicked: appSettings.ttsEngine = "elevenlabs"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,10 +99,7 @@ Page {
|
||||
Button {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: qsTr("Sign out")
|
||||
onClicked: {
|
||||
api.logout()
|
||||
pageStack.replace(Qt.resolvedUrl("LoginPage.qml"))
|
||||
}
|
||||
onClicked: page.signOut()
|
||||
}
|
||||
|
||||
SectionHeader { text: qsTr("About") }
|
||||
@@ -104,5 +120,10 @@ Page {
|
||||
VerticalScrollDecorator {}
|
||||
}
|
||||
|
||||
function signOut() {
|
||||
api.logout()
|
||||
pageStack.replace(Qt.resolvedUrl("LoginPage.qml"))
|
||||
}
|
||||
|
||||
Component.onCompleted: urlField.text = appSettings.baseUrl
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user