From 39c5978d0fb605d1b8976412f446149d97ec4e8a Mon Sep 17 00:00:00 2001 From: Anas Elgarhy Date: Thu, 25 May 2023 23:31:19 +0300 Subject: [PATCH] [fix] Fix the editions sel method for combo boxes models setup --- .../intellij/plugins/ayah/dialogs/AyahDetailsDialog.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/anas/intellij/plugins/ayah/dialogs/AyahDetailsDialog.java b/src/main/java/com/anas/intellij/plugins/ayah/dialogs/AyahDetailsDialog.java index aabbfb3..17eed7b 100644 --- a/src/main/java/com/anas/intellij/plugins/ayah/dialogs/AyahDetailsDialog.java +++ b/src/main/java/com/anas/intellij/plugins/ayah/dialogs/AyahDetailsDialog.java @@ -2,9 +2,8 @@ package com.anas.intellij.plugins.ayah.dialogs; import com.anas.alqurancloudapi.Ayah; import com.anas.alqurancloudapi.consts.Constants; -import com.anas.alqurancloudapi.consts.Surahs; import com.anas.alqurancloudapi.edition.Edition; -import com.anas.alqurancloudapi.edition.EditionType; +import com.anas.alqurancloudapi.edition.EditionFormat; import com.anas.intellij.plugins.ayah.audio.AudioPlayer; import com.anas.intellij.plugins.ayah.audio.PlayerListener; import com.anas.intellij.plugins.ayah.settings.userinterface.ReadableEdition; @@ -70,10 +69,10 @@ public class AyahDetailsDialog extends JDialog implements PlayerListener { final var editionComboBoxModel = new DefaultComboBoxModel(); Arrays.stream(Edition.getEditions()).forEach(edition -> { - if (edition.getType() == EditionType.TAFSIR || edition.getType() == EditionType.TRANSLATION) { - tafserAndTranslationComboBoxModel.addElement(new ReadableEdition(edition)); - } else { + if (edition.getFormat() == EditionFormat.AUDIO) { editionComboBoxModel.addElement(new ReadableEdition(edition)); + } else { + tafserAndTranslationComboBoxModel.addElement(new ReadableEdition(edition)); } });