← Back to team overview

syncany-team team mailing list archive

[Merge] lp:~5-launchpad-spacefish-biz/syncany/minor-wizzard-fixes into lp:syncany

 

Timo Witte has proposed merging lp:~5-launchpad-spacefish-biz/syncany/minor-wizzard-fixes into lp:syncany.

Requested reviews:
  Syncany Team (syncany-team)

For more details, see:
https://code.launchpad.net/~5-launchpad-spacefish-biz/syncany/minor-wizzard-fixes/+merge/66052

have added radio boxes to rackspace storage for selection between us and uk auth server
-- 
https://code.launchpad.net/~5-launchpad-spacefish-biz/syncany/minor-wizzard-fixes/+merge/66052
Your team Syncany Team is requested to review the proposed merge of lp:~5-launchpad-spacefish-biz/syncany/minor-wizzard-fixes into lp:syncany.
=== modified file 'syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.form'
--- syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.form	2011-05-23 16:50:04 +0000
+++ syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.form	2011-06-27 21:11:14 +0000
@@ -1,6 +1,10 @@
 <?xml version="1.1" encoding="UTF-8" ?>
 
-<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <NonVisualComponents>
+    <Component class="javax.swing.ButtonGroup" name="txtAuthServer">
+    </Component>
+  </NonVisualComponents>
   <AuxValues>
     <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
     <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
@@ -16,17 +20,23 @@
   <Layout>
     <DimensionLayout dim="0">
       <Group type="103" groupAlignment="0" attributes="0">
-          <Group type="102" alignment="0" attributes="0">
+          <Group type="102" attributes="0">
               <Group type="103" groupAlignment="0" attributes="0">
                   <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
                   <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
                   <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
+                  <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
               </Group>
               <EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
                   <Component id="txtUsername" alignment="0" pref="314" max="32767" attributes="0"/>
                   <Component id="txtApiKey" alignment="0" pref="314" max="32767" attributes="0"/>
                   <Component id="txtContainerName" alignment="0" pref="314" max="32767" attributes="0"/>
+                  <Group type="102" alignment="0" attributes="0">
+                      <Component id="authUs" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                      <Component id="authUk" min="-2" max="-2" attributes="0"/>
+                  </Group>
               </Group>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
@@ -49,7 +59,13 @@
                   <Component id="txtContainerName" alignment="3" min="-2" max="-2" attributes="0"/>
                   <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace pref="52" max="32767" attributes="0"/>
+              <EmptySpace type="separate" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="authUs" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="authUk" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="32767" attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
@@ -91,5 +107,34 @@
         <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
       </Properties>
     </Component>
+    <Component class="javax.swing.JLabel" name="jLabel4">
+      <Properties>
+        <Property name="horizontalAlignment" type="int" value="2"/>
+        <Property name="text" type="java.lang.String" value="Auth Server:"/>
+        <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JRadioButton" name="authUs">
+      <Properties>
+        <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+          <ComponentRef name="txtAuthServer"/>
+        </Property>
+        <Property name="selected" type="boolean" value="true"/>
+        <Property name="text" type="java.lang.String" value="US"/>
+        <Property name="name" type="java.lang.String" value="authUs" noResource="true"/>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="RackspaceConfigPanel_authUs"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JRadioButton" name="authUk">
+      <Properties>
+        <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+          <ComponentRef name="txtAuthServer"/>
+        </Property>
+        <Property name="text" type="java.lang.String" value="UK"/>
+        <Property name="name" type="java.lang.String" value="authUk" noResource="true"/>
+      </Properties>
+    </Component>
   </SubComponents>
 </Form>

=== modified file 'syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.java'
--- syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.java	2011-06-05 21:26:56 +0000
+++ syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.java	2011-06-27 21:11:14 +0000
@@ -18,6 +18,7 @@
 package org.syncany.connection.plugins.rackspace;
 
 import java.util.ResourceBundle;
+import org.jdesktop.application.Action;
 
 import org.syncany.config.Config;
 import org.syncany.connection.plugins.ConfigPanel;
@@ -40,7 +41,11 @@
     public void load() {
         txtUsername.setText(getConnection().getUsername());
         txtApiKey.setText(getConnection().getApiKey());
-        txtContainerName.setText(getConnection().getContainer());	
+        txtContainerName.setText(getConnection().getContainer());
+        if(getConnection().getAuthServer().equals("US"))
+            txtAuthServer.setSelected(authUs.getModel(), true);
+        else
+            txtAuthServer.setSelected(authUk.getModel(), true);
     }
 
     @Override
@@ -48,6 +53,13 @@
         getConnection().setUsername(txtUsername.getText());
         getConnection().setApiKey(new String(txtApiKey.getPassword()));
         getConnection().setContainer(txtContainerName.getText());
+        
+        String authServer;
+        if(txtAuthServer.getSelection() == authUs.getModel())
+            authServer = "US";
+        else
+            authServer = "UK";
+        getConnection().setAuthServer(authServer);
     }
 
     @Override
@@ -64,12 +76,16 @@
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
     private void initComponents() {
 
+        txtAuthServer = new javax.swing.ButtonGroup();
         txtUsername = new javax.swing.JTextField();
         txtApiKey = new javax.swing.JPasswordField();
         txtContainerName = new javax.swing.JTextField();
         jLabel3 = new javax.swing.JLabel();
         jLabel1 = new javax.swing.JLabel();
         jLabel2 = new javax.swing.JLabel();
+        jLabel4 = new javax.swing.JLabel();
+        authUs = new javax.swing.JRadioButton();
+        authUk = new javax.swing.JRadioButton();
 
         txtUsername.setName("txtUsername"); // NOI18N
 
@@ -78,17 +94,30 @@
         txtContainerName.setName("txtContainerName"); // NOI18N
 
         jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
-        jLabel3.setText(resourceBundle.getString("rackspace_container_name"));
+        jLabel3.setText("Container Name:");
         jLabel3.setName("jLabel3"); // NOI18N
 
         jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
-        jLabel1.setText(resourceBundle.getString("rackspace_username"));
+        jLabel1.setText("Username:");
         jLabel1.setName("jLabel1"); // NOI18N
 
         jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
-        jLabel2.setText(resourceBundle.getString("rackspace_apiKey"));
+        jLabel2.setText("API Key:");
         jLabel2.setName("jLabel2"); // NOI18N
 
+        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+        jLabel4.setText("Auth Server:");
+        jLabel4.setName("jLabel4"); // NOI18N
+
+        txtAuthServer.add(authUs);
+        authUs.setSelected(true);
+        authUs.setText("US");
+        authUs.setName("authUs"); // NOI18N
+
+        txtAuthServer.add(authUk);
+        authUk.setText("UK");
+        authUk.setName("authUk"); // NOI18N
+
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         this.setLayout(layout);
         layout.setHorizontalGroup(
@@ -97,12 +126,17 @@
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addComponent(jLabel1)
                     .addComponent(jLabel2)
-                    .addComponent(jLabel3))
+                    .addComponent(jLabel3)
+                    .addComponent(jLabel4))
                 .addGap(33, 33, 33)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addComponent(txtUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
                     .addComponent(txtApiKey, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
-                    .addComponent(txtContainerName, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE))
+                    .addComponent(txtContainerName, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(authUs)
+                        .addGap(18, 18, 18)
+                        .addComponent(authUk)))
                 .addContainerGap())
         );
         layout.setVerticalGroup(
@@ -119,14 +153,24 @@
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(txtContainerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                     .addComponent(jLabel3))
-                .addContainerGap(52, Short.MAX_VALUE))
+                .addGap(18, 18, 18)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jLabel4)
+                    .addComponent(authUs)
+                    .addComponent(authUk))
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
     }// </editor-fold>//GEN-END:initComponents
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JRadioButton authUk;
+    private javax.swing.JRadioButton authUs;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel2;
     private javax.swing.JLabel jLabel3;
+    private javax.swing.JLabel jLabel4;
     private javax.swing.JPasswordField txtApiKey;
+    private javax.swing.ButtonGroup txtAuthServer;
     private javax.swing.JTextField txtContainerName;
     private javax.swing.JTextField txtUsername;
     // End of variables declaration//GEN-END:variables

=== modified file 'syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConnection.java'
--- syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConnection.java	2011-06-05 21:26:56 +0000
+++ syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConnection.java	2011-06-27 21:11:14 +0000
@@ -35,6 +35,7 @@
 public class RackspaceConnection implements Connection {
     private String username;
     private String apiKey;
+    private String authServer;
     private String container;
     private ResourceBundle resourceBundle;
 
@@ -66,6 +67,14 @@
         this.apiKey = apiKey;
     }
 
+    public String getAuthServer() {
+        return authServer;
+    }
+    
+    public void setAuthServer(String authServer) {
+        this.authServer = authServer;
+    }
+    
     public String getContainer() {
         return container;
     }
@@ -87,6 +96,7 @@
         // Mandatory
         username = node.getProperty("username");
         apiKey = node.getProperty("apikey");
+        authServer = node.getProperty("authServer");
         container = node.getProperty("container");
 
         if (username == null || apiKey == null || container == null) {
@@ -99,6 +109,7 @@
         node.setAttribute("type", getPluginInfo().getId());
         node.setProperty("username", username);
         node.setProperty("apikey", apiKey);
+        node.setProperty("authServer", authServer);
         node.setProperty("container", container);
     }
     

=== modified file 'syncany/src/org/syncany/connection/plugins/rackspace/RackspaceTransferManager.java'
--- syncany/src/org/syncany/connection/plugins/rackspace/RackspaceTransferManager.java	2011-05-23 16:50:04 +0000
+++ syncany/src/org/syncany/connection/plugins/rackspace/RackspaceTransferManager.java	2011-06-27 21:11:14 +0000
@@ -38,7 +38,8 @@
  * @author oubou68, pheckel
  */
 public class RackspaceTransferManager extends AbstractTransferManager {
-    private static final String AUTH_URL = "https://auth.api.rackspacecloud.com/v1.0";;
+    private static final String AUTH_URL_US = "https://auth.api.rackspacecloud.com/v1.0";;
+    private static final String AUTH_URL_UK = "https://lon.auth.api.rackspacecloud.com/v1.0";;
     private static final int CONNECTION_TIMEOUT = 5000;
     
     private FilesClient client;
@@ -47,7 +48,11 @@
         super(connection);
         
         client = new FilesClient(connection.getUsername(), connection.getApiKey());
-        client.setAuthenticationURL(AUTH_URL);        
+        if(connection.getAuthServer().equals("US"))
+            client.setAuthenticationURL(AUTH_URL_US);
+        else
+            client.setAuthenticationURL(AUTH_URL_UK);
+        
         client.setConnectionTimeOut(CONNECTION_TIMEOUT);        
     }
 


Follow ups