فهرست منبع

storing shizzle

git-svn-id: http://repo.nplusc.de/svn/iZink@136 8b19561d-0d00-6744-8ac1-9afc8f58a8aa
masterX244 11 سال پیش
والد
کامیت
2763fc95ff
2فایلهای تغییر یافته به همراه36 افزوده شده و 32 حذف شده
  1. 7 14
      iZYT2SF/src/UI.form
  2. 29 18
      iZYT2SF/src/UI.java

+ 7 - 14
iZYT2SF/src/UI.form

@@ -24,18 +24,11 @@
     <DimensionLayout dim="0">
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="0" attributes="0">
+              <EmptySpace min="-2" pref="101" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
-                  <Group type="102" alignment="0" attributes="0">
-                      <EmptySpace min="-2" pref="109" max="-2" attributes="0"/>
-                      <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
-                  </Group>
-                  <Group type="102" alignment="0" attributes="0">
-                      <EmptySpace min="-2" pref="101" max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="0" attributes="0">
-                          <Component id="jButton1" alignment="0" min="-2" pref="531" max="-2" attributes="0"/>
-                          <Component id="jTextField1" min="-2" pref="531" max="-2" attributes="0"/>
-                      </Group>
-                  </Group>
+                  <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+                  <Component id="btnDL" alignment="0" min="-2" pref="531" max="-2" attributes="0"/>
+                  <Component id="jTextField1" min="-2" pref="531" max="-2" attributes="0"/>
               </Group>
               <EmptySpace pref="114" max="32767" attributes="0"/>
           </Group>
@@ -49,7 +42,7 @@
               <EmptySpace max="-2" attributes="0"/>
               <Component id="jTextField1" min="-2" max="-2" attributes="0"/>
               <EmptySpace type="separate" max="-2" attributes="0"/>
-              <Component id="jButton1" min="-2" pref="141" max="-2" attributes="0"/>
+              <Component id="btnDL" min="-2" pref="141" max="-2" attributes="0"/>
               <EmptySpace pref="179" max="32767" attributes="0"/>
           </Group>
       </Group>
@@ -63,12 +56,12 @@
         <Property name="text" type="java.lang.String" value="Video-URL hier einf&#xfc;gen"/>
       </Properties>
     </Component>
-    <Component class="javax.swing.JButton" name="jButton1">
+    <Component class="javax.swing.JButton" name="btnDL">
       <Properties>
         <Property name="text" type="java.lang.String" value="Laden"/>
       </Properties>
       <Events>
-        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDLActionPerformed"/>
       </Events>
     </Component>
   </SubComponents>

+ 29 - 18
iZYT2SF/src/UI.java

@@ -1,3 +1,8 @@
+
+import de.nplusc.izc.tools.IOtools.FileTK;
+import de.nplusc.izc.tools.baseTools.Tools;
+import java.util.prefs.Preferences;
+
 /*
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
@@ -31,18 +36,18 @@ public class UI extends javax.swing.JFrame
 
         jTextField1 = new javax.swing.JTextField();
         jLabel1 = new javax.swing.JLabel();
-        jButton1 = new javax.swing.JButton();
+        btnDL = new javax.swing.JButton();
 
         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 
         jLabel1.setText("Video-URL hier einfügen");
 
-        jButton1.setText("Laden");
-        jButton1.addActionListener(new java.awt.event.ActionListener()
+        btnDL.setText("Laden");
+        btnDL.addActionListener(new java.awt.event.ActionListener()
         {
             public void actionPerformed(java.awt.event.ActionEvent evt)
             {
-                jButton1ActionPerformed(evt);
+                btnDLActionPerformed(evt);
             }
         });
 
@@ -51,15 +56,11 @@ public class UI extends javax.swing.JFrame
         layout.setHorizontalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(layout.createSequentialGroup()
+                .addGap(101, 101, 101)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(layout.createSequentialGroup()
-                        .addGap(109, 109, 109)
-                        .addComponent(jLabel1))
-                    .addGroup(layout.createSequentialGroup()
-                        .addGap(101, 101, 101)
-                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 531, javax.swing.GroupLayout.PREFERRED_SIZE)
-                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 531, javax.swing.GroupLayout.PREFERRED_SIZE))))
+                    .addComponent(jLabel1)
+                    .addComponent(btnDL, javax.swing.GroupLayout.PREFERRED_SIZE, 531, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 531, javax.swing.GroupLayout.PREFERRED_SIZE))
                 .addContainerGap(114, Short.MAX_VALUE))
         );
         layout.setVerticalGroup(
@@ -70,17 +71,27 @@ public class UI extends javax.swing.JFrame
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addGap(18, 18, 18)
-                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addComponent(btnDL, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addContainerGap(179, Short.MAX_VALUE))
         );
 
         pack();
     }// </editor-fold>//GEN-END:initComponents
 
-    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
-    {//GEN-HEADEREND:event_jButton1ActionPerformed
-        // TODO add your handling code here:
-    }//GEN-LAST:event_jButton1ActionPerformed
+    private void btnDLActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnDLActionPerformed
+    {//GEN-HEADEREND:event_btnDLActionPerformed
+        
+        if(Preferences.userRoot().get("izyt.path", "...").equals("..."))
+        {
+            if(!FileTK.checkDirExist(Preferences.userRoot().get("izyt.path", "...")))//falls Pfad irgendwie ungültig wurde
+            {
+            String targetDirectory = Tools.FileChooseDlg(this, true, true, new String[]{});
+            Preferences.userRoot().put("izyt.path", targetDirectory);
+            }
+        }
+        String tdir = Preferences.userRoot().get("izyt.path", "...");
+        System.out.println(tdir);
+    }//GEN-LAST:event_btnDLActionPerformed
 
     /**
      * @param args the command line arguments
@@ -131,7 +142,7 @@ public class UI extends javax.swing.JFrame
         });
     }
     // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.JButton jButton1;
+    private javax.swing.JButton btnDL;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JTextField jTextField1;
     // End of variables declaration//GEN-END:variables