Skip to content

Commit

Permalink
- implement setting for duplicate evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Oct 24, 2024
1 parent 1f4cd52 commit c1a02b9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.miginfocom.layout.CC;
import net.miginfocom.layout.LC;
import net.miginfocom.swing.MigLayout;
import org.apache.commons.configuration2.Configuration;
import org.jdesktop.swingx.VerticalLayout;

import javax.swing.*;
Expand All @@ -28,6 +29,7 @@

public class PanelFilmlisteLaden extends JPanel {
private final List<JCheckBox> senderCbList = new ArrayList<>();
private final Configuration config = ApplicationConfiguration.getConfiguration();

private void initReloadButton() {
btnReloadFilmlist.setIcon(SVGIconUtilities.createSVGIcon("icons/fontawesome/arrows-rotate.svg"));
Expand Down Expand Up @@ -74,6 +76,13 @@ public PanelFilmlisteLaden(boolean inSettingsDialog) {
jButtonDateiAuswaehlen.setEnabled(selected);
jCheckBoxUpdate.setEnabled(selected);
});

// Duplicate evaluation
var enableDuplicateEvaluation = config.getBoolean(
ApplicationConfiguration.FILM_EVALUATE_DUPLICATES, true);
cbEvaluateDuplicates.setSelected(enableDuplicateEvaluation);
cbEvaluateDuplicates.addActionListener(l -> config.setProperty(ApplicationConfiguration.FILM_EVALUATE_DUPLICATES,
cbEvaluateDuplicates.isSelected()));
}

/**
Expand All @@ -86,7 +95,6 @@ private void prepareSettingsLayout() {
}

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

Expand Down Expand Up @@ -251,6 +259,8 @@ private void initComponents() {
jRadioButtonManuell = new JRadioButton();
var separator1 = new JSeparator();
var panel3 = new JPanel();
panel4 = new JPanel();
cbEvaluateDuplicates = new JCheckBox();
var panel2 = new JPanel();
var label1 = new JLabel();
var jSpinnerDays = new DaysSpinner();
Expand Down Expand Up @@ -302,6 +312,7 @@ private void initComponents() {
.gap()
.gap()
.gap()
.gap()
));

//======== jPanelAuto ========
Expand Down Expand Up @@ -370,6 +381,17 @@ private void initComponents() {
panel3.setBorder(new TitledBorder("Einschr\u00e4nkungen f\u00fcr das Laden der Filmliste")); //NON-NLS
panel3.setLayout(new VerticalLayout());

//======== panel4 ========
{
panel4.setBorder(new TitledBorder("Duplikate (\u00c4nderungen erfordern Neuladen der Filmliste)")); //NON-NLS
panel4.setLayout(new VerticalLayout());

//---- cbEvaluateDuplicates ----
cbEvaluateDuplicates.setText("Erkennung beim Laden der Filmliste einschalten"); //NON-NLS
panel4.add(cbEvaluateDuplicates);
}
panel3.add(panel4);

//======== panel2 ========
{
panel2.setLayout(new MigLayout(
Expand Down Expand Up @@ -577,6 +599,8 @@ private void initComponents() {
private JCheckBox jCheckBoxUpdate;
private JRadioButton jRadioButtonAuto;
private JRadioButton jRadioButtonManuell;
private JPanel panel4;
private JCheckBox cbEvaluateDuplicates;
private JButton btnReloadFilmlist;
private JCheckBox cbSign;
private JCheckBox cbTrailer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
JFDML JFormDesigner: "7.0.7.0.1134" Java: "11.0.15" encoding: "UTF-8"
JFDML JFormDesigner: "8.2.4.0.393" Java: "21.0.4" encoding: "UTF-8"

new FormModel {
contentType: "form/swing"
root: new FormRoot {
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "fillx,insets 5,hidemode 3,gap 5 5"
"$columnConstraints": "[label][640,grow,fill]"
"$rowConstraints": "[][][][]"
"$rowConstraints": "[][][][][]"
} ) {
name: "this"
"preferredSize": new java.awt.Dimension( 740, 506 )
Expand Down Expand Up @@ -115,6 +115,14 @@ new FormModel {
auxiliary() {
"JavaCodeGenerator.variableLocal": true
}
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)" )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "cbEvaluateDuplicates"
"text": "Erkennung beim Laden der Filmliste einschalten"
} )
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 5,hidemode 3"
"$columnConstraints": "[fill][fill][fill][left]"
Expand Down

0 comments on commit c1a02b9

Please sign in to comment.