You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jo...@apache.org on 2022/06/13 16:51:04 UTC
[isis] 01/06: ISIS-3044 show number of dialogs in status bar
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit dd1f1599289b3af10d3a979ac4b17775dffbe873
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Sat May 7 17:28:14 2022 +0200
ISIS-3044 show number of dialogs in status bar
---
.../isis/client/kroviz/core/event/StatusPo.kt | 25 +++++++++++++++++++++-
.../isis/client/kroviz/ui/core/RoStatusBar.kt | 10 ++++-----
.../isis/client/kroviz/ui/core/ViewManager.kt | 5 +++++
3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/StatusPo.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/StatusPo.kt
index 515530e342..4e31c17e51 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/StatusPo.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/StatusPo.kt
@@ -1,3 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.isis.client.kroviz.core.event
-class StatusPo(val successNo: Int, val runningNo: Int, val errorNo: Int, val viewsNo: Int)
\ No newline at end of file
+class StatusPo(
+ val successCnt: Int,
+ val runningCnt: Int,
+ val errorCnt: Int,
+ val viewsCnt: Int,
+ var dialogsCnt: Int) // code smell?: count of dialogs is updated en passant in ViewManager, when StatusPo is passed through
\ No newline at end of file
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
index 9da2dbeca9..fcbc0df4b5 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
@@ -77,11 +77,11 @@ class RoStatusBar {
}
fun update(status: StatusPo) {
- success.text = status.successNo.toString()
- running.text = status.runningNo.toString()
- errors.text = status.errorNo.toString()
- views.text = status.viewsNo.toString()
- //FIXME dialogs.text = status.dialogsNo.toString()
+ success.text = status.successCnt.toString()
+ running.text = status.runningCnt.toString()
+ errors.text = status.errorCnt.toString()
+ views.text = status.viewsCnt.toString()
+ dialogs.text = status.dialogsCnt.toString()
}
private fun initRunning() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/ViewManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/ViewManager.kt
index 401a48d91e..5038dde38a 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/ViewManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/ViewManager.kt
@@ -150,6 +150,7 @@ object ViewManager {
}
fun updateStatus(status: StatusPo) {
+ status.dialogsCnt = this.countDialogs() // code smell? arg is modified here
getRoStatusBar().update(status)
setNormalCursor()
}
@@ -236,4 +237,8 @@ object ViewManager {
return SessionManager.getEventStore()
}
+ fun countDialogs(): Int {
+ return popups.size + 1
+ }
+
}