|
@@ -6,11 +6,18 @@
|
|
|
|
|
|
package de.nplusc.izc.iZpl.GUI;
|
|
|
|
|
|
+import de.nplusc.izc.iZpl.API.IZPLApi;
|
|
|
+import de.nplusc.izc.iZpl.API.PlaybackPlugin;
|
|
|
+import de.nplusc.izc.iZpl.API.UIPlugin;
|
|
|
import de.nplusc.izc.iZpl.Configuration;
|
|
|
import de.nplusc.izc.iZpl.Main;
|
|
|
+import de.nplusc.izc.tools.baseTools.Tools;
|
|
|
+import java.io.File;
|
|
|
import java.io.FileWriter;
|
|
|
import java.io.IOException;
|
|
|
import javax.swing.DefaultComboBoxModel;
|
|
|
+import javax.swing.DefaultListModel;
|
|
|
+import javax.swing.JFrame;
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -19,14 +26,60 @@ import javax.swing.DefaultComboBoxModel;
|
|
|
public class ConfigureScreen extends javax.swing.JFrame
|
|
|
{
|
|
|
|
|
|
+ private boolean firstRunMode;
|
|
|
/**
|
|
|
* Creates new form ConfigureScreen
|
|
|
*/
|
|
|
- public ConfigureScreen()
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates new form ConfigureScreen
|
|
|
+ * @param firstrun Disable the cancel button so the config is updated on first run
|
|
|
+ */
|
|
|
+ public ConfigureScreen( boolean firstrun)
|
|
|
{
|
|
|
+ firstRunMode=firstrun;
|
|
|
initComponents();
|
|
|
((DefaultComboBoxModel)cboxPlayersAvailable.getModel()).removeAllElements();
|
|
|
- ((DefaultComboBoxModel)cboxPlayersAvailable.getModel()).addElement("VLC Media Player");
|
|
|
+ ((DefaultComboBoxModel)cbxPluginUI.getModel()).removeAllElements();
|
|
|
+ ((DefaultListModel)lstSkins.getModel()).removeAllElements();
|
|
|
+ for (PlaybackPlugin playbackPlugin : IZPLApi.getDetectedPlaybackPlugins())
|
|
|
+ {
|
|
|
+ ((DefaultComboBoxModel)cboxPlayersAvailable.getModel()).addElement(playbackPlugin.getPluginName());
|
|
|
+ }
|
|
|
+ for (UIPlugin uIPlugin : IZPLApi.getDetectedUIPlugins())
|
|
|
+ {
|
|
|
+ ((DefaultComboBoxModel)cbxPluginUI.getModel()).addElement(uIPlugin.getPluginName());
|
|
|
+ }
|
|
|
+ for (String skinFileName : IZPLApi.getAvailableSkins())
|
|
|
+ {
|
|
|
+ ((DefaultListModel)lstSkins.getModel()).addElement(skinFileName);
|
|
|
+ }
|
|
|
+ if(Main.CONFIG.isStandaloneMode())
|
|
|
+ {
|
|
|
+ rbStandaloneMode.setSelected(true);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ rbEstensionMode.setSelected(true);
|
|
|
+ }
|
|
|
+ cboxPlayersAvailable.setSelectedItem(Main.CONFIG.getMediaPlayerForStandalone());
|
|
|
+ cbxPluginUI.setSelectedItem(Main.CONFIG.getUsedPluginUI());
|
|
|
+ lstSkins.setSelectedValue(Main.CONFIG.getSkinSelected(), true);
|
|
|
+ if(firstrun)
|
|
|
+ {
|
|
|
+ btnCancel.setVisible(false);
|
|
|
+ btnSave.setVisible(false);
|
|
|
+ }
|
|
|
+ if(Main.CONFIG.getMPExecutablePath().equals("")||!new File(Main.CONFIG.getMPExecutablePath()).exists())
|
|
|
+ {
|
|
|
+ rbEstensionMode.setEnabled(false);
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lblVLCPath.setText(Main.CONFIG.getMPExecutablePath());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -42,26 +95,25 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
|
|
|
modeGroup = new javax.swing.ButtonGroup();
|
|
|
bgUISelection = new javax.swing.ButtonGroup();
|
|
|
- jTabbedPane1 = new javax.swing.JTabbedPane();
|
|
|
+ tabpaneOptions = new javax.swing.JTabbedPane();
|
|
|
jPanel1 = new javax.swing.JPanel();
|
|
|
rbStandaloneMode = new javax.swing.JRadioButton();
|
|
|
rbEstensionMode = new javax.swing.JRadioButton();
|
|
|
- rbUiDefault = new javax.swing.JRadioButton();
|
|
|
- rbUiSkinnable = new javax.swing.JRadioButton();
|
|
|
btnPlayerSelect = new javax.swing.JButton();
|
|
|
cboxPlayersAvailable = new javax.swing.JComboBox();
|
|
|
- rbPluginUI = new javax.swing.JRadioButton();
|
|
|
cbxPluginUI = new javax.swing.JComboBox();
|
|
|
jButton4 = new javax.swing.JButton();
|
|
|
+ jLabel1 = new javax.swing.JLabel();
|
|
|
+ jLabel2 = new javax.swing.JLabel();
|
|
|
+ lblVLCPath = new javax.swing.JLabel();
|
|
|
jPanel2 = new javax.swing.JPanel();
|
|
|
jScrollPane1 = new javax.swing.JScrollPane();
|
|
|
lstSkins = new javax.swing.JList();
|
|
|
- jButton1 = new javax.swing.JButton();
|
|
|
jButton2 = new javax.swing.JButton();
|
|
|
jButton3 = new javax.swing.JButton();
|
|
|
- jPanel3 = new javax.swing.JPanel();
|
|
|
btnSave = new javax.swing.JButton();
|
|
|
btnCancel = new javax.swing.JButton();
|
|
|
+ btnSaveAndExit = new javax.swing.JButton();
|
|
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
|
|
|
|
@@ -71,86 +123,101 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
modeGroup.add(rbEstensionMode);
|
|
|
rbEstensionMode.setText("Use existing VLC installation");
|
|
|
|
|
|
- bgUISelection.add(rbUiDefault);
|
|
|
- rbUiDefault.setText("Default-GUI");
|
|
|
-
|
|
|
- bgUISelection.add(rbUiSkinnable);
|
|
|
- rbUiSkinnable.setText("Skinnable GUI");
|
|
|
-
|
|
|
btnPlayerSelect.setText("Select Path to VLC Executable");
|
|
|
+ btnPlayerSelect.addActionListener(new java.awt.event.ActionListener()
|
|
|
+ {
|
|
|
+ public void actionPerformed(java.awt.event.ActionEvent evt)
|
|
|
+ {
|
|
|
+ btnPlayerSelectActionPerformed(evt);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
cboxPlayersAvailable.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
|
|
|
|
|
- bgUISelection.add(rbPluginUI);
|
|
|
- rbPluginUI.setText("UI from Plugin");
|
|
|
-
|
|
|
cbxPluginUI.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
|
|
|
|
|
jButton4.setText("Register FileExtensions");
|
|
|
|
|
|
+ jLabel1.setText("Playback-Module");
|
|
|
+
|
|
|
+ jLabel2.setText("UI Module");
|
|
|
+
|
|
|
+ lblVLCPath.setText("NO INSTALLATION DEFINED");
|
|
|
+
|
|
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
|
|
jPanel1.setLayout(jPanel1Layout);
|
|
|
jPanel1Layout.setHorizontalGroup(
|
|
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
|
|
.addContainerGap()
|
|
|
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
|
|
+ .addComponent(rbEstensionMode, javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
+ .addComponent(rbStandaloneMode, javax.swing.GroupLayout.Alignment.LEADING))
|
|
|
+ .addGap(33, 33, 33)
|
|
|
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
|
+ .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
+ .addComponent(btnPlayerSelect, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE))
|
|
|
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
+ .addGroup(jPanel1Layout.createSequentialGroup()
|
|
|
+ .addGap(24, 24, 24)
|
|
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
|
|
- .addComponent(rbUiDefault, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
- .addComponent(rbUiSkinnable, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
+ .addGroup(jPanel1Layout.createSequentialGroup()
|
|
|
+ .addComponent(lblVLCPath, javax.swing.GroupLayout.PREFERRED_SIZE, 350, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
|
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
- .addComponent(rbEstensionMode)
|
|
|
- .addComponent(rbStandaloneMode)
|
|
|
- .addComponent(rbPluginUI))
|
|
|
- .addGap(33, 33, 33)
|
|
|
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
|
- .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
- .addComponent(btnPlayerSelect, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
|
|
|
- .addComponent(cboxPlayersAvailable, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
- .addComponent(cbxPluginUI, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
|
|
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
+ .addComponent(jLabel2))
|
|
|
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
+ .addComponent(cbxPluginUI, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
+ .addComponent(cboxPlayersAvailable, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
|
+ .addGap(261, 261, 261))))
|
|
|
);
|
|
|
jPanel1Layout.setVerticalGroup(
|
|
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
|
|
.addGap(22, 22, 22)
|
|
|
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
|
- .addComponent(rbStandaloneMode)
|
|
|
- .addComponent(cboxPlayersAvailable, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
|
+ .addComponent(rbStandaloneMode)
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
|
.addComponent(rbEstensionMode)
|
|
|
.addComponent(btnPlayerSelect))
|
|
|
- .addGap(27, 27, 27)
|
|
|
- .addComponent(rbUiDefault)
|
|
|
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
|
- .addComponent(rbUiSkinnable)
|
|
|
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
|
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
|
- .addComponent(rbPluginUI)
|
|
|
- .addComponent(cbxPluginUI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
|
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
|
|
|
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
+ .addComponent(lblVLCPath)
|
|
|
+ .addGap(18, 18, 18)
|
|
|
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
+ .addGroup(jPanel1Layout.createSequentialGroup()
|
|
|
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
|
+ .addComponent(jLabel1)
|
|
|
+ .addComponent(cboxPlayersAvailable, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
|
+ .addGap(0, 0, Short.MAX_VALUE))
|
|
|
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
|
|
+ .addGap(77, 77, 77)
|
|
|
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
|
+ .addComponent(jLabel2)
|
|
|
+ .addComponent(cbxPluginUI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
|
|
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
.addComponent(jButton4)
|
|
|
- .addContainerGap())
|
|
|
+ .addGap(27, 27, 27))
|
|
|
);
|
|
|
|
|
|
- jTabbedPane1.addTab("General Options", jPanel1);
|
|
|
+ tabpaneOptions.addTab("General Options", jPanel1);
|
|
|
|
|
|
- lstSkins.setModel(new javax.swing.AbstractListModel()
|
|
|
- {
|
|
|
- String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
|
|
|
- public int getSize() { return strings.length; }
|
|
|
- public Object getElementAt(int i) { return strings[i]; }
|
|
|
- });
|
|
|
+ lstSkins.setModel(new DefaultListModel());
|
|
|
lstSkins.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
|
|
jScrollPane1.setViewportView(lstSkins);
|
|
|
|
|
|
- jButton1.setText("Gewählten Skin verwenden");
|
|
|
-
|
|
|
jButton2.setText("Skin installieren");
|
|
|
|
|
|
jButton3.setText("Skin-liste neu einlesen");
|
|
|
+ jButton3.addActionListener(new java.awt.event.ActionListener()
|
|
|
+ {
|
|
|
+ public void actionPerformed(java.awt.event.ActionEvent evt)
|
|
|
+ {
|
|
|
+ jButton3ActionPerformed(evt);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
|
|
jPanel2.setLayout(jPanel2Layout);
|
|
@@ -161,9 +228,8 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
.addGap(18, 18, 18)
|
|
|
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
- .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
|
|
|
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
- .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
+ .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE))
|
|
|
.addContainerGap())
|
|
|
);
|
|
|
jPanel2Layout.setVerticalGroup(
|
|
@@ -172,29 +238,14 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
.addComponent(jScrollPane1)
|
|
|
.addContainerGap())
|
|
|
.addGroup(jPanel2Layout.createSequentialGroup()
|
|
|
- .addGap(20, 20, 20)
|
|
|
- .addComponent(jButton1)
|
|
|
- .addGap(53, 53, 53)
|
|
|
+ .addGap(96, 96, 96)
|
|
|
.addComponent(jButton2)
|
|
|
.addGap(18, 18, 18)
|
|
|
.addComponent(jButton3)
|
|
|
.addContainerGap(87, Short.MAX_VALUE))
|
|
|
);
|
|
|
|
|
|
- jTabbedPane1.addTab("Skins", jPanel2);
|
|
|
-
|
|
|
- javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
|
|
- jPanel3.setLayout(jPanel3Layout);
|
|
|
- jPanel3Layout.setHorizontalGroup(
|
|
|
- jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
- .addGap(0, 400, Short.MAX_VALUE)
|
|
|
- );
|
|
|
- jPanel3Layout.setVerticalGroup(
|
|
|
- jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
- .addGap(0, 247, Short.MAX_VALUE)
|
|
|
- );
|
|
|
-
|
|
|
- jTabbedPane1.addTab("Verfügbare PLugins", jPanel3);
|
|
|
+ tabpaneOptions.addTab("Skins", jPanel2);
|
|
|
|
|
|
btnSave.setText("Save");
|
|
|
btnSave.addActionListener(new java.awt.event.ActionListener()
|
|
@@ -206,6 +257,22 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
});
|
|
|
|
|
|
btnCancel.setText("Cancel");
|
|
|
+ btnCancel.addActionListener(new java.awt.event.ActionListener()
|
|
|
+ {
|
|
|
+ public void actionPerformed(java.awt.event.ActionEvent evt)
|
|
|
+ {
|
|
|
+ btnCancelActionPerformed(evt);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ btnSaveAndExit.setText("Save & Exit");
|
|
|
+ btnSaveAndExit.addActionListener(new java.awt.event.ActionListener()
|
|
|
+ {
|
|
|
+ public void actionPerformed(java.awt.event.ActionEvent evt)
|
|
|
+ {
|
|
|
+ btnSaveAndExitActionPerformed(evt);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
|
|
getContentPane().setLayout(layout);
|
|
@@ -215,9 +282,11 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
.addContainerGap()
|
|
|
- .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
|
+ .addComponent(tabpaneOptions, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
- .addGap(168, 168, 168)
|
|
|
+ .addGap(77, 77, 77)
|
|
|
+ .addComponent(btnSaveAndExit)
|
|
|
+ .addGap(18, 18, 18)
|
|
|
.addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
|
.addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
|
@@ -227,20 +296,22 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
.addContainerGap()
|
|
|
- .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
+ .addComponent(tabpaneOptions, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
|
.addComponent(btnSave)
|
|
|
- .addComponent(btnCancel))
|
|
|
+ .addComponent(btnCancel)
|
|
|
+ .addComponent(btnSaveAndExit))
|
|
|
.addContainerGap(12, Short.MAX_VALUE))
|
|
|
);
|
|
|
|
|
|
pack();
|
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
|
|
- private void btnSaveActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSaveActionPerformed
|
|
|
- {//GEN-HEADEREND:event_btnSaveActionPerformed
|
|
|
- if(rbEstensionMode.isSelected())
|
|
|
+ private void saveConfig()
|
|
|
+ {
|
|
|
+
|
|
|
+ if(rbStandaloneMode.isSelected())
|
|
|
{
|
|
|
Main.CONFIG.setStandaloneMode(true);
|
|
|
}
|
|
@@ -248,105 +319,85 @@ public class ConfigureScreen extends javax.swing.JFrame
|
|
|
{
|
|
|
Main.CONFIG.setStandaloneMode(false);
|
|
|
}
|
|
|
- if(rbUiDefault.isSelected())
|
|
|
- {
|
|
|
- Main.CONFIG.setSelectedMode(Configuration.UIMode.INCLUDED);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(rbUiSkinnable.isSelected())
|
|
|
- {
|
|
|
- Main.CONFIG.setSelectedMode(Configuration.UIMode.SKINNABLE);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Main.CONFIG.setSelectedMode(Configuration.UIMode.PLUGIN);
|
|
|
- }
|
|
|
- }
|
|
|
Main.CONFIG.setUsedPluginUI(cbxPluginUI.getModel().getSelectedItem()+"");
|
|
|
Main.CONFIG.setSkinSelected(lstSkins.getSelectedValue()+"");
|
|
|
Main.CONFIG.setMediaPlayerForStandalone(cboxPlayersAvailable.getModel().getSelectedItem()+"");
|
|
|
- try{
|
|
|
- Main.y.dump(Main.CONFIG, new FileWriter(Main.CONFIGPATH));
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Main.y.dump(Main.CONFIG, new FileWriter(Main.CONFIGPATH));
|
|
|
}
|
|
|
catch(IOException e)
|
|
|
{
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private void btnSaveActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSaveActionPerformed
|
|
|
+ {//GEN-HEADEREND:event_btnSaveActionPerformed
|
|
|
+ saveConfig();
|
|
|
}//GEN-LAST:event_btnSaveActionPerformed
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * @param args the command line arguments
|
|
|
- */
|
|
|
- public static void main(String args[])
|
|
|
- {
|
|
|
- /* Set the Nimbus look and feel */
|
|
|
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
|
|
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
|
|
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
|
|
- */
|
|
|
- try
|
|
|
- {
|
|
|
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
|
|
|
+ private void btnSaveAndExitActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSaveAndExitActionPerformed
|
|
|
+ {//GEN-HEADEREND:event_btnSaveAndExitActionPerformed
|
|
|
+ saveConfig();
|
|
|
+ IZPLApi.quickQuitWithoutSaving();
|
|
|
+ }//GEN-LAST:event_btnSaveAndExitActionPerformed
|
|
|
+
|
|
|
+ private void btnCancelActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnCancelActionPerformed
|
|
|
+ {//GEN-HEADEREND:event_btnCancelActionPerformed
|
|
|
+ IZPLApi.quickQuitWithoutSaving();
|
|
|
+ }//GEN-LAST:event_btnCancelActionPerformed
|
|
|
+
|
|
|
+ private void btnPlayerSelectActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnPlayerSelectActionPerformed
|
|
|
+ {//GEN-HEADEREND:event_btnPlayerSelectActionPerformed
|
|
|
+ String fp = Tools.FileChooseDlg(this, true, false, new String[]
|
|
|
{
|
|
|
- if ("Nimbus".equals(info.getName()))
|
|
|
- {
|
|
|
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- catch (ClassNotFoundException ex)
|
|
|
- {
|
|
|
- java.util.logging.Logger.getLogger(ConfigureScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
|
- }
|
|
|
- catch (InstantiationException ex)
|
|
|
- {
|
|
|
- java.util.logging.Logger.getLogger(ConfigureScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
|
- }
|
|
|
- catch (IllegalAccessException ex)
|
|
|
- {
|
|
|
- java.util.logging.Logger.getLogger(ConfigureScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
|
- }
|
|
|
- catch (javax.swing.UnsupportedLookAndFeelException ex)
|
|
|
+ "exe"
|
|
|
+ });
|
|
|
+ if(!fp.equals("")&&new File(fp).exists())
|
|
|
+ {
|
|
|
+ Main.CONFIG.setMPExecutablePath(fp);
|
|
|
+ rbEstensionMode.setEnabled(true);
|
|
|
+ lblVLCPath.setText(Main.CONFIG.getMPExecutablePath());
|
|
|
+ }
|
|
|
+ }//GEN-LAST:event_btnPlayerSelectActionPerformed
|
|
|
+
|
|
|
+ private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton3ActionPerformed
|
|
|
+ {//GEN-HEADEREND:event_jButton3ActionPerformed
|
|
|
+ Main.detectSkins();
|
|
|
+ ((DefaultListModel)lstSkins.getModel()).removeAllElements();
|
|
|
+ for (String skinFileName : IZPLApi.getAvailableSkins())
|
|
|
{
|
|
|
- java.util.logging.Logger.getLogger(ConfigureScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
|
+ ((DefaultListModel)lstSkins.getModel()).addElement(skinFileName);
|
|
|
}
|
|
|
- //</editor-fold>
|
|
|
+ }//GEN-LAST:event_jButton3ActionPerformed
|
|
|
+
|
|
|
|
|
|
- /* Create and display the form */
|
|
|
- java.awt.EventQueue.invokeLater(new Runnable()
|
|
|
- {
|
|
|
- public void run()
|
|
|
- {
|
|
|
- new ConfigureScreen().setVisible(true);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
|
private javax.swing.ButtonGroup bgUISelection;
|
|
|
private javax.swing.JButton btnCancel;
|
|
|
private javax.swing.JButton btnPlayerSelect;
|
|
|
private javax.swing.JButton btnSave;
|
|
|
+ private javax.swing.JButton btnSaveAndExit;
|
|
|
private javax.swing.JComboBox cboxPlayersAvailable;
|
|
|
private javax.swing.JComboBox cbxPluginUI;
|
|
|
- private javax.swing.JButton jButton1;
|
|
|
private javax.swing.JButton jButton2;
|
|
|
private javax.swing.JButton jButton3;
|
|
|
private javax.swing.JButton jButton4;
|
|
|
+ private javax.swing.JLabel jLabel1;
|
|
|
+ private javax.swing.JLabel jLabel2;
|
|
|
private javax.swing.JPanel jPanel1;
|
|
|
private javax.swing.JPanel jPanel2;
|
|
|
- private javax.swing.JPanel jPanel3;
|
|
|
private javax.swing.JScrollPane jScrollPane1;
|
|
|
- private javax.swing.JTabbedPane jTabbedPane1;
|
|
|
+ private javax.swing.JLabel lblVLCPath;
|
|
|
private javax.swing.JList lstSkins;
|
|
|
private javax.swing.ButtonGroup modeGroup;
|
|
|
private javax.swing.JRadioButton rbEstensionMode;
|
|
|
- private javax.swing.JRadioButton rbPluginUI;
|
|
|
private javax.swing.JRadioButton rbStandaloneMode;
|
|
|
- private javax.swing.JRadioButton rbUiDefault;
|
|
|
- private javax.swing.JRadioButton rbUiSkinnable;
|
|
|
+ private javax.swing.JTabbedPane tabpaneOptions;
|
|
|
// End of variables declaration//GEN-END:variables
|
|
|
}
|