Creating of a default group if one is set in application properties.

cusax-fix
Damian Minkov 18 years ago
parent 3dbf15ccee
commit fd8ad43f7c

@ -1677,7 +1677,7 @@ javax.swing.event, javax.swing.border"/>
</jar>
</target>
<!--BUNDLE-StatusUpdatePlugin-->
<!--BUNDLE-SimpleAccRegPlugin-->
<target name="bundle-plugin-simpleaccreg">
<jar compress="false" destfile="${bundles.dest}/simpleaccreg.jar"
manifest="${src}/net/java/sip/communicator/plugin/simpleaccreg/simpleaccreg.manifest.mf">
@ -1689,6 +1689,8 @@ javax.swing.event, javax.swing.border"/>
prefix="resources"/>
<zipfileset dir="${resources}/colors"
prefix="resources/colors"/>
<zipfileset dir="${resources}" includes="application.properties"
prefix="resources"/>
</jar>
</target>
</project>

@ -5,4 +5,5 @@ fontSize=12
titleFontSize=14
isLookAndFeelDecorated=false
isToolBarExteneded=false
aboutLogoFontSize=14
aboutLogoFontSize=14
defaultGroupName=

@ -92,6 +92,23 @@ public InitialAccountRegistrationFrame()
this.getRootPane().setDefaultButton(signinButton);
this.initAccountWizards();
// Create the default group
String groupName = Resources.getString("defaultGroupName");
if(groupName != null && groupName.length() > 0)
{
SimpleAccountRegistrationActivator.getContactList().
createMetaContactGroup(
SimpleAccountRegistrationActivator.getContactList().getRoot(),
groupName);
SimpleAccountRegistrationActivator.getConfigurationService().
setProperty(
"net.java.sip.communicator.impl.gui.addcontact.lastContactParent",
groupName
);
}
}
private void initAccountWizards()

@ -61,7 +61,19 @@ public class Resources
*/
private static final ResourceBundle LOGIN_PROPERTIES_BUNDLE = ResourceBundle
.getBundle(LOGIN_BUNDLE_NAME);
/**
* Name of the bundle where we will search for application resources.
*/
private static final String APPLICATION_RESUORCE_LOCATION
= "resources.application";
/**
* Bundle which handle access to application resources.
*/
private static final ResourceBundle applicationBundle
= ResourceBundle.getBundle(APPLICATION_RESUORCE_LOCATION);
/**
* Returns an internationalized string corresponding to the given key.
*
@ -121,4 +133,25 @@ public static String getLoginProperty(String key)
return "";
}
}
/**
* Returns the application property corresponding to the given key.
*
* @param key The key of the string.
*
* @return the application property corresponding to the given key
*/
public static String getApplicationProperty(String key)
{
try
{
return applicationBundle.getString(key);
}
catch (MissingResourceException e)
{
log.error("Missing property.", e);
return "";
}
}
}

@ -10,6 +10,7 @@
import java.util.*;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
@ -24,6 +25,8 @@ public class SimpleAccountRegistrationActivator
public static BundleContext bundleContext;
private static ConfigurationService configService;
private static MetaContactListService contactListService;
public void start(BundleContext bc) throws Exception
{
@ -124,4 +127,23 @@ private static boolean hasRegisteredAccounts()
return hasRegisteredAccounts;
}
/**
* Returns the <tt>MetaContactListService</tt> obtained from the bundle
* context.
* @return the <tt>MetaContactListService</tt> obtained from the bundle
* context
*/
public static MetaContactListService getContactList()
{
if (contactListService == null) {
ServiceReference serviceReference = bundleContext
.getServiceReference(MetaContactListService.class.getName());
contactListService = (MetaContactListService) bundleContext
.getService(serviceReference);
}
return contactListService;
}
}

Loading…
Cancel
Save