=== modified file 'dhis-live/src/main/java/org/hisp/dhis/SettingsWindow.form'
--- dhis-live/src/main/java/org/hisp/dhis/SettingsWindow.form 2010-09-19 00:06:33 +0000
+++ dhis-live/src/main/java/org/hisp/dhis/SettingsWindow.form 2010-09-19 02:08:43 +0000
@@ -96,7 +96,6 @@
-
@@ -370,6 +369,9 @@
+
+
+
@@ -391,7 +393,7 @@
-
+
@@ -419,6 +421,7 @@
+
@@ -429,6 +432,7 @@
+
@@ -504,8 +508,12 @@
-
-
+
+
+
+
+
+
@@ -529,7 +537,6 @@
-
@@ -540,9 +547,8 @@
-
+
-
=== modified file 'dhis-live/src/main/java/org/hisp/dhis/SettingsWindow.java'
--- dhis-live/src/main/java/org/hisp/dhis/SettingsWindow.java 2010-09-19 00:06:33 +0000
+++ dhis-live/src/main/java/org/hisp/dhis/SettingsWindow.java 2010-09-19 02:08:43 +0000
@@ -26,6 +26,8 @@
*/
package org.hisp.dhis;
+
+import java.awt.Component;
import java.io.IOException;
import java.util.Enumeration;
import java.util.jar.JarEntry;
@@ -37,8 +39,13 @@
import java.net.URL;
import java.util.Vector;
import java.util.jar.JarFile;
+import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
+import javax.swing.DefaultCellEditor;
import javax.swing.JFrame;
+import javax.swing.JList;
+import javax.swing.plaf.basic.BasicComboBoxRenderer;
+import javax.swing.table.DefaultTableCellRenderer;
import org.hisp.dhis.config.ConfigType.DatabaseConfiguration.ConnectionTypes.ConnectionType;
import org.hisp.dhis.config.ConfigType.DatabaseConfiguration.DatabaseConnections.Connection;
@@ -51,6 +58,8 @@
private Vector countryVect = new Vector();
+ private JComboBox connTypesCombo;
+
public SettingsWindow()
{
try
@@ -60,12 +69,46 @@
{
JOptionPane.showMessageDialog( null, ex.getMessage() );
}
+ Vector connTypesVect = new Vector( TrayApp.databaseConfig.getConnectionTypes().getConnectionType() );
+ connTypesCombo = new JComboBox( connTypesVect );
+ connTypesCombo.setRenderer( new ConnTypesComboRenderer() );
initComponents();
langCombo.setModel( new DefaultComboBoxModel( getSupportedLanguages() ) );
langCombo.setSelectedIndex( selectedLang );
setLocationRelativeTo( null );
}
+ class ConnTypesComboRenderer extends BasicComboBoxRenderer
+ {
+
+ @Override
+ public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus )
+ {
+ super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus );
+ if ( value != null )
+ {
+ ConnectionType item = (ConnectionType) value;
+ setText( item.getId() );
+ }
+ if ( index == -1 )
+ {
+ ConnectionType item = (ConnectionType) value;
+ setText((value == null) ? "" : item.getId());
+ }
+ return this;
+ }
+ }
+
+ class ConnTypesCellRenderer extends DefaultTableCellRenderer
+ {
+ @Override
+ public void setValue( Object value )
+ {
+ ConnectionType item = (ConnectionType) value;
+ setText((value == null) ? "" : item.getId());
+ }
+ }
+
private String getJarfileName()
{
// Get the location of the jar file and the jar file name
@@ -294,8 +337,7 @@
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, appConfigPanelLayout.createSequentialGroup()
.addComponent(hostLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(hostField, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
+ .addComponent(hostField, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(10, 10, 10)
.addGroup(appConfigPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(countryLabel)
@@ -349,7 +391,8 @@
connTypePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(messageService.getString("settings.conntypes")));
- connTypeTable.setColumnSelectionAllowed(true);
+ connTypeTable.setBackground(new java.awt.Color(212, 208, 200));
+ connTypeTable.setEnabled(false);
connTypeTable.getTableHeader().setReorderingAllowed(false);
org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${databaseConfiguration.connectionTypes.connectionType}");
@@ -370,6 +413,7 @@
connTypeTable.getColumnModel().getColumn(0).setHeaderValue(messageService.getString("ID"));
connTypeAddButton.setText(messageService.getString("settings.add"));
+ connTypeAddButton.setEnabled(false);
connTypeAddButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
connTypeAddButtonActionPerformed(evt);
@@ -377,6 +421,7 @@
});
connTypeDelButton.setText(messageService.getString("settings.remove"));
+ connTypeDelButton.setEnabled(false);
connTypeDelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
connTypeDelButtonActionPerformed(evt);
@@ -410,7 +455,6 @@
connPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(messageService.getString("settings.connections")));
- connTable.setColumnSelectionAllowed(true);
connTable.getTableHeader().setReorderingAllowed(false);
eLProperty = org.jdesktop.beansbinding.ELProperty.create("${databaseConfiguration.databaseConnections.connection}");
@@ -418,9 +462,8 @@
columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
columnBinding.setColumnName("ID");
columnBinding.setColumnClass(String.class);
- columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${type.id}"));
+ columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${type}"));
columnBinding.setColumnName("Type");
- columnBinding.setColumnClass(String.class);
columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}"));
columnBinding.setColumnName("Name");
columnBinding.setColumnClass(String.class);
@@ -437,6 +480,8 @@
jTableBinding.bind();
connPane.setViewportView(connTable);
connTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+ connTable.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(connTypesCombo));
+ connTable.getColumnModel().getColumn(1).setCellRenderer(new ConnTypesCellRenderer());
connTable.getColumnModel().getColumn(3).setPreferredWidth(60);
connAddButton.setText(messageService.getString("settings.add"));
=== modified file 'dhis-live/src/main/resources/defaultConfig.xml'
--- dhis-live/src/main/resources/defaultConfig.xml 2010-09-19 00:06:33 +0000
+++ dhis-live/src/main/resources/defaultConfig.xml 2010-09-19 02:08:43 +0000
@@ -19,6 +19,14 @@
org.hisp.dhis.dialect.H2Dialect
org.h2.Driver
+
+ org.hibernate.dialect.MySQLDialect
+ com.mysql.jdbc.Driver
+
+
+ org.hibernate.dialect.PostgreSQLDialect
+ org.postgresql.Driver
+
@@ -26,16 +34,6 @@
jdbc:h2:./database/demo;AUTO_SERVER=TRUE
sa
-
- DHIS2 India
- jdbc:h2:./database/india;AUTO_SERVER=TRUE
- india
-
-
- DHIS2 Sierra Leone
- jdbc:h2:./database/sl;AUTO_SERVER=TRUE
- sl
-
=== modified file 'dhis-live/src/main/resources/messages/messages_en_GB.properties'
--- dhis-live/src/main/resources/messages/messages_en_GB.properties 2010-09-18 12:33:38 +0000
+++ dhis-live/src/main/resources/messages/messages_en_GB.properties 2010-09-19 02:08:43 +0000
@@ -30,7 +30,7 @@
settings.restartinfo=(* requires restart of DHIS 2 Live - default: 200000)
settings.bytes=(bytes)
settings.dbconfig= Database Configuration
-settings.conntypes=Connection Types
+settings.conntypes=Connection Types (Disabled)
settings.remove=Remove
settings.connections=Connections:
settings.add=Add
=== modified file 'dhis-live/src/main/resources/messages/messages_fr.properties'
--- dhis-live/src/main/resources/messages/messages_fr.properties 2010-09-18 12:33:38 +0000
+++ dhis-live/src/main/resources/messages/messages_fr.properties 2010-09-19 02:08:43 +0000
@@ -28,7 +28,7 @@
settings.restartinfo = (* n\u00e9cessite un red\u00e9marrage de DHIS 2 Live - par d\u00e9faut: 200000)
settings.bytes = (octets)
settings.dbconfig = Base de donn\u00e9es de configuration
-settings.conntypes = Les types de connexion
+settings.conntypes = Les types de connexion (Disabled)
settings.connections = Connexions =:
settings.add = Ajouter