Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaniszczyk2007-07-26 20:42:12 +0000
committercaniszczyk2007-07-26 20:42:12 +0000
commit3a1f85d759e565995e3a9e571a177c8debd89598 (patch)
tree1e6a8ee0c75c7589182db712bd39057b1efc84f0 /providers/bundles/org.eclipse.ecf.provider.irc.ui
parentb48c3b0c6f6b9609cf4e417612504cca231b6235 (diff)
downloadorg.eclipse.ecf-3a1f85d759e565995e3a9e571a177c8debd89598.tar.gz
org.eclipse.ecf-3a1f85d759e565995e3a9e571a177c8debd89598.tar.xz
org.eclipse.ecf-3a1f85d759e565995e3a9e571a177c8debd89598.zip
bug 193136: [IRC] Add default IRC server
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193136
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.irc.ui')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java1
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java10
3 files changed, 13 insertions, 0 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java
index 10c9cf75f..351998014 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java
@@ -18,6 +18,7 @@ import org.eclipse.osgi.util.NLS;
*/
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.irc.ui.messages"; //$NON-NLS-1$
+ public static String IRCConnectWizardPage_CONNECTID_DEFAULT;
public static String IRCConnectWizardPage_CONNECTID_EXAMPLE;
public static String IRCConnectWizardPage_CONNECTID_LABEL;
public static String IRCConnectWizardPage_PASSWORD_INFO;
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties
index 0d652ea94..0477bef92 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties
@@ -14,3 +14,5 @@ IRCConnectWizardPage_STATUS_MESSAGE_EMPTY=A valid connect ID must be specified.
IRCConnectWizardPage_STATUS_MESSAGE_MALFORMED=The connect ID is malformed.
IRCConnectWizardPage_CONNECTID_EXAMPLE=<user>@<ircserver>[:port][/<channel>,<channel2>,...]
IRCConnectWizardPage_PASSWORD_INFO=Password is for password-protected IRC servers.
+
+IRCConnectWizardPage_CONNECTID_DEFAULT=ecfuser{0}@irc.freenode.net/#eclipse \ No newline at end of file
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
index 23e078c7c..a48d39535 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
@@ -7,12 +7,14 @@
*
* Contributors:
* Remy Suen <remy.suen@gmail.com> - initial API and implementation
+ * Abner Ballardo <modlost@modlost.net> - bug 193136
*****************************************************************************/
package org.eclipse.ecf.internal.irc.ui.wizards;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Random;
import org.eclipse.ecf.internal.irc.ui.Activator;
import org.eclipse.ecf.internal.irc.ui.Messages;
@@ -20,6 +22,7 @@ import org.eclipse.ecf.ui.SharedImages;
import org.eclipse.ecf.ui.util.PasswordCacheHelper;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -104,6 +107,8 @@ final class IRCConnectWizardPage extends WizardPage {
passwordText.setText("");
verify();
}});
+ connectText.setText(NLS.bind(
+ Messages.IRCConnectWizardPage_CONNECTID_DEFAULT, getRandomNumber()));
label = new Label(parent, SWT.RIGHT);
label.setText(Messages.IRCConnectWizardPage_CONNECTID_EXAMPLE);
@@ -128,6 +133,11 @@ final class IRCConnectWizardPage extends WizardPage {
setControl(parent);
}
+ private String getRandomNumber() {
+ Random random = new Random();
+ return String.valueOf(random.nextInt(100000));
+ }
+
String getConnectID() {
String clean = connectText.getText().replaceAll("#",""); //$NON-NLS-1$ //$NON-NLS-2$
connectText.setText(clean);

Back to the top