Skip to content

Commit

Permalink
- code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Oct 26, 2024
1 parent d1e0f88 commit 169f9bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public PanelFilmlisteLaden(boolean inSettingsDialog) {
//now add the item listeners for update
senderCbList.forEach(cb -> cb.addItemListener(this::senderSelectionItemHandler));

jRadioButtonManuell.addChangeListener(l -> {
jRadioButtonManuell.addChangeListener(_ -> {
final var selected = jRadioButtonManuell.isSelected();
jTextFieldUrl.setEnabled(selected);
jButtonDateiAuswaehlen.setEnabled(selected);
Expand All @@ -81,7 +81,7 @@ public PanelFilmlisteLaden(boolean inSettingsDialog) {
var enableDuplicateEvaluation = config.getBoolean(
ApplicationConfiguration.FILM_EVALUATE_DUPLICATES, true);
cbEvaluateDuplicates.setSelected(enableDuplicateEvaluation);
cbEvaluateDuplicates.addActionListener(l -> config.setProperty(ApplicationConfiguration.FILM_EVALUATE_DUPLICATES,
cbEvaluateDuplicates.addActionListener(_ -> config.setProperty(ApplicationConfiguration.FILM_EVALUATE_DUPLICATES,
cbEvaluateDuplicates.isSelected()));
}

Expand All @@ -96,19 +96,19 @@ private void prepareSettingsLayout() {

private void setupCheckBoxes() {
cbSign.setSelected(config.getBoolean(ApplicationConfiguration.FilmList.LOAD_SIGN_LANGUAGE,true));
cbSign.addActionListener(e -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_SIGN_LANGUAGE,cbSign.isSelected()));
cbSign.addActionListener(_ -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_SIGN_LANGUAGE,cbSign.isSelected()));

cbAudio.setSelected(config.getBoolean(ApplicationConfiguration.FilmList.LOAD_AUDIO_DESCRIPTION,true));
cbAudio.addActionListener(e -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_AUDIO_DESCRIPTION,cbAudio.isSelected()));
cbAudio.addActionListener(_ -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_AUDIO_DESCRIPTION,cbAudio.isSelected()));

cbTrailer.setSelected(config.getBoolean(ApplicationConfiguration.FilmList.LOAD_TRAILER,true));
cbTrailer.addActionListener(e -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_TRAILER,cbTrailer.isSelected()));
cbTrailer.addActionListener(_ -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_TRAILER,cbTrailer.isSelected()));

cbLivestreams.setSelected(config.getBoolean(ApplicationConfiguration.FilmList.LOAD_LIVESTREAMS, true));
cbLivestreams.addActionListener(e -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_LIVESTREAMS, cbLivestreams.isSelected()));
cbLivestreams.addActionListener(_ -> config.setProperty(ApplicationConfiguration.FilmList.LOAD_LIVESTREAMS, cbLivestreams.isSelected()));

jCheckBoxUpdate.setSelected(config.getBoolean(ApplicationConfiguration.FilmList.EXTEND_OLD_FILMLIST, false));
jCheckBoxUpdate.addActionListener(e -> config.setProperty(ApplicationConfiguration.FilmList.EXTEND_OLD_FILMLIST, jCheckBoxUpdate.isSelected()));
jCheckBoxUpdate.addActionListener(_ -> config.setProperty(ApplicationConfiguration.FilmList.EXTEND_OLD_FILMLIST, jCheckBoxUpdate.isSelected()));
}

/**
Expand Down Expand Up @@ -174,7 +174,7 @@ private void init() {
initRadio();

jButtonDateiAuswaehlen.setIcon(SVGIconUtilities.createSVGIcon("icons/fontawesome/folder-open.svg"));
jButtonDateiAuswaehlen.addActionListener(l -> {
jButtonDateiAuswaehlen.addActionListener(_ -> {
var loadFile = FileDialogs.chooseLoadFileLocation(MediathekGui.ui(),"Filmliste laden", "");
if (loadFile != null) {
jTextFieldUrl.setText(loadFile.getAbsolutePath());
Expand Down Expand Up @@ -259,7 +259,7 @@ private void initComponents() {
jRadioButtonManuell = new JRadioButton();
var separator1 = new JSeparator();
var panel3 = new JPanel();
panel4 = new JPanel();
var panel4 = new JPanel();
cbEvaluateDuplicates = new JCheckBox();
var panel2 = new JPanel();
var label1 = new JLabel();
Expand Down Expand Up @@ -599,7 +599,6 @@ private void initComponents() {
private JCheckBox jCheckBoxUpdate;
private JRadioButton jRadioButtonAuto;
private JRadioButton jRadioButtonManuell;
private JPanel panel4;
private JCheckBox cbEvaluateDuplicates;
private JButton btnReloadFilmlist;
private JCheckBox cbSign;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ new FormModel {
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class org.jdesktop.swingx.VerticalLayout ) ) {
name: "panel4"
"border": new javax.swing.border.TitledBorder( "Duplikate (Änderungen erfordern Neuladen der Filmliste)" )
auxiliary() {
"JavaCodeGenerator.variableLocal": true
}
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "cbEvaluateDuplicates"
"text": "Erkennung beim Laden der Filmliste einschalten"
Expand Down

0 comments on commit 169f9bc

Please sign in to comment.