Browse Source

wired up the config. Refactored main to allow some config checking and a
few settings via commandline.

LH 10 years ago
parent
commit
7a722f1a73

+ 15 - 0
iZpl/src/main/java/de/nplusc/izc/iZpl/API/IZPLApi.java

@@ -8,6 +8,7 @@ package de.nplusc.izc.iZpl.API;
 
 import de.nplusc.izc.iZpl.Main;
 import java.io.File;
+import java.util.List;
 
 /**
  *
@@ -82,4 +83,18 @@ public class IZPLApi
     private IZPLApi()
     {
     }
+    
+    public static List<UIPlugin> getDetectedUIPlugins()
+    {
+        return Main.getRegisteredUIs();
+    }
+    
+    public static List<PlaybackPlugin> getDetectedPlaybackPlugins()
+    {
+        return Main.getRegisteredPlayBackAdapters();
+    }
+    public static List<String> getAvailableSkins()
+    {
+        return Main.getDetectedSkins();
+    }
 }

+ 88 - 96
iZpl/src/main/java/de/nplusc/izc/iZpl/GUI/ConfigureScreen.form

@@ -33,10 +33,12 @@
               <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="102" alignment="0" attributes="0">
                       <EmptySpace max="-2" attributes="0"/>
-                      <Component id="jTabbedPane1" min="-2" pref="405" max="-2" attributes="0"/>
+                      <Component id="tabpaneOptions" min="-2" pref="405" max="-2" attributes="0"/>
                   </Group>
                   <Group type="102" alignment="0" attributes="0">
-                      <EmptySpace min="-2" pref="168" max="-2" attributes="0"/>
+                      <EmptySpace min="-2" pref="77" max="-2" attributes="0"/>
+                      <Component id="btnSaveAndExit" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
                       <Component id="btnSave" min="-2" pref="88" max="-2" attributes="0"/>
                       <EmptySpace type="unrelated" max="-2" attributes="0"/>
                       <Component id="btnCancel" min="-2" pref="127" max="-2" attributes="0"/>
@@ -50,11 +52,12 @@
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="0" attributes="0">
               <EmptySpace max="-2" attributes="0"/>
-              <Component id="jTabbedPane1" min="-2" pref="275" max="-2" attributes="0"/>
+              <Component id="tabpaneOptions" min="-2" pref="275" max="-2" attributes="0"/>
               <EmptySpace type="unrelated" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="btnSave" alignment="3" min="-2" max="-2" attributes="0"/>
                   <Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="btnSaveAndExit" alignment="3" min="-2" max="-2" attributes="0"/>
               </Group>
               <EmptySpace pref="12" max="32767" attributes="0"/>
           </Group>
@@ -62,7 +65,7 @@
     </DimensionLayout>
   </Layout>
   <SubComponents>
-    <Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
+    <Container class="javax.swing.JTabbedPane" name="tabpaneOptions">
 
       <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
       <SubComponents>
@@ -80,27 +83,37 @@
               <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="102" attributes="0">
                       <EmptySpace max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="1" attributes="0">
+                          <Component id="rbEstensionMode" alignment="0" min="-2" max="-2" attributes="0"/>
+                          <Component id="rbStandaloneMode" alignment="0" min="-2" max="-2" attributes="0"/>
+                      </Group>
+                      <EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                          <Component id="jButton4" max="32767" attributes="0"/>
+                          <Component id="btnPlayerSelect" pref="192" max="32767" attributes="0"/>
+                      </Group>
+                      <EmptySpace max="32767" attributes="0"/>
+                  </Group>
+                  <Group type="102" alignment="0" attributes="0">
+                      <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
                       <Group type="103" groupAlignment="0" attributes="0">
-                          <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
-                              <Component id="rbUiDefault" alignment="0" max="32767" attributes="0"/>
-                              <Component id="rbUiSkinnable" alignment="0" max="32767" attributes="0"/>
+                          <Group type="102" attributes="0">
+                              <Component id="lblVLCPath" min="-2" pref="350" max="-2" attributes="0"/>
+                              <EmptySpace max="32767" attributes="0"/>
                           </Group>
-                          <Group type="102" alignment="0" attributes="0">
+                          <Group type="102" attributes="0">
                               <Group type="103" groupAlignment="0" attributes="0">
-                                  <Component id="rbEstensionMode" alignment="0" min="-2" max="-2" attributes="0"/>
-                                  <Component id="rbStandaloneMode" alignment="0" min="-2" max="-2" attributes="0"/>
-                                  <Component id="rbPluginUI" alignment="0" min="-2" max="-2" attributes="0"/>
+                                  <Component id="jLabel1" min="-2" pref="88" max="-2" attributes="0"/>
+                                  <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
                               </Group>
-                              <EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
-                              <Group type="103" groupAlignment="0" max="-2" attributes="0">
-                                  <Component id="jButton4" max="32767" attributes="0"/>
-                                  <Component id="btnPlayerSelect" pref="192" max="32767" attributes="0"/>
-                                  <Component id="cboxPlayersAvailable" max="32767" attributes="0"/>
-                                  <Component id="cbxPluginUI" max="32767" attributes="0"/>
+                              <EmptySpace max="32767" attributes="0"/>
+                              <Group type="103" groupAlignment="0" attributes="0">
+                                  <Component id="cbxPluginUI" min="-2" pref="237" max="-2" attributes="0"/>
+                                  <Component id="cboxPlayersAvailable" min="-2" pref="237" max="-2" attributes="0"/>
                               </Group>
+                              <EmptySpace min="-2" pref="261" max="-2" attributes="0"/>
                           </Group>
                       </Group>
-                      <EmptySpace max="32767" attributes="0"/>
                   </Group>
               </Group>
             </DimensionLayout>
@@ -108,27 +121,34 @@
               <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="102" alignment="0" attributes="0">
                       <EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="3" attributes="0">
-                          <Component id="rbStandaloneMode" alignment="3" min="-2" max="-2" attributes="0"/>
-                          <Component id="cboxPlayersAvailable" alignment="3" min="-2" max="-2" attributes="0"/>
-                      </Group>
+                      <Component id="rbStandaloneMode" min="-2" max="-2" attributes="0"/>
                       <EmptySpace type="unrelated" max="-2" attributes="0"/>
                       <Group type="103" groupAlignment="3" attributes="0">
                           <Component id="rbEstensionMode" alignment="3" min="-2" max="-2" attributes="0"/>
                           <Component id="btnPlayerSelect" alignment="3" min="-2" max="-2" attributes="0"/>
                       </Group>
-                      <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
-                      <Component id="rbUiDefault" min="-2" max="-2" attributes="0"/>
-                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
-                      <Component id="rbUiSkinnable" min="-2" max="-2" attributes="0"/>
-                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="3" attributes="0">
-                          <Component id="rbPluginUI" alignment="3" min="-2" max="-2" attributes="0"/>
-                          <Component id="cbxPluginUI" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace max="32767" attributes="0"/>
+                      <Component id="lblVLCPath" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <Group type="102" alignment="0" attributes="0">
+                              <Group type="103" groupAlignment="3" attributes="0">
+                                  <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
+                                  <Component id="cboxPlayersAvailable" alignment="3" min="-2" max="-2" attributes="0"/>
+                              </Group>
+                              <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                          </Group>
+                          <Group type="102" alignment="1" attributes="0">
+                              <EmptySpace min="-2" pref="77" max="-2" attributes="0"/>
+                              <Group type="103" groupAlignment="3" attributes="0">
+                                  <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
+                                  <Component id="cbxPluginUI" alignment="3" min="-2" max="-2" attributes="0"/>
+                              </Group>
+                          </Group>
                       </Group>
-                      <EmptySpace pref="29" max="32767" attributes="0"/>
-                      <Component id="jButton4" min="-2" max="-2" attributes="0"/>
                       <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jButton4" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
                   </Group>
               </Group>
             </DimensionLayout>
@@ -150,26 +170,13 @@
                 <Property name="text" type="java.lang.String" value="Use existing VLC installation"/>
               </Properties>
             </Component>
-            <Component class="javax.swing.JRadioButton" name="rbUiDefault">
-              <Properties>
-                <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
-                  <ComponentRef name="bgUISelection"/>
-                </Property>
-                <Property name="text" type="java.lang.String" value="Default-GUI"/>
-              </Properties>
-            </Component>
-            <Component class="javax.swing.JRadioButton" name="rbUiSkinnable">
-              <Properties>
-                <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
-                  <ComponentRef name="bgUISelection"/>
-                </Property>
-                <Property name="text" type="java.lang.String" value="Skinnable GUI"/>
-              </Properties>
-            </Component>
             <Component class="javax.swing.JButton" name="btnPlayerSelect">
               <Properties>
                 <Property name="text" type="java.lang.String" value="Select Path to VLC Executable"/>
               </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPlayerSelectActionPerformed"/>
+              </Events>
             </Component>
             <Component class="javax.swing.JComboBox" name="cboxPlayersAvailable">
               <Properties>
@@ -183,14 +190,6 @@
                 </Property>
               </Properties>
             </Component>
-            <Component class="javax.swing.JRadioButton" name="rbPluginUI">
-              <Properties>
-                <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
-                  <ComponentRef name="bgUISelection"/>
-                </Property>
-                <Property name="text" type="java.lang.String" value="UI from Plugin"/>
-              </Properties>
-            </Component>
             <Component class="javax.swing.JComboBox" name="cbxPluginUI">
               <Properties>
                 <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
@@ -208,6 +207,21 @@
                 <Property name="text" type="java.lang.String" value="Register FileExtensions"/>
               </Properties>
             </Component>
+            <Component class="javax.swing.JLabel" name="jLabel1">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Playback-Module"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JLabel" name="jLabel2">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="UI Module"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JLabel" name="lblVLCPath">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="NO INSTALLATION DEFINED"/>
+              </Properties>
+            </Component>
           </SubComponents>
         </Container>
         <Container class="javax.swing.JPanel" name="jPanel2">
@@ -227,9 +241,8 @@
                       <Component id="jScrollPane1" min="-2" pref="189" max="-2" attributes="0"/>
                       <EmptySpace type="separate" max="-2" attributes="0"/>
                       <Group type="103" groupAlignment="0" attributes="0">
-                          <Component id="jButton1" pref="173" max="32767" attributes="0"/>
                           <Component id="jButton2" max="32767" attributes="0"/>
-                          <Component id="jButton3" alignment="0" max="32767" attributes="0"/>
+                          <Component id="jButton3" alignment="0" pref="173" max="32767" attributes="0"/>
                       </Group>
                       <EmptySpace max="-2" attributes="0"/>
                   </Group>
@@ -242,9 +255,7 @@
                       <EmptySpace max="-2" attributes="0"/>
                   </Group>
                   <Group type="102" alignment="0" attributes="0">
-                      <EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
-                      <Component id="jButton1" min="-2" max="-2" attributes="0"/>
-                      <EmptySpace min="-2" pref="53" max="-2" attributes="0"/>
+                      <EmptySpace min="-2" pref="96" max="-2" attributes="0"/>
                       <Component id="jButton2" min="-2" max="-2" attributes="0"/>
                       <EmptySpace type="separate" max="-2" attributes="0"/>
                       <Component id="jButton3" min="-2" max="-2" attributes="0"/>
@@ -263,25 +274,14 @@
               <SubComponents>
                 <Component class="javax.swing.JList" name="lstSkins">
                   <Properties>
-                    <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
-                      <StringArray count="5">
-                        <StringItem index="0" value="Item 1"/>
-                        <StringItem index="1" value="Item 2"/>
-                        <StringItem index="2" value="Item 3"/>
-                        <StringItem index="3" value="Item 4"/>
-                        <StringItem index="4" value="Item 5"/>
-                      </StringArray>
+                    <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+                      <Connection code="new DefaultListModel()" type="code"/>
                     </Property>
                     <Property name="selectionMode" type="int" value="0"/>
                   </Properties>
                 </Component>
               </SubComponents>
             </Container>
-            <Component class="javax.swing.JButton" name="jButton1">
-              <Properties>
-                <Property name="text" type="java.lang.String" value="Gew&#xe4;hlten Skin verwenden"/>
-              </Properties>
-            </Component>
             <Component class="javax.swing.JButton" name="jButton2">
               <Properties>
                 <Property name="text" type="java.lang.String" value="Skin installieren"/>
@@ -291,31 +291,12 @@
               <Properties>
                 <Property name="text" type="java.lang.String" value="Skin-liste neu einlesen"/>
               </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
+              </Events>
             </Component>
           </SubComponents>
         </Container>
-        <Container class="javax.swing.JPanel" name="jPanel3">
-          <Constraints>
-            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
-              <JTabbedPaneConstraints tabName="Verf&#xfc;gbare PLugins">
-                <Property name="tabTitle" type="java.lang.String" value="Verf&#xfc;gbare PLugins"/>
-              </JTabbedPaneConstraints>
-            </Constraint>
-          </Constraints>
-
-          <Layout>
-            <DimensionLayout dim="0">
-              <Group type="103" groupAlignment="0" attributes="0">
-                  <EmptySpace min="0" pref="400" max="32767" attributes="0"/>
-              </Group>
-            </DimensionLayout>
-            <DimensionLayout dim="1">
-              <Group type="103" groupAlignment="0" attributes="0">
-                  <EmptySpace min="0" pref="247" max="32767" attributes="0"/>
-              </Group>
-            </DimensionLayout>
-          </Layout>
-        </Container>
       </SubComponents>
     </Container>
     <Component class="javax.swing.JButton" name="btnSave">
@@ -330,6 +311,17 @@
       <Properties>
         <Property name="text" type="java.lang.String" value="Cancel"/>
       </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="btnSaveAndExit">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Save &amp; Exit"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSaveAndExitActionPerformed"/>
+      </Events>
     </Component>
   </SubComponents>
 </Form>

+ 197 - 146
iZpl/src/main/java/de/nplusc/izc/iZpl/GUI/ConfigureScreen.java

@@ -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
 }

+ 121 - 46
iZpl/src/main/java/de/nplusc/izc/iZpl/Main.java

@@ -9,6 +9,7 @@ import de.nplusc.izc.iZpl.API.PlaybackPlugin;
 import de.nplusc.izc.iZpl.API.Plugin;
 import de.nplusc.izc.iZpl.API.UIPlugin;
 import de.nplusc.izc.iZpl.GUI.ConfigureScreen;
+import de.nplusc.izc.iZpl.GUI.FirstRunScreen;
 import de.nplusc.izc.iZpl.GUI.IZplGUIDefault;
 import de.nplusc.izc.iZpl.GUI.IZplGUISkinnable;
 import de.nplusc.izc.iZpl.Utils.BurnMe;
@@ -38,7 +39,6 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.prefs.Preferences;
-import javax.swing.JFrame;
 import javax.swing.JTextArea;
 import org.apache.commons.cli.AlreadySelectedException;
 import org.apache.commons.cli.CommandLine;
@@ -60,10 +60,28 @@ import uk.co.caprica.vlcj.logger.Logger;
 public class Main extends javax.swing.JFrame
 {
 
+    public static List<PlaybackPlugin> getRegisteredPlayBackAdapters()
+    {
+        return registeredPlayBackAdapters;
+    }
+
+    public static List<UIPlugin> getRegisteredUIs()
+    {
+        return registeredUIs;
+    }
+
+    public static List<String> getDetectedSkins()
+    {
+        return detectedSkins;
+    }
+
    
     public static final String CONFIGPATH = IZPLApi.APPDIR + File.separator + "config" + File.separator + "config.yml";
     public static final Yaml y = new Yaml();
-
+    
+    private static final int UIMODE_NONE=0,UIMODE_OLD=1,UIMODE_NEW=2;
+    private static int uimodestate=UIMODE_NONE;
+    
     // public static LogStream stdout;
     private static final List<PlaybackPlugin> registeredPlayBackAdapters = new ArrayList<>();
     private static final List<UIPlugin> registeredUIs = new ArrayList<>();
@@ -77,14 +95,16 @@ public class Main extends javax.swing.JFrame
     private static boolean statefile = false;
     private static String file_path = "";
     private static boolean burnDisc = false;
+    private static boolean loadConfigMode=false;
     //--file path
     //--state path
-
+    
     //--pregen
     private static Boolean forcePregen = false;
     //--burn path
     private static boolean firstrunmode = false;
     private static boolean useGUI = false;
+    private static boolean fullRun=false;
     //--newGUI
     public static Configuration CONFIG;
 
@@ -95,7 +115,7 @@ public class Main extends javax.swing.JFrame
     private static PlaybackPlugin selectedPlaybackPlugin;
 
     private static UIPlugin selectedUIPlugin;
-
+    private static FirstRunScreen frs;
     /**
      * Creates new form Builder
      */
@@ -146,8 +166,25 @@ public class Main extends javax.swing.JFrame
         {
             processCommandLine(args);
             setupLogging();
+            String time = new Date(System.currentTimeMillis()).toString();
+            System.out.println("IZPL-Loader:Bootstrapped at:" + time);
+            
+            
+            if(firstrunmode)
+            {
+                java.awt.EventQueue.invokeLater(() ->
+                {
+                    frs = new FirstRunScreen();
+                    frs.setVisible(true);
+                });
+            }
+            
             System.out.println("Loading the configs now");
             loadConfigs();
+            if(CONFIG.isStandaloneMode())
+            {
+                useGUI=true;
+            }
             System.out.println("Initializing the plugins now. This may take a while");
             initializePlugins();
             System.out.println("Plugins initialized");
@@ -177,7 +214,7 @@ public class Main extends javax.swing.JFrame
             
             java.awt.EventQueue.invokeLater(() ->
             {
-                if ((filemode || statefile)&&!firstrunmode)
+                if ((filemode || statefile)&&!(firstrunmode||loadConfigMode))
                 {
                     final Main b = new Main();
                     pload.setIndeterminate(true);
@@ -216,9 +253,11 @@ public class Main extends javax.swing.JFrame
                         BurnMe.InitializeBurnDisc(file_path);
                         //quickQuit();
                     }
-                    if(firstrunmode)
+                    if(firstrunmode||loadConfigMode)
                     {
-                        new ConfigureScreen().setVisible(true);
+                        if(!loadConfigMode)
+                            frs.setVisible(false);
+                        new ConfigureScreen(firstrunmode).setVisible(true);
                     }
                     //BuilderGUI
                 }
@@ -324,7 +363,13 @@ public class Main extends javax.swing.JFrame
         CommandLineParser parser = new DefaultParser();
         Options options = new Options();
         OptionGroup modes = new OptionGroup();
-        options.addOption("g", "newgui", false, "Loads embedded VLC & the standalone GUI. Only qworks with --file or --state");
+        OptionGroup uimodes = new OptionGroup();
+        uimodes.addOption(OptionBuilder.withLongOpt("newgui")
+                .withDescription("enables the Standalone GUI mode. Starts program straight if --file or --resume is set")
+                .create("g"));
+        uimodes.addOption(OptionBuilder.withLongOpt("oldgui")
+                .withDescription("enables External VLC Player UIMode. Starts program straight if --file or --resume is set")
+                .create("o"));
         options.addOption("p", "pregen", false, "Pregens a standalone playlist with the randomisation included. Use togehter only with --file");
         options.addOption("v", "verbose", false, "Enables verbose VLCJ logging");
         options.addOption(OptionBuilder.withLongOpt("skin")
@@ -350,14 +395,21 @@ public class Main extends javax.swing.JFrame
         modes.addOption(OptionBuilder.withLongOpt("initialize")
                 .withDescription("Loads the Setup-finalize-GUI to get the last steps configured")
                 .create("i"));
+        modes.addOption(OptionBuilder.withLongOpt("configure")
+                .withDescription("Loads the Configuration UI")
+                .create("c"));
         options.addOptionGroup(modes);
+        options.addOptionGroup(uimodes);
         CommandLine cl = parser.parse(options, args);
 
         if (cl.hasOption("i"))
         {
             firstrunmode=true;
         }
-
+        if (cl.hasOption("c"))
+        {
+            loadConfigMode=true;
+        }
         if (cl.hasOption("file"))
         {
             filemode = true;
@@ -385,13 +437,11 @@ public class Main extends javax.swing.JFrame
         }
         if (cl.hasOption("newgui"))
         {
-            if (!(filemode || statefile))
-            {
-                System.out.println("Error: newguiI requires a --file or --resume argument");
-                System.exit(9263);
-            }
-            useGUI = true;
-
+            uimodestate=UIMODE_NEW;
+        }
+        if (cl.hasOption("oldgui"))
+        {
+            uimodestate=UIMODE_OLD;
         }
         if (cl.hasOption("pregen"))
         {
@@ -421,12 +471,16 @@ public class Main extends javax.swing.JFrame
                 selectedSkinPath = "default";
             }
         }
-        if (!(burnDisc || filemode || statefile || firstrunmode))
+        if (!(burnDisc || filemode || statefile || firstrunmode||loadConfigMode)&&uimodestate==UIMODE_NONE)
         {
             HelpFormatter formatter = new HelpFormatter();
             formatter.printHelp("izpl", options);
             System.exit(0);
         }
+        if(burnDisc||filemode||statefile||firstrunmode||loadConfigMode)
+        {
+            fullRun=true;
+        }
     }
 
     private static void loadConfigs()
@@ -466,23 +520,49 @@ public class Main extends javax.swing.JFrame
             CONFIG.setSkinSelected(selectedSkinPath);
         }
         selectedSkinPath = CONFIG.getSkinSelected();
+        if(uimodestate!=UIMODE_NONE)
+        {
+            if(uimodestate==UIMODE_NEW)
+            {
+                CONFIG.setStandaloneMode(true);
+            }
+            else
+            {
+                if(!CONFIG.getMPExecutablePath().equals(""))
+                {
+                    CONFIG.setStandaloneMode(false);
+                }
+                else
+                {
+                    System.out.println("No MediaPlayer executable set.");
+                    quickQuit();
+                }
+            }
+        }
     }
 
-    @SuppressWarnings("element-type-mismatch")
-    private static void initializePlugins()
+    public static void detectSkins()
     {
-        new File(IZPLApi.PLUGINPATH).mkdirs();
         new File(IZPLApi.SKINPATH).mkdirs();
         //new File().mkdirs();
+        detectedSkins.clear();
         detectedSkins.add("default"); //hardwired da immer enthalten
         String[] skinsAvailable = FileTK.getDirectoryContent(IZPLApi.SKINPATH,true);
         detectedSkins.addAll(Arrays.asList(skinsAvailable));
+    }
+    
+    
+    @SuppressWarnings("element-type-mismatch")
+    private static void initializePlugins()
+    {
+        new File(IZPLApi.PLUGINPATH).mkdirs();
+        detectSkins();
         if(!detectedSkins.contains(selectedSkinPath))
         {
             CONFIG.setSkinSelected("default");
             skinParameterSet=true;
         }
-        if(skinParameterSet)
+        if(skinParameterSet||uimodestate!=UIMODE_NONE)
         {
             try
             {
@@ -493,6 +573,9 @@ public class Main extends javax.swing.JFrame
                 ex.printStackTrace();
             }
         }
+        if(!fullRun)
+            quickQuit();
+        
         if (selectedSkinPath.equals("default"))
         {
             selectedSkinPath = IZPLApi.DEFAULT_SKIN_PATH;
@@ -533,15 +616,15 @@ public class Main extends javax.swing.JFrame
                         boolean isplugin = false;
                         boolean isPlaybackPlugin = false;
                         boolean isUIPlugin = false;
-                        for (int y = 0; y < interfaces.length && !isplugin; y++)
+                        for (int i = 0; i < interfaces.length && !isplugin; i++)
                         {
-                            if (interfaces[y].getName().equals("de.nplusc.izc.iZpl.API.PlaybackPlugin"))
+                            if (interfaces[i].getName().equals("de.nplusc.izc.iZpl.API.PlaybackPlugin"))
                             {
                                 isplugin = true;
                                 isPlaybackPlugin = true;
 
                             }
-                            if (interfaces[y].getName().equals("de.nplusc.izc.iZpl.API.UIPlugin"))
+                            if (interfaces[i].getName().equals("de.nplusc.izc.iZpl.API.UIPlugin"))
                             {
                                 isplugin = true;
                                 isUIPlugin = true;
@@ -607,6 +690,10 @@ public class Main extends javax.swing.JFrame
 
     }
 
+    @SuppressWarnings(
+    {
+        "BroadCatchBlock", "TooBroadCatch"
+    })
     private static void setupLogging()
     {
         try
@@ -633,30 +720,15 @@ public class Main extends javax.swing.JFrame
     {
         String time = "";
 
-        String vlcpath = "...";
-        try
-        {
-            time = new Date(System.currentTimeMillis()).toString();
-            System.out.println("IZPL-Core:initialized at:" + time);
-            vlcpath = Preferences.userRoot().get("izpl.vlcpath", "...");
-        }
-        catch (Exception e)//danke du komisher javabug
-        {
-            System.out.println(e.getMessage());
-            System.out.println(e.toString());
-            e.printStackTrace();
-
-        }
-        //String vlcpath="...";
-        if (vlcpath.equals("..."))
+        time = new Date(System.currentTimeMillis()).toString();
+        System.out.println("IZPL-Core:initialized at:" + time);
+        String vlcpath = CONFIG.getMPExecutablePath();
+        System.err.println("vlcpath=" + vlcpath);
+        if(!useGUI&&vlcpath.equals("")&&!new File(vlcpath).exists())
         {
-            Preferences.userRoot().put("izpl.vlcpath", Tools.FileChooseDlg(new JFrame(), true, false, new String[]
-            {
-                "exe"
-            }));
-            vlcpath = Preferences.userRoot().get("izpl.vlcpath", "...");
+            System.out.println("ungültige MediaPlayer executable");
+            quickQuit();
         }
-        System.err.println("vlcpath=" + vlcpath);
         boolean isShittyPlayer = false;
         boolean isWMShit = false;
         boolean isOtherShit = false;
@@ -807,6 +879,9 @@ public class Main extends javax.swing.JFrame
         return selectedUIPlugin;
     }
 
+    
+    
+    
     /*
      * Changelog:
      * V0.1.0: First build; basic functionality for reading in the format; No Failsafe system. Relaod resetted the stte