From 6ad8cdf6622aa204b4f7cef2f44433637099f175 Mon Sep 17 00:00:00 2001 From: Rob Sharp Date: Tue, 19 Jul 2011 09:03:42 +0100 Subject: Add an advanced section to the IRC configuration page -Move the Real Name and Quit Message to the advanced section -Add a new Username field to the advanced section https://bugzilla.gnome.org/show_bug.cgi?id=654552 --- libempathy-gtk/empathy-account-widget-irc.c | 1 + libempathy-gtk/empathy-account-widget-irc.ui | 259 ++++++++++++++++++--------- 2 files changed, 180 insertions(+), 80 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-account-widget-irc.c b/libempathy-gtk/empathy-account-widget-irc.c index c8a401f17..8c47d661c 100644 --- a/libempathy-gtk/empathy-account-widget-irc.c +++ b/libempathy-gtk/empathy-account-widget-irc.c @@ -176,6 +176,7 @@ empathy_account_widget_irc_build (EmpathyAccountWidget *self, "entry_fullname", "fullname", "entry_password", "password", "entry_quit_message", "quit-message", + "entry_username", "username", NULL); empathy_builder_connect (self->ui_details->gui, settings, diff --git a/libempathy-gtk/empathy-account-widget-irc.ui b/libempathy-gtk/empathy-account-widget-irc.ui index 559e0809b..89af6c847 100644 --- a/libempathy-gtk/empathy-account-widget-irc.ui +++ b/libempathy-gtk/empathy-account-widget-irc.ui @@ -1,4 +1,4 @@ - + @@ -11,9 +11,38 @@ True True - + True 2 + + + True + False + end + + + gtk-close + True + True + True + False + False + True + + + False + False + 0 + + + + + False + True + end + 0 + + True @@ -94,6 +123,8 @@ + False + True 1 @@ -218,34 +249,10 @@ - - 2 - - - - - True - end - - - gtk-close - True - True - True - False - True - - - False - False - 0 - - - False - end - 0 + True + 2 @@ -263,45 +270,6 @@ 2 12 6 - - - True - True - - - 1 - 2 - 4 - 5 - - - - - - True - 0 - Quit message: - - - 4 - 5 - GTK_FILL - - - - - - True - True - - - 1 - 2 - 3 - 4 - - - True @@ -329,19 +297,6 @@ - - - True - 0 - Real name: - - - 3 - 4 - GTK_FILL - - - True @@ -382,11 +337,155 @@ + + + True + True + + + True + False + 3 + 2 + 12 + 6 + + + True + True + False + + True + + + 1 + 2 + 2 + 3 + + + + + + True + False + 0 + Quit message: + + + 2 + 3 + GTK_FILL + + + + + + True + True + + True + + + 1 + 2 + 1 + 2 + + + + + + True + False + 0 + Real name: + True + entry_nick + + + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + Username: + True + + + GTK_FILL + + + + + + True + True + + + + 1 + 2 + + + + + + + + True + False + Advanced + + + + + + + + 2 + 4 + 5 + + + + + + True + True + 0 + 3 + Most IRC servers don't need a password, so if you're not sure, don't enter a password. + True + True + + + + + + 1 + 2 + 3 + 4 + + + + + + + True + True 0 -- cgit v1.2.3 From 98182d81df41790db37ec222e598bfef1cd8d85b Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 19 Jul 2011 08:55:15 +0100 Subject: IRC accounts: make labels the same width. This addresses Nick's concern on https://bugzilla.gnome.org/show_bug.cgi?id=654552 --- libempathy-gtk/empathy-account-widget-irc.ui | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-account-widget-irc.ui b/libempathy-gtk/empathy-account-widget-irc.ui index 89af6c847..20e710aba 100644 --- a/libempathy-gtk/empathy-account-widget-irc.ui +++ b/libempathy-gtk/empathy-account-widget-irc.ui @@ -261,6 +261,16 @@ button_close + + + + + + + + + + True -- cgit v1.2.3 From 926cc3f303b944e46a2398c51a220cde48f9b46d Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 19 Jul 2011 09:15:11 +0100 Subject: =?UTF-8?q?IRC:=20rename=20=E2=80=9Cuser=5Fname=E2=80=9D=20regex?= =?UTF-8?q?=20to=20=E2=80=9Cnick=5Fname=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'account’ parameter in Telepathy, to which this regex applies, is the ‘nickname’ in IRC parlance. (I'm about to add a regex for what IRC calls ‘usernames’.) --- libempathy-gtk/empathy-account-widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index fcc5769a0..46db2ac20 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -172,7 +172,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; /* Based on http://www.ietf.org/rfc/rfc2812.txt (section 2.3.1) */ #define IRC_SPECIAL "_\\[\\]{}\\\\|`^" -#define IRC_USER_NAME "(["ALPHA IRC_SPECIAL"]["ALPHADIGITDASH IRC_SPECIAL"]*)" +#define IRC_NICK_NAME "(["ALPHA IRC_SPECIAL"]["ALPHADIGITDASH IRC_SPECIAL"]*)" /* Based on http://www.ietf.org/rfc/rfc4622.txt (section 2.2) * We just exclude invalid characters to avoid ucschars and other redundant * complexity */ @@ -185,7 +185,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; #define YAHOO_USER_NAME "(["ALPHA"]["ALPHADIGIT"_\\.]{3,31})" #define ACCOUNT_REGEX_ICQ "^"ICQ_USER_NAME"$" -#define ACCOUNT_REGEX_IRC "^"IRC_USER_NAME"$" +#define ACCOUNT_REGEX_IRC "^"IRC_NICK_NAME"$" #define ACCOUNT_REGEX_JABBER "^"JABBER_USER_NAME"@"HOST"$" #define ACCOUNT_REGEX_MSN "^"MSN_USER_NAME"@"HOST"$" #define ACCOUNT_REGEX_YAHOO "^"YAHOO_USER_NAME"$" -- cgit v1.2.3 From 3d3452cab15ac7dcc8dee37edef9faffadded3a1 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 19 Jul 2011 09:22:26 +0100 Subject: IRC: validate 'username' parameter. --- libempathy-gtk/empathy-account-widget.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 46db2ac20..5bdea6aff 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -173,6 +173,15 @@ static guint signals[LAST_SIGNAL] = { 0 }; /* Based on http://www.ietf.org/rfc/rfc2812.txt (section 2.3.1) */ #define IRC_SPECIAL "_\\[\\]{}\\\\|`^" #define IRC_NICK_NAME "(["ALPHA IRC_SPECIAL"]["ALPHADIGITDASH IRC_SPECIAL"]*)" +/* user = 1*( %x01-09 / %x0B-0C / %x0E-1F / %x21-3F / %x41-FF ) + * ; any octet except NUL, CR, LF, " " and "@" + * + * so technically, like so many other places in IRC, we should be using arrays + * of bytes here rather than UTF-8 strings. Life: too short. In practice this + * will always be ASCII. + */ +#define IRC_USER_NAME "([^\r\n@ ])+" + /* Based on http://www.ietf.org/rfc/rfc4622.txt (section 2.2) * We just exclude invalid characters to avoid ucschars and other redundant * complexity */ @@ -186,6 +195,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; #define ACCOUNT_REGEX_ICQ "^"ICQ_USER_NAME"$" #define ACCOUNT_REGEX_IRC "^"IRC_NICK_NAME"$" +#define USERNAME_REGEX_IRC "^"IRC_USER_NAME"$" #define ACCOUNT_REGEX_JABBER "^"JABBER_USER_NAME"@"HOST"$" #define ACCOUNT_REGEX_MSN "^"MSN_USER_NAME"@"HOST"$" #define ACCOUNT_REGEX_YAHOO "^"YAHOO_USER_NAME"$" @@ -1227,6 +1237,8 @@ account_widget_build_irc (EmpathyAccountWidget *self, empathy_account_settings_set_regex (priv->settings, "account", ACCOUNT_REGEX_IRC); + empathy_account_settings_set_regex (priv->settings, "username", + USERNAME_REGEX_IRC); if (priv->simple) { -- cgit v1.2.3 From bed17cf9d003db8ecea2fc012cb53ff38554654d Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 19 Jul 2011 13:09:49 +0100 Subject: IRC accounts: top-justify the password hint. As mentioned on , this makes the password hint text be right up against the field it's hinting about, at the cost of even more ugly space between it and the Advanced expander. I think this is the lesser of two evils. --- libempathy-gtk/empathy-account-widget-irc.ui | 1 + 1 file changed, 1 insertion(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-account-widget-irc.ui b/libempathy-gtk/empathy-account-widget-irc.ui index 20e710aba..b63001835 100644 --- a/libempathy-gtk/empathy-account-widget-irc.ui +++ b/libempathy-gtk/empathy-account-widget-irc.ui @@ -470,6 +470,7 @@ True True 0 + 0 3 Most IRC servers don't need a password, so if you're not sure, don't enter a password. True -- cgit v1.2.3