mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-03 13:43:34 +02:00
recordbox: fix focus policy on record box
The focus policy was broken and this patch fix also the tests due to an incorrect conversationModel. Change-Id: I9e7f76b0dff80548d3b92296f22bdd7b848ee931
This commit is contained in:
parent
2ce880670d
commit
73419e417a
3 changed files with 69 additions and 6 deletions
|
@ -80,6 +80,6 @@ protected:
|
||||||
using Role = ConversationList::Role;
|
using Role = ConversationList::Role;
|
||||||
|
|
||||||
// Convenience pointer to be pulled from lrcinstance
|
// Convenience pointer to be pulled from lrcinstance
|
||||||
ConversationModel* model_;
|
ConversationModel* model_ {nullptr};
|
||||||
QString accountId_;
|
QString accountId_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -149,6 +149,7 @@ Popup {
|
||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: cancelBtn
|
id: cancelBtn
|
||||||
|
objectName: "cancelBtn"
|
||||||
z: 1
|
z: 1
|
||||||
|
|
||||||
normalColor: "transparent"
|
normalColor: "transparent"
|
||||||
|
@ -164,6 +165,7 @@ Popup {
|
||||||
anchors.top: box.top
|
anchors.top: box.top
|
||||||
anchors.margins: 8
|
anchors.margins: 8
|
||||||
|
|
||||||
|
focusPolicy: Qt.TabFocus
|
||||||
onClicked: {
|
onClicked: {
|
||||||
closeRecorder();
|
closeRecorder();
|
||||||
updateState(RecordBox.States.INIT);
|
updateState(RecordBox.States.INIT);
|
||||||
|
@ -253,7 +255,7 @@ Popup {
|
||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: recordButton
|
id: recordButton
|
||||||
|
objectName: "recordButton"
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
preferredSize: btnSize
|
preferredSize: btnSize
|
||||||
|
@ -264,6 +266,7 @@ Popup {
|
||||||
source: JamiResources.fiber_manual_record_24dp_svg
|
source: JamiResources.fiber_manual_record_24dp_svg
|
||||||
imageColor: JamiTheme.recordIconColor
|
imageColor: JamiTheme.recordIconColor
|
||||||
|
|
||||||
|
focusPolicy: Qt.TabFocus
|
||||||
onClicked: {
|
onClicked: {
|
||||||
updateState(RecordBox.States.RECORDING);
|
updateState(RecordBox.States.RECORDING);
|
||||||
if (!root.isPhoto)
|
if (!root.isPhoto)
|
||||||
|
@ -273,7 +276,7 @@ Popup {
|
||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: screenshotBtn
|
id: screenshotBtn
|
||||||
|
objectName: "screenshotBtn"
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
preferredSize: btnSize
|
preferredSize: btnSize
|
||||||
|
@ -286,6 +289,7 @@ Popup {
|
||||||
source: JamiResources.fiber_manual_record_24dp_svg
|
source: JamiResources.fiber_manual_record_24dp_svg
|
||||||
imageColor: UtilsAdapter.luma(JamiTheme.backgroundColor) ? "white" : JamiTheme.redColor
|
imageColor: UtilsAdapter.luma(JamiTheme.backgroundColor) ? "white" : JamiTheme.redColor
|
||||||
|
|
||||||
|
focusPolicy: Qt.TabFocus
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.photo = videoProvider.captureVideoFrame(VideoDevices.getDefaultDevice());
|
root.photo = videoProvider.captureVideoFrame(VideoDevices.getDefaultDevice());
|
||||||
updateState(RecordBox.States.REC_SUCCESS);
|
updateState(RecordBox.States.REC_SUCCESS);
|
||||||
|
@ -294,7 +298,7 @@ Popup {
|
||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: btnStop
|
id: btnStop
|
||||||
|
objectName: "btnStop"
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
preferredSize: btnSize
|
preferredSize: btnSize
|
||||||
|
@ -307,6 +311,7 @@ Popup {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: imageColor
|
border.color: imageColor
|
||||||
|
|
||||||
|
focusPolicy: Qt.TabFocus
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!root.isPhoto)
|
if (!root.isPhoto)
|
||||||
stopRecording();
|
stopRecording();
|
||||||
|
@ -316,7 +321,7 @@ Popup {
|
||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: btnRestart
|
id: btnRestart
|
||||||
|
objectName: "btnRestart"
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
preferredSize: btnSize
|
preferredSize: btnSize
|
||||||
|
@ -329,6 +334,7 @@ Popup {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: imageColor
|
border.color: imageColor
|
||||||
|
|
||||||
|
focusPolicy: Qt.TabFocus
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!root.isPhoto)
|
if (!root.isPhoto)
|
||||||
stopRecording();
|
stopRecording();
|
||||||
|
@ -338,7 +344,7 @@ Popup {
|
||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: btnSend
|
id: btnSend
|
||||||
|
objectName: "btnSend"
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
preferredSize: btnSize
|
preferredSize: btnSize
|
||||||
|
@ -350,6 +356,7 @@ Popup {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: imageColor
|
border.color: imageColor
|
||||||
|
|
||||||
|
focusPolicy: Qt.TabFocus
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!root.isPhoto) {
|
if (!root.isPhoto) {
|
||||||
stopRecording();
|
stopRecording();
|
||||||
|
|
56
tests/qml/src/tst_RecordBox.qml
Normal file
56
tests/qml/src/tst_RecordBox.qml
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2023 Savoir-faire Linux Inc.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
import QtTest
|
||||||
|
|
||||||
|
import "../../../src/app/"
|
||||||
|
import "../../../src/app/mainview/components"
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
spacing: 0
|
||||||
|
width: 300
|
||||||
|
height: 300
|
||||||
|
|
||||||
|
RecordBox {
|
||||||
|
id: uut
|
||||||
|
|
||||||
|
TestCase {
|
||||||
|
name: "Take picture"
|
||||||
|
when: windowShown
|
||||||
|
|
||||||
|
function test_takePicture() {
|
||||||
|
// Open the recorder and take a picture
|
||||||
|
uut.openRecorder(true)
|
||||||
|
|
||||||
|
compare(uut.state, RecordBox.States.INIT)
|
||||||
|
|
||||||
|
var screenshotBtn = findChild(uut, "screenshotBtn")
|
||||||
|
screenshotBtn.clicked()
|
||||||
|
|
||||||
|
compare(uut.state, RecordBox.States.REC_SUCCESS)
|
||||||
|
|
||||||
|
uut.closeRecorder()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue