@@ -6,14 +6,14 @@ import ch.seidel.kutu.Config._
6
6
import ch .seidel .kutu .ConnectionStates
7
7
import ch .seidel .kutu .KuTuApp .handleAction
8
8
import ch .seidel .kutu .data ._
9
- import ch .seidel .kutu .domain .{Altersklasse , Durchgang , KutuService , TeamRegel , WertungView , WettkampfView , encodeFileName , isNumeric }
9
+ import ch .seidel .kutu .domain .{Altersklasse , Durchgang , KutuService , TeamRegel , WertungView , WettkampfView , encodeFileName }
10
10
import ch .seidel .kutu .renderer .PrintUtil .FilenameDefault
11
11
import scalafx .Includes .when
12
12
import scalafx .beans .binding .Bindings
13
13
import scalafx .beans .property .BooleanProperty
14
14
import scalafx .event .ActionEvent
15
15
import scalafx .scene .Node
16
- import scalafx .scene .control .{Button , Label , TextField }
16
+ import scalafx .scene .control .{Button , ComboBox , Label , TextField }
17
17
import scalafx .scene .layout .{BorderPane , Priority , VBox }
18
18
19
19
import scala .concurrent .Await
@@ -221,27 +221,38 @@ class RanglisteTab(wettkampfmode: BooleanProperty, wettkampf: WettkampfView, ove
221
221
btnPublikationFreigeben)
222
222
}
223
223
224
+ override def resetFilterPresets (combos : Seq [ComboBox [FilterBy ]], scoreListKind : ScoreListKind ): Unit = {
225
+ scoreListKind match {
226
+ case Teamrangliste =>
227
+ val team = groupers.find(p => p.isInstanceOf [ByTeamRule ] && p.groupname.startsWith(" Wettkampf" ))
228
+ combos(1 ).selectionModel.value.select(team.get)
229
+ combos(2 ).selectionModel.value.clearSelection()
230
+ combos(3 ).selectionModel.value.clearSelection()
231
+
232
+ case _ =>
233
+ val akg = groupers.find(p => p.isInstanceOf [ByAltersklasse ] && p.groupname.startsWith(" Wettkampf" ))
234
+ val jakg = groupers.find(p => p.isInstanceOf [ByJahrgangsAltersklasse ] && p.groupname.startsWith(" Wettkampf" ))
235
+ if (akg.nonEmpty) {
236
+ combos(1 ).selectionModel.value.select(ByProgramm (programmText))
237
+ combos(2 ).selectionModel.value.select(akg.get)
238
+ combos(3 ).selectionModel.value.select(ByGeschlecht ())
239
+ } else if (jakg.nonEmpty) {
240
+ combos(1 ).selectionModel.value.select(ByProgramm (programmText))
241
+ combos(2 ).selectionModel.value.select(jakg.get)
242
+ combos(3 ).selectionModel.value.select(ByGeschlecht ())
243
+ } else {
244
+ combos(1 ).selectionModel.value.select(ByProgramm (programmText))
245
+ combos(2 ).selectionModel.value.select(ByGeschlecht ())
246
+ }
247
+ }
248
+ }
224
249
225
250
override def isPopulated = {
226
251
val combos = populate(groupers)
227
- val akg = groupers.find(p => p.isInstanceOf [ByAltersklasse ] && p.groupname.startsWith(" Wettkampf" ))
228
- val jakg = groupers.find(p => p.isInstanceOf [ByJahrgangsAltersklasse ] && p.groupname.startsWith(" Wettkampf" ))
229
- val team = groupers.find(p => p.isInstanceOf [ByTeamRule ] && p.groupname.startsWith(" Wettkampf" ))
230
- if (akg.nonEmpty) {
231
- combos(1 ).selectionModel.value.select(ByProgramm (programmText))
232
- combos(2 ).selectionModel.value.select(akg.get)
233
- combos(3 ).selectionModel.value.select(ByGeschlecht ())
234
- } else if (jakg.nonEmpty) {
235
- combos(1 ).selectionModel.value.select(ByProgramm (programmText))
236
- combos(2 ).selectionModel.value.select(jakg.get)
237
- combos(3 ).selectionModel.value.select(ByGeschlecht ())
238
- } else if (team.nonEmpty) {
239
- combos(1 ).selectionModel.value.select(team.get)
240
- } else {
241
- combos(1 ).selectionModel.value.select(ByProgramm (programmText))
242
- combos(2 ).selectionModel.value.select(ByGeschlecht ())
243
- }
244
252
253
+ val team = groupers.find(p => p.isInstanceOf [ByTeamRule ] && p.groupname.startsWith(" Wettkampf" ))
254
+ val kind : ScoreListKind = if (getData.exists(_.team > 0 ) || team.nonEmpty) Teamrangliste else Einzelrangliste
255
+ resetFilterPresets(combos, kind)
245
256
true
246
257
}
247
258
0 commit comments