From 808aab1091606abf34fbb67b62026bd442c4c872 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 23 Aug 2011 11:19:14 +0200 Subject: add generic contact icon and account settings button to the message page https://bugzilla.gnome.org/show_bug.cgi?id=656097 --- src/empathy-roster-window.c | 21 +++++++++++++++-- src/empathy-roster-window.ui | 56 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 73 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c index 8f5bcf2fc..a1e120919 100644 --- a/src/empathy-roster-window.c +++ b/src/empathy-roster-window.c @@ -129,6 +129,7 @@ struct _EmpathyRosterWindowPriv { GtkWidget *search_bar; GtkWidget *notebook; GtkWidget *no_entry_label; + GtkWidget *button_account_settings; GtkToggleAction *show_protocols; GtkRadioAction *sort_by_name; @@ -607,9 +608,18 @@ OUT: tp_clear_object (&individual); } +static void +button_account_settings_clicked_cb (GtkButton *button, + EmpathyRosterWindow *self) +{ + empathy_accounts_dialog_show_application (gdk_screen_get_default (), + NULL, FALSE, FALSE); +} + static void display_page_message (EmpathyRosterWindow *self, - const gchar *msg) + const gchar *msg, + gboolean display_accounts_button) { gchar *tmp; @@ -620,6 +630,9 @@ display_page_message (EmpathyRosterWindow *self, gtk_label_set_line_wrap (GTK_LABEL (self->priv->no_entry_label), TRUE); + gtk_widget_set_visible (self->priv->button_account_settings, + display_accounts_button); + gtk_notebook_set_current_page (GTK_NOTEBOOK (self->priv->notebook), PAGE_MESSAGE); } @@ -637,7 +650,7 @@ roster_window_row_deleted_cb (GtkTreeModel *model, if (empathy_individual_view_is_searching (self->priv->individual_view)) { - display_page_message (self, _("No match found")); + display_page_message (self, _("No match found"), FALSE); } } } @@ -2317,6 +2330,7 @@ empathy_roster_window_init (EmpathyRosterWindow *self) "notebook", &self->priv->notebook, "no_entry_label", &self->priv->no_entry_label, "roster_scrolledwindow", &sw, + "button_account_settings", &self->priv->button_account_settings, NULL); g_free (filename); @@ -2568,6 +2582,9 @@ empathy_roster_window_init (EmpathyRosterWindow *self) roster_window_notify_contact_list_size_cb (self->priv->gsettings_ui, EMPATHY_PREFS_UI_SHOW_AVATARS, self); + + g_signal_connect (self->priv->button_account_settings, "clicked", + G_CALLBACK (button_account_settings_clicked_cb), self); } GtkWidget * diff --git a/src/empathy-roster-window.ui b/src/empathy-roster-window.ui index a09d123f8..87c3354a9 100644 --- a/src/empathy-roster-window.ui +++ b/src/empathy-roster-window.ui @@ -91,10 +91,62 @@ - + True False - 0.30000001192092896 + vertical + + + True + False + 1 + 1 + avatar-default + 6 + + + True + True + 0 + + + + + True + False + 0.30000001192092896 + + + True + True + 1 + + + + + True + False + 0 + 0 + 0 + + + Account settings + True + True + True + 6 + 6 + False + + + + + True + True + 2 + + 1 -- cgit v1.2.3