diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-07-25 19:43:10 +0800 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-07-25 19:43:59 +0800 |
commit | d9bb5b999731c247b845ba7e97393d2e25bcfeca (patch) | |
tree | b6645899df652e284970e67f25c881dc70ad1bef | |
parent | dcd8d507b617e5b8fb6cea5a23d61d922bcca3ba (diff) | |
parent | bed17cf9d003db8ecea2fc012cb53ff38554654d (diff) | |
download | gsoc2013-empathy-d9bb5b999731c247b845ba7e97393d2e25bcfeca.tar gsoc2013-empathy-d9bb5b999731c247b845ba7e97393d2e25bcfeca.tar.gz gsoc2013-empathy-d9bb5b999731c247b845ba7e97393d2e25bcfeca.tar.bz2 gsoc2013-empathy-d9bb5b999731c247b845ba7e97393d2e25bcfeca.tar.lz gsoc2013-empathy-d9bb5b999731c247b845ba7e97393d2e25bcfeca.tar.xz gsoc2013-empathy-d9bb5b999731c247b845ba7e97393d2e25bcfeca.tar.zst gsoc2013-empathy-d9bb5b999731c247b845ba7e97393d2e25bcfeca.zip |
Merge branch 'irc-dialog'
Fixes: <https://bugzilla.gnome.org/show_bug.cgi?id=654552>
Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
-rw-r--r-- | libempathy-gtk/empathy-account-widget-irc.c | 1 | ||||
-rw-r--r-- | libempathy-gtk/empathy-account-widget-irc.ui | 270 | ||||
-rw-r--r-- | libempathy-gtk/empathy-account-widget.c | 16 |
3 files changed, 205 insertions, 82 deletions
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..b63001835 100644 --- a/libempathy-gtk/empathy-account-widget-irc.ui +++ b/libempathy-gtk/empathy-account-widget-irc.ui @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy toplevel-contextual --> @@ -11,9 +11,38 @@ <property name="skip_taskbar_hint">True</property> <property name="skip_pager_hint">True</property> <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox10"> + <object class="GtkBox" id="dialog-vbox10"> <property name="visible">True</property> <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="button_close"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> <child> <object class="GtkFrame" id="frame14"> <property name="visible">True</property> @@ -94,6 +123,8 @@ </child> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> @@ -219,33 +250,9 @@ </child> </object> <packing> - <property name="position">2</property> - </packing> - </child> - <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area10"> - <property name="visible">True</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="button_close"> - <property name="label">gtk-close</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> <property name="expand">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> + <property name="fill">True</property> + <property name="position">2</property> </packing> </child> </object> @@ -254,6 +261,16 @@ <action-widget response="-7">button_close</action-widget> </action-widgets> </object> + <object class="GtkSizeGroup" id="sg_field_labels"> + <widgets> + <widget name="label_network2"/> + <widget name="label_nick"/> + <widget name="label_password"/> + <widget name="label_username"/> + <widget name="label_fullname"/> + <widget name="label_quit_message"/> + </widgets> + </object> <object class="GtkVBox" id="vbox_irc"> <property name="visible">True</property> <child> @@ -264,45 +281,6 @@ <property name="column_spacing">12</property> <property name="row_spacing">6</property> <child> - <object class="GtkEntry" id="entry_quit_message"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label_quit_message"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Quit message:</property> - </object> - <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="entry_fullname"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="y_options"></property> - </packing> - </child> - <child> <object class="GtkEntry" id="entry_password"> <property name="visible">True</property> <property name="can_focus">True</property> @@ -330,19 +308,6 @@ </packing> </child> <child> - <object class="GtkLabel" id="label_fullname"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Real name:</property> - </object> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> <object class="GtkEntry" id="entry_nick"> <property name="visible">True</property> <property name="can_focus">True</property> @@ -383,10 +348,155 @@ </packing> </child> <child> + <object class="GtkExpander" id="expander_advanced"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkTable" id="table_irc_settings1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="n_rows">3</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkEntry" id="entry_quit_message"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="visibility">False</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_quit_message"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Quit message:</property> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_fullname"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_fullname"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Real name:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry_nick</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_username"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Username:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_username"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label_advanced"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Advanced</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_password_note"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">3</property> + <property name="label" translatable="yes">Most IRC servers don't need a password, so if you're not sure, don't enter a password.</property> + <property name="use_markup">True</property> + <property name="wrap">True</property> + <attributes> + <attribute name="scale" value="0.80000000000000004"/> + </attributes> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> <placeholder/> </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index fcc5769a0..5bdea6aff 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -172,7 +172,16 @@ 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"]*)" +/* 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 */ @@ -185,7 +194,8 @@ 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 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) { |