Fix crash on startup

This commit is contained in:
vladest 2018-03-27 18:22:56 +02:00
parent 56150f8962
commit 096b56395e
16 changed files with 38 additions and 56 deletions

View file

@ -1,8 +0,0 @@
import QtQuick 2.7
Shortcut {
id: root
property string text
property alias shortcut: root.sequence
signal triggered()
}

View file

@ -9,7 +9,7 @@
//
import QtQuick 2.7
import QtQuick.Controls 2.2 as Original
import QtQuick.Controls 2.3 as Original
import TabletScriptingInterface 1.0
import "../styles-uit"
@ -21,8 +21,6 @@ Original.Button {
property int colorScheme: hifi.colorSchemes.light
property string buttonGlyph: "";
property Action action: null
width: hifi.dimensions.buttonWidth
height: hifi.dimensions.controlLineHeight
@ -40,17 +38,8 @@ Original.Button {
}
}
onActionChanged: {
if (action !== null && action.text !== "") {
control.text = action.text
}
}
onClicked: {
Tablet.playSound(TabletEnums.ButtonClick);
if (action !== null) {
action.triggered()
}
}
background: Rectangle {

View file

@ -24,18 +24,11 @@ Original.Button {
width: 120
height: 28
property Action action: null
onHoveredChanged: {
if (hovered) {
Tablet.playSound(TabletEnums.ButtonHover);
}
}
onActionChanged: {
if (action !== null && action.text !== "") {
control.text = action.text
}
}
onFocusChanged: {
if (focus) {
@ -45,9 +38,6 @@ Original.Button {
onClicked: {
Tablet.playSound(TabletEnums.ButtonClick);
if (action !== null) {
action.triggered()
}
}
background: Rectangle {

View file

@ -11,7 +11,7 @@
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.2 as QQC2
import QtQuick.Controls 2.3 as QQC2
import "../styles-uit"

View file

@ -8,8 +8,9 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
import QtQuick 2.5
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls 2.3 as QQC2
import "../dialogs"
import "../js/Utils.js" as Utils
@ -565,7 +566,7 @@ FocusScope {
ColorAnimation on color { from: "#7fffff00"; to: "#7f0000ff"; duration: 1000; loops: 9999 }
}
Action {
QQC2.Action {
text: "Toggle Focus Debugger"
shortcut: "Ctrl+Shift+F"
enabled: DebugQML

View file

@ -10,6 +10,7 @@
import QtQuick 2.7;
import QtQuick.Dialogs 1.2 as OriginalDialogs;
import QtQuick.Controls 2.3
import "../controls-uit";
import "../styles-uit";
@ -265,7 +266,7 @@ ModalWindow {
Action {
id: cancelAction;
text: qsTr("Cancel");
shortcut: Qt.Key_Escape;
shortcut: "Esc";
onTriggered: {
root.result = null;
root.canceled();
@ -276,7 +277,7 @@ ModalWindow {
Action {
id: acceptAction;
text: qsTr("Add");
shortcut: Qt.Key_Return;
shortcut: "Return"
onTriggered: {
var result = {};
if (textInput) {

View file

@ -13,6 +13,7 @@ import Qt.labs.folderlistmodel 2.1
import Qt.labs.settings 1.0
import QtQuick.Dialogs 1.2 as OriginalDialogs
import QtQuick.Controls 1.4 as QQC1
import QtQuick.Controls 2.3
import ".."
import "../controls-uit"

View file

@ -8,7 +8,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
import QtQuick 2.5
import QtQuick 2.7
import QtQuick.Controls 2.3
import "../controls-uit"
import "../styles-uit"
@ -164,7 +165,7 @@ ModalWindow {
Action {
id: cancelAction
text: qsTr("Cancel");
sequence: Qt.Key_Escape
shortcut: "Esc"
onTriggered: {
root.canceled();
root.destroy();
@ -174,7 +175,7 @@ ModalWindow {
Action {
id: acceptAction
text: qsTr("OK");
sequence: Qt.Key_Return
shortcut: "Return"
onTriggered: {
root.result = items ? comboBox.currentText : textResult.text
root.selected(root.result);

View file

@ -10,6 +10,7 @@
import QtQuick 2.7
import QtQuick.Dialogs 1.2 as OriginalDialogs
import QtQuick.Controls 2.3
import "../controls-uit"
import "../styles-uit"
@ -293,7 +294,7 @@ TabletModalWindow {
Action {
id: cancelAction;
text: qsTr("Cancel");
shortcut: Qt.Key_Escape;
shortcut: "Esc";
onTriggered: {
root.result = null;
root.canceled();
@ -304,7 +305,7 @@ TabletModalWindow {
Action {
id: acceptAction;
text: qsTr("Add");
shortcut: Qt.Key_Return;
shortcut: "Return";
onTriggered: {
var result = {};
if (textInput) {

View file

@ -13,6 +13,7 @@ import Qt.labs.folderlistmodel 2.1
import Qt.labs.settings 1.0
import QtQuick.Dialogs 1.2 as OriginalDialogs
import QtQuick.Controls 1.4 as QQC1
import QtQuick.Controls 2.3
import ".."
import "../controls-uit"

View file

@ -10,6 +10,7 @@
import QtQuick 2.7
import QtQuick.Dialogs 1.2 as OriginalDialogs
import QtQuick.Controls 2.3
import "../controls-uit"
import "../styles-uit"
@ -143,7 +144,7 @@ TabletModalWindow {
Action {
id: cancelAction
text: qsTr("Cancel")
shortcut: Qt.Key_Escape
shortcut: "Esc"
onTriggered: {
root.canceled();
root.destroy();
@ -152,7 +153,7 @@ TabletModalWindow {
Action {
id: acceptAction
text: qsTr("OK")
shortcut: Qt.Key_Return
shortcut: "Return"
onTriggered: {
root.result = items ? comboBox.currentText : textResult.text
root.selected(root.result);

View file

@ -9,7 +9,8 @@
//
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls 2.3
import QtQuick.Controls 1.5 as QQC1
import "../../controls-uit"
import "../../styles-uit"
@ -362,7 +363,7 @@ Item {
}
}
TableViewColumn {
QQC1.TableViewColumn {
id: fileNameColumn
role: "fileName"
title: "Name"

View file

@ -2,6 +2,8 @@ import QtQuick 2.7
import QtWebEngine 1.5;
import Qt.labs.settings 1.0
import QtQuick.Controls 2.3
import "../desktop" as OriginalDesktop
import ".."
import "."

View file

@ -1,5 +1,5 @@
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick 2.7
import QtQuick.Controls 1.5
import QtQuick.XmlListModel 2.0
import QtQuick.Controls.Styles 1.4
@ -104,7 +104,7 @@ ModalWindow {
id: acceptAction
text: qsTr("OK")
enabled: root.result ? true : false
shortcut: Qt.Key_Return
shortcut: "Return"
onTriggered: {
root.selected(root.result);
root.destroy();
@ -114,7 +114,7 @@ ModalWindow {
Action {
id: cancelAction
text: qsTr("Cancel")
shortcut: Qt.Key_Escape
shortcut: "Esc"
onTriggered: {
root.canceled();
root.destroy();

View file

@ -1,5 +1,5 @@
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.2 as OriginalDialogs
import "../../../styles-uit"
@ -256,7 +256,7 @@ Item {
}
}
HifiControls.Action {
Action {
id: cancelAction
text: "Cancel"
onTriggered: {
@ -265,7 +265,7 @@ Item {
}
}
HifiControls.Action {
Action {
id: okAction
text: "OK"
onTriggered: {

View file

@ -1,4 +1,5 @@
import QtQuick 2.5
import QtQuick 2.7
import QtQuick.Controls 2.3
import "../../../controls-uit" as HifiControls
@ -39,21 +40,21 @@ Column {
HifiControls.Button { action: cancelAction ; color: hifi.buttons.black; colorScheme: hifi.colorSchemes.dark }
}
HifiControls.Action {
Action {
id: acceptAction
text: qsTr("OK")
enabled: root.result ? true : false
shortcut: Qt.Key_Return
shortcut: "Return"
onTriggered: {
root.selected(root.result);
root.destroy();
}
}
HifiControls.Action {
Action {
id: cancelAction
text: qsTr("Cancel")
shortcut: Qt.Key_Escape
shortcut: "Esc"
onTriggered: {
root.canceled();
root.destroy();