Skip to content

Commit

Permalink
Merge branch 'after-develop-production-freeze' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Aug 21, 2024
2 parents f96a193 + e38a3e3 commit 41956b4
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# **14.2.0**
- **BUGFIX:** MV aktualisiert nun vor dem Download mittels `-dq` oder `--download-quit` Parameter die Filmliste.
- **BUGFIX:** FlatLaf Regression gelöst, die manchmal zu einer inkorrekten Darstellung der Oberfläche führte.
- **FEATURE(Linux/Windows):** Das Aussehen von FlatLaf kann in `.mediathek3/flatlaf` angepasst werden.
- **FEATURE:** Selektierte Einträge in `Suchhistorie bearbeiten`-Dialog können nun mittels Entfernen-Taste gelöscht werden.

# **14.1.0**
- JDK 21 wird nun mitgeliefert. Behebt primär Darstellungsfehler von Java Apps unter Windows.
- **macOS/Windows:** ffmpeg 7.0 ist nun enthalten.
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>de.mediathekview</groupId>
<artifactId>MediathekView</artifactId>
<version>14.1.0</version>
<version>14.2.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down Expand Up @@ -98,8 +98,8 @@
<commons-io.version>2.11.0</commons-io.version>
<commons-lang3.version>3.15.0</commons-lang3.version>
<controlsfx.version>11.2.1</controlsfx.version>
<flatlaf.version>3.5</flatlaf.version>
<guava.version>33.2.1-jre</guava.version>
<flatlaf.version>3.5.1</flatlaf.version>
<guava.version>33.3.0-jre</guava.version>
<install4j-maven-plugin.version>1.1.2</install4j-maven-plugin.version>
<jackson.version>2.17.2</jackson.version>
<jaffree.version>2023.09.10</jaffree.version>
Expand All @@ -123,7 +123,7 @@
<mockito.version>5.12.0</mockito.version>
<okhttp.version>5.0.0-alpha.14</okhttp.version>
<picocli.version>4.7.6</picocli.version>
<sqlite-jdbc.version>3.46.0.0</sqlite-jdbc.version>
<sqlite-jdbc.version>3.46.0.1</sqlite-jdbc.version>
<xz.version>1.9</xz.version>

<mainclass>mediathek.Main</mainclass>
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/mediathek/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,14 @@ private static void configureDnsPreferenceMode(CommandLine.ParseResult parseResu
logger.trace("Setting DNS selector to mode: {}", Config.getDnsIpPreferenceMode().toString());
}

private static void registerFlatLafCustomization() {
if (!SystemUtils.IS_OS_MAC_OSX) {
var settings = StandardLocations.getSettingsDirectory().resolve("flatlaf");
logger.info("Registering {} as custom FlatLaf config folder", settings);
FlatLaf.registerCustomDefaultsSource(settings.toFile());
}
}

/**
* @param args the command line arguments
*/
Expand Down Expand Up @@ -417,6 +425,8 @@ public static void main(final String... args) {
}

setupDockIcon();

registerFlatLafCustomization();
setupFlatLaf();

if (SystemUtils.IS_OS_LINUX) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mediathek/config/Konstanten.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

public class Konstanten {
public static final long MINIMUM_MEMORY_THRESHOLD = 768 * FileUtils.ONE_MB;
public static final Version MVVERSION = new Version(14,1,0);
public static final Version MVVERSION = new Version(14,2,0);

public static final ApplicationType APPLICATION_TYPE = ApplicationType.PRODUCTION;
public static final ApplicationType APPLICATION_TYPE = ApplicationType.NIGHTLY;
public static final String MACOS_OFFICIAL_APP = "OSX_OFFICIAL_APP";

public static final String FORMAT_ZIP = ".zip";
Expand Down
66 changes: 49 additions & 17 deletions src/main/java/mediathek/gui/tabs/tab_film/EditHistoryDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
Expand All @@ -30,6 +32,18 @@ public class EditHistoryDialog extends JDialog {
private final EventList<String> eventList;
private final Function<Integer,Integer> inc_op = f -> f + 1;
private final Function<Integer,Integer> dec_op = f -> f - 1;
private final DeleteKeyAdapter keyAdapter = new DeleteKeyAdapter();
private boolean keyAdapterInstalled;

private class DeleteKeyAdapter extends KeyAdapter {
@Override
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DELETE) {
e.consume();
deleteEntries();
}
}
}

public EditHistoryDialog(Window owner, JMenuItem menuItem, EventList<String> eventList) {
super(owner);
Expand All @@ -55,23 +69,7 @@ public void windowClosed(WindowEvent e) {
});
adjustButtons();

btnDeleteEntries.addActionListener(l -> {
var changeList = new ArrayList<String>();
var listModel = list.getModel();
for (var idx : list.getSelectedIndices()) {
changeList.add(listModel.getElementAt(idx));
}

var lock = eventList.getReadWriteLock().writeLock();
lock.lock();
try {
changeList.forEach(eventList::remove);
}
finally {
lock.unlock();
}
changeList.clear();
});
btnDeleteEntries.addActionListener(l -> deleteEntries());

btnUp.addActionListener(l -> {
var idx = list.getSelectedIndex();
Expand All @@ -88,6 +86,24 @@ public void windowClosed(WindowEvent e) {
restorePosition();
}

private void deleteEntries() {
var changeList = new ArrayList<String>();
var listModel = list.getModel();
for (var idx : list.getSelectedIndices()) {
changeList.add(listModel.getElementAt(idx));
}

var lock = eventList.getReadWriteLock().writeLock();
lock.lock();
try {
changeList.forEach(eventList::remove);
}
finally {
lock.unlock();
}
changeList.clear();
}

private int moveEntry(int idx, Function<Integer,Integer> operator) {
var lock = eventList.getReadWriteLock().writeLock();
lock.lock();
Expand Down Expand Up @@ -151,6 +167,22 @@ private void adjustButtons() {
if (idx == list.getModel().getSize() - 1) //last
btnDown.setEnabled(false);
}
setupKeyListener(itemCount);
}

private void setupKeyListener(int itemCount) {
if (itemCount > 0) {
if (!keyAdapterInstalled) {
list.addKeyListener(keyAdapter);
keyAdapterInstalled = true;
}
}
else {
if (keyAdapterInstalled) {
list.removeKeyListener(keyAdapter);
keyAdapterInstalled = false;
}
}
}

private void initComponents() {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/mediathek/mainwindow/MediathekGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ public MediathekGui() {
var future = Daten.getInstance().getDecoratedPool().submit(() -> {
try {
TimeUnit.SECONDS.sleep(10);
logger.info("Auto DL and Quit: Updating filmlist...");
final var daten = Daten.getInstance();
daten.getListeFilme().clear(); // sonst wird evtl. nur eine Diff geladen
daten.getFilmeLaden().loadFilmlist("", false);
logger.info("Auto DL and Quit: Filmlist update done.");
logger.info("Auto DL and Quit: Starting all downloads...");
SwingUtilities.invokeAndWait(() -> tabDownloads.starten(true));
return true;
Expand Down

0 comments on commit 41956b4

Please sign in to comment.