提交 97a401ea 编写于 作者: I Igor Malinovskiy

Update Connection handlers

上级 a7d2b0db
......@@ -25,7 +25,7 @@ FastTextView {
Connections {
id: modelConnections
onLog: {
function onLog(msg) {
if (model.count > 1500) {
model.remove(0, model.count - 1000)
}
......
......@@ -159,13 +159,13 @@ ApplicationWindow {
Connections {
target: serverStatsModel
ignoreUnknownSignals: true
onError: notification.showError(error)
function onError(error) { notification.showError(error) }
}
Connections {
target: keyFactory
onNewKeyDialog: {
function onNewKeyDialog(r) {
addNewKeyDialog.request = r
addNewKeyDialog.open()
}
......@@ -178,7 +178,7 @@ ApplicationWindow {
Connections {
target: bulkOperations
onOpenDialog: {
function onOpenDialog(operationName) {
bulkOperationDialog.operationName = operationName
bulkOperationDialog.open()
}
......@@ -187,7 +187,7 @@ ApplicationWindow {
Connections {
target: appEvents
onError: {
function onError(msg) {
notification.showError(msg)
}
}
......@@ -195,18 +195,18 @@ ApplicationWindow {
Connections {
target: connectionsManager
onEditConnection: {
function onEditConnection(config) {
connectionSettingsDialog.settings = config
connectionSettingsDialog.open()
}
onEditConnectionGroup: {
function onEditConnectionGroup(group) {
connectionGroupDialog.group = group
connectionGroupDialog.open()
}
Component.onCompleted: {
if (connectionsManager.size() == 0)
if (connectionsManager.size() === 0)
quickStartDialog.open()
}
}
......@@ -397,7 +397,8 @@ ApplicationWindow {
Connections {
target: valuesModel
ignoreUnknownSignals: true
onKeyError: {
function onKeyError(error) {
if (index != -1)
tabs.currentIndex = index
......
......@@ -350,20 +350,20 @@ Dialog {
Connections {
target: bulkOperations
onAffectedKeys: {
function onAffectedKeys(r) {
console.log("Affected keys loaded")
affectedKeysListView.model = r
uiBlocker.visible = false
}
onOperationFinished: {
function onOperationFinished() {
affectedKeysListView.model = []
uiBlocker.visible = false
bulkSuccessNotification.text = qsTr("Bulk Operation finished.")
bulkSuccessNotification.open()
}
onError: {
function onError(e) {
showError(qsTr("Bulk Operation finished with errors"), e, details)
}
}
......
......@@ -241,7 +241,13 @@ TreeView {
Connections {
target: connectionsManager
onExpand: !root.isExpanded(index) && root.expand(index)
function onExpand(index) {
if (root.isExpanded(index))
return
root.expand(index)
}
}
......
......@@ -87,13 +87,14 @@ BetterDialog {
Connections {
target: keyFactory
onKeyAdded: {
function onKeyAdded() {
root.request = null
valueAddEditor.item.reset()
valueAddEditor.item.initEmpty()
root.close()
}
onError: {
function onError(err) {
addError.text = err
addError.open()
}
......
......@@ -50,7 +50,6 @@ RowLayout {
anchors.margins: 10
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
font.pointSize: 8
text: ""
color: sysPalette.mid
visible: false
......@@ -189,12 +188,12 @@ RowLayout {
target: keyTab.keyModel ? keyTab.keyModel : null
onError: {
function onError(error) {
valueErrorNotification.text = error
valueErrorNotification.open()
}
onIsLoadedChanged: {
function onIsLoadedChanged() {
console.log("model loaded (qml)")
if (keyTab.keyModel.totalRowCount === 0) {
console.log("Load rows count")
......@@ -205,11 +204,11 @@ RowLayout {
}
}
onTotalRowCountChanged: {
function onTotalRowCountChanged() {
keyTab.keyModel.loadRows(table.currentStart, table.maxItemsOnPage)
}
onRowsLoaded: {
function onRowsLoaded() {
console.log("rows loaded")
wrapper.hideLoader()
......@@ -293,6 +292,7 @@ RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: 40
visible: status === Loader.Ready
source: keyModel && keyType === "list"? "./filters/ListFilters.qml" : ""
}
......
......@@ -480,12 +480,12 @@ Item
Connections {
target: keyTab.keyModel ? keyTab.keyModel : null
onValueUpdated: {
function valueUpdated() {
root.isEdited = false
saveBtnTimer.resetSaveBtn()
}
onError: saveBtnTimer.resetSaveBtn()
function error() { saveBtnTimer.resetSaveBtn() }
}
Timer {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册