Merge lp:~spacefish/syncany/minor-wizzard-fixes into lp:~syncany-team/syncany/trunk

Proposed by Timo Witte
Status: Needs review
Proposed branch: lp:~spacefish/syncany/minor-wizzard-fixes
Merge into: lp:~syncany-team/syncany/trunk
Diff against target: 295 lines (+117/-12)
4 files modified
syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.form (+48/-3)
syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConfigPanel.java (+51/-7)
syncany/src/org/syncany/connection/plugins/rackspace/RackspaceConnection.java (+11/-0)
syncany/src/org/syncany/connection/plugins/rackspace/RackspaceTransferManager.java (+7/-2)
To merge this branch: bzr merge lp:~spacefish/syncany/minor-wizzard-fixes
Reviewer Review Type Date Requested Status
Syncany Team Pending
Review via email: mp+66052@code.launchpad.net

Description of the change

have added radio boxes to rackspace storage for selection between us and uk auth server

To post a comment you must log in.
Revision history for this message
Timo Witte (spacefish) wrote :

Unmerged revisions

61. By Timo Witte

added radio boxes to select between different rackspace auth servers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
1<?xml version="1.1" encoding="UTF-8" ?>1<?xml version="1.1" encoding="UTF-8" ?>
22
3<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">3<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4 <NonVisualComponents>
5 <Component class="javax.swing.ButtonGroup" name="txtAuthServer">
6 </Component>
7 </NonVisualComponents>
4 <AuxValues>8 <AuxValues>
5 <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>9 <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
6 <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>10 <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
@@ -16,17 +20,23 @@
16 <Layout>20 <Layout>
17 <DimensionLayout dim="0">21 <DimensionLayout dim="0">
18 <Group type="103" groupAlignment="0" attributes="0">22 <Group type="103" groupAlignment="0" attributes="0">
19 <Group type="102" alignment="0" attributes="0">23 <Group type="102" attributes="0">
20 <Group type="103" groupAlignment="0" attributes="0">24 <Group type="103" groupAlignment="0" attributes="0">
21 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>25 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
22 <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>26 <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
23 <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>27 <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
28 <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
24 </Group>29 </Group>
25 <EmptySpace min="-2" pref="33" max="-2" attributes="0"/>30 <EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
26 <Group type="103" groupAlignment="0" attributes="0">31 <Group type="103" groupAlignment="0" attributes="0">
27 <Component id="txtUsername" alignment="0" pref="314" max="32767" attributes="0"/>32 <Component id="txtUsername" alignment="0" pref="314" max="32767" attributes="0"/>
28 <Component id="txtApiKey" alignment="0" pref="314" max="32767" attributes="0"/>33 <Component id="txtApiKey" alignment="0" pref="314" max="32767" attributes="0"/>
29 <Component id="txtContainerName" alignment="0" pref="314" max="32767" attributes="0"/>34 <Component id="txtContainerName" alignment="0" pref="314" max="32767" attributes="0"/>
35 <Group type="102" alignment="0" attributes="0">
36 <Component id="authUs" min="-2" max="-2" attributes="0"/>
37 <EmptySpace type="separate" max="-2" attributes="0"/>
38 <Component id="authUk" min="-2" max="-2" attributes="0"/>
39 </Group>
30 </Group>40 </Group>
31 <EmptySpace max="-2" attributes="0"/>41 <EmptySpace max="-2" attributes="0"/>
32 </Group>42 </Group>
@@ -49,7 +59,13 @@
49 <Component id="txtContainerName" alignment="3" min="-2" max="-2" attributes="0"/>59 <Component id="txtContainerName" alignment="3" min="-2" max="-2" attributes="0"/>
50 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>60 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
51 </Group>61 </Group>
52 <EmptySpace pref="52" max="32767" attributes="0"/>62 <EmptySpace type="separate" max="-2" attributes="0"/>
63 <Group type="103" groupAlignment="3" attributes="0">
64 <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
65 <Component id="authUs" alignment="3" min="-2" max="-2" attributes="0"/>
66 <Component id="authUk" alignment="3" min="-2" max="-2" attributes="0"/>
67 </Group>
68 <EmptySpace max="32767" attributes="0"/>
53 </Group>69 </Group>
54 </Group>70 </Group>
55 </DimensionLayout>71 </DimensionLayout>
@@ -91,5 +107,34 @@
91 <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>107 <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
92 </Properties>108 </Properties>
93 </Component>109 </Component>
110 <Component class="javax.swing.JLabel" name="jLabel4">
111 <Properties>
112 <Property name="horizontalAlignment" type="int" value="2"/>
113 <Property name="text" type="java.lang.String" value="Auth Server:"/>
114 <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>
115 </Properties>
116 </Component>
117 <Component class="javax.swing.JRadioButton" name="authUs">
118 <Properties>
119 <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
120 <ComponentRef name="txtAuthServer"/>
121 </Property>
122 <Property name="selected" type="boolean" value="true"/>
123 <Property name="text" type="java.lang.String" value="US"/>
124 <Property name="name" type="java.lang.String" value="authUs" noResource="true"/>
125 </Properties>
126 <AuxValues>
127 <AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="RackspaceConfigPanel_authUs"/>
128 </AuxValues>
129 </Component>
130 <Component class="javax.swing.JRadioButton" name="authUk">
131 <Properties>
132 <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
133 <ComponentRef name="txtAuthServer"/>
134 </Property>
135 <Property name="text" type="java.lang.String" value="UK"/>
136 <Property name="name" type="java.lang.String" value="authUk" noResource="true"/>
137 </Properties>
138 </Component>
94 </SubComponents>139 </SubComponents>
95</Form>140</Form>
96141
=== 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 @@
18package org.syncany.connection.plugins.rackspace;18package org.syncany.connection.plugins.rackspace;
1919
20import java.util.ResourceBundle;20import java.util.ResourceBundle;
21import org.jdesktop.application.Action;
2122
22import org.syncany.config.Config;23import org.syncany.config.Config;
23import org.syncany.connection.plugins.ConfigPanel;24import org.syncany.connection.plugins.ConfigPanel;
@@ -40,7 +41,11 @@
40 public void load() {41 public void load() {
41 txtUsername.setText(getConnection().getUsername());42 txtUsername.setText(getConnection().getUsername());
42 txtApiKey.setText(getConnection().getApiKey());43 txtApiKey.setText(getConnection().getApiKey());
43 txtContainerName.setText(getConnection().getContainer()); 44 txtContainerName.setText(getConnection().getContainer());
45 if(getConnection().getAuthServer().equals("US"))
46 txtAuthServer.setSelected(authUs.getModel(), true);
47 else
48 txtAuthServer.setSelected(authUk.getModel(), true);
44 }49 }
4550
46 @Override51 @Override
@@ -48,6 +53,13 @@
48 getConnection().setUsername(txtUsername.getText());53 getConnection().setUsername(txtUsername.getText());
49 getConnection().setApiKey(new String(txtApiKey.getPassword()));54 getConnection().setApiKey(new String(txtApiKey.getPassword()));
50 getConnection().setContainer(txtContainerName.getText());55 getConnection().setContainer(txtContainerName.getText());
56
57 String authServer;
58 if(txtAuthServer.getSelection() == authUs.getModel())
59 authServer = "US";
60 else
61 authServer = "UK";
62 getConnection().setAuthServer(authServer);
51 }63 }
5264
53 @Override65 @Override
@@ -64,12 +76,16 @@
64 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents76 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
65 private void initComponents() {77 private void initComponents() {
6678
79 txtAuthServer = new javax.swing.ButtonGroup();
67 txtUsername = new javax.swing.JTextField();80 txtUsername = new javax.swing.JTextField();
68 txtApiKey = new javax.swing.JPasswordField();81 txtApiKey = new javax.swing.JPasswordField();
69 txtContainerName = new javax.swing.JTextField();82 txtContainerName = new javax.swing.JTextField();
70 jLabel3 = new javax.swing.JLabel();83 jLabel3 = new javax.swing.JLabel();
71 jLabel1 = new javax.swing.JLabel();84 jLabel1 = new javax.swing.JLabel();
72 jLabel2 = new javax.swing.JLabel();85 jLabel2 = new javax.swing.JLabel();
86 jLabel4 = new javax.swing.JLabel();
87 authUs = new javax.swing.JRadioButton();
88 authUk = new javax.swing.JRadioButton();
7389
74 txtUsername.setName("txtUsername"); // NOI18N90 txtUsername.setName("txtUsername"); // NOI18N
7591
@@ -78,17 +94,30 @@
78 txtContainerName.setName("txtContainerName"); // NOI18N94 txtContainerName.setName("txtContainerName"); // NOI18N
7995
80 jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);96 jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
81 jLabel3.setText(resourceBundle.getString("rackspace_container_name"));97 jLabel3.setText("Container Name:");
82 jLabel3.setName("jLabel3"); // NOI18N98 jLabel3.setName("jLabel3"); // NOI18N
8399
84 jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);100 jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
85 jLabel1.setText(resourceBundle.getString("rackspace_username"));101 jLabel1.setText("Username:");
86 jLabel1.setName("jLabel1"); // NOI18N102 jLabel1.setName("jLabel1"); // NOI18N
87103
88 jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);104 jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
89 jLabel2.setText(resourceBundle.getString("rackspace_apiKey"));105 jLabel2.setText("API Key:");
90 jLabel2.setName("jLabel2"); // NOI18N106 jLabel2.setName("jLabel2"); // NOI18N
91107
108 jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
109 jLabel4.setText("Auth Server:");
110 jLabel4.setName("jLabel4"); // NOI18N
111
112 txtAuthServer.add(authUs);
113 authUs.setSelected(true);
114 authUs.setText("US");
115 authUs.setName("authUs"); // NOI18N
116
117 txtAuthServer.add(authUk);
118 authUk.setText("UK");
119 authUk.setName("authUk"); // NOI18N
120
92 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);121 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
93 this.setLayout(layout);122 this.setLayout(layout);
94 layout.setHorizontalGroup(123 layout.setHorizontalGroup(
@@ -97,12 +126,17 @@
97 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)126 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
98 .addComponent(jLabel1)127 .addComponent(jLabel1)
99 .addComponent(jLabel2)128 .addComponent(jLabel2)
100 .addComponent(jLabel3))129 .addComponent(jLabel3)
130 .addComponent(jLabel4))
101 .addGap(33, 33, 33)131 .addGap(33, 33, 33)
102 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)132 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
103 .addComponent(txtUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)133 .addComponent(txtUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
104 .addComponent(txtApiKey, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)134 .addComponent(txtApiKey, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
105 .addComponent(txtContainerName, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE))135 .addComponent(txtContainerName, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
136 .addGroup(layout.createSequentialGroup()
137 .addComponent(authUs)
138 .addGap(18, 18, 18)
139 .addComponent(authUk)))
106 .addContainerGap())140 .addContainerGap())
107 );141 );
108 layout.setVerticalGroup(142 layout.setVerticalGroup(
@@ -119,14 +153,24 @@
119 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)153 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
120 .addComponent(txtContainerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)154 .addComponent(txtContainerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
121 .addComponent(jLabel3))155 .addComponent(jLabel3))
122 .addContainerGap(52, Short.MAX_VALUE))156 .addGap(18, 18, 18)
157 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
158 .addComponent(jLabel4)
159 .addComponent(authUs)
160 .addComponent(authUk))
161 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
123 );162 );
124 }// </editor-fold>//GEN-END:initComponents163 }// </editor-fold>//GEN-END:initComponents
164
125 // Variables declaration - do not modify//GEN-BEGIN:variables165 // Variables declaration - do not modify//GEN-BEGIN:variables
166 private javax.swing.JRadioButton authUk;
167 private javax.swing.JRadioButton authUs;
126 private javax.swing.JLabel jLabel1;168 private javax.swing.JLabel jLabel1;
127 private javax.swing.JLabel jLabel2;169 private javax.swing.JLabel jLabel2;
128 private javax.swing.JLabel jLabel3;170 private javax.swing.JLabel jLabel3;
171 private javax.swing.JLabel jLabel4;
129 private javax.swing.JPasswordField txtApiKey;172 private javax.swing.JPasswordField txtApiKey;
173 private javax.swing.ButtonGroup txtAuthServer;
130 private javax.swing.JTextField txtContainerName;174 private javax.swing.JTextField txtContainerName;
131 private javax.swing.JTextField txtUsername;175 private javax.swing.JTextField txtUsername;
132 // End of variables declaration//GEN-END:variables176 // End of variables declaration//GEN-END:variables
133177
=== 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 @@
35public class RackspaceConnection implements Connection {35public class RackspaceConnection implements Connection {
36 private String username;36 private String username;
37 private String apiKey;37 private String apiKey;
38 private String authServer;
38 private String container;39 private String container;
39 private ResourceBundle resourceBundle;40 private ResourceBundle resourceBundle;
4041
@@ -66,6 +67,14 @@
66 this.apiKey = apiKey;67 this.apiKey = apiKey;
67 }68 }
6869
70 public String getAuthServer() {
71 return authServer;
72 }
73
74 public void setAuthServer(String authServer) {
75 this.authServer = authServer;
76 }
77
69 public String getContainer() {78 public String getContainer() {
70 return container;79 return container;
71 }80 }
@@ -87,6 +96,7 @@
87 // Mandatory96 // Mandatory
88 username = node.getProperty("username");97 username = node.getProperty("username");
89 apiKey = node.getProperty("apikey");98 apiKey = node.getProperty("apikey");
99 authServer = node.getProperty("authServer");
90 container = node.getProperty("container");100 container = node.getProperty("container");
91101
92 if (username == null || apiKey == null || container == null) {102 if (username == null || apiKey == null || container == null) {
@@ -99,6 +109,7 @@
99 node.setAttribute("type", getPluginInfo().getId());109 node.setAttribute("type", getPluginInfo().getId());
100 node.setProperty("username", username);110 node.setProperty("username", username);
101 node.setProperty("apikey", apiKey);111 node.setProperty("apikey", apiKey);
112 node.setProperty("authServer", authServer);
102 node.setProperty("container", container);113 node.setProperty("container", container);
103 }114 }
104 115
105116
=== 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 @@
38 * @author oubou68, pheckel38 * @author oubou68, pheckel
39 */39 */
40public class RackspaceTransferManager extends AbstractTransferManager {40public class RackspaceTransferManager extends AbstractTransferManager {
41 private static final String AUTH_URL = "https://auth.api.rackspacecloud.com/v1.0";41 private static final String AUTH_URL_US = "https://auth.api.rackspacecloud.com/v1.0";
42 private static final String AUTH_URL_UK = "https://lon.auth.api.rackspacecloud.com/v1.0";
42 private static final int CONNECTION_TIMEOUT = 5000;43 private static final int CONNECTION_TIMEOUT = 5000;
43 44
44 private FilesClient client;45 private FilesClient client;
@@ -47,7 +48,11 @@
47 super(connection);48 super(connection);
48 49
49 client = new FilesClient(connection.getUsername(), connection.getApiKey());50 client = new FilesClient(connection.getUsername(), connection.getApiKey());
50 client.setAuthenticationURL(AUTH_URL); 51 if(connection.getAuthServer().equals("US"))
52 client.setAuthenticationURL(AUTH_URL_US);
53 else
54 client.setAuthenticationURL(AUTH_URL_UK);
55
51 client.setConnectionTimeOut(CONNECTION_TIMEOUT); 56 client.setConnectionTimeOut(CONNECTION_TIMEOUT);
52 }57 }
5358