diff options
Diffstat (limited to 'libempathy-gtk')
40 files changed, 1341 insertions, 1574 deletions
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am index 31e0ec8cc..cac2fe6f1 100644 --- a/libempathy-gtk/Makefile.am +++ b/libempathy-gtk/Makefile.am @@ -19,9 +19,6 @@ AM_CPPFLAGS = \ $(DISABLE_DEPRECATED) BUILT_SOURCES = \ - empathy-gtk-marshal.h \ - empathy-gtk-marshal.c \ - empathy-gtk-marshal.list \ empathy-gtk-enum-types.h \ empathy-gtk-enum-types.c @@ -52,7 +49,6 @@ libempathy_gtk_handwritten_source = \ empathy-linking-dialog.c \ empathy-live-search.c \ empathy-contact-search-dialog.c \ - empathy-contact-selector.c \ empathy-contact-selector-dialog.c \ empathy-contact-widget.c \ empathy-geometry.c \ @@ -119,7 +115,6 @@ libempathy_gtk_headers = \ empathy-linking-dialog.h \ empathy-live-search.h \ empathy-contact-search-dialog.h \ - empathy-contact-selector.h \ empathy-contact-selector-dialog.h \ empathy-contact-widget.h \ empathy-geometry.h \ @@ -216,24 +211,6 @@ ui_DATA = \ empathy-search-bar.ui \ empathy-individual-widget.ui -empathy-gtk-marshal.list: $(libempathy_gtk_la_SOURCES) Makefile.am - $(AM_V_GEN)( cd $(srcdir) && \ - sed -n -e 's/.*empathy_gtk_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \ - $(libempathy_gtk_la_SOURCES) ) \ - | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp - @if cmp -s $@.tmp $@; then \ - rm $@.tmp; \ - else \ - mv $@.tmp $@; \ - fi - -%-marshal.h: %-marshal.list Makefile - $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h - -%-marshal.c: %-marshal.list Makefile - $(AM_V_GEN)echo "#include \"empathy-gtk-marshal.h\"" > $@ && \ - $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c - empathy-gtk-enum-types.h: stamp-empathy-gtk-enum-types.h $(AM_V_GEN)true stamp-empathy-gtk-enum-types.h: Makefile $(libempathy_gtk_headers) diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c index cb9028c31..863992871 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -205,7 +205,7 @@ empathy_account_chooser_class_init (EmpathyAccountChooserClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, + g_cclosure_marshal_generic, G_TYPE_NONE, 0); @@ -428,6 +428,7 @@ empathy_account_chooser_set_account (EmpathyAccountChooser *chooser, data.chooser = chooser; data.account = account; + data.set = FALSE; gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc) account_chooser_set_account_foreach, @@ -569,7 +570,7 @@ account_manager_prepared_cb (GObject *source_object, EmpathyAccountChooserPriv *priv = GET_PRIV (chooser); GError *error = NULL; - if (!tp_account_manager_prepare_finish (manager, result, &error)) { + if (!tp_proxy_prepare_finish (manager, result, &error)) { DEBUG ("Failed to prepare account manager: %s", error->message); g_error_free (error); return; @@ -685,7 +686,7 @@ account_chooser_setup (EmpathyAccountChooser *chooser) NULL); /* Populate accounts */ - tp_account_manager_prepare_async (priv->manager, NULL, + tp_proxy_prepare_async (priv->manager, NULL, account_manager_prepared_cb, chooser); g_object_unref (store); diff --git a/libempathy-gtk/empathy-account-widget-irc.c b/libempathy-gtk/empathy-account-widget-irc.c index 8c47d661c..d7282b198 100644 --- a/libempathy-gtk/empathy-account-widget-irc.c +++ b/libempathy-gtk/empathy-account-widget-irc.c @@ -164,8 +164,8 @@ empathy_account_widget_irc_build (EmpathyAccountWidget *self, g_signal_connect (settings->network_chooser, "changed", G_CALLBACK (network_changed_cb), settings); - gtk_table_attach (GTK_TABLE (*table_common_settings), - settings->network_chooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_grid_attach (GTK_GRID (*table_common_settings), + settings->network_chooser, 1, 0, 1, 1); gtk_widget_show (settings->network_chooser); diff --git a/libempathy-gtk/empathy-account-widget-irc.ui b/libempathy-gtk/empathy-account-widget-irc.ui index 8e08a9d68..3e12c90d9 100644 --- a/libempathy-gtk/empathy-account-widget-irc.ui +++ b/libempathy-gtk/empathy-account-widget-irc.ui @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.16"/> - <!-- interface-naming-policy toplevel-contextual --> <object class="GtkDialog" id="irc_network_dialog"> + <property name="can_focus">False</property> <property name="border_width">5</property> <property name="title" translatable="yes">Network</property> <property name="window_position">center-on-parent</property> @@ -13,6 +13,7 @@ <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox10"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area10"> @@ -46,16 +47,19 @@ <child> <object class="GtkFrame" id="frame14"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label_xalign">0</property> <property name="shadow_type">none</property> <child> <object class="GtkAlignment" id="alignment28"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="top_padding">6</property> <property name="left_padding">12</property> <child> <object class="GtkTable" id="table14"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">2</property> <property name="n_columns">2</property> <property name="column_spacing">12</property> @@ -63,6 +67,7 @@ <child> <object class="GtkLabel" id="label_network"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Network:</property> </object> @@ -74,6 +79,7 @@ <child> <object class="GtkLabel" id="label_charset"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Character set:</property> </object> @@ -98,6 +104,7 @@ <child> <object class="GtkComboBox" id="combobox_charset"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="left_attach">1</property> @@ -115,6 +122,7 @@ <child type="label"> <object class="GtkLabel" id="label_network1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Network</property> <attributes> <attribute name="weight" value="bold"/> @@ -131,16 +139,19 @@ <child> <object class="GtkFrame" id="frame15"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label_xalign">0</property> <property name="shadow_type">none</property> <child> <object class="GtkAlignment" id="alignment29"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="top_padding">6</property> <property name="left_padding">12</property> <child> <object class="GtkTable" id="table15"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_columns">2</property> <property name="column_spacing">6</property> <property name="row_spacing">6</property> @@ -149,13 +160,15 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">never</property> - <property name="vscrollbar_policy">automatic</property> <property name="shadow_type">in</property> <child> <object class="GtkTreeView" id="treeview_servers"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="enable_search">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> </object> </child> </object> @@ -166,6 +179,7 @@ <child> <object class="GtkVButtonBox" id="vbuttonbox1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <property name="layout_style">start</property> <child> @@ -175,6 +189,7 @@ <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> @@ -190,6 +205,7 @@ <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> @@ -205,6 +221,7 @@ <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> @@ -220,6 +237,7 @@ <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> @@ -242,6 +260,7 @@ <child type="label"> <object class="GtkLabel" id="label_servers"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Servers</property> <attributes> <attribute name="weight" value="bold"/> @@ -261,25 +280,15 @@ <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> + <property name="can_focus">False</property> <child> - <object class="GtkTable" id="table_irc_settings"> + <object class="GtkGrid" id="table_irc_settings"> <property name="visible">True</property> - <property name="n_rows">5</property> - <property name="n_columns">2</property> - <property name="column_spacing">12</property> + <property name="can_focus">False</property> <property name="row_spacing">6</property> + <property name="column_spacing">12</property> <child> <object class="GtkEntry" id="entry_password"> <property name="visible">True</property> @@ -288,231 +297,239 @@ </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> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> - <object class="GtkLabel" id="label_password"> + <object class="GtkEntry" id="entry_nick"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Password:</property> + <property name="can_focus">True</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> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> - <object class="GtkEntry" id="entry_nick"> + <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">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_network2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Network:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> <object class="GtkLabel" id="label_nick"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Nickname:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">entry_nick</property> </object> <packing> + <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> - <object class="GtkLabel" id="label_network2"> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <object class="GtkLabel" id="label_password"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Network:</property> - <property name="use_underline">True</property> + <property name="label" translatable="yes">Password:</property> </object> <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkExpander" id="expander_advanced"> + <property name="visible">True</property> + <property name="can_focus">True</property> <child> - <object class="GtkExpander" id="expander_advanced"> + <object class="GtkTable" id="table_irc_settings1"> <property name="visible">True</property> - <property name="can_focus">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="invisible_char">•</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="GtkTable" id="table_irc_settings1"> + <object class="GtkLabel" id="label_quit_message"> <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> - </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> + <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 type="label"> - <object class="GtkLabel" id="label_advanced"> + <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="label" translatable="yes">Advanced</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> + <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> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> </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"> + <child type="label"> + <object class="GtkLabel" id="label_advanced"> <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> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Advanced</property> <attributes> - <attribute name="scale" value="0.80000000000000004"/> + <attribute name="weight" value="bold"/> </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> + <property name="position">1</property> </packing> </child> </object> <object class="GtkVBox" id="vbox_irc_simple"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <object class="GtkLabel" id="label_network_simple"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Which IRC network?</property> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkAlignment" id="alignment_network_simple"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0</property> <property name="xscale">0.34999999403953552</property> @@ -525,22 +542,28 @@ </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> <child> <object class="GtkLabel" id="label_nick_simple"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">What is your IRC nickname?</property> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">2</property> </packing> </child> <child> <object class="GtkAlignment" id="alignment_nick_simple"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0</property> <property name="xscale">0.34999999403953552</property> @@ -552,13 +575,25 @@ <object class="GtkEntry" id="entry_nick_simple"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="invisible_char">•</property> + <property name="invisible_char">•</property> </object> </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">3</property> </packing> </child> </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> </interface> diff --git a/libempathy-gtk/empathy-account-widget-jabber.ui b/libempathy-gtk/empathy-account-widget-jabber.ui index b50c496e7..c8aa1d494 100644 --- a/libempathy-gtk/empathy-account-widget-jabber.ui +++ b/libempathy-gtk/empathy-account-widget-jabber.ui @@ -1,7 +1,6 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.16"/> - <!-- interface-naming-policy toplevel-contextual --> <object class="GtkAdjustment" id="adjustment1"> <property name="lower">-128</property> <property name="upper">127</property> @@ -9,106 +8,305 @@ <property name="page_increment">10</property> </object> <object class="GtkAdjustment" id="adjustment2"> - <property name="value">5222</property> <property name="upper">65555</property> + <property name="value">5222</property> <property name="step_increment">1</property> <property name="page_increment">10</property> </object> - <object class="GtkVBox" id="vbox_jabber_settings"> + <object class="GtkVBox" id="vbox_fb_simple"> <property name="visible">True</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> + <property name="can_focus">False</property> <child> - <object class="GtkTable" id="table_common_settings"> + <object class="GtkLabel" id="label_id_fb_simple"> <property name="visible">True</property> - <property name="n_rows">4</property> - <property name="n_columns">2</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">What is your Facebook username?</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">12</property> <child> - <object class="GtkEntry" id="entry_password"> + <object class="GtkEntry" id="entry_id_fb_simple"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="visibility">False</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="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkEntry" id="entry_id"> + <object class="GtkLabel" id="label_fb_example"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_top">4</property> + <property name="xalign">0.10000000149011612</property> + <property name="label" translatable="yes">This is your username, not your normal Facebook login. +If you are facebook.com/<b>badger</b>, enter <b>badger</b>. +Use <a href="http://www.facebook.com/username/">this page</a> to choose a Facebook username if you don't have one.</property> + <property name="use_markup">True</property> + <attributes> + <attribute name="scale" value="0.80000000000000004"/> + </attributes> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_password_fb_simple"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="ypad">6</property> + <property name="label" translatable="yes">What is your Facebook password?</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_password_fb_simple"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">12</property> + <property name="visibility">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="remember_password_fb_simple"> + <property name="label" translatable="yes">Remember Password</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + </object> + <object class="GtkVBox" id="vbox_gtalk_simple"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="label_id_g_simple"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">What is your Google ID?</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="vbox1b"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">12</property> + <property name="spacing">4</property> + <child> + <object class="GtkEntry" id="entry_id_g_simple"> <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="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkLabel" id="label_id"> + <object class="GtkLabel" id="label_g_example"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Login I_D:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">entry_id</property> + <property name="can_focus">False</property> + <property name="xalign">0.10000000149011612</property> + <property name="label" translatable="yes"><b>Example:</b> user@gmail.com</property> + <property name="use_markup">True</property> + <attributes> + <attribute name="scale" value="0.80000000000000004"/> + </attributes> </object> <packing> - <property name="x_options">GTK_FILL</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_password_g_simple"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="ypad">6</property> + <property name="label" translatable="yes">What is your Google password?</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_password_g_simple"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">12</property> + <property name="visibility">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="remember_password_g_simple"> + <property name="label" translatable="yes">Remember Password</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + </object> + <object class="GtkVBox" id="vbox_jabber_settings"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">6</property> + <child> + <object class="GtkGrid" id="table_common_settings"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> <child> - <object class="GtkLabel" id="label_password"> + <object class="GtkEntry" id="entry_password"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Pass_word:</property> - <property name="use_underline">True</property> - <property name="justify">right</property> - <property name="mnemonic_widget">entry_password</property> + <property name="can_focus">True</property> + <property name="valign">start</property> + <property name="hexpand">True</property> + <property name="visibility">False</property> </object> <packing> + <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_id"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> - <object class="GtkVBox" id="vbox1"> + <object class="GtkGrid" id="vbox1"> <property name="visible">True</property> - <property name="orientation">vertical</property> + <property name="can_focus">False</property> + <property name="valign">start</property> <child> <object class="GtkLabel" id="label_username_example"> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="hexpand">True</property> <property name="xalign">0</property> <property name="xpad">3</property> <property name="label" translatable="yes"><b>Example:</b> user@jabber.org</property> <property name="use_markup">True</property> <attributes> - <attribute name="scale" value="0.800000"/> + <attribute name="scale" value="0.80000000000000004"/> </attributes> </object> <packing> - <property name="position">0</property> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> <object class="GtkLabel" id="label_username_g_example"> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="hexpand">True</property> <property name="xalign">0</property> <property name="xpad">3</property> <property name="label" translatable="yes"><b>Example:</b> user@gmail.com</property> <property name="use_markup">True</property> <attributes> - <attribute name="scale" value="0.800000"/> + <attribute name="scale" value="0.80000000000000004"/> </attributes> </object> <packing> - <property name="position">1</property> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> <object class="GtkLabel" id="label_username_f_example"> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="hexpand">True</property> <property name="xalign">0</property> <property name="xpad">3</property> <property name="label" translatable="yes" comments="This string is not wrapped in the dialog so you may have to add some '\n' to make it look nice.">This is your username, not your normal Facebook login. @@ -117,19 +315,22 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <property name="use_markup">True</property> <property name="wrap">True</property> <attributes> - <attribute name="scale" value="0.800000"/> + <attribute name="scale" value="0.80000000000000004"/> </attributes> </object> <packing> - <property name="position">2</property> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> </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="width">1</property> + <property name="height">1</property> </packing> </child> <child> @@ -138,21 +339,50 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="hexpand">True</property> + <property name="use_action_appearance">False</property> <property name="active">True</property> <property name="draw_indicator">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="width">1</property> + <property name="height">1</property> </packing> </child> <child> - <placeholder/> + <object class="GtkLabel" id="label_id"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Login I_D:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry_id</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> </child> <child> - <placeholder/> + <object class="GtkLabel" id="label_password"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Pass_word:</property> + <property name="use_underline">True</property> + <property name="justify">right</property> + <property name="mnemonic_widget">entry_password</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> </child> </object> <packing> @@ -170,20 +400,20 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">never</property> - <property name="vscrollbar_policy">automatic</property> <child> <object class="GtkViewport" id="viewport1"> <property name="visible">True</property> - <property name="resize_mode">queue</property> + <property name="can_focus">False</property> <property name="shadow_type">none</property> <child> <object class="GtkVBox" id="vbox_advanced"> <property name="visible">True</property> - <property name="orientation">vertical</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkTable" id="table_advanced_settings"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">4</property> <property name="n_columns">3</property> <property name="column_spacing">12</property> @@ -222,7 +452,9 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> + <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> <packing> @@ -236,6 +468,7 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <child> <object class="GtkLabel" id="label_priority"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Priori_ty:</property> <property name="use_underline">True</property> @@ -251,6 +484,7 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <child> <object class="GtkLabel" id="label_resource"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Reso_urce:</property> <property name="use_underline">True</property> @@ -269,7 +503,9 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> + <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> <packing> @@ -280,105 +516,109 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho </child> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkFrame" id="frame1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label_xalign">0</property> <property name="shadow_type">none</property> <child> - <object class="GtkAlignment" id="alignment_server_settings"> + <object class="GtkTable" id="table1"> <property name="visible">True</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> + <property name="can_focus">False</property> + <property name="margin_left">12</property> + <property name="n_rows">3</property> + <property name="n_columns">2</property> + <property name="column_spacing">6</property> + <property name="row_spacing">6</property> <child> - <object class="GtkTable" id="table1"> + <object class="GtkSpinButton" id="spinbutton_port"> <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">2</property> - <property name="column_spacing">6</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkSpinButton" id="spinbutton_port"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">adjustment2</property> - <property name="climb_rate">1</property> - <property name="numeric">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="GtkEntry" id="entry_server"> - <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="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="checkbutton_ssl"> - <property name="label" translatable="yes">Use old SS_L</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="right_attach">2</property> - <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="GtkLabel" id="label_port"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_Port:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">spinbutton_port</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_server"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_Server:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">entry_server</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> + <property name="can_focus">True</property> + <property name="adjustment">adjustment2</property> + <property name="climb_rate">1</property> + <property name="numeric">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="GtkEntry" id="entry_server"> + <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="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton_ssl"> + <property name="label" translatable="yes">Use old SS_L</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="right_attach">2</property> + <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="GtkLabel" id="label_port"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Port:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">spinbutton_port</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_server"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Server:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry_server</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> </child> </object> </child> <child type="label"> <object class="GtkLabel" id="label2"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> <property name="label" translatable="yes">Override server settings</property> <attributes> <attribute name="weight" value="bold"/> @@ -387,6 +627,8 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> @@ -399,6 +641,7 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <child type="label"> <object class="GtkLabel" id="label1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Advanced</property> <attributes> <attribute name="weight" value="bold"/> @@ -407,115 +650,118 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> <object class="GtkVBox" id="vbox_jabber_simple"> <property name="visible">True</property> - <property name="orientation">vertical</property> + <property name="can_focus">False</property> <child> <object class="GtkLabel" id="label_id_simple"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">What is your Jabber ID?</property> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkLabel" id="label_id_create"> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">What is your desired Jabber ID?</property> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> <child> - <object class="GtkAlignment" id="alignment_simple_jabber_id"> + <object class="GtkVBox" id="vbox1a"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xscale">0.34999999403953552</property> - <property name="yscale">0.34999999403953552</property> - <property name="top_padding">6</property> - <property name="bottom_padding">3</property> - <property name="left_padding">12</property> + <property name="can_focus">False</property> + <property name="margin_left">12</property> + <property name="spacing">4</property> <child> - <object class="GtkVBox" id="vbox1a"> + <object class="GtkEntry" id="entry_id_simple"> <property name="visible">True</property> - <property name="orientation">vertical</property> - <property name="spacing">4</property> - <child> - <object class="GtkEntry" id="entry_id_simple"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label_example"> - <property name="visible">True</property> - <property name="xalign">0.10000000149011612</property> - <property name="label" translatable="yes"><b>Example:</b> user@jabber.org</property> - <property name="use_markup">True</property> - <attributes> - <attribute name="scale" value="0.800000"/> - </attributes> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> + <property name="can_focus">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_example"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0.10000000149011612</property> + <property name="label" translatable="yes"><b>Example:</b> user@jabber.org</property> + <property name="use_markup">True</property> + <attributes> + <attribute name="scale" value="0.80000000000000004"/> + </attributes> </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">2</property> </packing> </child> <child> <object class="GtkLabel" id="label_password_simple"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="ypad">6</property> <property name="label" translatable="yes">What is your Jabber password?</property> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">3</property> </packing> </child> <child> <object class="GtkLabel" id="label_password_create"> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="ypad">6</property> <property name="label" translatable="yes">What is your desired Jabber password?</property> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">4</property> </packing> </child> <child> - <object class="GtkAlignment" id="alignment2"> + <object class="GtkEntry" id="entry_password_simple"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xscale">0.34999999403953552</property> - <property name="yscale">0.5</property> - <property name="left_padding">12</property> - <child> - <object class="GtkEntry" id="entry_password_simple"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="visibility">False</property> - </object> - </child> + <property name="can_focus">True</property> + <property name="margin_left">12</property> + <property name="visibility">False</property> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">5</property> </packing> </child> @@ -525,220 +771,15 @@ Use <a href="http://www.facebook.com/username/">this page</a> to cho <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="active">True</property> <property name="draw_indicator">True</property> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">6</property> </packing> </child> </object> - <object class="GtkVBox" id="vbox_gtalk_simple"> - <property name="visible">True</property> - <property name="orientation">vertical</property> - <child> - <object class="GtkLabel" id="label_id_g_simple"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">What is your Google ID?</property> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment_simple_gtalk_id"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xscale">0.34999999403953552</property> - <property name="yscale">0.34999999403953552</property> - <property name="top_padding">6</property> - <property name="bottom_padding">3</property> - <property name="left_padding">12</property> - <child> - <object class="GtkVBox" id="vbox1b"> - <property name="visible">True</property> - <property name="orientation">vertical</property> - <property name="spacing">4</property> - <child> - <object class="GtkEntry" id="entry_id_g_simple"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label_g_example"> - <property name="visible">True</property> - <property name="xalign">0.10000000149011612</property> - <property name="label" translatable="yes"><b>Example:</b> user@gmail.com</property> - <property name="use_markup">True</property> - <attributes> - <attribute name="scale" value="0.800000"/> - </attributes> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label_password_g_simple"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="ypad">6</property> - <property name="label" translatable="yes">What is your Google password?</property> - </object> - <packing> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment2a"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xscale">0.34999999403953552</property> - <property name="yscale">0.5</property> - <property name="left_padding">12</property> - <child> - <object class="GtkEntry" id="entry_password_g_simple"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="visibility">False</property> - </object> - </child> - </object> - <packing> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="remember_password_g_simple"> - <property name="label" translatable="yes">Remember Password</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="position">4</property> - </packing> - </child> - </object> - <object class="GtkVBox" id="vbox_fb_simple"> - <property name="visible">True</property> - <property name="orientation">vertical</property> - <child> - <object class="GtkLabel" id="label_id_fb_simple"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">What is your Facebook username?</property> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment_simple_fb_id"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xscale">0.34999999403953552</property> - <property name="yscale">0.34999999403953552</property> - <property name="top_padding">6</property> - <property name="bottom_padding">3</property> - <property name="left_padding">12</property> - <child> - <object class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="orientation">vertical</property> - <property name="spacing">4</property> - <child> - <object class="GtkEntry" id="entry_id_fb_simple"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label_fb_example"> - <property name="visible">True</property> - <property name="xalign">0.10000000149011612</property> - <property name="label" translatable="yes">This is your username, not your normal Facebook login. -If you are facebook.com/<b>badger</b>, enter <b>badger</b>. -Use <a href="http://www.facebook.com/username/">this page</a> to choose a Facebook username if you don't have one.</property> - <property name="use_markup">True</property> - <attributes> - <attribute name="scale" value="0.800000"/> - </attributes> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label_password_fb_simple"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="ypad">6</property> - <property name="label" translatable="yes">What is your Facebook password?</property> - </object> - <packing> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment3"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xscale">0.34999999403953552</property> - <property name="yscale">0.5</property> - <property name="left_padding">12</property> - <child> - <object class="GtkEntry" id="entry_password_fb_simple"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="visibility">False</property> - </object> - </child> - </object> - <packing> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="remember_password_fb_simple"> - <property name="label" translatable="yes">Remember Password</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="position">4</property> - </packing> - </child> - </object> </interface> diff --git a/libempathy-gtk/empathy-account-widget-sip.ui b/libempathy-gtk/empathy-account-widget-sip.ui index 488becaf1..5928d6077 100644 --- a/libempathy-gtk/empathy-account-widget-sip.ui +++ b/libempathy-gtk/empathy-account-widget-sip.ui @@ -125,11 +125,11 @@ <child> <object class="GtkCheckButton" id="checkbutton_tel"> <property name="label" translatable="yes">Use this account to call _landlines and mobile phones</property> - <property name="use_underline">True</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> @@ -137,6 +137,7 @@ <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> diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 8df91745d..f3a2a66ad 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -1098,6 +1098,30 @@ static void account_widget_launch_external_clicked (GtkWidget *button, TpAccount *account) { + GdkAppLaunchContext *context = NULL; + GdkDisplay *display; + GAppInfo *app_info; + GError *error = NULL; + + app_info = g_object_get_data (G_OBJECT (button), "app-info"); + + g_return_if_fail (G_IS_APP_INFO (app_info)); + + display = gdk_display_get_default (); + context = gdk_display_get_app_launch_context (display); + + if (!g_app_info_launch (app_info, NULL, (GAppLaunchContext *) context, + &error)) + { + g_critical ("Failed to bisho: %s", error->message); + g_clear_error (&error); + } +} + +static void +account_widget_launch_external_clicked_meego (GtkWidget *button, + TpAccount *account) +{ if (!tp_strdiff (tp_account_get_storage_provider (account), "com.meego.libsocialweb")) { @@ -1155,17 +1179,35 @@ account_widget_build_external (EmpathyAccountWidget *self, TpAccount *account = empathy_account_settings_get_account (settings); GtkWidget *bar, *widget; gchar *str; + const gchar *provider, *name = NULL; + GDesktopAppInfo *desktop_info = NULL; self->ui_details->widget = gtk_vbox_new (FALSE, 6); priv->table_common_settings = gtk_table_new (1, 2, FALSE); - if (!tp_strdiff (tp_account_get_storage_provider (account), - "com.meego.libsocialweb")) + provider = tp_account_get_storage_provider (account); + + if (!tp_strdiff (provider, "com.meego.libsocialweb")) + { + name = _("My Web Accounts"); + } + else if (!tp_strdiff (provider, "org.gnome.OnlineAccounts")) + { + /* FIXME: we should publish the .desktop file in some general way */ + desktop_info = g_desktop_app_info_new ( + "gnome-online-accounts-panel.desktop"); + + if (desktop_info == NULL) + g_critical ("Could not locate 'gnome-online-accounts-panel.desktop'"); + else + name = g_app_info_get_name (G_APP_INFO (desktop_info)); + } + + if (name != NULL) { - /* we know how to handle this external provider */ str = g_strdup_printf ( - _("The account %s is edited via My Web Accounts."), - empathy_account_settings_get_display_name (settings)); + _("The account %s is edited via %s."), + empathy_account_settings_get_display_name (settings), name); } else { @@ -1185,15 +1227,30 @@ account_widget_build_external (EmpathyAccountWidget *self, widget); gtk_container_set_border_width (GTK_CONTAINER (bar), 6); - if (!tp_strdiff (tp_account_get_storage_provider (account), - "com.meego.libsocialweb")) + if (!tp_strdiff (provider, "com.meego.libsocialweb")) { /* we know how to handle this external provider */ widget = gtk_info_bar_add_button (GTK_INFO_BAR (bar), _("Launch My Web Accounts"), RESPONSE_LAUNCH); g_signal_connect (widget, "clicked", + G_CALLBACK (account_widget_launch_external_clicked_meego), account); + } + else if (desktop_info != NULL) + { + /* general handler */ + str = g_strdup_printf (_("Edit %s"), name); + + widget = gtk_info_bar_add_button (GTK_INFO_BAR (bar), + str, RESPONSE_LAUNCH); + + g_object_set_data_full (G_OBJECT (widget), "app-info", + g_object_ref (desktop_info), g_object_unref); + + g_signal_connect (widget, "clicked", G_CALLBACK (account_widget_launch_external_clicked), account); + + g_free (str); } gtk_box_pack_start (GTK_BOX (self->ui_details->widget), bar, @@ -1202,6 +1259,8 @@ account_widget_build_external (EmpathyAccountWidget *self, priv->table_common_settings, FALSE, TRUE, 0); gtk_widget_show_all (self->ui_details->widget); + + tp_clear_object (&desktop_info); } static void @@ -1902,7 +1961,7 @@ account_manager_ready_cb (GObject *source_object, GError *error = NULL; TpConnectionPresenceType state; - if (!tp_account_manager_prepare_finish (account_manager, result, &error)) + if (!tp_proxy_prepare_finish (account_manager, result, &error)) { DEBUG ("Failed to prepare account manager: %s", error->message); g_error_free (error); @@ -2133,7 +2192,7 @@ do_constructed (GObject *obj) priv->account_manager = tp_account_manager_dup (); g_object_ref (self); - tp_account_manager_prepare_async (priv->account_manager, NULL, + tp_proxy_prepare_async (priv->account_manager, NULL, account_manager_ready_cb, self); /* handle apply and cancel button */ @@ -2305,7 +2364,7 @@ empathy_account_widget_class_init (EmpathyAccountWidgetClass *klass) signals[HANDLE_APPLY] = g_signal_new ("handle-apply", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); @@ -2313,14 +2372,14 @@ empathy_account_widget_class_init (EmpathyAccountWidgetClass *klass) signals[ACCOUNT_CREATED] = g_signal_new ("account-created", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[CANCELLED] = g_signal_new ("cancelled", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, + g_cclosure_marshal_generic, G_TYPE_NONE, 0); diff --git a/libempathy-gtk/empathy-avatar-chooser.c b/libempathy-gtk/empathy-avatar-chooser.c index e1487d563..0a04fe0c0 100644 --- a/libempathy-gtk/empathy-avatar-chooser.c +++ b/libempathy-gtk/empathy-avatar-chooser.c @@ -28,6 +28,7 @@ #include <gtk/gtk.h> #include <gio/gio.h> +#include <libempathy/empathy-camera-monitor.h> #include <libempathy/empathy-gsettings.h> #include <libempathy/empathy-utils.h> @@ -200,7 +201,7 @@ empathy_avatar_chooser_class_init (EmpathyAvatarChooserClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, + g_cclosure_marshal_generic, G_TYPE_NONE, 0); /** @@ -923,6 +924,10 @@ avatar_chooser_clicked_cb (GtkWidget *button, const gchar *default_dir = DEFAULT_DIR; const gchar *pics_dir; GtkFileFilter *filter; +#ifdef HAVE_CHEESE + GtkWidget *picture_button; + EmpathyCameraMonitor *monitor; +#endif if (self->priv->chooser_dialog != NULL) { @@ -934,17 +939,28 @@ avatar_chooser_clicked_cb (GtkWidget *button, gtk_file_chooser_dialog_new (_("Select Your Avatar Image"), empathy_get_toplevel_window (GTK_WIDGET (self)), GTK_FILE_CHOOSER_ACTION_OPEN, - #ifdef HAVE_CHEESE - _("Take a picture..."), - EMPATHY_AVATAR_CHOOSER_RESPONSE_WEBCAM, - #endif - _("No Image"), - EMPATHY_AVATAR_CHOOSER_RESPONSE_NO_IMAGE, - GTK_STOCK_CANCEL, - EMPATHY_AVATAR_CHOOSER_RESPONSE_CANCEL, - GTK_STOCK_OPEN, - EMPATHY_AVATAR_CHOOSER_RESPONSE_FILE, - NULL)); + NULL, NULL)); + +#ifdef HAVE_CHEESE + picture_button = gtk_dialog_add_button ( + GTK_DIALOG (self->priv->chooser_dialog), + _("Take a picture..."), EMPATHY_AVATAR_CHOOSER_RESPONSE_WEBCAM); + + /* Button is sensitive only if there is one camera connected */ + monitor = empathy_camera_monitor_dup_singleton (); + + g_object_set_data_full (G_OBJECT (picture_button), + "monitor", monitor, g_object_unref); + + g_object_bind_property (monitor, "available", picture_button, "sensitive", + G_BINDING_SYNC_CREATE); +#endif + + gtk_dialog_add_buttons (GTK_DIALOG (self->priv->chooser_dialog), + _("No Image"), EMPATHY_AVATAR_CHOOSER_RESPONSE_NO_IMAGE, + GTK_STOCK_CANCEL, EMPATHY_AVATAR_CHOOSER_RESPONSE_CANCEL, + GTK_STOCK_OPEN, EMPATHY_AVATAR_CHOOSER_RESPONSE_FILE, + NULL); chooser_dialog = self->priv->chooser_dialog; gtk_window_set_destroy_with_parent (GTK_WINDOW (chooser_dialog), TRUE); diff --git a/libempathy-gtk/empathy-call-utils.c b/libempathy-gtk/empathy-call-utils.c index 0926230ec..adf4987ba 100644 --- a/libempathy-gtk/empathy-call-utils.c +++ b/libempathy-gtk/empathy-call-utils.c @@ -134,6 +134,7 @@ create_streamed_media_channel_cb (GObject *source, } } +#ifdef HAVE_CALL static void create_call_channel_cb (GObject *source, GAsyncResult *result, @@ -165,8 +166,9 @@ create_call_channel_cb (GObject *source, NULL); } -void -empathy_call_new_with_streams (const gchar *contact, +/* Try to request a Call channel and fallback to StreamedMedia if that fails */ +static void +call_new_with_streams (const gchar *contact, TpAccount *account, gboolean initial_audio, gboolean initial_video, @@ -175,28 +177,78 @@ empathy_call_new_with_streams (const gchar *contact, GHashTable *call_request, *streamed_media_request; TpAccountChannelRequest *call_req, *streamed_media_req; + /* Call */ call_request = empathy_call_create_call_request (contact, initial_audio, initial_video); + call_req = tp_account_channel_request_new (account, call_request, timestamp); + + g_hash_table_unref (call_request); + + /* StreamedMedia */ streamed_media_request = empathy_call_create_streamed_media_request ( contact, initial_audio, initial_video); - call_req = tp_account_channel_request_new (account, call_request, timestamp); streamed_media_req = tp_account_channel_request_new (account, streamed_media_request, timestamp); + g_hash_table_unref (streamed_media_request); + tp_account_channel_request_create_channel_async (call_req, EMPATHY_CALL_BUS_NAME, NULL, create_call_channel_cb, streamed_media_req); - g_hash_table_unref (call_request); - g_hash_table_unref (streamed_media_request); g_object_unref (call_req); } +#else /* HAVE_CALL */ + +static void +sm_new_with_streams (const gchar *contact, + TpAccount *account, + gboolean initial_audio, + gboolean initial_video, + gint64 timestamp) +{ + GHashTable *streamed_media_request; + TpAccountChannelRequest *streamed_media_req; + + /* StreamedMedia */ + streamed_media_request = empathy_call_create_streamed_media_request ( + contact, initial_audio, initial_video); + + streamed_media_req = tp_account_channel_request_new (account, + streamed_media_request, + timestamp); + + g_hash_table_unref (streamed_media_request); + + tp_account_channel_request_create_channel_async (streamed_media_req, + EMPATHY_AV_BUS_NAME, NULL, create_streamed_media_channel_cb, NULL); + + g_object_unref (streamed_media_req); +} +#endif /* HAVE_CALL */ + +void +empathy_call_new_with_streams (const gchar *contact, + TpAccount *account, + gboolean initial_audio, + gboolean initial_video, + gint64 timestamp) +{ +#ifdef HAVE_CALL + call_new_with_streams (contact, account, initial_audio, initial_video, + timestamp); +#else + sm_new_with_streams (contact, account, initial_audio, initial_video, + timestamp); +#endif +} + void empathy_call_set_stream_properties (GstElement *element) { diff --git a/libempathy-gtk/empathy-cell-renderer-activatable.c b/libempathy-gtk/empathy-cell-renderer-activatable.c index 9c1a6e53b..c2325adec 100644 --- a/libempathy-gtk/empathy-cell-renderer-activatable.c +++ b/libempathy-gtk/empathy-cell-renderer-activatable.c @@ -183,7 +183,7 @@ empathy_cell_renderer_activatable_class_init ( G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__STRING, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_STRING); diff --git a/libempathy-gtk/empathy-chat-view.c b/libempathy-gtk/empathy-chat-view.c index 49c384489..088b12084 100644 --- a/libempathy-gtk/empathy-chat-view.c +++ b/libempathy-gtk/empathy-chat-view.c @@ -84,6 +84,22 @@ empathy_chat_view_append_event (EmpathyChatView *view, } void +empathy_chat_view_append_event_markup (EmpathyChatView *view, + const gchar *markup_text, + const gchar *fallback_text) +{ + g_return_if_fail (EMPATHY_IS_CHAT_VIEW (view)); + + if (EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->append_event_markup) { + EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->append_event_markup (view, + markup_text, + fallback_text); + } else { + empathy_chat_view_append_event (view, fallback_text); + } +} + +void empathy_chat_view_edit_message (EmpathyChatView *view, EmpathyMessage *message) { diff --git a/libempathy-gtk/empathy-chat-view.h b/libempathy-gtk/empathy-chat-view.h index 1fa44450a..bc9e91761 100644 --- a/libempathy-gtk/empathy-chat-view.h +++ b/libempathy-gtk/empathy-chat-view.h @@ -46,6 +46,9 @@ struct _EmpathyChatViewIface { EmpathyMessage *msg); void (*append_event) (EmpathyChatView *view, const gchar *str); + void (*append_event_markup) (EmpathyChatView *view, + const gchar *markup_text, + const gchar *fallback_text); void (*edit_message) (EmpathyChatView *view, EmpathyMessage *message); void (*scroll) (EmpathyChatView *view, @@ -81,6 +84,9 @@ void empathy_chat_view_append_message (EmpathyChatView *view, EmpathyMessage *msg); void empathy_chat_view_append_event (EmpathyChatView *view, const gchar *str); +void empathy_chat_view_append_event_markup (EmpathyChatView *view, + const gchar *markup_text, + const gchar *fallback_text); void empathy_chat_view_edit_message (EmpathyChatView *view, EmpathyMessage *message); void empathy_chat_view_scroll (EmpathyChatView *view, diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 032dd2464..bdb97be3a 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -52,10 +52,10 @@ #include "empathy-contact-list-store.h" #include "empathy-contact-list-view.h" #include "empathy-contact-menu.h" -#include "empathy-gtk-marshal.h" #include "empathy-input-text-view.h" #include "empathy-search-bar.h" #include "empathy-theme-manager.h" +#include "empathy-theme-adium.h" #include "empathy-smiley-manager.h" #include "empathy-ui-utils.h" #include "empathy-string-parser.h" @@ -106,6 +106,8 @@ struct _EmpathyChatPriv { guint update_misspelled_words_id; /* Source func ID for save_paned_pos_timeout () */ guint save_paned_pos_id; + /* Source func ID for chat_contacts_visible_timeout_cb () */ + guint contacts_visible_id; GtkWidget *widget; GtkWidget *hpaned; @@ -1012,6 +1014,44 @@ chat_command_whois (EmpathyChat *chat, whois_got_contact_cb, NULL, NULL, G_OBJECT (chat)); } +static void +chat_command_whale (EmpathyChat *chat, + GStrv strv) +{ + EmpathyChatPriv *priv = GET_PRIV (chat); + TpMessage *message; + + message = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, + "\n\n\n" + "•_______________•"); + empathy_tp_chat_send (priv->tp_chat, message); + g_object_unref (message); +} + +static void +chat_command_babywhale (EmpathyChat *chat, + GStrv strv) +{ + EmpathyChatPriv *priv = GET_PRIV (chat); + TpMessage *message; + + message = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, + "\n" + "•_____•"); + empathy_tp_chat_send (priv->tp_chat, message); + g_object_unref (message); +} + +static void +chat_command_inspector (EmpathyChat *chat, + GStrv strv) +{ + if (EMPATHY_IS_THEME_ADIUM (chat->view)) { + empathy_theme_adium_show_inspector ( + EMPATHY_THEME_ADIUM (chat->view)); + } +} + static void chat_command_help (EmpathyChat *chat, GStrv strv); typedef void (*ChatCommandFunc) (EmpathyChat *chat, GStrv strv); @@ -1066,6 +1106,11 @@ static ChatCommandItem commands[] = { {"help", 1, 2, chat_command_help, NULL, N_("/help [<command>]: show all supported commands. " "If <command> is defined, show its usage.")}, + + {"inspector", 1, 1, chat_command_inspector, NULL, NULL}, + + {"whale", 1, 1, chat_command_whale, NULL, NULL}, + {"babywhale", 1, 1, chat_command_babywhale, NULL, NULL}, }; static void @@ -1074,6 +1119,10 @@ chat_command_show_help (EmpathyChat *chat, { gchar *str; + if (item->help == NULL) { + return; + } + str = g_strdup_printf (_("Usage: %s"), _(item->help)); empathy_chat_view_append_event (chat->view, str); g_free (str); @@ -1094,8 +1143,11 @@ chat_command_help (EmpathyChat *chat, continue; } } - empathy_chat_view_append_event (chat->view, - _(commands[i].help)); + if (commands[i].help == NULL) { + continue; + } + empathy_chat_view_append_event (chat->view, + _(commands[i].help)); } return; } @@ -1107,6 +1159,9 @@ chat_command_help (EmpathyChat *chat, break; } } + if (commands[i].help == NULL) { + break; + } chat_command_show_help (chat, &commands[i]); return; } @@ -1397,6 +1452,51 @@ chat_message_acknowledged_cb (EmpathyTpChat *tp_chat, } static void +append_balance_error (EmpathyChat *chat, + const gchar *message_body) +{ + EmpathyChatPriv *priv = GET_PRIV (chat); + TpConnection *conn = tp_channel_borrow_connection (TP_CHANNEL (priv->tp_chat)); + const gchar *uri = tp_connection_get_balance_uri (conn); + const gchar *error = _("insufficient balance to send message"); + gchar *str, *str_markup = NULL; + + if (message_body != NULL) { + str = g_strdup_printf (_("Error sending message '%s': %s"), message_body, error); + } else { + str = g_strdup_printf (_("Error sending message: %s"), error); + } + + if (!tp_str_empty (uri)) { + /* translators: error used when user doesn't have enough credit on his + * account to send the message. */ + gchar *markup_error = g_strdup_printf (_("insufficient balance to send message." + " <a href='%s'>Top up</a>."), uri); + + if (message_body != NULL) { + gchar *escaped_body = g_markup_escape_text (message_body, -1); + + str_markup = g_strdup_printf (_("Error sending message '%s': %s"), + escaped_body, markup_error); + + g_free (escaped_body); + } else { + str_markup = g_strdup_printf (_("Error sending message: %s"), markup_error); + } + + g_free (markup_error); + } + + if (str_markup != NULL) + empathy_chat_view_append_event_markup (chat->view, str_markup, str); + else + empathy_chat_view_append_event (chat->view, str); + + g_free (str); + g_free (str_markup); +} + +static void chat_send_error_cb (EmpathyTpChat *tp_chat, const gchar *message_body, TpChannelTextSendError error_code, @@ -1407,9 +1507,8 @@ chat_send_error_cb (EmpathyTpChat *tp_chat, gchar *str; if (!tp_strdiff (dbus_error, TP_ERROR_STR_INSUFFICIENT_BALANCE)) { - /* translators: error used when user doesn't have enough credit on his - * account to send the message. */ - error = _("insufficient balance to send message"); + append_balance_error (chat, message_body); + return; } else if (!tp_strdiff (dbus_error, TP_ERROR_STR_NOT_CAPABLE)) { error = _("not capable"); } @@ -2595,9 +2694,22 @@ chat_member_renamed_cb (EmpathyTpChat *tp_chat, } static gboolean -chat_reset_size_request (gpointer widget) +chat_contacts_visible_timeout_cb (gpointer chat) { - gtk_widget_set_size_request (widget, -1, -1); + EmpathyChatPriv *priv = GET_PRIV (chat); + + /* Relax the size request */ + gtk_widget_set_size_request (priv->vbox_left, -1, -1); + + /* Set the position of the slider. This must be done here because + * GtkPaned need to know its size allocation and it will be settled only + * after the gtk_window_resize () tough effect. */ + if (priv->contacts_width > 0) { + gtk_paned_set_position (GTK_PANED (priv->hpaned), + priv->contacts_width); + } + + priv->contacts_visible_id = 0; return FALSE; } @@ -2607,7 +2719,6 @@ chat_update_contacts_visibility (EmpathyChat *chat, gboolean show) { EmpathyChatPriv *priv = GET_PRIV (chat); - GtkAllocation allocation; if (!priv->scrolled_window_contacts) { return; @@ -2620,6 +2731,7 @@ chat_update_contacts_visibility (EmpathyChat *chat, if (show && priv->contact_list_view == NULL) { EmpathyContactListStore *store; gint min_width; + GtkAllocation allocation; /* We are adding the contact list to the chat, we don't want the * chat view to become too small. If the chat view is already @@ -2630,12 +2742,13 @@ chat_update_contacts_visibility (EmpathyChat *chat, gtk_widget_get_allocation (priv->vbox_left, &allocation); min_width = MIN (allocation.width, 250); gtk_widget_set_size_request (priv->vbox_left, min_width, -1); - g_idle_add (chat_reset_size_request, priv->vbox_left); - if (priv->contacts_width > 0) { - gtk_paned_set_position (GTK_PANED (priv->hpaned), - priv->contacts_width); - } + /* There is no way to know when the window resize will happen + * since it is WM's decision. Let's hope it won't be longer. */ + if (priv->contacts_visible_id != 0) + g_source_remove (priv->contacts_visible_id); + priv->contacts_visible_id = g_timeout_add (500, + chat_contacts_visible_timeout_cb, chat); store = empathy_contact_list_store_new ( EMPATHY_CONTACT_LIST (priv->tp_chat)); @@ -2877,7 +2990,6 @@ chat_create_ui (EmpathyChat *chat) GList *list = NULL; gchar *filename; GtkTextBuffer *buffer; - gint paned_pos; EmpathyThemeManager *theme_mgr; filename = empathy_file_lookup ("empathy-chat.ui", @@ -2963,12 +3075,6 @@ chat_create_ui (EmpathyChat *chat) G_CALLBACK (chat_hpaned_pos_changed_cb), chat); - /* Load the paned position */ - paned_pos = g_settings_get_int (priv->gsettings_ui, - EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS); - if (paned_pos != 0) - gtk_paned_set_position (GTK_PANED(priv->hpaned), paned_pos); - /* Set widget focus order */ list = g_list_append (NULL, priv->search_bar); list = g_list_append (list, priv->scrolled_window_input); @@ -3007,6 +3113,9 @@ chat_finalize (GObject *object) if (priv->save_paned_pos_id != 0) g_source_remove (priv->save_paned_pos_id); + if (priv->contacts_visible_id != 0) + g_source_remove (priv->contacts_visible_id); + g_object_unref (priv->gsettings_chat); g_object_unref (priv->gsettings_ui); @@ -3175,7 +3284,7 @@ empathy_chat_class_init (EmpathyChatClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); @@ -3185,7 +3294,7 @@ empathy_chat_class_init (EmpathyChatClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - _empathy_gtk_marshal_VOID__OBJECT_BOOLEAN, + g_cclosure_marshal_generic, G_TYPE_NONE, 2, EMPATHY_TYPE_MESSAGE, G_TYPE_BOOLEAN); @@ -3195,7 +3304,7 @@ empathy_chat_class_init (EmpathyChatClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__POINTER, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_STRV); @@ -3222,7 +3331,7 @@ account_manager_prepared_cb (GObject *source_object, EmpathyChat *chat = user_data; GError *error = NULL; - if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { + if (!tp_proxy_prepare_finish (account_manager, result, &error)) { DEBUG ("Failed to prepare the account manager: %s", error->message); g_error_free (error); return; @@ -3251,12 +3360,13 @@ empathy_chat_init (EmpathyChat *chat) priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA); priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA); - priv->contacts_width = -1; + priv->contacts_width = g_settings_get_int (priv->gsettings_ui, + EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS); priv->input_history = NULL; priv->input_history_current = NULL; priv->account_manager = tp_account_manager_dup (); - tp_account_manager_prepare_async (priv->account_manager, NULL, + tp_proxy_prepare_async (priv->account_manager, NULL, account_manager_prepared_cb, chat); priv->show_contacts = g_settings_get_boolean (priv->gsettings_chat, diff --git a/libempathy-gtk/empathy-contact-blocking-dialog.c b/libempathy-gtk/empathy-contact-blocking-dialog.c index 404dab172..64ab590d5 100644 --- a/libempathy-gtk/empathy-contact-blocking-dialog.c +++ b/libempathy-gtk/empathy-contact-blocking-dialog.c @@ -236,7 +236,8 @@ contact_blocking_dialog_deny_channel_members_changed (TpChannel *channel, EMPATHY_ACCOUNT_CHOOSER (self->priv->account_chooser))))) return; - DEBUG ("deny list changed: %u added, %u removed", added->len, removed->len); + DEBUG ("deny list changed on %s: %u added, %u removed", + get_pretty_conn_name (conn), added->len, removed->len); /* add contacts */ contact_blocking_dialog_add_contacts_to_list (self, conn, added); @@ -317,7 +318,8 @@ contact_blocking_dialog_connection_prepared (GObject *conn, if (!tp_proxy_prepare_finish (conn, result, &error)) { - DEBUG ("Failed to prepare connection: %s", error->message); + DEBUG ("Failed to prepare connection %s: %s", + get_pretty_conn_name ((TpConnection *) conn), error->message); g_error_free (error); return; } @@ -366,7 +368,8 @@ contact_blocking_dialog_got_deny_channel (TpConnection *conn, if (in_error != NULL) { - DEBUG ("Failed to get 'deny' channel: %s", in_error->message); + DEBUG ("Failed to get 'deny' channel on %s: %s", + get_pretty_conn_name (conn), in_error->message); return; } @@ -374,7 +377,8 @@ contact_blocking_dialog_got_deny_channel (TpConnection *conn, if (error != NULL) { - DEBUG ("Failed to create channel proxy: %s", error->message); + DEBUG ("Failed to create channel proxy on %s: %s", + get_pretty_conn_name (conn), in_error->message); g_error_free (error); return; } @@ -394,14 +398,16 @@ contact_blocking_dialog_deny_channel_prepared (GObject *channel, if (!tp_proxy_prepare_finish (channel, result, &error)) { - DEBUG ("Failed to prepare channel: %s", error->message); + DEBUG ("Failed to prepare channel %s: %s", + tp_proxy_get_object_path (channel), error->message); g_error_free (error); return; } conn = tp_channel_borrow_connection (TP_CHANNEL (channel)); - DEBUG ("Channel prepared for connection %s", get_pretty_conn_name (conn)); + DEBUG ("Channel %s prepared for connection %s", + tp_proxy_get_object_path (channel), get_pretty_conn_name (conn)); g_hash_table_insert (self->priv->channels, g_object_ref (conn), channel); @@ -451,7 +457,8 @@ contact_blocking_dialog_add_contact (GtkWidget *widget, identifiers[0] = gtk_entry_get_text ( GTK_ENTRY (self->priv->add_contact_entry)); - DEBUG ("Looking up handle for '%s'", identifiers[0]); + DEBUG ("Looking up handle for '%s' on %s", + identifiers[0], get_pretty_conn_name (conn)); tp_cli_connection_call_request_handles (conn, -1, TP_HANDLE_TYPE_CONTACT, identifiers, @@ -478,7 +485,8 @@ contact_blocking_dialog_add_contact_got_handle (TpConnection *conn, if (in_error != NULL) { - DEBUG ("Error getting handle: %s", in_error->message); + DEBUG ("Error getting handle on %s: %s", + get_pretty_conn_name (conn), in_error->message); contact_blocking_dialog_set_error ( EMPATHY_CONTACT_BLOCKING_DIALOG (self), in_error); @@ -488,8 +496,8 @@ contact_blocking_dialog_add_contact_got_handle (TpConnection *conn, g_return_if_fail (handles->len == 1); - DEBUG ("Adding handle %u to deny channel", - g_array_index (handles, TpHandle, 0)); + DEBUG ("Adding handle %u to deny channel on %s", + g_array_index (handles, TpHandle, 0), get_pretty_conn_name (conn)); tp_cli_channel_interface_group_call_add_members (channel, -1, handles, "", @@ -504,7 +512,8 @@ contact_blocking_dialog_added_contact (TpChannel *channel, { if (in_error != NULL) { - DEBUG ("Error adding contact to deny list: %s", in_error->message); + DEBUG ("Error adding contact to deny list %s: %s", + tp_proxy_get_object_path (channel), in_error->message); contact_blocking_dialog_set_error ( EMPATHY_CONTACT_BLOCKING_DIALOG (self), in_error); @@ -512,7 +521,7 @@ contact_blocking_dialog_added_contact (TpChannel *channel, return; } - DEBUG ("Contact added"); + DEBUG ("Contact added to %s", tp_proxy_get_object_path (channel)); } static void diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c index 7faee3e09..10a3757a3 100644 --- a/libempathy-gtk/empathy-contact-chooser.c +++ b/libempathy-gtk/empathy-contact-chooser.c @@ -35,6 +35,7 @@ struct _EmpathyContactChooserPrivate EmpathyIndividualStore *store; EmpathyIndividualView *view; + GtkWidget *search_entry; GPtrArray *search_words; gchar *search_str; @@ -118,7 +119,7 @@ empathy_contact_chooser_class_init ( G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, FOLKS_TYPE_INDIVIDUAL); } @@ -285,7 +286,6 @@ empathy_contact_chooser_init (EmpathyContactChooser *self) EmpathyIndividualManager *mgr; GtkTreeSelection *selection; GtkWidget *scroll; - GtkWidget *search_entry; GQuark features[] = { TP_ACCOUNT_MANAGER_FEATURE_CORE, 0 }; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EMPATHY_TYPE_CONTACT_CHOOSER, @@ -300,11 +300,11 @@ empathy_contact_chooser_init (EmpathyContactChooser *self) tp_proxy_prepare_async (self->priv->account_mgr, features, NULL, NULL); /* Search entry */ - search_entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (self), search_entry, FALSE, TRUE, 6); - gtk_widget_show (search_entry); + self->priv->search_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (self), self->priv->search_entry, FALSE, TRUE, 6); + gtk_widget_show (self->priv->search_entry); - g_signal_connect (search_entry, "changed", + g_signal_connect (self->priv->search_entry, "changed", G_CALLBACK (search_text_changed), self); /* Add the treeview */ @@ -358,3 +358,10 @@ empathy_contact_chooser_set_filter_func (EmpathyContactChooser *self, self->priv->filter_func = func; self->priv->filter_data = user_data; } + +void +empathy_contact_chooser_show_search_entry (EmpathyContactChooser *self, + gboolean show) +{ + gtk_widget_set_visible (self->priv->search_entry, show); +} diff --git a/libempathy-gtk/empathy-contact-chooser.h b/libempathy-gtk/empathy-contact-chooser.h index ba95bcfbe..87466beb8 100644 --- a/libempathy-gtk/empathy-contact-chooser.h +++ b/libempathy-gtk/empathy-contact-chooser.h @@ -61,6 +61,9 @@ void empathy_contact_chooser_set_filter_func (EmpathyContactChooser *self, EmpathyContactChooserFilterFunc func, gpointer user_data); +void empathy_contact_chooser_show_search_entry (EmpathyContactChooser *self, + gboolean show); + G_END_DECLS #endif diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index 189df5dc5..80fc572d2 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -70,9 +70,9 @@ typedef struct { guint setup_idle_id; gboolean dispose_has_run; GHashTable *status_icons; - /* Hash: EmpathyContact* -> GQueue (GtkTreeRowReference) */ + /* Hash: EmpathyContact* -> GQueue (GtkTreeIter *) */ GHashTable *empathy_contact_cache; - /* Hash: char *groupname -> GtkTreeRowReference *row */ + /* Hash: char *groupname -> GtkTreeIter * */ GHashTable *empathy_group_cache; } EmpathyContactListStorePriv; @@ -322,10 +322,10 @@ empathy_contact_list_store_class_init (EmpathyContactListStoreClass *klass) } static void -g_queue_free_full_row_ref (gpointer data) +g_queue_free_full_iter (gpointer data) { GQueue *queue = (GQueue *) data; - g_queue_foreach (queue, (GFunc) gtk_tree_row_reference_free, NULL); + g_queue_foreach (queue, (GFunc) gtk_tree_iter_free, NULL); g_queue_free (queue); } @@ -345,10 +345,10 @@ empathy_contact_list_store_init (EmpathyContactListStore *store) store); priv->status_icons = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); priv->empathy_contact_cache = g_hash_table_new_full (NULL, NULL, NULL, - g_queue_free_full_row_ref); + g_queue_free_full_iter); priv->empathy_group_cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - (GDestroyNotify) gtk_tree_row_reference_free); + (GDestroyNotify) gtk_tree_iter_free); contact_list_store_setup (store); } @@ -1007,8 +1007,6 @@ add_contact_to_store (GtkTreeStore *store, EmpathyContactListFlags flags) { EmpathyContactListStorePriv *priv = GET_PRIV (store); - GtkTreeRowReference *row_ref; - GtkTreePath *path; GQueue *queue; gtk_tree_store_insert_with_values (store, iter, parent, 0, @@ -1025,18 +1023,15 @@ add_contact_to_store (GtkTreeStore *store, EMPATHY_CONTACT_LIST_STORE_COL_FLAGS, flags, -1); - path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter); - row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (store), path); queue = g_hash_table_lookup (priv->empathy_contact_cache, contact); if (queue) { - g_queue_push_tail (queue, row_ref); + g_queue_push_tail (queue, gtk_tree_iter_copy (iter)); } else { queue = g_queue_new (); - g_queue_push_tail (queue, row_ref); + g_queue_push_tail (queue, gtk_tree_iter_copy (iter)); g_hash_table_insert (priv->empathy_contact_cache, contact, queue); } - gtk_tree_path_free (path); } static void @@ -1136,22 +1131,14 @@ contact_list_store_remove_contact (EmpathyContactListStore *store, model = GTK_TREE_MODEL (store); for (l = g_queue_peek_head_link (row_refs); l; l = l->next) { - GtkTreePath *path = gtk_tree_row_reference_get_path (l->data); - GtkTreeIter iter; + GtkTreeIter *iter = l->data; GtkTreeIter parent; - if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, - path)) { - gtk_tree_path_free (path); - continue; - } - gtk_tree_path_free (path); - /* NOTE: it is only <= 2 here because we have * separators after the group name, otherwise it * should be 1. */ - if (gtk_tree_model_iter_parent (model, &parent, &iter) && + if (gtk_tree_model_iter_parent (model, &parent, iter) && gtk_tree_model_iter_n_children (model, &parent) <= 2) { gchar *group_name; gtk_tree_model_get (model, &parent, @@ -1161,7 +1148,7 @@ contact_list_store_remove_contact (EmpathyContactListStore *store, group_name); gtk_tree_store_remove (GTK_TREE_STORE (store), &parent); } else { - gtk_tree_store_remove (GTK_TREE_STORE (store), &iter); + gtk_tree_store_remove (GTK_TREE_STORE (store), iter); } } @@ -1441,14 +1428,12 @@ contact_list_store_get_group (EmpathyContactListStore *store, GtkTreeModel *model; GtkTreeIter iter_group; GtkTreeIter iter_separator; - GtkTreeRowReference *row_ref; + GtkTreeIter *iter; model = GTK_TREE_MODEL (store); - row_ref = g_hash_table_lookup (priv->empathy_group_cache, name); - - if (row_ref == NULL) { - GtkTreePath *path; + iter = g_hash_table_lookup (priv->empathy_group_cache, name); + if (iter == NULL) { if (created) { *created = TRUE; } @@ -1462,11 +1447,8 @@ contact_list_store_get_group (EmpathyContactListStore *store, EMPATHY_CONTACT_LIST_STORE_COL_IS_FAKE_GROUP, is_fake_group, -1); - path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), &iter_group); - row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (store), path); g_hash_table_insert (priv->empathy_group_cache, - g_strdup (name), row_ref); - gtk_tree_path_free (path); + g_strdup (name), gtk_tree_iter_copy (&iter_group)); if (iter_group_to_set) { *iter_group_to_set = iter_group; @@ -1480,24 +1462,15 @@ contact_list_store_get_group (EmpathyContactListStore *store, *iter_separator_to_set = iter_separator; } } else { - GtkTreePath *path = gtk_tree_row_reference_get_path (row_ref); - GtkTreeIter iter; - - if (!gtk_tree_model_get_iter (model, &iter, path)) { - gtk_tree_path_free (path); - return; - } - gtk_tree_path_free (path); - if (created) { *created = FALSE; } if (iter_group_to_set) { - *iter_group_to_set = iter; + *iter_group_to_set = *iter; } - iter_separator = iter; + iter_separator = *iter; if (gtk_tree_model_iter_next (model, &iter_separator)) { gboolean is_separator; @@ -1744,27 +1717,20 @@ contact_list_store_find_contact (EmpathyContactListStore *store, EmpathyContact *contact) { EmpathyContactListStorePriv *priv = GET_PRIV (store); - GtkTreeModel *model; GQueue *row_refs_queue; GList *i; GList *iters_list = NULL; - model = GTK_TREE_MODEL (store); row_refs_queue = g_hash_table_lookup (priv->empathy_contact_cache, contact); if (!row_refs_queue) return NULL; for (i = g_queue_peek_head_link (row_refs_queue) ; i != NULL ; i = i->next) { - GtkTreePath *path = gtk_tree_row_reference_get_path (i->data); - GtkTreeIter iter; - if (!gtk_tree_model_get_iter (model, &iter, path)) { - gtk_tree_path_free (path); - continue; - } - gtk_tree_path_free (path); + GtkTreeIter *iter = i->data; + iters_list = g_list_prepend - (iters_list, gtk_tree_iter_copy (&iter)); + (iters_list, gtk_tree_iter_copy (iter)); } return iters_list; diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 277842ff5..f8c055c7e 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -49,7 +49,6 @@ #include "empathy-cell-renderer-activatable.h" #include "empathy-ui-utils.h" #include "empathy-gtk-enum-types.h" -#include "empathy-gtk-marshal.h" #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT #include <libempathy/empathy-debug.h> @@ -1784,7 +1783,7 @@ empathy_contact_list_view_class_init (EmpathyContactListViewClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - _empathy_gtk_marshal_VOID__OBJECT_STRING_STRING, + g_cclosure_marshal_generic, G_TYPE_NONE, 3, EMPATHY_TYPE_CONTACT, G_TYPE_STRING, G_TYPE_STRING); diff --git a/libempathy-gtk/empathy-contact-selector-dialog.c b/libempathy-gtk/empathy-contact-selector-dialog.c index a4747b488..d436c3e0d 100644 --- a/libempathy-gtk/empathy-contact-selector-dialog.c +++ b/libempathy-gtk/empathy-contact-selector-dialog.c @@ -233,19 +233,6 @@ contact_selector_change_state_button_cb (GtkEditable *editable, } static void -entry_activate_cb (GtkEntry *entry, - gpointer self) -{ - const gchar *id; - - id = gtk_entry_get_text (entry); - if (EMP_STR_EMPTY (id)) - return; - - gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_ACCEPT); -} - -static void account_chooser_filter (TpAccount *account, EmpathyAccountChooserFilterResultCallback callback, gpointer callback_data, @@ -295,7 +282,7 @@ empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog) gchar *filename; GtkEntryCompletion *completion; GtkWidget *content_area; - GtkWidget *table_contact; + GtkWidget *table_grid; dialog->vbox = gtk_vbox_new (FALSE, 3); @@ -305,19 +292,17 @@ empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog) filename = empathy_file_lookup ("empathy-contact-selector-dialog.ui", "libempathy-gtk"); gui = empathy_builder_get_file (filename, - "table_contact", &table_contact, + "table_grid", &table_grid, "account_chooser_label", &priv->account_chooser_label, "entry_id", &priv->entry_id, NULL); g_free (filename); - empathy_builder_connect (gui, dialog, - "entry_id", "activate", entry_activate_cb, - NULL); + gtk_entry_set_activates_default (GTK_ENTRY (priv->entry_id), TRUE); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_container_add (GTK_CONTAINER (content_area), dialog->vbox); - gtk_box_pack_start (GTK_BOX (dialog->vbox), table_contact, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (dialog->vbox), table_grid, TRUE, TRUE, 0); gtk_widget_show (dialog->vbox); gtk_dialog_add_button (GTK_DIALOG (dialog), @@ -356,9 +341,9 @@ empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog) /* Create account chooser */ priv->show_account_chooser = TRUE; priv->account_chooser = empathy_account_chooser_new (); - gtk_table_attach_defaults (GTK_TABLE (table_contact), + gtk_grid_attach (GTK_GRID (table_grid), priv->account_chooser, - 1, 2, 0, 1); + 1, 0, 1, 1); empathy_account_chooser_set_filter ( EMPATHY_ACCOUNT_CHOOSER (priv->account_chooser), account_chooser_filter, @@ -439,8 +424,12 @@ empathy_contact_selector_dialog_set_property (GObject *self, static void empathy_contact_selector_dialog_constructed (GObject *dialog) { + EmpathyContactSelectorDialog *self = EMPATHY_CONTACT_SELECTOR_DIALOG (dialog); EmpathyContactSelectorDialogPriv *priv = GET_PRIV (dialog); + gtk_widget_set_can_default (self->button_action, TRUE); + gtk_widget_grab_default (self->button_action); + if (EMPATHY_CONTACT_SELECTOR_DIALOG_GET_CLASS (dialog)->contact_filter) { GtkEntryCompletion *completion; diff --git a/libempathy-gtk/empathy-contact-selector-dialog.ui b/libempathy-gtk/empathy-contact-selector-dialog.ui index e86466889..9b7f9219f 100644 --- a/libempathy-gtk/empathy-contact-selector-dialog.ui +++ b/libempathy-gtk/empathy-contact-selector-dialog.ui @@ -1,33 +1,37 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <interface> - <!-- interface-requires gtk+ 2.12 --> - <!-- interface-naming-policy toplevel-contextual --> - <object class="GtkTable" id="table_contact"> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkGrid" id="table_grid"> <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="column_spacing">6</property> + <property name="can_focus">False</property> <property name="row_spacing">6</property> + <property name="column_spacing">6</property> <child> <object class="GtkLabel" id="account_chooser_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Account:</property> </object> <packing> - <property name="x_options"></property> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> <object class="GtkLabel" id="label2"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Contact ID:</property> </object> <packing> + <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options"></property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> @@ -39,13 +43,10 @@ </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="width">1</property> + <property name="height">1</property> </packing> </child> - <child> - <placeholder/> - </child> </object> </interface> diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c deleted file mode 100644 index a77ed43e2..000000000 --- a/libempathy-gtk/empathy-contact-selector.c +++ /dev/null @@ -1,473 +0,0 @@ -/* -* Copyright (C) 2007 Marco Barisione <marco@barisione.org> -* Copyright (C) 2008 Collabora Ltd. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -* -* Authors: Marco Barisione <marco@barisione.org> -* Elliot Fairweather <elliot.fairweather@collabora.co.uk> -*/ - -#include "config.h" - -#include <glib/gi18n-lib.h> -#include <gtk/gtk.h> - -#include <libempathy/empathy-contact.h> -#include <libempathy-gtk/empathy-contact-list-store.h> -#include <libempathy/empathy-utils.h> - -#include "empathy-contact-selector.h" - -/** - * SECTION:empathy-contact-selector - * @title:EmpathyContactSelector - * @short_description: A widget used to choose from a list of contacts. - * @include: libempathy-gtk/empathy-contact-selector.h - * - * #EmpathyContactSelector is a widget which extends #GtkComboBox to provide - * a chooser of available contacts. - */ - -/** - * EmpathyContactSelector: - * @parent: parent object - * - * Widget which extends #GtkComboBox to provide a chooser of available contacts. - */ - -G_DEFINE_TYPE (EmpathyContactSelector, empathy_contact_selector, - GTK_TYPE_COMBO_BOX) - -enum -{ - PROP_0, - PROP_CONTACT_LIST -}; - -#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContactSelector) -typedef struct -{ - EmpathyContactList *contact_list; - EmpathyContactListStore *store; - GtkTreeModel *model; - gboolean dispose_run; -} EmpathyContactSelectorPriv; - -static void contact_selector_manage_blank_contact ( - EmpathyContactSelector *selector); - -static guint -contact_selector_get_number_online_contacts (GtkTreeModel *model) -{ - GtkTreeIter tmp_iter; - gboolean is_online; - guint number_online_contacts = 0; - gboolean ok; - - for (ok = gtk_tree_model_get_iter_first (model, &tmp_iter); - ok; ok = gtk_tree_model_iter_next (model, &tmp_iter)) - { - gtk_tree_model_get (model, - &tmp_iter, EMPATHY_CONTACT_LIST_STORE_COL_IS_ONLINE, - &is_online, -1); - if (is_online) - number_online_contacts++; - } - - return number_online_contacts; -} - -static gboolean -contact_selector_get_iter_for_blank_contact (GtkTreeStore *model, - GtkTreeIter *blank_iter) -{ - GtkTreeIter tmp_iter; - EmpathyContact *tmp_contact; - gboolean is_present = FALSE; - gboolean ok; - - for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &tmp_iter); - ok; ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &tmp_iter)) - { - gtk_tree_model_get (GTK_TREE_MODEL (model), - &tmp_iter, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, - &tmp_contact, -1); - if (tmp_contact == NULL) - { - *blank_iter = tmp_iter; - is_present = TRUE; - break; - } - g_object_unref (tmp_contact); - } - - return is_present; -} - -static void -contact_selector_add_blank_contact (EmpathyContactSelector *selector) -{ - EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - GtkTreeIter blank_iter, iter; - - gtk_tree_store_insert_with_values ( - GTK_TREE_STORE (priv->store), &blank_iter, NULL, 0, - EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, NULL, - EMPATHY_CONTACT_LIST_STORE_COL_NAME, (_("Select a contact")), - EMPATHY_CONTACT_LIST_STORE_COL_IS_ONLINE, FALSE, -1); - - /* look up blank_iter in the filter model */ - g_return_if_fail (gtk_tree_model_filter_convert_child_iter_to_iter ( - GTK_TREE_MODEL_FILTER (priv->model), &iter, &blank_iter)); - - g_signal_handlers_block_by_func (selector, - contact_selector_manage_blank_contact, selector); - gtk_combo_box_set_active_iter (GTK_COMBO_BOX (selector), &iter); - g_signal_handlers_unblock_by_func (selector, - contact_selector_manage_blank_contact, selector); -} - -static void -contact_selector_remove_blank_contact (EmpathyContactSelector *selector) -{ - EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - GtkTreeIter blank_iter; - - if (contact_selector_get_iter_for_blank_contact - (GTK_TREE_STORE (priv->store), &blank_iter)) - gtk_tree_store_remove (GTK_TREE_STORE (priv->store), &blank_iter); -} - -static void -contact_selector_manage_sensitivity (EmpathyContactSelector *selector) -{ - EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - guint number_online_contacts; - - number_online_contacts = contact_selector_get_number_online_contacts (priv->model); - - if (number_online_contacts != 0) - gtk_widget_set_sensitive (GTK_WIDGET (selector), TRUE); - else - gtk_widget_set_sensitive (GTK_WIDGET (selector), FALSE); -} - -static void -contact_selector_manage_blank_contact (EmpathyContactSelector *selector) -{ - gboolean is_popup_shown; - - g_object_get (selector, "popup-shown", &is_popup_shown, NULL); - - if (is_popup_shown) - { - contact_selector_remove_blank_contact (selector); - } - else - { - if (gtk_combo_box_get_active (GTK_COMBO_BOX (selector)) == -1) - { - contact_selector_add_blank_contact (selector); - } - else - { - contact_selector_remove_blank_contact (selector); - } - } - - contact_selector_manage_sensitivity (selector); -} - -static GObject * -contact_selector_constructor (GType type, - guint n_construct_params, - GObjectConstructParam *construct_params) -{ - GObject *object; - EmpathyContactSelector *contact_selector; - EmpathyContactSelectorPriv *priv; - GtkCellLayout *cell_layout; - GtkCellRenderer *renderer; - - object = G_OBJECT_CLASS (empathy_contact_selector_parent_class)->constructor - (type, n_construct_params, construct_params); - priv = GET_PRIV (object); - contact_selector = EMPATHY_CONTACT_SELECTOR (object); - cell_layout = GTK_CELL_LAYOUT (object); - - priv->store = empathy_contact_list_store_new (priv->contact_list); - - g_object_set (priv->store, "is-compact", TRUE, "show-avatars", FALSE, - "show-offline", FALSE, "show-groups", FALSE, "show-protocols", FALSE, - "sort-criterium", EMPATHY_CONTACT_LIST_STORE_SORT_NAME, NULL); - - g_signal_connect_swapped (priv->store, "row-changed", - G_CALLBACK (contact_selector_manage_sensitivity), - contact_selector); - g_signal_connect_swapped (contact_selector, "changed", - G_CALLBACK (contact_selector_manage_blank_contact), - contact_selector); - g_signal_connect_swapped (contact_selector, "notify::popup-shown", - G_CALLBACK (contact_selector_manage_blank_contact), - contact_selector); - - priv->model = gtk_tree_model_filter_new (GTK_TREE_MODEL (priv->store), NULL); - - gtk_combo_box_set_model (GTK_COMBO_BOX (contact_selector), priv->model); - gtk_widget_set_sensitive (GTK_WIDGET (contact_selector), FALSE); - - renderer = gtk_cell_renderer_pixbuf_new (); - gtk_cell_layout_pack_start (cell_layout, renderer, FALSE); - gtk_cell_layout_set_attributes (cell_layout, renderer, - "pixbuf", EMPATHY_CONTACT_LIST_STORE_COL_ICON_STATUS, NULL); - - renderer = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (cell_layout, renderer, TRUE); - gtk_cell_layout_set_attributes (cell_layout, renderer, - "text", EMPATHY_CONTACT_LIST_STORE_COL_NAME, NULL); - - contact_selector_manage_blank_contact (contact_selector); - contact_selector_manage_sensitivity (contact_selector); - - return object; -} - -static void -empathy_contact_selector_init (EmpathyContactSelector *empathy_contact_selector) -{ - EmpathyContactSelectorPriv *priv = - G_TYPE_INSTANCE_GET_PRIVATE (empathy_contact_selector, - EMPATHY_TYPE_CONTACT_SELECTOR, EmpathyContactSelectorPriv); - - empathy_contact_selector->priv = priv; - - priv->dispose_run = FALSE; -} - -static void -contact_selector_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - EmpathyContactSelectorPriv *priv = GET_PRIV (object); - - switch (prop_id) - { - case PROP_CONTACT_LIST: - priv->contact_list = g_value_dup_object (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -contact_selector_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - EmpathyContactSelectorPriv *priv = GET_PRIV (object); - - switch (prop_id) - { - case PROP_CONTACT_LIST: - g_value_set_object (value, priv->contact_list); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -contact_selector_dispose (GObject *object) -{ - EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (object); - EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - - if (priv->dispose_run) - return; - - priv->dispose_run = TRUE; - - if (priv->contact_list) - { - g_object_unref (priv->contact_list); - priv->contact_list = NULL; - } - - if (priv->model) - { - g_object_unref (priv->model); - priv->model = NULL; - } - - if (priv->store) - { - g_object_unref (priv->store); - priv->store = NULL; - } - - (G_OBJECT_CLASS (empathy_contact_selector_parent_class)->dispose) (object); -} - -static void -empathy_contact_selector_class_init (EmpathyContactSelectorClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->constructor = contact_selector_constructor; - object_class->dispose = contact_selector_dispose; - object_class->set_property = contact_selector_set_property; - object_class->get_property = contact_selector_get_property; - g_type_class_add_private (klass, sizeof (EmpathyContactSelectorPriv)); - - /** - * EmpathyContactSelector:contact-list: - * - * An #EmpathyContactList containing the contacts for the - * #EmpathyContactSelector. - */ - g_object_class_install_property (object_class, PROP_CONTACT_LIST, - g_param_spec_object ("contact-list", "contact list", "contact list", - EMPATHY_TYPE_CONTACT_LIST, G_PARAM_CONSTRUCT_ONLY | - G_PARAM_READWRITE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); -} - -/** - * empathy_contact_selector_new: - * @contact_list: an #EmpathyContactList containing the contacts to list in - * the contact selector - * - * Creates a new #EmpathyContactSelector. - * - * Return value: A new #EmpathyContactSelector - */ -GtkWidget * -empathy_contact_selector_new (EmpathyContactList *contact_list) -{ - g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST (contact_list), NULL); - - return GTK_WIDGET (g_object_new (EMPATHY_TYPE_CONTACT_SELECTOR, - "contact-list", contact_list, NULL)); -} - -/** - * empathy_contact_selector_dup_selected: - * @selector: An #EmpathyContactSelector - * - * Returns a new reference to the contact which is currently selected in - * @selector, or %NULL if there is no contact selected. The returned contact - * should be unrefed with g_object_unref() when finished with. - * - * Return value: A new reference to the contact currently selected, or %NULL - */ -EmpathyContact * -empathy_contact_selector_dup_selected (EmpathyContactSelector *selector) -{ - EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - EmpathyContact *contact = NULL; - GtkTreeIter iter; - - g_return_val_if_fail (EMPATHY_IS_CONTACT_SELECTOR (selector), NULL); - - if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (selector), &iter)) - return NULL; - - gtk_tree_model_get (priv->model, &iter, - EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact, -1); - - return contact; -} - -typedef struct -{ - EmpathyContactSelectorFilterFunc func; - gpointer user_data; -} FilterData; - -static void -filter_data_free (gpointer data) -{ - g_slice_free (FilterData, data); -} - -static gboolean -contact_selector_filter_visible_func (GtkTreeModel *model, - GtkTreeIter *iter, - gpointer user_data) -{ - EmpathyContact *contact; - gboolean visible = TRUE; - FilterData *data = (FilterData *) user_data; - - gtk_tree_model_get (model, iter, - EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact, - -1); - - if (contact != NULL) - { - visible = data->func (contact, data->user_data); - - g_object_unref (contact); - } - - return visible; -} - -/** - * empathy_contact_selector_set_visible: - * @selector: an #EmpathyContactSelector - * @func: an #EmpathyContactSelectorFilterFunc to filter the contacts - * @user_data: data to pass to @func or %NULL - * - * Sets a filter on the @selector so only contacts that return %TRUE - * when passed into @func are visible. - * - * A typical usage for this function would be to only show contacts that - * can send or receive files. In this case, one could use the - * empathy_contact_can_send_files() function - */ -void -empathy_contact_selector_set_visible (EmpathyContactSelector *selector, - EmpathyContactSelectorFilterFunc func, - gpointer user_data) -{ - EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - FilterData *data; - - data = g_slice_new0 (FilterData); - data->func = func; - data->user_data = user_data; - - gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (priv->model), - contact_selector_filter_visible_func, data, filter_data_free); - - gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->model)); -} - -/** - * EmpathyContactSelectorFilterFunc: - * @contact: an #EmpathyContact - * @user_data: user data or %NULL - * - * A function which decides whether the contact indicated by @contact - * is visible. - * - * Return value: whether @contact is visible - */ diff --git a/libempathy-gtk/empathy-contact-selector.h b/libempathy-gtk/empathy-contact-selector.h deleted file mode 100644 index 205b9e411..000000000 --- a/libempathy-gtk/empathy-contact-selector.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -* Copyright (C) 2007 Marco Barisione <marco@barisione.org> -* Copyright (C) 2008 Collabora Ltd. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -* -* Authors: Marco Barisione <marco@barisione.org> -* Elliot Fairweather <elliot.fairweather@collabora.co.uk> -*/ - -#ifndef __EMPATHY_CONTACT_SELECTOR_H__ -#define __EMPATHY_CONTACT_SELECTOR_H__ - -G_BEGIN_DECLS - -#include <glib-object.h> -#include <gtk/gtk.h> - -#include <libempathy/empathy-contact.h> -#include <libempathy-gtk/empathy-contact-list-store.h> - -#define EMPATHY_TYPE_CONTACT_SELECTOR (empathy_contact_selector_get_type ()) -#define EMPATHY_CONTACT_SELECTOR(object) (G_TYPE_CHECK_INSTANCE_CAST \ - ((object), EMPATHY_TYPE_CONTACT_SELECTOR, EmpathyContactSelector)) -#define EMPATHY_CONTACT_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - EMPATHY_TYPE_CONTACT_SELECTOR, EmpathyContactSelectorClass)) -#define EMPATHY_IS_CONTACT_SELECTOR(object) (G_TYPE_CHECK_INSTANCE_TYPE \ - ((object), EMPATHY_TYPE_CONTACT_SELECTOR)) -#define EMPATHY_IS_CONTACT_SELECTOR_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), EMPATHY_TYPE_CONTACT_SELECTOR)) -#define EMPATHY_CONTACT_SELECTOR_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS \ - ((object), EMPATHY_TYPE_CONTACT_SELECTOR, EmpathyContactSelectorClass)) - -typedef struct _EmpathyContactSelector EmpathyContactSelector; -typedef struct _EmpathyContactSelectorClass EmpathyContactSelectorClass; - -struct _EmpathyContactSelector -{ - GtkComboBox parent; - - /*<private>*/ - gpointer priv; -}; - -struct _EmpathyContactSelectorClass -{ - GtkComboBoxClass parent_class; -}; - -GType empathy_contact_selector_get_type (void) G_GNUC_CONST; - -GtkWidget * empathy_contact_selector_new (EmpathyContactList *contact_list); - -EmpathyContact * empathy_contact_selector_dup_selected (EmpathyContactSelector *selector); - -typedef gboolean (*EmpathyContactSelectorFilterFunc) (EmpathyContact *contact, gpointer user_data); - -void empathy_contact_selector_set_visible (EmpathyContactSelector *selector, - EmpathyContactSelectorFilterFunc func, gpointer user_data); - -G_END_DECLS - -#endif /* __EMPATHY_CONTACT_SELECTOR_H__ */ diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index b9c17687c..6c021c3ee 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -1750,6 +1750,7 @@ contact_widget_contact_setup (EmpathyContactWidget *information) PANGO_WRAP_WORD_CHAR); gtk_label_set_line_wrap (GTK_LABEL (information->label_status), TRUE); + gtk_misc_set_alignment (GTK_MISC (information->label_status), 0, 0.5); if (!(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP)) gtk_label_set_selectable (GTK_LABEL (information->label_status), TRUE); diff --git a/libempathy-gtk/empathy-individual-linker.c b/libempathy-gtk/empathy-individual-linker.c index 54663ef26..793c2827f 100644 --- a/libempathy-gtk/empathy-individual-linker.c +++ b/libempathy-gtk/empathy-individual-linker.c @@ -280,7 +280,7 @@ individual_view_drag_motion_cb (GtkWidget *widget, target = gtk_drag_dest_find_target (GTK_WIDGET (view), context, NULL); - if (target == gdk_atom_intern_static_string ("text/persona-id")) + if (target == gdk_atom_intern_static_string ("text/x-persona-id")) { GtkTreePath *path; diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c index 745474d84..77cbc57d5 100644 --- a/libempathy-gtk/empathy-individual-menu.c +++ b/libempathy-gtk/empathy-individual-menu.c @@ -664,7 +664,7 @@ empathy_individual_menu_class_init (EmpathyIndividualMenuClass *klass) signals[SIGNAL_LINK_CONTACTS_ACTIVATED] = g_signal_new ("link-contacts-activated", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, EMPATHY_TYPE_LINKING_DIALOG); g_type_class_add_private (object_class, sizeof (EmpathyIndividualMenuPriv)); @@ -1131,8 +1131,9 @@ empathy_individual_edit_menu_item_new (FolksIndividual *individual) manager = empathy_individual_manager_dup_singleton (); connection = empathy_contact_get_connection (contact); - enable = (empathy_connection_can_alias_personas (connection) && - empathy_connection_can_group_personas (connection)); + enable = (empathy_connection_can_alias_personas (connection, + individual) && + empathy_connection_can_group_personas (connection, individual)); g_object_unref (manager); } diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index d21a9d50b..a499bf1cc 100644 --- a/libempathy-gtk/empathy-individual-store.c +++ b/libempathy-gtk/empathy-individual-store.c @@ -73,9 +73,9 @@ typedef struct GHashTable *status_icons; /* List of owned GCancellables for each pending avatar load operation */ GList *avatar_cancellables; - /* Hash: FolksIndividual* -> GQueue (GtkTreeRowReference) */ + /* Hash: FolksIndividual* -> GQueue (GtkTreeIter *) */ GHashTable *folks_individual_cache; - /* Hash: char *groupname -> GtkTreeRowReference *row */ + /* Hash: char *groupname -> GtkTreeIter * */ GHashTable *empathy_group_cache; } EmpathyIndividualStorePriv; @@ -205,8 +205,6 @@ add_individual_to_store (GtkTreeStore *self, EmpathyIndividualStorePriv *priv = GET_PRIV (self); gboolean can_audio_call, can_video_call; const gchar * const *types; - GtkTreeRowReference *row_ref; - GtkTreePath *path; GQueue *queue; individual_can_audio_video_call (individual, &can_audio_call, @@ -225,21 +223,18 @@ add_individual_to_store (GtkTreeStore *self, EMPATHY_INDIVIDUAL_STORE_COL_CLIENT_TYPES, types, -1); - path = gtk_tree_model_get_path (GTK_TREE_MODEL (self), iter); - row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (self), path); queue = g_hash_table_lookup (priv->folks_individual_cache, individual); if (queue) { - g_queue_push_tail (queue, row_ref); + g_queue_push_tail (queue, gtk_tree_iter_copy (iter)); } else { queue = g_queue_new (); - g_queue_push_tail (queue, row_ref); + g_queue_push_tail (queue, gtk_tree_iter_copy (iter)); g_hash_table_insert (priv->folks_individual_cache, individual, queue); } - gtk_tree_path_free (path); } static void @@ -254,15 +249,13 @@ individual_store_get_group (EmpathyIndividualStore *self, GtkTreeModel *model; GtkTreeIter iter_group; GtkTreeIter iter_separator; - GtkTreeRowReference *row_ref; + GtkTreeIter *iter; model = GTK_TREE_MODEL (self); - row_ref = g_hash_table_lookup (priv->empathy_group_cache, name); + iter = g_hash_table_lookup (priv->empathy_group_cache, name); - if (row_ref == NULL) + if (iter == NULL) { - GtkTreePath *path; - if (created) *created = TRUE; @@ -276,11 +269,8 @@ individual_store_get_group (EmpathyIndividualStore *self, EMPATHY_INDIVIDUAL_STORE_COL_IS_FAKE_GROUP, is_fake_group, -1); - path = gtk_tree_model_get_path (GTK_TREE_MODEL (self), &iter_group); - row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (self), path); - g_hash_table_insert (priv->empathy_group_cache, - g_strdup (name), row_ref); - gtk_tree_path_free (path); + g_hash_table_insert (priv->empathy_group_cache, g_strdup (name), + gtk_tree_iter_copy (&iter_group)); if (iter_group_to_set) *iter_group_to_set = iter_group; @@ -295,22 +285,13 @@ individual_store_get_group (EmpathyIndividualStore *self, } else { - GtkTreePath *path = gtk_tree_row_reference_get_path (row_ref); - GtkTreeIter iter; - - if (!gtk_tree_model_get_iter (model, &iter, path)) { - gtk_tree_path_free (path); - return; - } - gtk_tree_path_free (path); - if (created) *created = FALSE; if (iter_group_to_set) - *iter_group_to_set = iter; + *iter_group_to_set = *iter; - iter_separator = iter; + iter_separator = *iter; if (gtk_tree_model_iter_next (model, &iter_separator)) { @@ -330,12 +311,10 @@ individual_store_find_contact (EmpathyIndividualStore *self, FolksIndividual *individual) { EmpathyIndividualStorePriv *priv = GET_PRIV (self); - GtkTreeModel *model; GQueue *row_refs_queue; GList *i; GList *iters_list = NULL; - model = GTK_TREE_MODEL (self); row_refs_queue = g_hash_table_lookup (priv->folks_individual_cache, individual); if (!row_refs_queue) @@ -343,16 +322,9 @@ individual_store_find_contact (EmpathyIndividualStore *self, for (i = g_queue_peek_head_link (row_refs_queue) ; i != NULL ; i = i->next) { - GtkTreePath *path = gtk_tree_row_reference_get_path (i->data); - GtkTreeIter iter; - if (!gtk_tree_model_get_iter (model, &iter, path)) - { - gtk_tree_path_free (path); - continue; - } - gtk_tree_path_free (path); - iters_list = g_list_prepend - (iters_list, gtk_tree_iter_copy (&iter)); + GtkTreeIter *iter = i->data; + + iters_list = g_list_prepend (iters_list, gtk_tree_iter_copy (iter)); } return iters_list; @@ -383,23 +355,14 @@ individual_store_remove_individual (EmpathyIndividualStore *self, for (l = g_queue_peek_head_link (row_refs); l; l = l->next) { - GtkTreePath *path = gtk_tree_row_reference_get_path (l->data); - GtkTreeIter iter; + GtkTreeIter *iter = l->data; GtkTreeIter parent; - if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (self), &iter, - path)) - { - gtk_tree_path_free (path); - continue; - } - gtk_tree_path_free (path); - /* NOTE: it is only <= 2 here because we have * separators after the group name, otherwise it * should be 1. */ - if (gtk_tree_model_iter_parent (model, &parent, &iter) && + if (gtk_tree_model_iter_parent (model, &parent, iter) && gtk_tree_model_iter_n_children (model, &parent) <= 2) { gchar *group_name; @@ -412,7 +375,7 @@ individual_store_remove_individual (EmpathyIndividualStore *self, } else { - gtk_tree_store_remove (GTK_TREE_STORE (self), &iter); + gtk_tree_store_remove (GTK_TREE_STORE (self), iter); } } @@ -954,6 +917,20 @@ individual_personas_changed_cb (FolksIndividual *individual, g_clear_object (&iter); } +static void +individual_store_favourites_changed_cb (FolksIndividual *individual, + GParamSpec *param, + EmpathyIndividualStore *self) +{ + DEBUG ("Individual %s is %s a favourite", + folks_individual_get_id (individual), + folks_favourite_details_get_is_favourite ( + FOLKS_FAVOURITE_DETAILS (individual)) ? "now" : "no longer"); + + individual_store_remove_individual (self, individual); + individual_store_add_individual (self, individual); +} + void individual_store_add_individual_and_connect (EmpathyIndividualStore *self, FolksIndividual *individual) @@ -972,6 +949,8 @@ individual_store_add_individual_and_connect (EmpathyIndividualStore *self, (GCallback) individual_store_individual_updated_cb, self); g_signal_connect (individual, "personas-changed", (GCallback) individual_personas_changed_cb, self); + g_signal_connect (individual, "notify::is-favourite", + (GCallback) individual_store_favourites_changed_cb, self); /* provide an empty set so the callback can assume non-NULL sets */ individual_personas_changed_cb (individual, @@ -994,6 +973,8 @@ individual_store_disconnect_individual (EmpathyIndividualStore *self, (GCallback) individual_store_individual_updated_cb, self); g_signal_handlers_disconnect_by_func (individual, (GCallback) individual_personas_changed_cb, self); + g_signal_handlers_disconnect_by_func (individual, + (GCallback) individual_store_favourites_changed_cb, self); } void @@ -1031,20 +1012,6 @@ individual_store_members_changed_cb (EmpathyIndividualManager *manager, } static void -individual_store_favourites_changed_cb (EmpathyIndividualManager *manager, - FolksIndividual *individual, - gboolean is_favourite, - EmpathyIndividualStore *self) -{ - DEBUG ("Individual %s is %s a favourite", - folks_individual_get_id (individual), - is_favourite ? "now" : "no longer"); - - individual_store_remove_individual (self, individual); - individual_store_add_individual (self, individual); -} - -static void individual_store_groups_changed_cb (EmpathyIndividualManager *manager, FolksIndividual *individual, gchar *group, @@ -1087,10 +1054,6 @@ individual_store_manager_setup (gpointer user_data) G_CALLBACK (individual_store_members_changed_cb), self); g_signal_connect (priv->manager, - "favourites-changed", - G_CALLBACK (individual_store_favourites_changed_cb), self); - - g_signal_connect (priv->manager, "groups-changed", G_CALLBACK (individual_store_groups_changed_cb), self); @@ -1169,8 +1132,6 @@ individual_store_dispose (GObject *object) g_signal_handlers_disconnect_by_func (priv->manager, G_CALLBACK (individual_store_members_changed_cb), object); g_signal_handlers_disconnect_by_func (priv->manager, - G_CALLBACK (individual_store_favourites_changed_cb), object); - g_signal_handlers_disconnect_by_func (priv->manager, G_CALLBACK (individual_store_groups_changed_cb), object); g_object_unref (priv->manager); @@ -1624,10 +1585,10 @@ individual_store_inhibit_active_cb (EmpathyIndividualStore *self) } static void -g_queue_free_full_row_ref (gpointer data) +g_queue_free_full_iter (gpointer data) { GQueue *queue = (GQueue *) data; - g_queue_foreach (queue, (GFunc) gtk_tree_row_reference_free, NULL); + g_queue_foreach (queue, (GFunc) gtk_tree_iter_free, NULL); g_queue_free (queue); } @@ -1647,10 +1608,9 @@ empathy_individual_store_init (EmpathyIndividualStore *self) priv->status_icons = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); priv->folks_individual_cache = g_hash_table_new_full (NULL, NULL, NULL, - g_queue_free_full_row_ref); + g_queue_free_full_iter); priv->empathy_group_cache = g_hash_table_new_full (g_str_hash, - g_str_equal, g_free, - (GDestroyNotify) gtk_tree_row_reference_free); + g_str_equal, g_free, (GDestroyNotify) gtk_tree_iter_free); individual_store_setup (self); } diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 9d23027fc..51c9dfc29 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -55,7 +55,6 @@ #include "empathy-cell-renderer-activatable.h" #include "empathy-ui-utils.h" #include "empathy-gtk-enum-types.h" -#include "empathy-gtk-marshal.h" #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT #include <libempathy/empathy-debug.h> @@ -132,8 +131,8 @@ typedef enum { (gchar *) T, 0, I } static const GtkTargetEntry drag_types_dest[] = { - DRAG_TYPE ("text/individual-id", DND_DRAG_TYPE_INDIVIDUAL_ID), - DRAG_TYPE ("text/persona-id", DND_DRAG_TYPE_PERSONA_ID), + DRAG_TYPE ("text/x-individual-id", DND_DRAG_TYPE_INDIVIDUAL_ID), + DRAG_TYPE ("text/x-persona-id", DND_DRAG_TYPE_PERSONA_ID), DRAG_TYPE ("text/path-list", DND_DRAG_TYPE_URI_LIST), DRAG_TYPE ("text/uri-list", DND_DRAG_TYPE_URI_LIST), DRAG_TYPE ("text/plain", DND_DRAG_TYPE_STRING), @@ -141,7 +140,7 @@ static const GtkTargetEntry drag_types_dest[] = { }; static const GtkTargetEntry drag_types_source[] = { - DRAG_TYPE ("text/individual-id", DND_DRAG_TYPE_INDIVIDUAL_ID), + DRAG_TYPE ("text/x-individual-id", DND_DRAG_TYPE_INDIVIDUAL_ID), }; #undef DRAG_TYPE @@ -866,7 +865,7 @@ individual_view_drag_data_get (GtkWidget *widget, if (info == DND_DRAG_TYPE_INDIVIDUAL_ID) { gtk_selection_data_set (selection, - gdk_atom_intern ("text/individual-id", FALSE), 8, + gdk_atom_intern ("text/x-individual-id", FALSE), 8, (guchar *) individual_id, strlen (individual_id) + 1); } @@ -2152,7 +2151,7 @@ empathy_individual_view_class_init (EmpathyIndividualViewClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EmpathyIndividualViewClass, drag_individual_received), NULL, NULL, - _empathy_gtk_marshal_VOID__UINT_OBJECT_STRING_STRING, + g_cclosure_marshal_generic, G_TYPE_NONE, 4, G_TYPE_UINT, FOLKS_TYPE_INDIVIDUAL, G_TYPE_STRING, G_TYPE_STRING); @@ -2162,7 +2161,7 @@ empathy_individual_view_class_init (EmpathyIndividualViewClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EmpathyIndividualViewClass, drag_persona_received), NULL, NULL, - _empathy_gtk_marshal_BOOLEAN__UINT_OBJECT_OBJECT, + g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 3, G_TYPE_UINT, FOLKS_TYPE_PERSONA, FOLKS_TYPE_INDIVIDUAL); g_object_class_install_property (object_class, diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c index 0a3844aa2..9e0b9d3a2 100644 --- a/libempathy-gtk/empathy-individual-widget.c +++ b/libempathy-gtk/empathy-individual-widget.c @@ -80,10 +80,10 @@ typedef struct { /* weak pointer to the contact whose contact details we're displaying */ TpContact *contact; - /* unowned Persona (borrowed from priv->individual) -> GtkTable child */ - GHashTable *persona_tables; + /* unowned Persona (borrowed from priv->individual) -> GtkGrid child */ + GHashTable *persona_grids; /* Table containing the information for the individual as whole, or NULL */ - GtkTable *individual_table; + GtkGrid *individual_grid; /* Individual */ GtkWidget *hbox_presence; @@ -111,7 +111,7 @@ typedef struct { /* Details */ GtkWidget *vbox_details; - GtkWidget *table_details; + GtkWidget *grid_details; GtkWidget *hbox_details_requested; GtkWidget *details_spinner; GCancellable *details_cancellable; /* owned */ @@ -297,8 +297,8 @@ details_update_show (EmpathyIndividualWidget *self, /* Add Title */ w = gtk_label_new (_(field_data->title)); - gtk_table_attach (GTK_TABLE (priv->table_details), - w, 0, 1, n_rows, n_rows + 1, GTK_FILL, 0, 0, 0); + gtk_grid_attach (GTK_GRID (priv->grid_details), + w, 0, n_rows, 1, 1); gtk_misc_set_alignment (GTK_MISC (w), 0, 0.5); gtk_widget_show (w); @@ -316,8 +316,8 @@ details_update_show (EmpathyIndividualWidget *self, gtk_label_set_selectable (GTK_LABEL (w), (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_FOR_TOOLTIP) ? FALSE : TRUE); - gtk_table_attach_defaults (GTK_TABLE (priv->table_details), - w, 1, 2, n_rows, n_rows + 1); + gtk_grid_attach (GTK_GRID (priv->grid_details), + w, 1, n_rows, 1, 1); gtk_misc_set_alignment (GTK_MISC (w), 0, 0.5); gtk_widget_show (w); @@ -336,7 +336,7 @@ details_notify_cb (TpContact *contact, EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); guint n_rows; - gtk_container_foreach (GTK_CONTAINER (priv->table_details), + gtk_container_foreach (GTK_CONTAINER (priv->grid_details), (GtkCallback) gtk_widget_destroy, NULL); n_rows = details_update_show (self, contact); @@ -344,7 +344,7 @@ details_notify_cb (TpContact *contact, if (n_rows > 0) { gtk_widget_show (priv->vbox_details); - gtk_widget_show (priv->table_details); + gtk_widget_show (priv->grid_details); } else { @@ -411,7 +411,7 @@ fetch_contact_information (EmpathyIndividualWidget *self) /* Request the Individual's info */ gtk_widget_show (priv->vbox_details); gtk_widget_show (priv->hbox_details_requested); - gtk_widget_hide (priv->table_details); + gtk_widget_hide (priv->grid_details); gtk_spinner_start (GTK_SPINNER (priv->details_spinner)); if (priv->details_cancellable == NULL) @@ -1158,28 +1158,28 @@ notify_avatar_cb (gpointer folks_object, { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); EmpathyAvatar *avatar = NULL; - GObject *table; + GObject *grid; GtkWidget *avatar_widget; if (FOLKS_IS_INDIVIDUAL (folks_object)) { avatar = individual_dup_avatar (FOLKS_INDIVIDUAL (folks_object)); - table = G_OBJECT (priv->individual_table); + grid = G_OBJECT (priv->individual_grid); } else if (FOLKS_IS_PERSONA (folks_object)) { avatar = persona_dup_avatar (FOLKS_PERSONA (folks_object)); - table = g_hash_table_lookup (priv->persona_tables, folks_object); + grid = g_hash_table_lookup (priv->persona_grids, folks_object); } else { g_assert_not_reached (); } - if (table == NULL) + if (grid == NULL) return; - avatar_widget = g_object_get_data (table, "avatar-widget"); + avatar_widget = g_object_get_data (grid, "avatar-widget"); empathy_avatar_image_set (EMPATHY_AVATAR_IMAGE (avatar_widget), avatar); if (avatar != NULL) @@ -1192,20 +1192,20 @@ notify_alias_cb (gpointer folks_object, EmpathyIndividualWidget *self) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); - GObject *table; + GObject *grid; GtkWidget *alias_widget; if (FOLKS_IS_INDIVIDUAL (folks_object)) - table = G_OBJECT (priv->individual_table); + grid = G_OBJECT (priv->individual_grid); else if (FOLKS_IS_PERSONA (folks_object)) - table = g_hash_table_lookup (priv->persona_tables, folks_object); + grid = g_hash_table_lookup (priv->persona_grids, folks_object); else g_assert_not_reached (); - if (table == NULL) + if (grid == NULL) return; - alias_widget = g_object_get_data (table, "alias-widget"); + alias_widget = g_object_get_data (grid, "alias-widget"); if (GTK_IS_ENTRY (alias_widget)) { @@ -1225,23 +1225,23 @@ notify_presence_cb (gpointer folks_object, EmpathyIndividualWidget *self) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); - GObject *table; + GObject *grid; GtkWidget *status_label, *state_image; const gchar *message; gchar *markup_text = NULL; if (FOLKS_IS_INDIVIDUAL (folks_object)) - table = G_OBJECT (priv->individual_table); + grid = G_OBJECT (priv->individual_grid); else if (FOLKS_IS_PERSONA (folks_object)) - table = g_hash_table_lookup (priv->persona_tables, folks_object); + grid = g_hash_table_lookup (priv->persona_grids, folks_object); else g_assert_not_reached (); - if (table == NULL) + if (grid == NULL) return; - status_label = g_object_get_data (table, "status-label"); - state_image = g_object_get_data (table, "state-image"); + status_label = g_object_get_data (grid, "status-label"); + state_image = g_object_get_data (grid, "state-image"); /* FIXME: Default messages should be moved into libfolks (bgo#627403) */ message = folks_presence_details_get_presence_message ( @@ -1272,20 +1272,20 @@ notify_is_favourite_cb (gpointer folks_object, EmpathyIndividualWidget *self) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); - GObject *table; + GObject *grid; GtkWidget *favourite_widget; if (FOLKS_IS_INDIVIDUAL (folks_object)) - table = G_OBJECT (priv->individual_table); + grid = G_OBJECT (priv->individual_grid); else if (FOLKS_IS_PERSONA (folks_object)) - table = g_hash_table_lookup (priv->persona_tables, folks_object); + grid = g_hash_table_lookup (priv->persona_grids, folks_object); else g_assert_not_reached (); - if (table == NULL) + if (grid == NULL) return; - favourite_widget = g_object_get_data (table, "favourite-widget"); + favourite_widget = g_object_get_data (grid, "favourite-widget"); if (GTK_IS_TOGGLE_BUTTON (favourite_widget)) { @@ -1297,18 +1297,17 @@ notify_is_favourite_cb (gpointer folks_object, static void alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self, - GtkTable *table, + GtkGrid *grid, guint starting_row) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); - GtkWidget *label, *alias, *image, *avatar, *alignment; + GtkWidget *label, *alias, *image, *avatar; guint current_row = starting_row; /* Alias */ label = gtk_label_new (_("Alias:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, 0, 1, current_row, current_row + 1, GTK_FILL, - GTK_FILL, 0, 0); + gtk_grid_attach (grid, label, 0, current_row, 1, 1); gtk_widget_show (label); /* Set up alias label/entry */ @@ -1330,9 +1329,9 @@ alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self, gtk_misc_set_alignment (GTK_MISC (alias), 0.0, 0.5); } - g_object_set_data (G_OBJECT (table), "alias-widget", alias); - gtk_table_attach (table, alias, 1, 2, current_row, current_row + 1, - GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); + g_object_set_data (G_OBJECT (grid), "alias-widget", alias); + gtk_grid_attach_next_to (grid, alias, label, + GTK_POS_RIGHT, 1, 1); gtk_widget_show (alias); current_row++; @@ -1343,7 +1342,7 @@ alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self, /* Presence image */ image = gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_BUTTON); - g_object_set_data (G_OBJECT (table), "state-image", image); + g_object_set_data (G_OBJECT (grid), "state-image", image); gtk_box_pack_start (GTK_BOX (priv->hbox_presence), image, FALSE, FALSE, 0); gtk_widget_show (image); @@ -1356,13 +1355,13 @@ alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self, gtk_label_set_selectable (GTK_LABEL (label), (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_FOR_TOOLTIP) ? FALSE : TRUE); - g_object_set_data (G_OBJECT (table), "status-label", label); - gtk_box_pack_start (GTK_BOX (priv->hbox_presence), label, TRUE, - TRUE, 0); + g_object_set_data (G_OBJECT (grid), "status-label", label); + gtk_box_pack_start (GTK_BOX (priv->hbox_presence), label, FALSE, + FALSE, 0); gtk_widget_show (label); - gtk_table_attach (table, priv->hbox_presence, 0, 2, current_row, - current_row + 1, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); + gtk_grid_attach (grid, priv->hbox_presence, + 0, current_row, 2, 1); gtk_widget_show (priv->hbox_presence); current_row++; @@ -1375,9 +1374,9 @@ alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self, g_signal_connect (favourite, "toggled", (GCallback) favourite_toggled_cb, self); - g_object_set_data (G_OBJECT (table), "favourite-widget", favourite); - gtk_table_attach (table, favourite, 0, 2, current_row, current_row + 1, - GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); + g_object_set_data (G_OBJECT (grid), "favourite-widget", favourite); + gtk_grid_attach (grid, favourite, + 0, current_row, 2, 1); gtk_widget_show (favourite); current_row++; @@ -1394,15 +1393,18 @@ alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self, (GCallback) avatar_widget_button_press_event_cb, self); } - g_object_set_data (G_OBJECT (table), "avatar-widget", avatar); + g_object_set_data (G_OBJECT (grid), "avatar-widget", avatar); + g_object_set (avatar, + "valign", GTK_ALIGN_START, + "margin-left", 6, + "margin-right", 6, + "margin-top", 6, + "margin-bottom", 6, + NULL); - alignment = gtk_alignment_new (1.0, 0.0, 0.0, 0.0); - gtk_container_add (GTK_CONTAINER (alignment), avatar); + gtk_grid_attach (grid, avatar, + 2, 0, 1, current_row); gtk_widget_show (avatar); - - gtk_table_attach (table, alignment, 2, 3, 0, current_row, - GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 6, 6); - gtk_widget_show (alignment); } static void @@ -1412,14 +1414,14 @@ update_persona (EmpathyIndividualWidget *self, FolksPersona *persona) TpContact *tp_contact; EmpathyContact *contact; TpAccount *account; - GtkTable *table; + GtkGrid *grid; GtkLabel *label; GtkImage *image; const gchar *id; - table = g_hash_table_lookup (priv->persona_tables, persona); + grid = g_hash_table_lookup (priv->persona_grids, persona); - g_assert (table != NULL); + g_assert (grid != NULL); tp_contact = tpf_persona_get_contact (TPF_PERSONA (persona)); if (tp_contact == NULL) @@ -1435,8 +1437,8 @@ update_persona (EmpathyIndividualWidget *self, FolksPersona *persona) { const gchar *name; - label = g_object_get_data (G_OBJECT (table), "account-label"); - image = g_object_get_data (G_OBJECT (table), "account-image"); + label = g_object_get_data (G_OBJECT (grid), "account-label"); + image = g_object_get_data (G_OBJECT (grid), "account-image"); name = tp_account_get_display_name (account); gtk_label_set_label (label, name); @@ -1446,7 +1448,7 @@ update_persona (EmpathyIndividualWidget *self, FolksPersona *persona) } /* Update id widget */ - label = g_object_get_data (G_OBJECT (table), "id-widget"); + label = g_object_get_data (G_OBJECT (grid), "id-widget"); id = folks_persona_get_display_id (persona); gtk_label_set_label (label, (id != NULL) ? id : ""); @@ -1467,7 +1469,7 @@ add_persona (EmpathyIndividualWidget *self, { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); GtkBox *hbox; - GtkTable *table; + GtkGrid *grid; GtkWidget *label, *account_label, *account_image, *separator; guint current_row = 0; @@ -1475,17 +1477,18 @@ add_persona (EmpathyIndividualWidget *self, return; if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_EDIT_FAVOURITE) - table = GTK_TABLE (gtk_table_new (5, 3, FALSE)); + grid = GTK_GRID (gtk_grid_new ()); else - table = GTK_TABLE (gtk_table_new (4, 3, FALSE)); - gtk_table_set_row_spacings (table, 6); - gtk_table_set_col_spacings (table, 6); + grid = GTK_GRID (gtk_grid_new ()); + + gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL); + gtk_grid_set_row_spacing (grid, 6); + gtk_grid_set_column_spacing (grid, 6); /* Account and Identifier */ label = gtk_label_new (_("Account:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, 0, 1, current_row, current_row + 1, - GTK_FILL, GTK_FILL, 0, 0); + gtk_grid_attach (grid, label, 0, current_row, 1, 1); gtk_widget_show (label); /* Pack the protocol icon with the account name in an hbox */ @@ -1503,10 +1506,9 @@ add_persona (EmpathyIndividualWidget *self, gtk_box_pack_start (hbox, account_image, FALSE, FALSE, 0); gtk_box_pack_start (hbox, account_label, FALSE, TRUE, 0); - g_object_set_data (G_OBJECT (table), "account-image", account_image); - g_object_set_data (G_OBJECT (table), "account-label", account_label); - gtk_table_attach (table, GTK_WIDGET (hbox), 1, 2, current_row, - current_row + 1, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); + g_object_set_data (G_OBJECT (grid), "account-image", account_image); + g_object_set_data (G_OBJECT (grid), "account-label", account_label); + gtk_grid_attach_next_to (grid, GTK_WIDGET (hbox), label, GTK_POS_RIGHT, 1, 1); gtk_widget_show (GTK_WIDGET (hbox)); current_row++; @@ -1514,8 +1516,7 @@ add_persona (EmpathyIndividualWidget *self, /* Translators: Identifier to connect to Instant Messaging network */ label = gtk_label_new (_("Identifier:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, 0, 1, current_row, current_row + 1, - GTK_FILL, GTK_FILL, 0, 0); + gtk_grid_attach (grid, label, 0, current_row, 1, 1); gtk_widget_show (label); /* Set up ID label */ @@ -1524,16 +1525,15 @@ add_persona (EmpathyIndividualWidget *self, (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_FOR_TOOLTIP) ? FALSE : TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - g_object_set_data (G_OBJECT (table), "id-widget", label); - gtk_table_attach (table, label, 1, 2, current_row, current_row + 1, - GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); + g_object_set_data (G_OBJECT (grid), "id-widget", label); + gtk_grid_attach (grid, label, 1, current_row, 1, 1); gtk_widget_show (label); current_row++; - alias_presence_avatar_favourite_set_up (self, table, current_row); + alias_presence_avatar_favourite_set_up (self, grid, current_row); - /* Connect to signals and display the table */ + /* Connect to signals and display the grid */ g_signal_connect (persona, "notify::alias", (GCallback) notify_alias_cb, self); g_signal_connect (persona, "notify::avatar", @@ -1550,17 +1550,17 @@ add_persona (EmpathyIndividualWidget *self, } gtk_box_pack_start (GTK_BOX (priv->vbox_individual), - GTK_WIDGET (table), FALSE, TRUE, 0); - gtk_widget_show (GTK_WIDGET (table)); + GTK_WIDGET (grid), FALSE, TRUE, 0); + gtk_widget_show (GTK_WIDGET (grid)); - /* Pack a separator after the table */ + /* Pack a separator after the grid */ separator = gtk_hseparator_new (); - g_object_set_data (G_OBJECT (table), "separator", separator); + g_object_set_data (G_OBJECT (grid), "separator", separator); gtk_box_pack_start (GTK_BOX (priv->vbox_individual), separator, FALSE, FALSE, 0); gtk_widget_show (separator); - g_hash_table_replace (priv->persona_tables, persona, table); + g_hash_table_replace (priv->persona_grids, persona, grid); /* Update the new widgets */ update_persona (self, persona); @@ -1572,13 +1572,13 @@ remove_persona (EmpathyIndividualWidget *self, { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); GtkWidget *separator; - GtkTable *table; + GtkGrid *grid; if (!empathy_folks_persona_is_interesting (persona)) return; - table = g_hash_table_lookup (priv->persona_tables, persona); - if (table == NULL) + grid = g_hash_table_lookup (priv->persona_grids, persona); + if (grid == NULL) return; g_signal_handlers_disconnect_by_func (persona, notify_alias_cb, self); @@ -1592,19 +1592,19 @@ remove_persona (EmpathyIndividualWidget *self, } /* Remove the separator */ - separator = g_object_get_data (G_OBJECT (table), "separator"); + separator = g_object_get_data (G_OBJECT (grid), "separator"); if (separator != NULL) gtk_container_remove (GTK_CONTAINER (priv->vbox_individual), separator); /* Remove the widget */ gtk_container_remove (GTK_CONTAINER (priv->vbox_individual), - GTK_WIDGET (table)); + GTK_WIDGET (grid)); - g_hash_table_remove (priv->persona_tables, persona); + g_hash_table_remove (priv->persona_grids, persona); } static void -update_individual_table (EmpathyIndividualWidget *self) +update_individual_grid (EmpathyIndividualWidget *self) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); @@ -1617,22 +1617,16 @@ update_individual_table (EmpathyIndividualWidget *self) } static void -individual_table_set_up (EmpathyIndividualWidget *self) +individual_grid_set_up (EmpathyIndividualWidget *self) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); - GtkTable *table; guint current_row = 0; - guint nb_rows = 2; - - if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_EDIT_FAVOURITE) - nb_rows++; - - if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_FOR_TOOLTIP) - nb_rows++; + GtkGrid *grid; - table = GTK_TABLE (gtk_table_new (nb_rows, 3, FALSE)); - gtk_table_set_row_spacings (table, 6); - gtk_table_set_col_spacings (table, 6); + grid = GTK_GRID (gtk_grid_new ()); + gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL); + gtk_grid_set_row_spacing (grid, 6); + gtk_grid_set_column_spacing (grid, 6); /* We only display the number of personas in tooltips */ if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_FOR_TOOLTIP) @@ -1666,37 +1660,36 @@ individual_table_set_up (EmpathyIndividualWidget *self) gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); g_free (message); - gtk_table_attach (table, label, 0, 2, current_row, current_row + 1, - GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); + gtk_grid_attach (grid, label, 0, current_row, 2, 1); gtk_widget_show (label); current_row++; } - alias_presence_avatar_favourite_set_up (self, table, current_row); + alias_presence_avatar_favourite_set_up (self, grid, current_row); - /* Display the table */ - gtk_box_pack_start (GTK_BOX (priv->vbox_individual), GTK_WIDGET (table), + /* Display the grid */ + gtk_box_pack_start (GTK_BOX (priv->vbox_individual), GTK_WIDGET (grid), FALSE, TRUE, 0); - gtk_widget_show (GTK_WIDGET (table)); + gtk_widget_show (GTK_WIDGET (grid)); - priv->individual_table = table; + priv->individual_grid = grid; - /* Update the table */ - update_individual_table (self); + /* Update the grid */ + update_individual_grid (self); } static void -individual_table_destroy (EmpathyIndividualWidget *self) +individual_grid_destroy (EmpathyIndividualWidget *self) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (self); - if (priv->individual_table == NULL) + if (priv->individual_grid == NULL) return; gtk_container_remove (GTK_CONTAINER (priv->vbox_individual), - GTK_WIDGET (priv->individual_table)); - priv->individual_table = NULL; + GTK_WIDGET (priv->individual_grid)); + priv->individual_grid = NULL; } static void @@ -1716,10 +1709,10 @@ personas_changed_cb (FolksIndividual *individual, /* we'll re-use this iterator throughout */ iter = gee_iterable_iterator (GEE_ITERABLE (personas)); - /* Note that old_num_personas is the number of persona tables we were + /* Note that old_num_personas is the number of persona gridss we were * displaying, not the number of Personas which were in the Individual * before. */ - old_num_personas = g_hash_table_size (priv->persona_tables); + old_num_personas = g_hash_table_size (priv->persona_grids); while (gee_iterator_next (iter)) { @@ -1733,11 +1726,11 @@ personas_changed_cb (FolksIndividual *individual, /* * What we display for various conditions: * - "Personas": display the alias, avatar, presence account and identifier - * for each of the Individual's Personas. (i.e. One table per + * for each of the Individual's Personas. (i.e. One grid per * Persona.) * - "Individual": display the alias, avatar and presence for the Individual, * and a label saying "Meta-contact containing x contacts". - * (i.e. One table in total.) + * (i.e. One grid in total.) * * | SHOW_PERSONAS | !SHOW_PERSONAS * -------------+---------------+--------------- @@ -1750,7 +1743,7 @@ personas_changed_cb (FolksIndividual *individual, will_show_personas = show_personas || new_num_personas == 1; /* If both @added and @removed are NULL, we're being called manually, and we - * need to set up the tables for the first time. We do this simply by + * need to set up the gridss for the first time. We do this simply by * ensuring was_showing_personas and will_show_personas are different so that * the code resets the UI. */ @@ -1785,10 +1778,10 @@ personas_changed_cb (FolksIndividual *individual, { gboolean c; - /* Remove the old Individual table */ - individual_table_destroy (self); + /* Remove the old Individual grid */ + individual_grid_destroy (self); - /* Set up all the Persona tables instead */ + /* Set up all the Persona grids instead */ for (c = gee_iterator_first (iter); c; c = gee_iterator_next (iter)) { FolksPersona *persona = gee_iterator_get (iter); @@ -1822,8 +1815,8 @@ personas_changed_cb (FolksIndividual *individual, g_clear_object (&iter_changed); } - /* Set up the Individual table instead */ - individual_table_set_up (self); + /* Set up the Individual grid instead */ + individual_grid_set_up (self); } g_clear_object (&iter); @@ -1887,7 +1880,7 @@ remove_individual (EmpathyIndividualWidget *self) g_clear_object (&persona); } g_clear_object (&iter); - individual_table_destroy (self); + individual_grid_destroy (self); if (priv->contact != NULL) remove_weak_contact (self); @@ -1926,7 +1919,7 @@ individual_update (EmpathyIndividualWidget *self) (GCallback) notify_is_favourite_cb, self); } - /* Update individual table */ + /* Update individual grid */ personas_changed_cb (priv->individual, NULL, NULL, self); } @@ -1934,10 +1927,10 @@ individual_update (EmpathyIndividualWidget *self) { gtk_widget_hide (priv->vbox_individual); } - else if (priv->individual_table != NULL) + else if (priv->individual_grid != NULL) { /* We only need to update the details for the Individual as a whole */ - update_individual_table (self); + update_individual_grid (self); gtk_widget_show (priv->vbox_individual); } else @@ -1992,7 +1985,7 @@ empathy_individual_widget_init (EmpathyIndividualWidget *self) #endif "groups_widget", &priv->groups_widget, "vbox_details", &priv->vbox_details, - "table_details", &priv->table_details, + "grid_details", &priv->grid_details, "hbox_details_requested", &priv->hbox_details_requested, "hbox_client_types", &priv->hbox_client_types, NULL); @@ -2004,8 +1997,8 @@ empathy_individual_widget_init (EmpathyIndividualWidget *self) 0); gtk_widget_show (priv->vbox_individual_widget); - priv->persona_tables = g_hash_table_new (NULL, NULL); - priv->individual_table = NULL; + priv->persona_grids = g_hash_table_new (NULL, NULL); + priv->individual_grid = NULL; /* Create widgets */ details_set_up (self); @@ -2109,7 +2102,7 @@ finalize (GObject *object) { EmpathyIndividualWidgetPriv *priv = GET_PRIV (object); - g_hash_table_destroy (priv->persona_tables); + g_hash_table_destroy (priv->persona_grids); G_OBJECT_CLASS (empathy_individual_widget_parent_class)->finalize (object); } diff --git a/libempathy-gtk/empathy-individual-widget.ui b/libempathy-gtk/empathy-individual-widget.ui index dcfc83a47..7e4d3f328 100644 --- a/libempathy-gtk/empathy-individual-widget.ui +++ b/libempathy-gtk/empathy-individual-widget.ui @@ -149,17 +149,10 @@ <property name="visible">True</property> <property name="spacing">6</property> <child> - <object class="GtkTable" id="table_details"> + <object class="GtkGrid" id="grid_details"> <property name="visible">True</property> - <property name="n_columns">2</property> <property name="column_spacing">12</property> <property name="row_spacing">6</property> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> </object> <packing> <property name="position">0</property> diff --git a/libempathy-gtk/empathy-irc-network-chooser.c b/libempathy-gtk/empathy-irc-network-chooser.c index 0fbd7b5fd..7a6bd7898 100644 --- a/libempathy-gtk/empathy-irc-network-chooser.c +++ b/libempathy-gtk/empathy-irc-network-chooser.c @@ -348,7 +348,7 @@ empathy_irc_network_chooser_class_init (EmpathyIrcNetworkChooserClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, + g_cclosure_marshal_generic, G_TYPE_NONE, 0); diff --git a/libempathy-gtk/empathy-live-search.c b/libempathy-gtk/empathy-live-search.c index 422bfcb73..968adca77 100644 --- a/libempathy-gtk/empathy-live-search.c +++ b/libempathy-gtk/empathy-live-search.c @@ -30,7 +30,6 @@ #include <libempathy/empathy-utils.h> #include "empathy-live-search.h" -#include "empathy-gtk-marshal.h" G_DEFINE_TYPE (EmpathyLiveSearch, empathy_live_search, GTK_TYPE_HBOX) @@ -546,7 +545,7 @@ empathy_live_search_class_init (EmpathyLiveSearchClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, + g_cclosure_marshal_generic, G_TYPE_NONE, 0); signals[KEYNAV] = g_signal_new ("key-navigation", @@ -554,7 +553,7 @@ empathy_live_search_class_init (EmpathyLiveSearchClass *klass) G_SIGNAL_RUN_LAST, 0, g_signal_accumulator_true_handled, NULL, - _empathy_gtk_marshal_BOOLEAN__BOXED, + g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); param_spec = g_param_spec_object ("hook-widget", "Live Search Hook Widget", diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index 03b97d03d..94df27835 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -182,7 +182,7 @@ publish_to_all_am_prepared_cb (GObject *source_object, GList *accounts, *l; GError *error = NULL; - if (!tp_account_manager_prepare_finish (manager, result, &error)) + if (!tp_proxy_prepare_finish (manager, result, &error)) { DEBUG ("Failed to prepare account manager: %s", error->message); g_error_free (error); @@ -214,7 +214,7 @@ publish_to_all_connections (EmpathyLocationManager *self, data->self = g_object_ref (self); data->force_publication = force_publication; - tp_account_manager_prepare_async (self->priv->account_manager, NULL, + tp_proxy_prepare_async (self->priv->account_manager, NULL, publish_to_all_am_prepared_cb, data); } @@ -609,7 +609,7 @@ account_manager_prepared_cb (GObject *source_object, EmpathyLocationManager *self = user_data; GError *error = NULL; - if (!tp_account_manager_prepare_finish (account_manager, result, &error)) + if (!tp_proxy_prepare_finish (account_manager, result, &error)) { DEBUG ("Failed to prepare account manager: %s", error->message); g_error_free (error); @@ -641,7 +641,7 @@ empathy_location_manager_init (EmpathyLocationManager *self) /* Setup account status callbacks */ priv->account_manager = tp_account_manager_dup (); - tp_account_manager_prepare_async (priv->account_manager, NULL, + tp_proxy_prepare_async (priv->account_manager, NULL, account_manager_prepared_cb, self); /* Setup settings status callbacks */ diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 5ea872e14..cc3a90614 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -182,6 +182,7 @@ enum COL_WHO_TYPE, COL_WHO_ICON, COL_WHO_NAME, + COL_WHO_NAME_SORT_KEY, COL_WHO_ID, COL_WHO_ACCOUNT, COL_WHO_TARGET, @@ -678,6 +679,9 @@ empathy_log_window_init (EmpathyLogWindow *self) empathy_account_chooser_filter_has_logs, NULL); empathy_account_chooser_set_all (account_chooser); + gtk_style_context_add_class (gtk_widget_get_style_context (self->priv->account_chooser), + GTK_STYLE_CLASS_RAISED); + g_signal_connect (self->priv->account_chooser, "changed", G_CALLBACK (log_window_chats_accounts_changed_cb), self); @@ -699,10 +703,10 @@ empathy_log_window_init (EmpathyLogWindow *self) vbox = gtk_vbox_new (FALSE, 3); self->priv->search_entry = gtk_entry_new (); - gtk_entry_set_icon_from_stock (GTK_ENTRY (self->priv->search_entry), - GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND); - gtk_entry_set_icon_from_stock (GTK_ENTRY (self->priv->search_entry), - GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR); + gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->search_entry), + GTK_ENTRY_ICON_SECONDARY, "edit-find-symbolic"); + gtk_entry_set_icon_sensitive (GTK_ENTRY (self->priv->search_entry), + GTK_ENTRY_ICON_SECONDARY, FALSE); label = gtk_label_new (_("Search")); @@ -1367,13 +1371,24 @@ log_window_append_call (TplEvent *event, if (tpl_call_event_get_end_reason (call) != TPL_CALL_END_REASON_NO_ANSWER) { gchar *body; + gchar *tmp; span = tpl_call_event_get_duration (TPL_CALL_EVENT (event)); + if (span < 60) - duration = g_strdup_printf (_("%" G_GINT64_FORMAT " seconds"), span); + { + tmp = g_strdup_printf ("%" G_GINT64_FORMAT, span); + duration = g_strdup_printf ( + ngettext ("%s second", "%s seconds", span), tmp); + g_free (tmp); + } else - duration = g_strdup_printf (_("%" G_GINT64_FORMAT " minutes"), - span / 60); + { + tmp = g_strdup_printf ("%" G_GINT64_FORMAT, span / 60); + duration = g_strdup_printf ( + ngettext ("%s minute", "%s minutes", span / 60), tmp); + g_free (tmp); + } finished_date = g_date_time_add (started_date, -span); finished = g_date_time_format (finished_date, "%X"); @@ -1729,9 +1744,8 @@ format_date_for_display (GDate *date) text = g_date_time_format (dt, "%A"); else text = g_date_time_format (dt, - C_("A date such as '23 May 2010', " - "%e is the day, %B the month and %Y the year", - "%e %B %Y")); + /* Translators: A date such as '23 May 2010' (strftime format) */ + _("%e %B %Y")); g_date_time_unref (dt); } @@ -1861,22 +1875,29 @@ populate_entities_from_search_hits (void) { TplEntityType type = tpl_entity_get_entity_type (hit->target); EmpathyContact *contact; + const gchar *name; + gchar *sort_key; gboolean room = type == TPL_ENTITY_ROOM; contact = empathy_contact_from_tpl_contact (hit->account, hit->target); + name = empathy_contact_get_alias (contact); + sort_key = g_utf8_collate_key (name, -1); + gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COL_WHO_TYPE, COL_TYPE_NORMAL, COL_WHO_ICON, room ? EMPATHY_IMAGE_GROUP_MESSAGE : EMPATHY_IMAGE_AVATAR_DEFAULT, - COL_WHO_NAME, empathy_contact_get_alias (contact), + COL_WHO_NAME, name, + COL_WHO_NAME_SORT_KEY, sort_key, COL_WHO_ID, tpl_entity_get_identifier (hit->target), COL_WHO_ACCOUNT, hit->account, COL_WHO_TARGET, hit->target, -1); + g_free (sort_key); g_object_unref (contact); } } @@ -2004,6 +2025,25 @@ static void log_window_search_entry_changed_cb (GtkWidget *entry, EmpathyLogWindow *self) { + const gchar *str; + + str = gtk_entry_get_text (GTK_ENTRY (self->priv->search_entry)); + + if (!tp_str_empty (str)) + { + gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->search_entry), + GTK_ENTRY_ICON_SECONDARY, "edit-clear-symbolic"); + gtk_entry_set_icon_sensitive (GTK_ENTRY (self->priv->search_entry), + GTK_ENTRY_ICON_SECONDARY, TRUE); + } + else + { + gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->search_entry), + GTK_ENTRY_ICON_SECONDARY, "edit-find-symbolic"); + gtk_entry_set_icon_sensitive (GTK_ENTRY (self->priv->search_entry), + GTK_ENTRY_ICON_SECONDARY, FALSE); + } + if (self->priv->source != 0) g_source_remove (self->priv->source); self->priv->source = g_timeout_add (500, (GSourceFunc) start_find_search, @@ -2279,21 +2319,28 @@ log_manager_got_entities_cb (GObject *manager, TplEntity *entity = TPL_ENTITY (l->data); TplEntityType type = tpl_entity_get_entity_type (entity); EmpathyContact *contact; + const gchar *name; + gchar *sort_key; gboolean room = type == TPL_ENTITY_ROOM; contact = empathy_contact_from_tpl_contact (ctx->account, entity); + name = empathy_contact_get_alias (contact); + sort_key = g_utf8_collate_key (name, -1); + gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COL_WHO_TYPE, COL_TYPE_NORMAL, COL_WHO_ICON, room ? EMPATHY_IMAGE_GROUP_MESSAGE : EMPATHY_IMAGE_AVATAR_DEFAULT, - COL_WHO_NAME, empathy_contact_get_alias (contact), + COL_WHO_NAME, name, + COL_WHO_NAME_SORT_KEY, sort_key, COL_WHO_ID, tpl_entity_get_identifier (entity), COL_WHO_ACCOUNT, ctx->account, COL_WHO_TARGET, entity, -1); + g_free (sort_key); g_object_unref (contact); if (ctx->self->priv->selected_account != NULL && @@ -2445,23 +2492,23 @@ log_window_who_populate (EmpathyLogWindow *self) } static gint -sort_by_name (GtkTreeModel *model, +sort_by_name_key (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) { - gchar *name1, *name2; + gchar *key1, *key2; gint type1, type2; gint ret; gtk_tree_model_get (model, a, COL_WHO_TYPE, &type1, - COL_WHO_NAME, &name1, + COL_WHO_NAME_SORT_KEY, &key1, -1); gtk_tree_model_get (model, b, COL_WHO_TYPE, &type2, - COL_WHO_NAME, &name2, + COL_WHO_NAME_SORT_KEY, &key2, -1); if (type1 == COL_TYPE_ANY) @@ -2473,10 +2520,10 @@ sort_by_name (GtkTreeModel *model, else if (type2 == COL_TYPE_SEPARATOR) ret = 1; else - ret = g_strcmp0 (name1, name2); + ret = g_strcmp0 (key1, key2); - g_free (name1); - g_free (name2); + g_free (key1); + g_free (key2); return ret; } @@ -2623,6 +2670,7 @@ log_window_who_setup (EmpathyLogWindow *self) G_TYPE_INT, /* type */ G_TYPE_STRING, /* icon */ G_TYPE_STRING, /* name */ + G_TYPE_STRING, /* name sort key */ G_TYPE_STRING, /* id */ TP_TYPE_ACCOUNT, /* account */ TPL_TYPE_ENTITY); /* target */ @@ -2657,10 +2705,10 @@ log_window_who_setup (EmpathyLogWindow *self) NULL, NULL); gtk_tree_sortable_set_sort_column_id (sortable, - COL_WHO_NAME, + COL_WHO_NAME_SORT_KEY, GTK_SORT_ASCENDING); gtk_tree_sortable_set_sort_func (sortable, - COL_WHO_NAME, sort_by_name, + COL_WHO_NAME_SORT_KEY, sort_by_name_key, NULL, NULL); gtk_tree_view_set_search_column (view, COL_WHO_NAME); diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c index 7a4374c48..3fcf9afb7 100644 --- a/libempathy-gtk/empathy-notify-manager.c +++ b/libempathy-gtk/empathy-notify-manager.c @@ -114,7 +114,7 @@ account_manager_prepared_cb (GObject *source_object, TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); GError *error = NULL; - if (!tp_account_manager_prepare_finish (account_manager, result, &error)) + if (!tp_proxy_prepare_finish (account_manager, result, &error)) { DEBUG ("Failed to prepare account manager: %s", error->message); g_error_free (error); @@ -150,7 +150,7 @@ empathy_notify_manager_init (EmpathyNotifyManager *self) priv->account_manager = tp_account_manager_dup (); - tp_account_manager_prepare_async (priv->account_manager, NULL, + tp_proxy_prepare_async (priv->account_manager, NULL, account_manager_prepared_cb, self); } diff --git a/libempathy-gtk/empathy-persona-view.c b/libempathy-gtk/empathy-persona-view.c index 5cb77c94b..7df94a630 100644 --- a/libempathy-gtk/empathy-persona-view.c +++ b/libempathy-gtk/empathy-persona-view.c @@ -46,7 +46,6 @@ #include "empathy-cell-renderer-text.h" #include "empathy-cell-renderer-activatable.h" #include "empathy-gtk-enum-types.h" -#include "empathy-gtk-marshal.h" #include "empathy-ui-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT @@ -96,13 +95,13 @@ typedef enum { (gchar *) T, 0, I } static const GtkTargetEntry drag_types_dest[] = { - DRAG_TYPE ("text/individual-id", DND_DRAG_TYPE_INDIVIDUAL_ID), + DRAG_TYPE ("text/x-individual-id", DND_DRAG_TYPE_INDIVIDUAL_ID), DRAG_TYPE ("text/plain", DND_DRAG_TYPE_STRING), DRAG_TYPE ("STRING", DND_DRAG_TYPE_STRING), }; static const GtkTargetEntry drag_types_source[] = { - DRAG_TYPE ("text/persona-id", DND_DRAG_TYPE_PERSONA_ID), + DRAG_TYPE ("text/x-persona-id", DND_DRAG_TYPE_PERSONA_ID), }; #undef DRAG_TYPE @@ -477,7 +476,7 @@ drag_data_get (GtkWidget *widget, persona_uid = folks_persona_get_uid (persona); gtk_selection_data_set (selection, - gdk_atom_intern ("text/persona-id", FALSE), 8, + gdk_atom_intern ("text/x-persona-id", FALSE), 8, (guchar *) persona_uid, strlen (persona_uid) + 1); g_object_unref (persona); @@ -715,7 +714,7 @@ empathy_persona_view_class_init (EmpathyPersonaViewClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EmpathyPersonaViewClass, drag_individual_received), NULL, NULL, - _empathy_gtk_marshal_BOOLEAN__UINT_OBJECT, + g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_UINT, FOLKS_TYPE_INDIVIDUAL); /* We override the "model" property so that we can wrap it in a diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index 66d516c40..65ec2f62f 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -742,7 +742,7 @@ update_sensitivity_am_prepared_cb (GObject *source_object, GList *accounts, *l; GError *error = NULL; - if (!tp_account_manager_prepare_finish (manager, result, &error)) { + if (!tp_proxy_prepare_finish (manager, result, &error)) { DEBUG ("Failed to prepare account manager: %s", error->message); g_error_free (error); return; @@ -774,7 +774,7 @@ presence_chooser_update_sensitivity (EmpathyPresenceChooser *chooser) { EmpathyPresenceChooserPriv *priv = GET_PRIV (chooser); - tp_account_manager_prepare_async (priv->account_manager, NULL, + tp_proxy_prepare_async (priv->account_manager, NULL, update_sensitivity_am_prepared_cb, chooser); } diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index 4e32630d5..9c23d3517 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -541,7 +541,8 @@ theme_adium_append_html (EmpathyThemeAdium *theme, const gchar *service_name, const gchar *message_classes, gint64 timestamp, - gboolean is_backlog) + gboolean is_backlog, + gboolean outgoing) { EmpathyThemeAdiumPriv *priv = GET_PRIV (theme); GString *string; @@ -571,7 +572,12 @@ theme_adium_append_html (EmpathyThemeAdium *theme, * Incoming/SenderColors.txt it will be used instead of * the default colors. */ - if (contact_id != NULL) { + + /* Ensure we always use the same color when sending messages + * (bgo #658821) */ + if (outgoing) { + replace = "inherit"; + } else if (contact_id != NULL) { guint hash = g_str_hash (contact_id); replace = colors[hash % G_N_ELEMENTS (colors)]; } @@ -687,7 +693,7 @@ theme_adium_append_event_escaped (EmpathyChatView *view, theme_adium_append_html (theme, "appendMessage", priv->data->status_html, escaped, NULL, NULL, NULL, NULL, "event", - empathy_time_get_current (), FALSE); + empathy_time_get_current (), FALSE, FALSE); /* There is no last contact */ if (priv->last_contact) { @@ -944,7 +950,7 @@ theme_adium_append_message (EmpathyChatView *view, theme_adium_append_html (theme, func, html, body_escaped, avatar_filename, name, contact_id, service_name, message_classes->str, - timestamp, is_backlog); + timestamp, is_backlog, empathy_contact_is_user (sender)); /* Keep the sender of the last displayed message */ if (priv->last_contact) { @@ -976,6 +982,14 @@ theme_adium_append_event (EmpathyChatView *view, } static void +theme_adium_append_event_markup (EmpathyChatView *view, + const gchar *markup_text, + const gchar *fallback_text) +{ + theme_adium_append_event_escaped (view, markup_text); +} + +static void theme_adium_edit_message (EmpathyChatView *view, EmpathyMessage *message) { @@ -1291,6 +1305,7 @@ theme_adium_iface_init (EmpathyChatViewIface *iface) { iface->append_message = theme_adium_append_message; iface->append_event = theme_adium_append_event; + iface->append_event_markup = theme_adium_append_event_markup; iface->edit_message = theme_adium_edit_message; iface->scroll = theme_adium_scroll; iface->scroll_down = theme_adium_scroll_down; @@ -1648,6 +1663,20 @@ empathy_theme_adium_set_variant (EmpathyThemeAdium *theme, g_object_notify (G_OBJECT (theme), "variant"); } +void +empathy_theme_adium_show_inspector (EmpathyThemeAdium *theme) +{ + WebKitWebView *web_view = WEBKIT_WEB_VIEW (theme); + WebKitWebInspector *inspector; + + g_object_set (G_OBJECT (webkit_web_view_get_settings (web_view)), + "enable-developer-extras", TRUE, + NULL); + + inspector = webkit_web_view_get_inspector (web_view); + webkit_web_inspector_show (inspector); +} + gboolean empathy_adium_path_is_valid (const gchar *path) { @@ -1733,8 +1762,11 @@ adium_info_dup_path_for_variant (GHashTable *info, return g_strdup ("main.css"); } - /* Verify the variant exists, fallback to the first one */ variants = empathy_adium_info_get_available_variants (info); + if (variants->len == 0) + return g_strdup ("main.css"); + + /* Verify the variant exists, fallback to the first one */ for (i = 0; i < variants->len; i++) { if (!tp_strdiff (variant, g_ptr_array_index (variants, i))) { break; diff --git a/libempathy-gtk/empathy-theme-adium.h b/libempathy-gtk/empathy-theme-adium.h index 1c01b7b37..6f7573b04 100644 --- a/libempathy-gtk/empathy-theme-adium.h +++ b/libempathy-gtk/empathy-theme-adium.h @@ -53,6 +53,7 @@ EmpathyThemeAdium *empathy_theme_adium_new (EmpathyAdiumData *data, const gchar *variant); void empathy_theme_adium_set_variant (EmpathyThemeAdium *theme, const gchar *variant); +void empathy_theme_adium_show_inspector (EmpathyThemeAdium *theme); gboolean empathy_adium_path_is_valid (const gchar *path); diff --git a/libempathy-gtk/empathy-theme-manager.c b/libempathy-gtk/empathy-theme-manager.c index c771392b9..28cbbf3bc 100644 --- a/libempathy-gtk/empathy-theme-manager.c +++ b/libempathy-gtk/empathy-theme-manager.c @@ -590,7 +590,7 @@ empathy_theme_manager_class_init (EmpathyThemeManagerClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, + g_cclosure_marshal_generic, G_TYPE_NONE, 0); diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index 8822ccdf6..32ad451a1 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -1762,7 +1762,8 @@ empathy_send_file (EmpathyContact *contact, GFile *file) factory = empathy_ft_factory_dup_singleton (); - empathy_ft_factory_new_transfer_outgoing (factory, contact, file); + empathy_ft_factory_new_transfer_outgoing (factory, contact, file, + empathy_get_current_action_time ()); uri = g_file_get_uri (file); manager = gtk_recent_manager_get_default (); |