#include <gtk/gtk.h>
#include <glade/glade.h>
#include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
#include <telepathy-glib/util.h>
GList *accounts;
empathy_window_present (GTK_WINDOW (priv->window), TRUE);
-
+
/* Show the accounts dialog if there is no enabled accounts */
accounts = mc_accounts_list_by_enabled (TRUE);
if (accounts) {
return TRUE;
}
+static gboolean
+status_icon_key_press_event_cb (GtkWidget *window,
+ GdkEventKey *event,
+ EmpathyStatusIcon *icon)
+{
+ if (event->keyval == GDK_Escape) {
+ status_icon_set_visibility (icon, FALSE, TRUE);
+ }
+ return FALSE;
+}
+
static void
status_icon_activate_cb (GtkStatusIcon *status_icon,
EmpathyStatusIcon *icon)
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK, str);
+ GTK_BUTTONS_OK,
+ "%s", str);
gtk_window_set_title (GTK_WINDOW (dialog),
_("Invitation Error"));
g_free (str);
}
EmpathyStatusIcon *
-empathy_status_icon_new (GtkWindow *window)
+empathy_status_icon_new (GtkWindow *window, gboolean hide_contact_list)
{
EmpathyStatusIconPriv *priv;
EmpathyStatusIcon *icon;
priv->window = g_object_ref (window);
+ g_signal_connect (priv->window, "key-press-event",
+ G_CALLBACK (status_icon_key_press_event_cb),
+ icon);
+
g_signal_connect (priv->window, "delete-event",
G_CALLBACK (status_icon_delete_event_cb),
icon);
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN,
- &should_hide);
+ if (!hide_contact_list) {
+ empathy_conf_get_bool (empathy_conf_get (),
+ EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN,
+ &should_hide);
+ } else {
+ should_hide = TRUE;
+ }
if (gtk_window_is_active (priv->window) == should_hide) {
status_icon_set_visibility (icon, !should_hide, FALSE);