mirror of
https://github.com/anas-elgarhy/Ayah-intellij.git
synced 2024-08-15 00:43:43 +00:00
🥰💙😆 Compleate the settings system yoooo
This commit is contained in:
parent
c1b4af4cb5
commit
bf012bf694
2 changed files with 27 additions and 2 deletions
|
@ -33,8 +33,12 @@ public class AyahSettingsConfigurable implements Configurable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
|
||||
public void apply() {
|
||||
final var settingsState = AyahSettingsState.getInstance();
|
||||
settingsState.setBasmalhOnStart(settingsComponent.getBasmalhOnStart());
|
||||
settingsState.setIntervalTimeBetweenNotifications(settingsComponent.getIntervalTimeBetweenNotifications());
|
||||
settingsState.setAutoPlayAudio(settingsComponent.isAutoPlayAudio());
|
||||
settingsState.setPlayerId(settingsComponent.getPlayerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.miginfocom.swing.MigLayout;
|
|||
|
||||
import javax.swing.*;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* The settings UI.
|
||||
|
@ -133,4 +134,24 @@ public class SettingsComponent {
|
|||
public JPanel getPanel() {
|
||||
return panel;
|
||||
}
|
||||
|
||||
public BasmalhOnStart getBasmalhOnStart() {
|
||||
final var b = new BasmalhOnStart();
|
||||
b.setActive(basmalhOnStartCheckBox.isSelected());
|
||||
b.setSoundActive(autoPlayBasmalhCheckBox.isSelected());
|
||||
b.setPlayerId(Objects.requireNonNull(basmalhPlayerIdComboBox.getSelectedItem()).toString());
|
||||
return b;
|
||||
}
|
||||
|
||||
public int getIntervalTimeBetweenNotifications() {
|
||||
return notificationsIntervalSpinnerModel.getNumber().intValue();
|
||||
}
|
||||
|
||||
public boolean isAutoPlayAudio() {
|
||||
return notificationsAudioCheckBox.isSelected();
|
||||
}
|
||||
|
||||
public String getPlayerId() {
|
||||
return Objects.requireNonNull(ayahPlayerIdComboBox.getSelectedItem()).toString();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue