diff options
-rw-r--r-- | src/empathy-roster-window.c | 22 | ||||
-rw-r--r-- | src/empathy-roster-window.ui | 26 |
2 files changed, 48 insertions, 0 deletions
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c index 465a403ad..4df1ee4bc 100644 --- a/src/empathy-roster-window.c +++ b/src/empathy-roster-window.c @@ -41,6 +41,7 @@ #include <libempathy/empathy-individual-manager.h> #include <libempathy/empathy-gsettings.h> #include <libempathy/empathy-status-presets.h> +#include <libempathy/empathy-presence-manager.h> #include <libempathy-gtk/empathy-live-search.h> #include <libempathy-gtk/empathy-contact-blocking-dialog.h> @@ -124,6 +125,7 @@ struct _EmpathyRosterWindowPriv { GtkWidget *notebook; GtkWidget *no_entry_label; GtkWidget *button_account_settings; + GtkWidget *button_online; GtkWidget *spinner_loading; GtkWidget *tooltip_widget; @@ -379,11 +381,26 @@ button_account_settings_clicked_cb (GtkButton *button, NULL, FALSE, FALSE); } +static void +button_online_clicked_cb (GtkButton *button, + EmpathyRosterWindow *self) +{ + EmpathyPresenceManager *mgr; + + mgr = empathy_presence_manager_dup_singleton (); + + empathy_presence_manager_set_state (mgr, + TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); + + g_object_unref (mgr); +} + typedef enum { PAGE_MESSAGE_FLAG_NONE = 0, PAGE_MESSAGE_FLAG_ACCOUNTS = 1 << 0, PAGE_MESSAGE_FLAG_SPINNER = 1 << 2, + PAGE_MESSAGE_FLAG_ONLINE = 1 << 3, } PageMessageFlags; static void @@ -412,6 +429,8 @@ display_page_message (EmpathyRosterWindow *self, (flags & PAGE_MESSAGE_FLAG_ACCOUNTS) != 0); gtk_widget_set_visible (self->priv->spinner_loading, (flags & PAGE_MESSAGE_FLAG_SPINNER) != 0); + gtk_widget_set_visible (self->priv->button_online, + (flags & PAGE_MESSAGE_FLAG_ONLINE) != 0); gtk_notebook_set_current_page (GTK_NOTEBOOK (self->priv->notebook), PAGE_MESSAGE); @@ -2180,6 +2199,7 @@ empathy_roster_window_init (EmpathyRosterWindow *self) "no_entry_label", &self->priv->no_entry_label, "roster_scrolledwindow", &sw, "button_account_settings", &self->priv->button_account_settings, + "button_online", &self->priv->button_online, "spinner_loading", &self->priv->spinner_loading, NULL); g_free (filename); @@ -2343,6 +2363,8 @@ empathy_roster_window_init (EmpathyRosterWindow *self) g_signal_connect (self->priv->button_account_settings, "clicked", G_CALLBACK (button_account_settings_clicked_cb), self); + g_signal_connect (self->priv->button_online, "clicked", + G_CALLBACK (button_online_clicked_cb), self); } GtkWidget * diff --git a/src/empathy-roster-window.ui b/src/empathy-roster-window.ui index 843f94e69..06f582672 100644 --- a/src/empathy-roster-window.ui +++ b/src/empathy-roster-window.ui @@ -165,6 +165,32 @@ <property name="position">2</property> </packing> </child> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="yalign">0</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <child> + <object class="GtkButton" id="button_online"> + <property name="label" translatable="yes">Go _Online</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="margin_left">6</property> + <property name="margin_right">6</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="position">1</property> |