aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-08 22:59:00 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-08 22:59:00 +0800
commit7cc1dd208fb806d68d472a9f25ed940f81a66280 (patch)
treec164a97fe2f6fa330bd7cf07ee6724e5ac013e2d /libempathy-gtk
parent3faf8e3117364f6b09e73d003830128bb47cf4f5 (diff)
downloadgsoc2013-empathy-7cc1dd208fb806d68d472a9f25ed940f81a66280.tar
gsoc2013-empathy-7cc1dd208fb806d68d472a9f25ed940f81a66280.tar.gz
gsoc2013-empathy-7cc1dd208fb806d68d472a9f25ed940f81a66280.tar.bz2
gsoc2013-empathy-7cc1dd208fb806d68d472a9f25ed940f81a66280.tar.lz
gsoc2013-empathy-7cc1dd208fb806d68d472a9f25ed940f81a66280.tar.xz
gsoc2013-empathy-7cc1dd208fb806d68d472a9f25ed940f81a66280.tar.zst
gsoc2013-empathy-7cc1dd208fb806d68d472a9f25ed940f81a66280.zip
Add an advanced expander in the generic setting widget. Fixes bug #466521 (Marco Barisione).
svn path=/trunk/; revision=706
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/Makefile.am1
-rw-r--r--libempathy-gtk/empathy-account-widget-generic.glade89
-rw-r--r--libempathy-gtk/empathy-account-widget.c44
3 files changed, 117 insertions, 17 deletions
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index 5134e74b0..88e10794d 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -127,6 +127,7 @@ glade_DATA = \
empathy-preferences.glade \
empathy-presence-chooser.glade \
empathy-accounts-dialog.glade \
+ empathy-account-widget-generic.glade \
empathy-account-widget-jabber.glade \
empathy-account-widget-msn.glade \
empathy-account-widget-salut.glade \
diff --git a/libempathy-gtk/empathy-account-widget-generic.glade b/libempathy-gtk/empathy-account-widget-generic.glade
new file mode 100644
index 000000000..5278e0a2b
--- /dev/null
+++ b/libempathy-gtk/empathy-account-widget-generic.glade
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+ <widget class="GtkWindow" id="account_generic_settings">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">generic account settings</property>
+ <property name="resizable">False</property>
+ <child>
+ <widget class="GtkVBox" id="vbox_generic_settings">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkTable" id="table_common_settings">
+ <property name="visible">True</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkExpander" id="expander1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="resize_mode">GTK_RESIZE_QUEUE</property>
+ <child>
+ <widget class="GtkTable" id="table_advanced_settings">
+ <property name="visible">True</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Advanced&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 81095a463..a8373cb66 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -239,12 +239,12 @@ account_widget_generic_format_param_name (const gchar *param_name)
static void
accounts_widget_generic_setup (McAccount *account,
- GtkWidget *table_settings)
+ GtkWidget *table_common_settings,
+ GtkWidget *table_advanced_settings)
{
McProtocol *protocol;
McProfile *profile;
GSList *params, *l;
- guint n_rows = 0;
profile = mc_account_get_profile (account);
protocol = mc_profile_get_protocol (profile);
@@ -263,11 +263,19 @@ accounts_widget_generic_setup (McAccount *account,
for (l = params; l; l = l->next) {
McProtocolParam *param;
+ GtkWidget *table_settings;
+ guint n_rows = 0;
GtkWidget *widget = NULL;
gchar *param_name_formatted;
param = l->data;
+ if (param->flags & MC_PROTOCOL_PARAM_REQUIRED) {
+ table_settings = table_common_settings;
+ } else {
+ table_settings = table_advanced_settings;
+ }
param_name_formatted = account_widget_generic_format_param_name (param->name);
+ g_object_get (table_settings, "n-rows", &n_rows, NULL);
gtk_table_resize (GTK_TABLE (table_settings), ++n_rows, 2);
if (param->signature[0] == 's') {
@@ -434,26 +442,28 @@ empathy_account_widget_add_forget_button (McAccount *account,
GtkWidget *
empathy_account_widget_generic_new (McAccount *account)
{
- GtkWidget *table_settings;
- GtkWidget *sw;
+ GladeXML *glade;
+ GtkWidget *widget;
+ GtkWidget *table_common_settings;
+ GtkWidget *table_advanced_settings;
g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
- table_settings = gtk_table_new (0, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (table_settings), 6);
- gtk_table_set_col_spacings (GTK_TABLE (table_settings), 6);
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw),
- table_settings);
-
- accounts_widget_generic_setup (account, table_settings);
+ glade = empathy_glade_get_file ("empathy-account-widget-generic.glade",
+ "vbox_generic_settings",
+ NULL,
+ "vbox_generic_settings", &widget,
+ "table_common_settings", &table_common_settings,
+ "table_advanced_settings", &table_advanced_settings,
+ NULL);
+
+ accounts_widget_generic_setup (account, table_common_settings, table_advanced_settings);
- gtk_widget_show_all (sw);
+ g_object_unref (glade);
- return sw;
+ gtk_widget_show_all (widget);
+
+ return widget;
}
GtkWidget *