aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-11-06 19:17:29 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-11-06 19:17:29 +0800
commitbd067766c70820efa311ed1eb63dbbb886263673 (patch)
treebba1b39d8710cc7c71fcb86b5967a4486fd1b6a6
parent7533bdab8b2a03501c4aa95fa259ca5c576f67cc (diff)
downloadgsoc2013-empathy-bd067766c70820efa311ed1eb63dbbb886263673.tar.gz
gsoc2013-empathy-bd067766c70820efa311ed1eb63dbbb886263673.tar.zst
gsoc2013-empathy-bd067766c70820efa311ed1eb63dbbb886263673.zip
Allow to change jabber priority. Fixes bug #493992 (Laurent Bigonville).
2007-11-06 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-account-widget-jabber.glade: * libempathy-gtk/empathy-account-widget-jabber.c: Allow to change jabber priority. Fixes bug #493992 (Laurent Bigonville). svn path=/trunk/; revision=423
-rw-r--r--ChangeLog6
-rw-r--r--libempathy-gtk/empathy-account-widget-jabber.c25
-rw-r--r--libempathy-gtk/empathy-account-widget-jabber.glade115
3 files changed, 107 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index a04e251bf..de09c3750 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-06 Xavier Claessens <xclaesse@gmail.com>
+
+ * libempathy-gtk/empathy-account-widget-jabber.glade:
+ * libempathy-gtk/empathy-account-widget-jabber.c: Allow to change jabber
+ priority. Fixes bug #493992 (Laurent Bigonville).
+
2007-11-04 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/empathy-main-window.c: Display error message when an
diff --git a/libempathy-gtk/empathy-account-widget-jabber.c b/libempathy-gtk/empathy-account-widget-jabber.c
index f17623fad..5e7793cfc 100644
--- a/libempathy-gtk/empathy-account-widget-jabber.c
+++ b/libempathy-gtk/empathy-account-widget-jabber.c
@@ -49,6 +49,7 @@ typedef struct {
GtkWidget *entry_resource;
GtkWidget *entry_server;
GtkWidget *spinbutton_port;
+ GtkWidget *spinbutton_priority;
GtkWidget *checkbutton_ssl;
} EmpathyAccountWidgetJabber;
@@ -147,12 +148,16 @@ static void
account_widget_jabber_value_changed_cb (GtkWidget *spinbutton,
EmpathyAccountWidgetJabber *settings)
{
- if (spinbutton == settings->spinbutton_port) {
- gdouble value;
+ gdouble value;
+
+ value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spinbutton));
- value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spinbutton));
+ if (spinbutton == settings->spinbutton_port) {
mc_account_set_param_int (settings->account, "port", (gint) value);
}
+ else if (spinbutton == settings->spinbutton_priority) {
+ mc_account_set_param_int (settings->account, "priority", (gint) value);
+ }
}
static void
@@ -175,6 +180,7 @@ static void
account_widget_jabber_setup (EmpathyAccountWidgetJabber *settings)
{
gint port = 0;
+ gint priority = 0;
gchar *id = NULL;
gchar *resource = NULL;
gchar *server = NULL;
@@ -182,6 +188,7 @@ account_widget_jabber_setup (EmpathyAccountWidgetJabber *settings)
gboolean old_ssl = FALSE;
mc_account_get_param_int (settings->account, "port", &port);
+ mc_account_get_param_int (settings->account, "priority", &priority);
mc_account_get_param_string (settings->account, "account", &id);
mc_account_get_param_string (settings->account, "resource", &resource);
mc_account_get_param_string (settings->account, "server", &server);
@@ -206,6 +213,7 @@ account_widget_jabber_setup (EmpathyAccountWidgetJabber *settings)
gtk_entry_set_text (GTK_ENTRY (settings->entry_resource), resource ? resource : "");
gtk_entry_set_text (GTK_ENTRY (settings->entry_server), server ? server : "");
gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_port), port);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (settings->spinbutton_priority), priority);
gtk_widget_set_sensitive (settings->button_forget, !G_STR_EMPTY (password));
@@ -222,7 +230,8 @@ empathy_account_widget_jabber_new (McAccount *account)
GladeXML *glade;
GtkSizeGroup *size_group;
GtkWidget *label_id, *label_password;
- GtkWidget *label_server, *label_resource, *label_port;
+ GtkWidget *label_server, *label_resource;
+ GtkWidget *label_port, *label_priority;
settings = g_new0 (EmpathyAccountWidgetJabber, 1);
settings->account = g_object_ref (account);
@@ -235,6 +244,7 @@ empathy_account_widget_jabber_new (McAccount *account)
"label_id", &label_id,
"label_password", &label_password,
"label_resource", &label_resource,
+ "label_priority", &label_priority,
"label_server", &label_server,
"label_port", &label_port,
"entry_id", &settings->entry_id,
@@ -242,6 +252,7 @@ empathy_account_widget_jabber_new (McAccount *account)
"entry_resource", &settings->entry_resource,
"entry_server", &settings->entry_server,
"spinbutton_port", &settings->spinbutton_port,
+ "spinbutton_priority", &settings->spinbutton_priority,
"checkbutton_ssl", &settings->checkbutton_ssl,
NULL);
@@ -253,6 +264,7 @@ empathy_account_widget_jabber_new (McAccount *account)
"button_forget", "clicked", account_widget_jabber_button_forget_clicked_cb,
"entry_password", "changed", account_widget_jabber_entry_changed_cb,
"spinbutton_port", "value-changed", account_widget_jabber_value_changed_cb,
+ "spinbutton_priority", "value-changed", account_widget_jabber_value_changed_cb,
"entry_id", "focus-out-event", account_widget_jabber_entry_focus_cb,
"entry_password", "focus-out-event", account_widget_jabber_entry_focus_cb,
"entry_resource", "focus-out-event", account_widget_jabber_entry_focus_cb,
@@ -270,11 +282,12 @@ empathy_account_widget_jabber_new (McAccount *account)
gtk_size_group_add_widget (size_group, label_resource);
gtk_size_group_add_widget (size_group, label_server);
gtk_size_group_add_widget (size_group, label_port);
+ gtk_size_group_add_widget (size_group, label_priority);
g_object_unref (size_group);
- gtk_editable_select_region (GTK_EDITABLE (settings->entry_id), 0, -1);
- gtk_widget_grab_focus (settings->entry_id);
+ gtk_editable_select_region (GTK_EDITABLE (settings->entry_id), 0, -1);
+ gtk_widget_grab_focus (settings->entry_id);
gtk_widget_show (settings->vbox_settings);
diff --git a/libempathy-gtk/empathy-account-widget-jabber.glade b/libempathy-gtk/empathy-account-widget-jabber.glade
index 8a2af8cca..3d0639daa 100644
--- a/libempathy-gtk/empathy-account-widget-jabber.glade
+++ b/libempathy-gtk/empathy-account-widget-jabber.glade
@@ -181,7 +181,7 @@
<child>
<widget class="GtkTable" id="table_advanced_settings">
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">5</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -238,30 +238,31 @@
</child>
<child>
- <widget class="GtkEntry" id="entry_server">
+ <widget class="GtkCheckButton" id="checkbutton_ssl">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char">*</property>
- <property name="activates_default">False</property>
+ <property name="label" translatable="yes">Use encryption (SS_L)</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label_server">
+ <widget class="GtkLabel" id="label_port">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Server:</property>
+ <property name="label" translatable="yes">_Port:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -271,7 +272,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="mnemonic_widget">entry_server</property>
+ <property name="mnemonic_widget">spinbutton_port</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
@@ -280,8 +281,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@@ -302,16 +303,16 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label_port">
+ <widget class="GtkLabel" id="label_server">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Port:</property>
+ <property name="label" translatable="yes">_Server:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -321,7 +322,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="mnemonic_widget">spinbutton_port</property>
+ <property name="mnemonic_widget">entry_server</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
@@ -338,26 +339,74 @@
</child>
<child>
- <widget class="GtkCheckButton" id="checkbutton_ssl">
+ <widget class="GtkEntry" id="entry_server">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Use encryption (SS_L)</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
+ <property name="activates_default">False</property>
</widget>
<packing>
- <property name="left_attach">0</property>
+ <property name="left_attach">1</property>
<property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label_priority">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Priority:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkSpinButton" id="spinbutton_priority">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
</child>