Skip to content

Commit

Permalink
Set Downloadmanager
Browse files Browse the repository at this point in the history
Former-commit-id: 6a93c9a
  • Loading branch information
xaverW committed Jan 24, 2016
1 parent 756f537 commit 8ab5c93
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 107 deletions.
2 changes: 0 additions & 2 deletions dist/Info/11.269.build

This file was deleted.

2 changes: 2 additions & 0 deletions dist/Info/11.298.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Datum: 24.01.2016
MediathekView Buildnummer: 11.298
2 changes: 1 addition & 1 deletion dist/MediathekView.jar.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d938daa982340167d45d912186057c06fa0fe31b
737cdf8c339c47577d0ea3b3103c4a34d4528493
Binary file modified dist/lib/MSearch.jar
Binary file not shown.
Binary file modified libs/MSearch.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion post_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ then
# nur für den Entwicklungsrechner sinnvoll

# Programmsets ins www-verzeichnis kopieren
cp src/mediathek/file/*.xml /home/emil/daten/www/online/ZDFMediathekView/programmgruppen10/
cp src/mediathek/file/*.xml /home/emil/daten/www/online/ZDFMediathekView/programmgruppen11/
# Dateien ins share-Verzeichnis von VmWare kopieren
rm -r /mnt/lager/virtualbox/share/aktMed/*.zip
cp -r dist/* /mnt/lager/virtualbox/share/aktMed
Expand Down
66 changes: 0 additions & 66 deletions res/bin/aria2-remote.sh

This file was deleted.

67 changes: 35 additions & 32 deletions src/mediathek/gui/dialog/DialogEditDownload.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import msearch.daten.DatenFilm;

public class DialogEditDownload extends javax.swing.JDialog {

private final DatenDownload datenDownload;
public boolean ok = false;
private final JTextField[] textfeldListe = new JTextField[DatenDownload.MAX_ELEM];
Expand All @@ -65,34 +65,34 @@ public class DialogEditDownload extends javax.swing.JDialog {
private JFrame parent = null;
private String orgProgArray = "";
private String resolution = DatenFilm.AUFLOESUNG_NORMAL;

public DialogEditDownload(JFrame parent, boolean modal, DatenDownload ddownload, boolean ggestartet) {
super(parent, modal);
initComponents();
this.parent = parent;
datenDownload = ddownload;
gestartet = ggestartet;
jScrollPane1.getVerticalScrollBar().setUnitIncrement(16);

orgProgArray = datenDownload.arr[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_ARRAY_NR];
mVPanelDownloadZiel = new MVPanelDownloadZiel(parent, datenDownload, false);
mVPanelDownloadZiel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));
jRadioButtonResHd.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
changeRes();
}
});
jRadioButtonResHi.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
changeRes();
}
});
jRadioButtonResLo.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
changeRes();
Expand Down Expand Up @@ -122,7 +122,7 @@ public void beenden_() {
setupResolutionButtons();
setExtra();
}

private void setupResolutionButtons() {
jRadioButtonResHd.setEnabled(false);
jRadioButtonResHi.setEnabled(false);
Expand All @@ -139,7 +139,7 @@ private void setupResolutionButtons() {
if (!dateiGroesse_Hoch.isEmpty()) {
jRadioButtonResHi.setText(jRadioButtonResHi.getText() + " [ " + dateiGroesse_Hoch + " MB ]");
}

if (!datenDownload.film.arr[DatenFilm.FILM_URL_HD_NR].isEmpty()) {
jRadioButtonResHd.setEnabled(!gestartet);
jRadioButtonResHd.setSelected(datenDownload.arr[DatenDownload.DOWNLOAD_URL_NR].equals(datenDownload.film.getUrlFuerAufloesung(DatenFilm.AUFLOESUNG_HD)));
Expand All @@ -148,7 +148,7 @@ private void setupResolutionButtons() {
jRadioButtonResHd.setText(jRadioButtonResHd.getText() + " [ " + dateiGroesse_HD + " MB ]");
}
}

if (!datenDownload.film.arr[DatenFilm.FILM_URL_KLEIN_NR].isEmpty()) {
jRadioButtonResLo.setEnabled(!gestartet);
jRadioButtonResLo.setSelected(datenDownload.arr[DatenDownload.DOWNLOAD_URL_NR].equals(datenDownload.film.getUrlFuerAufloesung(DatenFilm.AUFLOESUNG_KLEIN)));
Expand All @@ -157,7 +157,7 @@ private void setupResolutionButtons() {
jRadioButtonResLo.setText(jRadioButtonResLo.getText() + " [ " + dateiGroesse_Klein + " MB ]");
}
}

}
if (jRadioButtonResHd.isSelected()) {
resolution = DatenFilm.AUFLOESUNG_HD;
Expand All @@ -167,7 +167,7 @@ private void setupResolutionButtons() {
resolution = DatenFilm.AUFLOESUNG_NORMAL;
}
}

private void changeRes() {
// RadioButton sind nur enabled wenn "datenDownload.film" vorhanden
final String res;
Expand All @@ -182,7 +182,7 @@ private void changeRes() {
datenDownload.arr[DatenDownload.DOWNLOAD_URL_RTMP_NR] = datenDownload.film.getUrlRtmpFuerAufloesung(res);
textfeldListe[DatenDownload.DOWNLOAD_URL_NR].setText(datenDownload.arr[DatenDownload.DOWNLOAD_URL_NR]);
textfeldListe[DatenDownload.DOWNLOAD_URL_RTMP_NR].setText(datenDownload.arr[DatenDownload.DOWNLOAD_URL_RTMP_NR]);

final String size;
if (jRadioButtonResHd.isSelected()) {
size = dateiGroesse_HD;
Expand All @@ -196,22 +196,22 @@ private void changeRes() {
DatenDownload d = new DatenDownload(datenDownload.pSet, datenDownload.film, datenDownload.quelle, datenDownload.abo,
datenDownload.arr[DatenDownload.DOWNLOAD_ZIEL_DATEINAME_NR],
datenDownload.arr[DatenDownload.DOWNLOAD_ZIEL_PFAD_NR], res);

datenDownload.arr[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_NR] = d.arr[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_NR];
datenDownload.arr[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_ARRAY_NR] = d.arr[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_ARRAY_NR];
textfeldListe[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_NR].setText(datenDownload.arr[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_NR]);
textfeldListe[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_ARRAY_NR].setText(datenDownload.arr[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_ARRAY_NR]);
}
datenDownload.setGroesse(size);
}

private void setExtra() {
jPanelExtra.removeAll();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(5, 10, 10, 5);

jPanelExtra.setLayout(gridbag);
int zeile = 0;
for (int i = 0; i < DatenDownload.MAX_ELEM; ++i) {
Expand All @@ -227,7 +227,7 @@ private void setExtra() {
}
jPanelExtra.validate();
}

private void addExtraFeld(int i, GridBagLayout gridbag, GridBagConstraints c) {
//Label
c.gridx = 0;
Expand Down Expand Up @@ -264,6 +264,9 @@ private void addExtraFeld(int i, GridBagLayout gridbag, GridBagConstraints c) {
c.weightx = 10;
gridbag.setConstraints(jCheckBoxRestart, c);
jPanelExtra.add(jCheckBoxRestart);
if (datenDownload.isDownloadManager()) {
jCheckBoxRestart.setEnabled(false);
}
} else if (i == DatenDownload.DOWNLOAD_PROGRAMM_DOWNLOADMANAGER_NR) {
jCheckBoxDownloadmanager.setSelected(datenDownload.isDownloadManager());
// jCheckBoxRestart.addActionListener(new BeobCheckbox());
Expand Down Expand Up @@ -352,7 +355,7 @@ private void addExtraFeld(int i, GridBagLayout gridbag, GridBagConstraints c) {
gc.fill = GridBagConstraints.HORIZONTAL;
gc.insets = new Insets(2, 2, 2, 2);
jp.setLayout(gb);

JButton jButtonReset = new JButton("");
jButtonReset.setToolTipText("Reset");
jButtonReset.setIcon(GetIcon.getProgramIcon("view-refresh_16.png"));
Expand All @@ -371,7 +374,7 @@ public void actionPerformed(ActionEvent e) {
new DialogHilfe(parent, true, new GetFile().getHilfeSuchen(GetFile.PFAD_HILFETEXT_EDIT_DOWNLOAD_PROG)).setVisible(true);
}
});

gc.gridy = 0;
gc.gridx = 0;
gc.weightx = 1;
Expand All @@ -381,7 +384,7 @@ public void actionPerformed(ActionEvent e) {
gc.weightx = 10;
gb.setConstraints(textfeldListe[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_NR], gc);
jp.add(textfeldListe[DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_NR]);

gc.gridy = 1;
gc.gridx = 0;
gc.weightx = 1;
Expand All @@ -391,7 +394,7 @@ public void actionPerformed(ActionEvent e) {
gc.weightx = 10;
gb.setConstraints(textfeldListe[i], gc);
jp.add(textfeldListe[i]);

c.gridx = 1;
c.weightx = 10;
gridbag.setConstraints(jp, c);
Expand Down Expand Up @@ -453,14 +456,14 @@ public void actionPerformed(ActionEvent e) {
}
}
}

private boolean downloadDateiLoeschen(DatenDownload datenDownload) {
try {
File file = new File(datenDownload.arr[DatenDownload.DOWNLOAD_ZIEL_PFAD_DATEINAME_NR]);
if (!file.exists()) {
return true; // gibt nichts zu löschen
}

int ret = JOptionPane.showConfirmDialog(parent,
"Die Auflösung wurde geändert, der Film kann nicht weitergeführt werden.\n"
+ "Datei muss zuerst gelöscht werden.", "Film Löschen?", JOptionPane.YES_NO_OPTION);
Expand All @@ -479,7 +482,7 @@ private boolean downloadDateiLoeschen(DatenDownload datenDownload) {
}
return true;
}

private boolean check() {
mVPanelDownloadZiel.setPfadName_geaendert();
if ((jRadioButtonResHd.isSelected() && !resolution.equals(DatenFilm.AUFLOESUNG_HD))
Expand All @@ -492,7 +495,7 @@ private boolean check() {
}
return ok;
}

private void beenden() {
this.dispose();
}
Expand Down Expand Up @@ -626,28 +629,28 @@ private void initComponents() {
// End of variables declaration//GEN-END:variables

private class BeobachterDocumentTextfeld implements DocumentListener {

int nr;

public BeobachterDocumentTextfeld(int n) {
nr = n;
}

@Override
public void insertUpdate(DocumentEvent arg0) {
eingabe();
}

@Override
public void removeUpdate(DocumentEvent arg0) {
eingabe();
}

@Override
public void changedUpdate(DocumentEvent arg0) {
eingabe();
}

private void eingabe() {
datenDownload.arr[nr] = textfeldListe[nr].getText().trim();
if (nr == DatenDownload.DOWNLOAD_PROGRAMM_AUFRUF_ARRAY_NR) {
Expand All @@ -656,9 +659,9 @@ private void eingabe() {
}
}
}

private class BeobCheckbox implements ActionListener {

@Override
public void actionPerformed(ActionEvent e) {
datenDownload.arr[DatenDownload.DOWNLOAD_PROGRAMM_RESTART_NR] = Boolean.toString(jCheckBoxRestart.isSelected());
Expand Down
6 changes: 5 additions & 1 deletion src/mediathek/tool/GuiFunktionenProgramme.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,17 @@ private static boolean addOnZip(String datei) {
}

} else {
String file = GuiFunktionen.getDateiName(datei);
File f = new File(GuiFunktionen.addsPfad(zielPfad, file));
try (BufferedInputStream in = new BufferedInputStream(conn.getInputStream())) {
FileOutputStream fOut = new FileOutputStream(GuiFunktionen.addsPfad(zielPfad, datei));
FileOutputStream fOut = new FileOutputStream(f);
final byte[] buffer = new byte[1024];
while ((n = in.read(buffer)) != -1) {
fOut.write(buffer, 0, n);
}
fOut.close();
f.setExecutable(true, false);
f.setReadable(true, false);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/mediathek/tool/Konstanten.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Konstanten {
public static final String ADRESSE_PROGRAMM_VERSION = "http://zdfmediathk.sourceforge.net/prog-info.xml"; // ab Version 4, einstellig!
public static final String ADRESSE_DOWNLAD = "http://sourceforge.net/projects/zdfmediathk/";
public static final String ADRESSE_ANLEITUNG = "http://sourceforge.net/p/zdfmediathk/wiki/Home/";
public static final String ADRESSE_VORLAGE_PROGRAMMGRUPPEN = "http://zdfmediathk.sourceforge.net/programmgruppen10/programmgruppen.xml";
public static final String ADRESSE_VORLAGE_PROGRAMMGRUPPEN = "http://zdfmediathk.sourceforge.net/programmgruppen11/programmgruppen.xml";
public static final String ADRESSE_WEBSITE = "http://zdfmediathk.sourceforge.net/";
public static final String ADRESSE_FORUM = "http://zdfmediathk.sourceforge.net/forum/";
public static final String ADRESSE_DONATION = "http://zdfmediathk.sourceforge.net/index.html#donate";
Expand Down
6 changes: 3 additions & 3 deletions src/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Sat, 23 Jan 2016 18:29:55 +0100
#Sun, 24 Jan 2016 18:22:25 +0100

BUILD=11.269
DATE=23.01.2016 / 18\:29\:55
BUILD=11.298
DATE=24.01.2016 / 18\:22\:25

0 comments on commit 8ab5c93

Please sign in to comment.