From: Xavier Claessens Date: Thu, 10 May 2007 09:02:17 +0000 (+0000) Subject: [darcs-to-svn @ Improved EmpathyStatusIcon and GossipPresenceChooser] X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=cba1e6d2a95193cab71914016840c8f317cb5e2d [darcs-to-svn @ Improved EmpathyStatusIcon and GossipPresenceChooser] svn path=/trunk/; revision=43 --- diff --git a/libempathy-gtk/empathy-main-window.c b/libempathy-gtk/empathy-main-window.c index 6394a649..531d311e 100644 --- a/libempathy-gtk/empathy-main-window.c +++ b/libempathy-gtk/empathy-main-window.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -53,15 +52,11 @@ /* Accels (menu shortcuts) can be configured and saved */ #define ACCELS_FILENAME "accels.txt" -/* Flashing delay for icons (milliseconds). */ -#define FLASH_TIMEOUT 500 - /* Name in the geometry file */ #define GEOMETRY_NAME "main-window" typedef struct { GossipContactList *contact_list; - MissionControl *mc; /* Main widgets */ GtkWidget *window; @@ -132,14 +127,6 @@ static void main_window_accels_load (void); static void main_window_accels_save (void); static void main_window_connection_items_setup (EmpathyMainWindow *window, GladeXML *glade); -//static void main_window_connection_items_update (void); -static void main_window_presence_changed_cb (MissionControl *mc, - McPresence state, - EmpathyMainWindow *window); -static void main_window_presence_chooser_changed_cb (GtkWidget *chooser, - McPresence state, - const gchar *status, - EmpathyMainWindow *window); static gboolean main_window_configure_event_timeout_cb (EmpathyMainWindow *window); static gboolean main_window_configure_event_cb (GtkWidget *widget, GdkEventConfigure *event, @@ -168,7 +155,6 @@ empathy_main_window_show (void) GtkWidget *ebox; GtkToolItem *item; gchar *str; - McPresence state; gboolean show_offline; gboolean show_avatars; gboolean compact_contact_list; @@ -230,22 +216,8 @@ empathy_main_window_show (void) gtk_widget_hide (window->edit_context_separator); /* Set up presence chooser */ - window->mc = mission_control_new (tp_get_bus ()); window->presence_chooser = gossip_presence_chooser_new (); - gossip_presence_chooser_set_flash_interval (GOSSIP_PRESENCE_CHOOSER (window->presence_chooser), - FLASH_TIMEOUT); - dbus_g_proxy_connect_signal (DBUS_G_PROXY (window->mc), - "PresenceStatusActual", - G_CALLBACK (main_window_presence_changed_cb), - window, NULL); - g_signal_connect (window->presence_chooser, - "changed", - G_CALLBACK (main_window_presence_chooser_changed_cb), - window); - state = mission_control_get_presence_actual (window->mc, NULL); - main_window_presence_changed_cb (window->mc, state, window); gtk_widget_show (window->presence_chooser); - item = gtk_tool_item_new (); gtk_widget_show (GTK_WIDGET (item)); gtk_container_add (GTK_CONTAINER (item), window->presence_chooser); @@ -254,7 +226,7 @@ empathy_main_window_show (void) gtk_toolbar_insert (GTK_TOOLBAR (window->presence_toolbar), item, -1); window->widgets_connected = g_list_prepend (window->widgets_connected, - window->presence_chooser); + window->presence_chooser); /* Set up the throbber */ ebox = gtk_event_box_new (); @@ -371,7 +343,6 @@ main_window_destroy_cb (GtkWidget *widget, g_list_free (window->widgets_disconnected); g_object_unref (window->tooltips); - g_object_unref (window->mc); g_free (window); } @@ -385,7 +356,7 @@ static void main_window_chat_quit_cb (GtkWidget *widget, EmpathyMainWindow *window) { - gtk_widget_destroy (window->window); + gtk_main_quit (); } static void @@ -729,68 +700,6 @@ main_window_connection_items_setup (EmpathyMainWindow *window, window->widgets_disconnected = list; } -#if 0 -FIXME: -static void -main_window_connection_items_update (void) -{ - GList *l; - guint connected = 0; - guint disconnected = 0; - - /* Get account count for: - * - connected and disabled, - * - connected and enabled - * - disabled and enabled - */ - gossip_session_count_accounts (window->session, - &connected, - NULL, - &disconnected); - - for (l = window->widgets_connected; l; l = l->next) { - gtk_widget_set_sensitive (l->data, (connected > 0)); - } - - for (l = window->widgets_disconnected; l; l = l->next) { - gtk_widget_set_sensitive (l->data, (disconnected > 0)); - } -} -#endif - -static void -main_window_presence_changed_cb (MissionControl *mc, - McPresence state, - EmpathyMainWindow *window) -{ - gchar *status; - - gossip_debug (DEBUG_DOMAIN, "presence changed to %d", state); - - status = mission_control_get_presence_message_actual (window->mc, NULL); - - if (G_STR_EMPTY (status)) { - g_free (status); - status = g_strdup (gossip_presence_state_get_default_status (state)); - } - - gossip_presence_chooser_set_state (GOSSIP_PRESENCE_CHOOSER (window->presence_chooser), - state); - gossip_presence_chooser_set_status (GOSSIP_PRESENCE_CHOOSER (window->presence_chooser), - status); - g_free (status); -} - -static void -main_window_presence_chooser_changed_cb (GtkWidget *chooser, - McPresence state, - const gchar *status, - EmpathyMainWindow *window) -{ - gossip_status_presets_set_default (state, status); - mission_control_set_presence (window->mc, state, status, NULL, NULL); -} - static gboolean main_window_configure_event_timeout_cb (EmpathyMainWindow *window) { diff --git a/libempathy-gtk/empathy-status-icon.c b/libempathy-gtk/empathy-status-icon.c index e46944e5..ac77275a 100644 --- a/libempathy-gtk/empathy-status-icon.c +++ b/libempathy-gtk/empathy-status-icon.c @@ -45,23 +45,18 @@ struct _EmpathyStatusIconPriv { MissionControl *mc; GtkStatusIcon *icon; + GtkWindow *window; }; -static void empathy_status_icon_class_init (EmpathyStatusIconClass *klass); -static void empathy_status_icon_init (EmpathyStatusIcon *icon); -static void status_icon_finalize (GObject *object); -static void status_icon_presence_changed_cb (MissionControl *mc, - McPresence state, - EmpathyStatusIcon *icon); -static void status_icon_activate_cb (GtkStatusIcon *status_icon, - EmpathyStatusIcon *icon); - -enum { - ACTIVATE, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL]; +static void empathy_status_icon_class_init (EmpathyStatusIconClass *klass); +static void empathy_status_icon_init (EmpathyStatusIcon *icon); +static void status_icon_finalize (GObject *object); +static void status_icon_presence_changed_cb (MissionControl *mc, + McPresence state, + EmpathyStatusIcon *icon); +static void status_icon_toggle_visibility (EmpathyStatusIcon *icon); +static void status_icon_activate_cb (GtkStatusIcon *status_icon, + EmpathyStatusIcon *icon); G_DEFINE_TYPE (EmpathyStatusIcon, empathy_status_icon, G_TYPE_OBJECT); @@ -72,16 +67,6 @@ empathy_status_icon_class_init (EmpathyStatusIconClass *klass) object_class->finalize = status_icon_finalize; - signals[ACTIVATE] = - g_signal_new ("activate", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - g_type_class_add_private (object_class, sizeof (EmpathyStatusIconPriv)); } @@ -93,8 +78,10 @@ empathy_status_icon_init (EmpathyStatusIcon *icon) priv = GET_PRIV (icon); - priv->mc = mission_control_new (tp_get_bus ()); priv->icon = gtk_status_icon_new (); + priv->mc = mission_control_new (tp_get_bus ()); + state = mission_control_get_presence_actual (priv->mc, NULL); + status_icon_presence_changed_cb (priv->mc, state, icon); dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc), "PresenceStatusActual", @@ -103,9 +90,10 @@ empathy_status_icon_init (EmpathyStatusIcon *icon) g_signal_connect (priv->icon, "activate", G_CALLBACK (status_icon_activate_cb), icon); - - state = mission_control_get_presence_actual (priv->mc, NULL); - status_icon_presence_changed_cb (priv->mc, state, icon); +/* g_signal_connect (priv->icon, "popup-menu", + G_CALLBACK (status_icon_popup_menu_cb), + icon); +*/ } static void @@ -119,18 +107,26 @@ status_icon_finalize (GObject *object) "PresenceStatusActual", G_CALLBACK (status_icon_presence_changed_cb), object); - g_signal_handlers_disconnect_by_func (priv->icon, - status_icon_activate_cb, - object); g_object_unref (priv->mc); g_object_unref (priv->icon); + g_object_unref (priv->window); } EmpathyStatusIcon * -empathy_status_icon_new (void) +empathy_status_icon_new (GtkWindow *window) { - return g_object_new (EMPATHY_TYPE_STATUS_ICON, NULL); + EmpathyStatusIconPriv *priv; + EmpathyStatusIcon *icon; + + g_return_val_if_fail (GTK_IS_WINDOW (window), NULL); + + icon = g_object_new (EMPATHY_TYPE_STATUS_ICON, NULL); + priv = GET_PRIV (icon); + + priv->window = g_object_ref (window); + + return icon; } static void @@ -157,10 +153,100 @@ status_icon_presence_changed_cb (MissionControl *mc, g_free (status); } +static void +status_icon_toggle_visibility (EmpathyStatusIcon *icon) +{ + EmpathyStatusIconPriv *priv; + gboolean visible; + + priv = GET_PRIV (icon); + + visible = gossip_window_get_is_visible (GTK_WINDOW (priv->window)); + + if (visible) { + gtk_widget_hide (GTK_WIDGET (priv->window)); + } else { + gossip_window_present (GTK_WINDOW (priv->window), TRUE); + } +} + static void status_icon_activate_cb (GtkStatusIcon *status_icon, EmpathyStatusIcon *icon) { - g_signal_emit (icon, signals[ACTIVATE], 0); + status_icon_toggle_visibility (icon); +} +#if 0 +static void +status_icon_popup_menu_cb (GtkStatusIcon *status_icon, + guint button, + guint activate_time, + EmpathyStatusIcon *icon) +{ + EmpathyStatusIconPriv *priv; + GtkWidget *submenu; + gboolean show; + + priv = GET_PRIV (icon); + + show = gossip_window_get_is_visible (GTK_WINDOW (priv->window)); + + g_signal_handlers_block_by_func (priv->show_window_item, + contact_list_show_hide_window_cb, + icon); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (priv->show_window_item), + show); + g_signal_handlers_unblock_by_func (priv->show_window_item, + contact_list_show_hide_window_cb, + icon); + + submenu = gossip_presence_chooser_create_menu ( + GOSSIP_PRESENCE_CHOOSER (priv->presence_chooser)); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (priv->popup_menu_status_item), + submenu); + + gtk_menu_popup (GTK_MENU (priv->popup_menu), + NULL, NULL, + gtk_status_icon_position_menu, + priv->status_icon, + button, + activate_time); +} + +static void +app_status_icon_create_menu (void) +{ + GossipAppPriv *priv; + GladeXML *glade; + GtkWidget *message_item; + + priv = GET_PRIV (app); + + glade = gossip_glade_get_file ("main.glade", + "tray_menu", + NULL, + "tray_menu", &priv->popup_menu, + "tray_show_list", &priv->popup_menu_show_list_item, + "tray_new_message", &message_item, + "tray_status", &priv->popup_menu_status_item, + NULL); + + gossip_glade_connect (glade, + app, + "tray_new_message", "activate", app_popup_new_message_cb, + "tray_quit", "activate", app_chat_quit_cb, + NULL); + + g_signal_connect (priv->popup_menu_show_list_item, "toggled", + G_CALLBACK (app_show_hide_list_cb), app); + + priv->widgets_connected = g_list_prepend (priv->widgets_connected, + priv->popup_menu_status_item); + + priv->widgets_connected = g_list_prepend (priv->widgets_connected, + message_item); + + g_object_unref (glade); } +#endif diff --git a/libempathy-gtk/empathy-status-icon.glade b/libempathy-gtk/empathy-status-icon.glade new file mode 100644 index 00000000..5a60e722 --- /dev/null +++ b/libempathy-gtk/empathy-status-icon.glade @@ -0,0 +1,8236 @@ + + + + + + + 5 + Subscription Request + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + Decide _Later + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + GTK_RELIEF_NORMAL + True + -9 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-no + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Deny + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + True + True + GTK_RELIEF_NORMAL + True + -8 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-yes + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Accept + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 12 + + + + True + gtk-dialog-question + 6 + 0.5 + 0 + 0 + 0 + + + 0 + False + False + + + + + + True + False + 18 + + + + True + + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + 2 + 2 + False + 6 + 12 + + + + True + True + + False + False + GTK_JUSTIFY_LEFT + False + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + + + + + + + True + ID: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Web site: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + 0 + False + True + + + + + + True + False + 6 + + + + True + gtk-dialog-info + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Information requested... + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + 2 + 2 + False + 6 + 12 + + + + True + _Name: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + name_entry + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + _Group: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + group_comboboxentry + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + True + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + This is the name that will be used on your roster for this contact + True + True + True + 64 + + True + * + True + + + 1 + 2 + 0 + 1 + + + + + + 0 + False + True + + + + + + True + False + 6 + + + + True + If you chose to decide later you will be asked the next time you log on. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 5 + Preferences + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + True + False + gtk-preferences + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -6 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + True + True + True + GTK_POS_TOP + False + False + + + + 12 + True + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + Avatars are user chosen images shown in the contact list + True + Show _avatars + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + True + Show co_mpact contact list + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Show _smileys as images + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + + + + + True + <b>Appearance</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + True + _Open new chats in separate windows + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + + + + True + <b>Behaviour</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Sort by _name + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Sort by s_tate + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton_contact_list_sort_by_name + + + 0 + False + False + + + + + + + + + + True + <b>Contact List</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + False + True + + + + + + True + General + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + True + _Play sound when messages arrive + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Enable sounds when _busy + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Enable sounds when _away + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + + + True + <b>Audio</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + True + Display notifications when contacts come _online + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + + + + True + <b>Visual</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + False + True + + + + + + True + Notifications + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + False + 0 + + + + True + False + 6 + + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + gtk-dialog-info + 4 + 0.5 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + <small>The list of languages reflects only the languages for which you have a dictionary installed.</small> + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + + + + + True + <b>Languages</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + True + _Enable spell checking + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + + + + True + <b>Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + False + True + + + + + + True + Spell Checking + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + False + 12 + + + + True + Chat Th_eme: + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + combobox_chat_theme + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + + + True + <b>Appearance</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + True + _Use for chat rooms + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + + + + True + <b>Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + False + True + + + + + + True + Themes + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + + + 5 + Edit Groups + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + 275 + 325 + False + False + gtk-edit + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + gtk-save + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 18 + + + + True + False + 6 + + + + True + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + + True + False + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + False + + + + + + 125 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + False + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 5 + Status Message Presets + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 6 + + + + True + False + 6 + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + Enter status message: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + True + True + + + 0 + False + False + + + + + + True + True + _Add to status message list + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + + + + True + _Show Contact List + True + False + + + + + + True + + + + + + True + _New Message... + True + + + + True + gossip-message.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Status + True + + + + + + True + + + + + + True + _Quit + True + + + + True + gtk-quit + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + 5 + Personal Details + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + gtk-save + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 18 + + + + True + False + 12 + + + + True + Account: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 18 + + + + True + 7 + 2 + False + 6 + 12 + + + + True + N_ame: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_name + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + _Nickname: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_nickname + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + This name will be used to identify you in chat windows + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + + True + _Email: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_email + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + _Web site: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_web_site + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 3 + 4 + + + + + + + True + This name will be used to identify you when new contacts lookup your details + True + True + True + True + 0 + + True + * + False + 22 + + + 1 + 2 + 0 + 1 + + + + + + + True + Avatar: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 5 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + fill + + + + + + True + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + + + + + 1 + 2 + 5 + 6 + fill + fill + + + + + + True + _Birthday: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + 150 + 59 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + True + 3 + 3 + 0 + 0 + 0 + 3 + + + + + + 1 + 2 + 6 + 7 + fill + fill + + + + + + True + _Description: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + textview_description + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 6 + 7 + fill + fill + + + + + + True + False + 6 + + + + True + True + True + True + 0 + + True + ● + False + + + 0 + True + True + + + + + + True + False + 0 + + + + + + + 0 + True + True + + + + + 1 + 2 + 4 + 5 + fill + fill + + + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 5 + Spell Checker + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + True + 275 + 225 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + False + True + True + GTK_RELIEF_NORMAL + True + -5 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-convert + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Replace + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 6 + + + + True + Suggestions for the word: + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 5 + New Message + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + False + True + True + True + Ch_at + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 18 + + + + True + False + 6 + + + + True + Which account do you want to use? + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + + + + + True + <span size="smaller">Note: You must select an account if the contact is unknown</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + GTK_PACK_END + + + + + 0 + True + True + GTK_PACK_END + + + + + 0 + False + True + + + + + + True + False + 6 + + + + True + _Enter the name or contact ID of the person you want to chat to below: + True + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + name_entry + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + True + This acts as a filter to the contact list below. You can use segments of contact's name or ID, for example, "jabber.org" will list everyone using that server + True + True + True + True + 0 + + True + * + True + + + 0 + False + False + + + + + + True + <span size="smaller">Example: Mikael or user@server.org</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 2 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + 135 + True + True + False + True + False + False + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + Contact List - Gossip + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 225 + 325 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR + + + + True + _Chat + True + + + + + + + True + _Connect + True + + + + True + gtk-connect + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Disconnect + True + + + + True + gtk-disconnect + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _New Message... + True + + + + + True + gossip-message.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _View Previous Conversations + True + + + + + True + gtk-justify-left + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _Add Contact... + True + + + + True + gtk-add + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Search + True + + + + + True + gtk-find + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + Show _Offline Contacts + True + False + + + + + + + True + + + + + + True + _Quit + True + + + + + True + gtk-quit + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Room + True + + + + + + + True + Join _New... + True + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Join _Favorites + True + + + + + + + True + + + + + + True + + + + + + True + Manage Favorites... + True + + + + True + gossip-group-message.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Edit + True + + + + + + + True + Context + True + + + + + + True + + + + + + True + _Accounts + True + + + + + + + True + _Personal Information + True + + + + + + True + + + + + + True + _Preferences + True + + + + True + gtk-preferences + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Help + True + + + + + + + True + _Contents + True + + + + + True + gtk-help + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _About + True + + + + True + gtk-about + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + 0 + False + False + + + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + True + True + + + + + + + + + + + 0 + False + False + + + + + + This acts as a filter to the contact list below. + +You can use segments of contact's name or ID, for example, "jabber.org" will list everyone using that server. + +You can also use the name of a group to show only contacts in a specific group. + True + True + True + 50 + + True + ● + False + + + 0 + False + False + + + + + + False + 0 + + + + + + + 0 + False + False + + + + + + True + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + + + + 0 + True + True + + + + + + + + View Previous Conversations + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 640 + 450 + True + False + gtk-justify-left + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 2 + True + True + True + True + GTK_POS_TOP + False + False + + + + 12 + True + False + 6 + + + + True + False + 12 + + + + True + _For: + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + entry_find + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + True + 0 + + True + * + True + + + 0 + True + True + + + + + + True + False + True + True + True + gtk-find + True + GTK_RELIEF_NORMAL + False + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + True + 120 + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + False + False + False + False + + + + + True + False + + + + + + True + False + 6 + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + + + + 0 + True + True + + + + + + True + False + 12 + + + + + + + + True + False + True + gtk-media-next + True + GTK_RELIEF_NORMAL + False + + + 0 + False + False + GTK_PACK_END + + + + + + True + False + True + gtk-media-previous + True + GTK_RELIEF_NORMAL + False + + + 0 + False + False + GTK_PACK_END + + + + + 0 + False + False + + + + + True + True + + + + + 0 + True + True + + + + + False + True + + + + + + True + Search + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + 2 + 2 + False + 6 + 6 + + + + True + False + 6 + + + + True + gtk-find + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + True + + + 0 + True + True + + + + + 1 + 2 + 0 + 1 + fill + fill + + + + + + True + False + 6 + + + + 150 + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + True + GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES + + + 0 + False + False + + + + + 0 + 1 + 1 + 2 + fill + + + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + + + + 1 + 2 + 1 + 2 + + + + + + True + False + 6 + + + + + + + 0 + 1 + 0 + 1 + fill + fill + + + + + False + True + + + + + + True + Contacts + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + 2 + 2 + False + 6 + 6 + + + + True + False + 6 + + + + True + gtk-find + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + True + + + 0 + True + True + + + + + 1 + 2 + 0 + 1 + fill + fill + + + + + + True + False + 6 + + + + 150 + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + True + GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES + + + 0 + False + False + + + + + 0 + 1 + 1 + 2 + fill + + + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + + + + 1 + 2 + 1 + 2 + + + + + + True + False + 6 + + + + + + + 0 + 1 + 0 + 1 + fill + fill + + + + + False + True + + + + + + True + Chat Rooms + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + + + 5 + Accounts + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -6 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 18 + + + + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + 200 + True + True + True + False + False + False + False + False + False + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + True + gtk-connect + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + 6 + + + + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + 0 + True + True + + + + + + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + False + + + + + 0 + False + False + + + + + + 415 + True + False + 18 + + + + True + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 20 + 0 + + + + True + False + 6 + + + + True + 5 + 2 + False + 6 + 6 + + + + True + Jabber + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + True + Imendio + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 0 + False + 0 + + + 0 + 1 + 1 + 2 + + + + + + + True + True + Connect on S_tartup + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + True + Use system pro_xy + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + + + 0 + 2 + 2 + 3 + fill + fill + + + + + + True + gtk-cut + 6 + 0.5 + 0 + 0 + 0 + + + 1 + 2 + 0 + 2 + fill + fill + + + + + 0 + True + True + + + + + + + + + + True + <b>Account</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 20 + 0 + + + + + + + + + + True + <b>Settings</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 20 + 0 + + + + True + False + 12 + + + + True + False + 12 + + + + True + False + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-new + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Cr_eate + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + GTK_PACK_END + + + + + + True + True + gtk-go-back + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + GTK_PACK_END + + + + + 0 + False + False + GTK_PACK_END + + + + + + True + 2 + 2 + False + 6 + 6 + + + + True + _Name: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_name + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + _Type: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + combobox_type + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + False + 6 + + + + True + A unique name for this account to identify it personally to you. + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + + False + True + + + 1 + 2 + 0 + 1 + fill + + + + + 0 + True + True + + + + + + + + + + True + <b>New Account</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + To add a new account, you can click on the 'Add' button and a new entry will be created for you to started configuring. + +If you do not want to add an account, simply click on the account you want to configure in the list on the left. + False + True + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + + + + True + <b>No Account Selected</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 5 + Edit Contact + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + True + False + gtk-edit + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + Set the alias you want to use for: +<b>foo@bar.baz</b> + +You can retrieve contact information from the server. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + True + True + True + 0 + + True + * + True + + + 0 + True + True + + + + + + True + Use default name here from the contact's VCard. + True + _Retrieve + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + False + + + + + + + + + + True + <b>Name</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + False + 18 + + + + True + False + 6 + + + + True + gtk-dialog-warning + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + You are not subscribed to this contact. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + Press Subscribe to request to receive their status + True + _Subscribe + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + + + + + True + <b>Subscription</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + Select the groups you want this contact to appear in, you can select more than one group or no groups. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + + True + False + True + _Add Group + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + False + + + + + + 100 + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + False + False + False + False + + + + + 0 + True + True + + + + + + + + + + True + <b>Groups</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 5 + Contact Information + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + 350 + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -6 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 18 + + + + True + False + 12 + + + + True + False + 6 + + + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + 2 + 1 + False + 6 + 6 + + + + True + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 4 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + True + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 4 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + + + + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + <b>Status</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + 1 + 4 + False + 6 + 6 + + + + True + - + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + + + + + + + 0 + False + False + + + + + + + 0 + False + False + + + + + 0 + False + False + + + + + + False + 6 + + + + True + <b>Personal Details</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + 3 + 2 + False + 6 + 12 + + + + Email: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + Web site: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + Birthday: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + gtk-dialog-info + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Information requested... + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + False + + + + + + + 0 + False + False + + + + + 0 + False + False + + + + + + False + 6 + + + + True + <b>Client Information</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + 3 + 2 + False + 6 + 12 + + + + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 2 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 2 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 2 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + + + + + + + Client: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + Version: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + OS: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + 0 + False + True + + + + + + True + False + 6 + + + + True + gtk-dialog-info + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Information requested... + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + False + + + + + + + 0 + False + False + + + + + 0 + False + False + + + + + + False + 6 + + + + True + <b>About</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + jabber account settings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 6 + 3 + False + 6 + 12 + + + + True + Login I_D: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_id + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Pass_word: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_password + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Reso_urce: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_resource + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + _Server: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_server + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + _Port: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_port + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 3 + 2 + 3 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 3 + 3 + 4 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 3 + 4 + 5 + + + + + + + True + True + Use encryption (SS_L) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 3 + 5 + 6 + fill + + + + + + + True + False + 2 + + + + True + True + True + False + 0 + + True + * + False + + + 0 + True + True + + + + + + True + Forget password and clear the entry. + True + GTK_RELIEF_NORMAL + True + + + + True + gtk-clear + 1 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + False + True + C_hange + True + GTK_RELIEF_NORMAL + True + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + R_egister + True + GTK_RELIEF_NORMAL + True + + + 2 + 3 + 0 + 1 + fill + + + + + + + + + True + msn account settings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + 4 + 2 + False + 6 + 12 + + + + True + Login I_D: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_id + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Pass_word: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_password + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + 2 + + + + True + True + True + False + 0 + + True + * + False + + + 0 + True + True + + + + + + True + Forget password and clear the entry. + True + GTK_RELIEF_NORMAL + True + + + + True + gtk-clear + 1 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + _Server: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_server + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + + True + _Port: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_port + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 3 + 4 + + + + + + + + + True + irc account settings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + 7 + 2 + False + 6 + 12 + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 4 + 5 + + + + + + + True + _Port: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_port + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + _Server: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_server + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + _Password: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 3 + 4 + + + + + + + True + False + 2 + + + + True + True + True + False + 0 + + True + * + False + + + 0 + True + True + + + + + + True + Forget password and clear the entry. + True + GTK_RELIEF_NORMAL + True + + + + True + gtk-clear + 1 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + True + _Nick Name: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_nick_name + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + _Full Name: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_full_name + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + + True + _Quit Message: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_quit_message + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 5 + 6 + + + + + + + True + True + Use encryption (SS_L) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 2 + 6 + 7 + fill + + + + + + + + + 5 + True + Add Contact + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 6 + + + + True + 3 + 2 + False + 6 + 12 + + + + True + Con_tact: + True + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + entry_id + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + + + + + + + + True + Accou_nt: + True + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + + True + True + True + True + True + 0 + user@jabber.org + True + * + True + 30 + + + 1 + 2 + 1 + 2 + + + + + + + <i>Information requested, please wait...</i> + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + expand + + + + + 0 + True + True + + + + + + False + 0 + + + + True + False + 18 + + + + 3 + 2 + False + 6 + 12 + + + + Country: + True + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + label_country + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + + + + + + + + Name: + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + Email: + True + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + label_email + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + + + + + + 0 + True + True + + + + + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + 2 + 2 + False + 6 + 12 + + + + True + False + True + False + True + False + + + + True + True + True + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + + 1 + 2 + 1 + 2 + + + + + + True + True + True + True + 0 + + True + * + True + + + 1 + 2 + 0 + 1 + + + + + + True + Alia_s: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_alias + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + _Group: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + entry_group + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + + diff --git a/libempathy-gtk/empathy-status-icon.h b/libempathy-gtk/empathy-status-icon.h index 898e3514..6cfa8899 100644 --- a/libempathy-gtk/empathy-status-icon.h +++ b/libempathy-gtk/empathy-status-icon.h @@ -46,8 +46,8 @@ struct _EmpathyStatusIconClass { GObjectClass parent_class; }; -GType empathy_status_icon_get_type (void) G_GNUC_CONST; -EmpathyStatusIcon *empathy_status_icon_new (void); +GType empathy_status_icon_get_type (void) G_GNUC_CONST; +EmpathyStatusIcon *empathy_status_icon_new (GtkWindow *window); G_END_DECLS diff --git a/libempathy-gtk/gossip-chat-manager.c b/libempathy-gtk/gossip-chat-manager.c deleted file mode 100644 index 86cd0ea3..00000000 --- a/libempathy-gtk/gossip-chat-manager.c +++ /dev/null @@ -1,327 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2004-2007 Imendio AB - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Martyn Russell - */ - -#include "config.h" - -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include "gossip-app.h" -#include "gossip-chat.h" -#include "gossip-chat-manager.h" - -#define DEBUG_DOMAIN "ChatManager" - -#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOSSIP_TYPE_CHAT_MANAGER, GossipChatManagerPriv)) - -typedef struct _GossipChatManagerPriv GossipChatManagerPriv; - -struct _GossipChatManagerPriv { - GHashTable *chats; - GHashTable *events; -}; - -static void chat_manager_finalize (GObject *object); -static void chat_manager_new_message_cb (GossipSession *session, - GossipMessage *msg, - GossipChatManager *manager); -static void chat_manager_event_activated_cb (GossipEventManager *event_manager, - GossipEvent *event, - GObject *object); -static void chat_manager_get_chats_foreach (GossipContact *contact, - GossipPrivateChat *chat, - GList **chats); -static void chat_manager_chat_removed_cb (GossipChatManager *manager, - GossipChat *chat, - gboolean is_last_ref); - -G_DEFINE_TYPE (GossipChatManager, gossip_chat_manager, G_TYPE_OBJECT); - -static void -gossip_chat_manager_class_init (GossipChatManagerClass *class) -{ - GObjectClass *object_class; - - object_class = G_OBJECT_CLASS (class); - - object_class->finalize = chat_manager_finalize; - - g_type_class_add_private (object_class, sizeof (GossipChatManagerPriv)); -} - -static void -gossip_chat_manager_init (GossipChatManager *manager) -{ - GossipChatManagerPriv *priv; - - priv = GET_PRIV (manager); - - priv->chats = g_hash_table_new_full (gossip_contact_hash, - gossip_contact_equal, - (GDestroyNotify) g_object_unref, - (GDestroyNotify) g_object_unref); - - priv->events = g_hash_table_new_full (gossip_contact_hash, - gossip_contact_equal, - (GDestroyNotify) g_object_unref, - (GDestroyNotify) g_object_unref); - - /* Connect to signals on GossipSession to listen for new messages */ - g_signal_connect (gossip_app_get_session (), - "new-message", - G_CALLBACK (chat_manager_new_message_cb), - manager); -} - -static void -chat_manager_finalize (GObject *object) -{ - GossipChatManagerPriv *priv; - - priv = GET_PRIV (object); - - g_hash_table_destroy (priv->chats); - g_hash_table_destroy (priv->events); - - G_OBJECT_CLASS (gossip_chat_manager_parent_class)->finalize (object); -} - -static void -chat_manager_new_message_cb (GossipSession *session, - GossipMessage *message, - GossipChatManager *manager) -{ - GossipChatManagerPriv *priv; - GossipPrivateChat *chat; - GossipContact *sender; - GossipEvent *event = NULL; - GossipEvent *old_event; - - priv = GET_PRIV (manager); - - sender = gossip_message_get_sender (message); - chat = g_hash_table_lookup (priv->chats, sender); - - old_event = g_hash_table_lookup (priv->events, sender); - - /* Add event to event manager if one doesn't exist already. */ - if (!chat) { - gossip_debug (DEBUG_DOMAIN, "New chat for: %s", - gossip_contact_get_id (sender)); - chat = gossip_chat_manager_get_chat (manager, sender); - - if (!old_event) { - event = gossip_event_new (GOSSIP_EVENT_NEW_MESSAGE); - } - } else { - GossipChatWindow *window; - - window = gossip_chat_get_window (GOSSIP_CHAT (chat)); - - if (!window && !old_event) { - event = gossip_event_new (GOSSIP_EVENT_NEW_MESSAGE); - } - } - - gossip_private_chat_append_message (chat, message); - - if (event) { - gchar *str; - - str = g_strdup_printf (_("New message from %s"), - gossip_contact_get_name (sender)); - g_object_set (event, - "message", str, - "data", message, - NULL); - g_free (str); - - gossip_event_manager_add (gossip_app_get_event_manager (), - event, - chat_manager_event_activated_cb, - G_OBJECT (manager)); - - g_hash_table_insert (priv->events, - g_object_ref (sender), - g_object_ref (event)); - } -} - -static void -chat_manager_event_activated_cb (GossipEventManager *event_manager, - GossipEvent *event, - GObject *object) -{ - GossipMessage *message; - GossipContact *contact; - - message = GOSSIP_MESSAGE (gossip_event_get_data (event)); - contact = gossip_message_get_sender (message); - - gossip_chat_manager_show_chat (GOSSIP_CHAT_MANAGER (object), contact); -} - -static void -chat_manager_get_chats_foreach (GossipContact *contact, - GossipPrivateChat *chat, - GList **chats) -{ - const gchar *contact_id; - - contact_id = gossip_contact_get_id (contact); - *chats = g_list_prepend (*chats, g_strdup (contact_id)); -} - -GossipChatManager * -gossip_chat_manager_new (void) -{ - return g_object_new (GOSSIP_TYPE_CHAT_MANAGER, NULL); -} - -static void -chat_manager_chat_removed_cb (GossipChatManager *manager, - GossipChat *chat, - gboolean is_last_ref) -{ - GossipChatManagerPriv *priv; - GossipContact *contact; - - if (!is_last_ref) { - return; - } - - priv = GET_PRIV (manager); - - contact = gossip_chat_get_contact (chat); - - gossip_debug (DEBUG_DOMAIN, - "Removing an old chat:'%s'", - gossip_contact_get_id (contact)); - - g_hash_table_remove (priv->chats, contact); -} - -GossipPrivateChat * -gossip_chat_manager_get_chat (GossipChatManager *manager, - GossipContact *contact) -{ - GossipChatManagerPriv *priv; - GossipPrivateChat *chat; - - g_return_val_if_fail (GOSSIP_IS_CHAT_MANAGER (manager), NULL); - g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL); - - priv = GET_PRIV (manager); - - chat = g_hash_table_lookup (priv->chats, contact); - - if (!chat) { - GossipSession *session; - GossipAccount *account; - GossipContact *own_contact; - - session = gossip_app_get_session (); - account = gossip_contact_get_account (contact); - own_contact = gossip_session_get_own_contact (session, account); - - chat = gossip_private_chat_new (own_contact, contact); - g_hash_table_insert (priv->chats, - g_object_ref (contact), - chat); - g_object_add_toggle_ref (G_OBJECT (chat), - (GToggleNotify) chat_manager_chat_removed_cb, - manager); - - gossip_debug (DEBUG_DOMAIN, - "Creating a new chat:'%s'", - gossip_contact_get_id (contact)); - } - - return chat; -} - -GList * -gossip_chat_manager_get_chats (GossipChatManager *manager) -{ - GossipChatManagerPriv *priv; - GList *chats = NULL; - - g_return_val_if_fail (GOSSIP_IS_CHAT_MANAGER (manager), NULL); - - priv = GET_PRIV (manager); - - g_hash_table_foreach (priv->chats, - (GHFunc) chat_manager_get_chats_foreach, - &chats); - - chats = g_list_sort (chats, (GCompareFunc) strcmp); - - return chats; -} - -void -gossip_chat_manager_remove_events (GossipChatManager *manager, - GossipContact *contact) -{ - GossipChatManagerPriv *priv; - GossipEvent *event; - - g_return_if_fail (GOSSIP_IS_CHAT_MANAGER (manager)); - g_return_if_fail (GOSSIP_IS_CONTACT (contact)); - - gossip_debug (DEBUG_DOMAIN, - "Removing events for contact:'%s'", - gossip_contact_get_id (contact)); - - priv = GET_PRIV (manager); - - event = g_hash_table_lookup (priv->events, contact); - if (event) { - gossip_event_manager_remove (gossip_app_get_event_manager (), - event, G_OBJECT (manager)); - g_hash_table_remove (priv->events, contact); - } -} - -void -gossip_chat_manager_show_chat (GossipChatManager *manager, - GossipContact *contact) -{ - GossipPrivateChat *chat; - - g_return_if_fail (GOSSIP_IS_CHAT_MANAGER (manager)); - g_return_if_fail (GOSSIP_IS_CONTACT (contact)); - - chat = gossip_chat_manager_get_chat (manager, contact); - - gossip_chat_present (GOSSIP_CHAT (chat)); - - gossip_chat_manager_remove_events(manager, contact); -} diff --git a/libempathy-gtk/gossip-chat-manager.h b/libempathy-gtk/gossip-chat-manager.h deleted file mode 100644 index 7500b594..00000000 --- a/libempathy-gtk/gossip-chat-manager.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2004-2007 Imendio AB - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Martyn Russell - */ - -#ifndef __GOSSIP_CHAT_MANAGER_H__ -#define __GOSSIP_CHAT_MANAGER_H__ - -#include - -#include - -G_BEGIN_DECLS - -#define GOSSIP_TYPE_CHAT_MANAGER (gossip_chat_manager_get_type ()) -#define GOSSIP_CHAT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GOSSIP_TYPE_CHAT_MANAGER, GossipChatManager)) -#define GOSSIP_CHAT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GOSSIP_TYPE_CHAT_MANAGER, GossipChatManagerClass)) -#define GOSSIP_IS_CHAT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GOSSIP_TYPE_CHAT_MANAGER)) -#define GOSSIP_IS_CHAT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOSSIP_TYPE_CHAT_MANAGER)) -#define GOSSIP_CHAT_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOSSIP_TYPE_CHAT_MANAGER, GossipChatManagerClass)) - -typedef struct _GossipChatManager GossipChatManager; -typedef struct _GossipChatManagerClass GossipChatManagerClass; - -#include "gossip-private-chat.h" - -struct _GossipChatManager { - GObject parent; -}; - -struct _GossipChatManagerClass { - GObjectClass parent_class; -}; - -GType gossip_chat_manager_get_type (void) G_GNUC_CONST; -GossipChatManager *gossip_chat_manager_new (void); -GossipPrivateChat *gossip_chat_manager_get_chat (GossipChatManager *manager, - GossipContact *contact); -GList * gossip_chat_manager_get_chats (GossipChatManager *manager); -void gossip_chat_manager_remove_events (GossipChatManager *manager, - GossipContact *contact); -void gossip_chat_manager_show_chat (GossipChatManager *manager, - GossipContact *contact); - -G_END_DECLS - -#endif /* __GOSSIP_CHAT_MANAGER_H__ */ - diff --git a/libempathy-gtk/gossip-presence-chooser.c b/libempathy-gtk/gossip-presence-chooser.c index 46b27545..556bcf13 100644 --- a/libempathy-gtk/gossip-presence-chooser.c +++ b/libempathy-gtk/gossip-presence-chooser.c @@ -30,7 +30,11 @@ #include #include +#include +#include + #include +#include #include #include "gossip-ui-utils.h" @@ -40,83 +44,103 @@ #define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOSSIP_TYPE_PRESENCE_CHOOSER, GossipPresenceChooserPriv)) +#define DEBUG_DOMAIN "PresenceChooser" + +/* Flashing delay for icons (milliseconds). */ +#define FLASH_TIMEOUT 500 + typedef struct { - GtkWidget *hbox; - GtkWidget *image; - GtkWidget *label; - GtkWidget *menu; + MissionControl *mc; + + GtkWidget *hbox; + GtkWidget *image; + GtkWidget *label; + GtkWidget *menu; - McPresence last_state; + McPresence last_state; - guint flash_interval; - McPresence flash_state_1; - McPresence flash_state_2; - guint flash_timeout_id; + McPresence flash_state_1; + McPresence flash_state_2; + guint flash_timeout_id; /* The handle the kind of unnessecary scroll support. */ - guint scroll_timeout_id; - McPresence scroll_state; - gchar *scroll_status; + guint scroll_timeout_id; + McPresence scroll_state; + gchar *scroll_status; } GossipPresenceChooserPriv; +typedef struct { + McPresence state; + const gchar *status; +} StateAndStatus; + /* States to be listed in the menu */ static McPresence states[] = {MC_PRESENCE_AVAILABLE, MC_PRESENCE_DO_NOT_DISTURB, MC_PRESENCE_AWAY}; -static void presence_chooser_finalize (GObject *object); -static void presence_chooser_reset_scroll_timeout (GossipPresenceChooser *chooser); -static void presence_chooser_set_state (GossipPresenceChooser *chooser, - McPresence state, - const gchar *status, - gboolean save); -static void presence_chooser_dialog_response_cb (GtkWidget *dialog, - gint response, - GossipPresenceChooser *chooser); -static void presence_chooser_show_dialog (GossipPresenceChooser *chooser, - McPresence state); -static void presence_chooser_custom_activate_cb (GtkWidget *item, - GossipPresenceChooser *chooser); -static void presence_chooser_clear_response_cb (GtkWidget *widget, - gint response, - gpointer user_data); -static void presence_chooser_clear_activate_cb (GtkWidget *item, - GossipPresenceChooser *chooser); -static void presence_chooser_menu_add_item (GossipPresenceChooser *chooser, - GtkWidget *menu, - const gchar *str, - McPresence state, - gboolean custom); -static void presence_chooser_menu_align_func (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - GossipPresenceChooser *chooser); -static void presence_chooser_menu_selection_done_cb (GtkMenuShell *menushell, - GossipPresenceChooser *chooser); -static void presence_chooser_menu_detach (GtkWidget *attach_widget, - GtkMenu *menu); -static void presence_chooser_menu_popup (GossipPresenceChooser *chooser); -static void presence_chooser_menu_popdown (GossipPresenceChooser *chooser); -static void presence_chooser_toggled_cb (GtkWidget *chooser, - gpointer user_data); -static gboolean presence_chooser_button_press_event_cb (GtkWidget *chooser, - GdkEventButton *event, - gpointer user_data); -static gboolean presence_chooser_scroll_event_cb (GtkWidget *chooser, - GdkEventScroll *event, - gpointer user_data); -static gboolean presence_chooser_flash_timeout_cb (GossipPresenceChooser *chooser); +static void gossip_presence_chooser_class_init (GossipPresenceChooserClass *klass); +static void gossip_presence_chooser_init (GossipPresenceChooser *chooser); +static void presence_chooser_finalize (GObject *object); +static void presence_chooser_presence_changed_cb (MissionControl *mc, + McPresence state, + GossipPresenceChooser *chooser); +static void presence_chooser_reset_scroll_timeout (GossipPresenceChooser *chooser); +static gboolean presence_chooser_scroll_timeout_cb (GossipPresenceChooser *chooser); +static gboolean presence_chooser_scroll_event_cb (GossipPresenceChooser *chooser, + GdkEventScroll *event, + gpointer user_data); +static GList * presence_chooser_get_presets (GossipPresenceChooser *chooser); +static StateAndStatus *presence_chooser_state_and_status_new (McPresence state, + const gchar *status); +static gboolean presence_chooser_flash_timeout_cb (GossipPresenceChooser *chooser); +void gossip_presence_chooser_flash_start (GossipPresenceChooser *chooser, + McPresence state_1, + McPresence state_2); +void gossip_presence_chooser_flash_stop (GossipPresenceChooser *chooser, + McPresence state); +gboolean gossip_presence_chooser_is_flashing (GossipPresenceChooser *chooser); +static gboolean presence_chooser_button_press_event_cb (GtkWidget *chooser, + GdkEventButton *event, + gpointer user_data); +static void presence_chooser_toggled_cb (GtkWidget *chooser, + gpointer user_data); +static void presence_chooser_menu_popup (GossipPresenceChooser *chooser); +static void presence_chooser_menu_popdown (GossipPresenceChooser *chooser); +static void presence_chooser_menu_selection_done_cb (GtkMenuShell *menushell, + GossipPresenceChooser *chooser); +static void presence_chooser_menu_destroy_cb (GtkWidget *menu, + GossipPresenceChooser *chooser); +static void presence_chooser_menu_detach (GtkWidget *attach_widget, + GtkMenu *menu); +static void presence_chooser_menu_align_func (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + GtkWidget *widget); +static void presence_chooser_menu_add_item (GtkWidget *menu, + const gchar *str, + McPresence state, + gboolean custom); +static void presence_chooser_clear_activate_cb (GtkWidget *item, + gpointer user_data); +static void presence_chooser_clear_response_cb (GtkWidget *widget, + gint response, + gpointer user_data); +static void presence_chooser_noncustom_activate_cb (GtkWidget *item, + gpointer user_data); +static void presence_chooser_set_state (McPresence state, + const gchar *status, + gboolean save); +static void presence_chooser_custom_activate_cb (GtkWidget *item, + gpointer user_data); +static void presence_chooser_show_dialog (McPresence state); +static void presence_chooser_dialog_response_cb (GtkWidget *dialog, + gint response, + gpointer user_data); G_DEFINE_TYPE (GossipPresenceChooser, gossip_presence_chooser, GTK_TYPE_TOGGLE_BUTTON); -enum { - CHANGED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL]; - static void gossip_presence_chooser_class_init (GossipPresenceChooserClass *klass) { @@ -124,16 +148,6 @@ gossip_presence_chooser_class_init (GossipPresenceChooserClass *klass) object_class->finalize = presence_chooser_finalize; - signals[CHANGED] = - g_signal_new ("changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - empathy_marshal_VOID__INT_STRING, - G_TYPE_NONE, 2, - G_TYPE_INT, G_TYPE_STRING); - g_type_class_add_private (object_class, sizeof (GossipPresenceChooserPriv)); } @@ -143,12 +157,10 @@ gossip_presence_chooser_init (GossipPresenceChooser *chooser) GossipPresenceChooserPriv *priv; GtkWidget *arrow; GtkWidget *alignment; + McPresence state; priv = GET_PRIV (chooser); - /* Default to 1/2 a second flash interval */ - priv->flash_interval = 500; - gtk_button_set_relief (GTK_BUTTON (chooser), GTK_RELIEF_NONE); gtk_button_set_focus_on_click (GTK_BUTTON (chooser), FALSE); @@ -189,6 +201,14 @@ gossip_presence_chooser_init (GossipPresenceChooser *chooser) g_signal_connect (chooser, "scroll-event", G_CALLBACK (presence_chooser_scroll_event_cb), NULL); + + priv->mc = mission_control_new (tp_get_bus ()); + state = mission_control_get_presence_actual (priv->mc, NULL); + presence_chooser_presence_changed_cb (priv->mc, state, chooser); + dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc), + "PresenceStatusActual", + G_CALLBACK (presence_chooser_presence_changed_cb), + chooser, NULL); } static void @@ -206,389 +226,331 @@ presence_chooser_finalize (GObject *object) g_source_remove (priv->scroll_timeout_id); } + dbus_g_proxy_disconnect_signal (DBUS_G_PROXY (priv->mc), + "PresenceStatusActual", + G_CALLBACK (presence_chooser_presence_changed_cb), + object); + g_object_unref (priv->mc); + G_OBJECT_CLASS (gossip_presence_chooser_parent_class)->finalize (object); } -static void -presence_chooser_reset_scroll_timeout (GossipPresenceChooser *chooser) +GtkWidget * +gossip_presence_chooser_new (void) { - GossipPresenceChooserPriv *priv; - - priv = GET_PRIV (chooser); + GtkWidget *chooser; - if (priv->scroll_timeout_id) { - g_source_remove (priv->scroll_timeout_id); - priv->scroll_timeout_id = 0; - } + chooser = g_object_new (GOSSIP_TYPE_PRESENCE_CHOOSER, NULL); - g_free (priv->scroll_status); - priv->scroll_status = NULL; + return chooser; } static void -presence_chooser_set_state (GossipPresenceChooser *chooser, - McPresence state, - const gchar *status, - gboolean save) +presence_chooser_presence_changed_cb (MissionControl *mc, + McPresence state, + GossipPresenceChooser *chooser) { GossipPresenceChooserPriv *priv; - const gchar *default_status; + gchar *status; priv = GET_PRIV (chooser); - default_status = gossip_presence_state_get_default_status (state); - + status = mission_control_get_presence_message_actual (priv->mc, NULL); if (G_STR_EMPTY (status)) { - status = default_status; - } else { - /* Only store the value if it differs from the default ones. */ - if (save && strcmp (status, default_status) != 0) { - gossip_status_presets_set_last (state, status); - } + g_free (status); + status = g_strdup (gossip_presence_state_get_default_status (state)); } - priv->last_state = state; + gossip_debug (DEBUG_DOMAIN, "Presence changed to %s (%d)", + status, state); presence_chooser_reset_scroll_timeout (chooser); - g_signal_emit (chooser, signals[CHANGED], 0, state, status); + gossip_presence_chooser_flash_stop (chooser, state); + gtk_label_set_text (GTK_LABEL (priv->label), status); + + g_free (status); } static void -presence_chooser_dialog_response_cb (GtkWidget *dialog, - gint response, - GossipPresenceChooser *chooser) +presence_chooser_reset_scroll_timeout (GossipPresenceChooser *chooser) { - if (response == GTK_RESPONSE_OK) { - GtkWidget *entry; - GtkWidget *checkbutton; - GtkListStore *store; - GtkTreeModel *model; - GtkTreeIter iter; - McPresence state; - const gchar *status; - gboolean save; - gboolean duplicate = FALSE; - gboolean has_next; + GossipPresenceChooserPriv *priv; - entry = g_object_get_data (G_OBJECT (dialog), "entry"); - status = gtk_entry_get_text (GTK_ENTRY (entry)); - store = g_object_get_data (G_OBJECT (dialog), "store"); - model = GTK_TREE_MODEL (store); + priv = GET_PRIV (chooser); - has_next = gtk_tree_model_get_iter_first (model, &iter); - while (has_next) { - gchar *str; + if (priv->scroll_timeout_id) { + g_source_remove (priv->scroll_timeout_id); + priv->scroll_timeout_id = 0; + } - gtk_tree_model_get (model, &iter, - 0, &str, - -1); + g_free (priv->scroll_status); + priv->scroll_status = NULL; +} - if (strcmp (status, str) == 0) { - g_free (str); - duplicate = TRUE; - break; - } +static gboolean +presence_chooser_scroll_timeout_cb (GossipPresenceChooser *chooser) +{ + GossipPresenceChooserPriv *priv; - g_free (str); + priv = GET_PRIV (chooser); - has_next = gtk_tree_model_iter_next (model, &iter); - } + priv->scroll_timeout_id = 0; - if (!duplicate) { - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, status, -1); - } + gossip_debug (DEBUG_DOMAIN, "Setting presence to %s (%d)", + priv->scroll_status, priv->scroll_state); - checkbutton = g_object_get_data (G_OBJECT (dialog), "checkbutton"); - save = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)); - state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "state")); + mission_control_set_presence (priv->mc, + priv->scroll_state, + priv->scroll_status, + NULL, NULL); - presence_chooser_set_state (chooser, state, status, save); - } + g_free (priv->scroll_status); + priv->scroll_status = NULL; - gtk_widget_destroy (dialog); + return FALSE; } -static void -presence_chooser_show_dialog (GossipPresenceChooser *chooser, - McPresence state) +static gboolean +presence_chooser_scroll_event_cb (GossipPresenceChooser *chooser, + GdkEventScroll *event, + gpointer user_data) { GossipPresenceChooserPriv *priv; - static GtkWidget *dialog = NULL; - static GtkListStore *store[LAST_MC_PRESENCE]; - GladeXML *glade; - GtkWidget *image; - GtkWidget *combo; - GtkWidget *entry; - GtkWidget *checkbutton; - const gchar *default_status; + GList *list, *l; + const gchar *current_status; + StateAndStatus *sas; + gboolean match; priv = GET_PRIV (chooser); - if (dialog) { - gtk_widget_destroy (dialog); - dialog = NULL; - } else { - guint i; - - for (i = 0; i < LAST_MC_PRESENCE; i++) { - store[i] = NULL; - } + switch (event->direction) { + case GDK_SCROLL_UP: + break; + case GDK_SCROLL_DOWN: + break; + default: + return FALSE; } - glade = gossip_glade_get_file ("gossip-presence-chooser.glade", - "status_message_dialog", - NULL, - "status_message_dialog", &dialog, - "comboentry_status", &combo, - "image_status", &image, - "checkbutton_add", &checkbutton, - NULL); + current_status = gtk_label_get_text (GTK_LABEL (priv->label)); - g_object_unref (glade); + /* Get the list of presets, which in this context means all the items + * without a trailing "...". + */ + list = presence_chooser_get_presets (chooser); + sas = NULL; + match = FALSE; + for (l = list; l; l = l->next) { + sas = l->data; - g_signal_connect (dialog, "destroy", - G_CALLBACK (gtk_widget_destroyed), - &dialog); - g_signal_connect (dialog, "response", - G_CALLBACK (presence_chooser_dialog_response_cb), - chooser); + if (sas->state == priv->last_state && + strcmp (sas->status, current_status) == 0) { + sas = NULL; + match = TRUE; + if (event->direction == GDK_SCROLL_UP) { + if (l->prev) { + sas = l->prev->data; + } + } + else if (event->direction == GDK_SCROLL_DOWN) { + if (l->next) { + sas = l->next->data; + } + } + break; + } - gtk_image_set_from_icon_name (GTK_IMAGE (image), - gossip_icon_name_for_presence_state (state), - GTK_ICON_SIZE_MENU); + sas = NULL; + } - if (!store[state]) { - GList *presets, *l; - GtkTreeIter iter; + if (sas) { + presence_chooser_reset_scroll_timeout (chooser); - store[state] = gtk_list_store_new (1, G_TYPE_STRING); + priv->scroll_status = g_strdup (sas->status); + priv->scroll_state = sas->state; - presets = gossip_status_presets_get (state, -1); - for (l = presets; l; l = l->next) { - gtk_list_store_append (store[state], &iter); - gtk_list_store_set (store[state], &iter, 0, l->data, -1); - } + priv->scroll_timeout_id = + g_timeout_add (500, + (GSourceFunc) presence_chooser_scroll_timeout_cb, + chooser); - g_list_free (presets); + gossip_presence_chooser_flash_stop (chooser, sas->state); + gtk_label_set_text (GTK_LABEL (priv->label), sas->status); } + else if (!match) { + const gchar *status; + /* If we didn't get any match at all, it means the last state + * was a custom one. Just switch to the first one. + */ + status = gossip_presence_state_get_default_status (states[0]); - default_status = gossip_presence_state_get_default_status (state); - - entry = GTK_BIN (combo)->child; - gtk_entry_set_text (GTK_ENTRY (entry), default_status); - gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); - gtk_entry_set_width_chars (GTK_ENTRY (entry), 25); - - gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store[state])); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo), 0); + gossip_debug (DEBUG_DOMAIN, "Setting presence to %s (%d)", + status, states[0]); - /* FIXME: Set transian for a window ? */ + presence_chooser_reset_scroll_timeout (chooser); + mission_control_set_presence (priv->mc, + states[0], + status, + NULL, NULL); + } - g_object_set_data (G_OBJECT (dialog), "store", store[state]); - g_object_set_data (G_OBJECT (dialog), "entry", entry); - g_object_set_data (G_OBJECT (dialog), "checkbutton", checkbutton); - g_object_set_data (G_OBJECT (dialog), "state", GINT_TO_POINTER (state)); + g_list_foreach (list, (GFunc) g_free, NULL); + g_list_free (list); - gtk_widget_show_all (dialog); + return TRUE; } -static void -presence_chooser_custom_activate_cb (GtkWidget *item, - GossipPresenceChooser *chooser) +static GList * +presence_chooser_get_presets (GossipPresenceChooser *chooser) { - McPresence state; + GList *list = NULL; + guint i; - state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "state")); + for (i = 0; i < G_N_ELEMENTS (states); i++) { + GList *presets, *p; + StateAndStatus *sas; + const gchar *status; + + status = gossip_presence_state_get_default_status (states[i]); + sas = presence_chooser_state_and_status_new (states[i], status); + list = g_list_append (list, sas); + + presets = gossip_status_presets_get (states[i], 5); + for (p = presets; p; p = p->next) { + sas = presence_chooser_state_and_status_new (states[i], p->data); + list = g_list_append (list, sas); + } + g_list_free (presets); + } - presence_chooser_show_dialog (chooser, state); + return list; } -static void -presence_chooser_noncustom_activate_cb (GtkWidget *item, - GossipPresenceChooser *chooser) +static StateAndStatus * +presence_chooser_state_and_status_new (McPresence state, + const gchar *status) { - McPresence state; - const gchar *status; + StateAndStatus *sas; - status = g_object_get_data (G_OBJECT (item), "status"); - state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "state")); - presence_chooser_reset_scroll_timeout (chooser); - g_signal_emit (chooser, signals[CHANGED], 0, state, status); -} + sas = g_new0 (StateAndStatus, 1); -static void -presence_chooser_clear_response_cb (GtkWidget *widget, - gint response, - gpointer user_data) -{ - if (response == GTK_RESPONSE_OK) { - gossip_status_presets_reset (); - } + sas->state = state; + sas->status = status; - gtk_widget_destroy (widget); + return sas; } -static void -presence_chooser_clear_activate_cb (GtkWidget *item, - GossipPresenceChooser *chooser) +static gboolean +presence_chooser_flash_timeout_cb (GossipPresenceChooser *chooser) { - GtkWidget *dialog; - GtkWidget *toplevel; - GtkWindow *parent = NULL; - - toplevel = gtk_widget_get_toplevel (GTK_WIDGET (chooser)); - if (GTK_WIDGET_TOPLEVEL (toplevel) && - GTK_IS_WINDOW (toplevel)) { - GtkWindow *window; - gboolean visible; + GossipPresenceChooserPriv *priv; + McPresence state; + static gboolean on = FALSE; - window = GTK_WINDOW (toplevel); - visible = gossip_window_get_is_visible (window); + priv = GET_PRIV (chooser); - if (visible) { - parent = window; - } + if (on) { + state = priv->flash_state_1; + } else { + state = priv->flash_state_2; } - dialog = gtk_message_dialog_new (GTK_WINDOW (parent), - 0, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - _("Are you sure you want to clear the list?")); - - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("This will remove any custom messages you have " - "added to the list of preset status messages.")); - - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - _("Clear List"), GTK_RESPONSE_OK, - NULL); - - gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), + gossip_icon_name_for_presence_state (state), + GTK_ICON_SIZE_MENU); - g_signal_connect (dialog, "response", - G_CALLBACK (presence_chooser_clear_response_cb), - NULL); + on = !on; - gtk_widget_show (dialog); + return TRUE; } -static void -presence_chooser_menu_add_item (GossipPresenceChooser *chooser, - GtkWidget *menu, - const gchar *str, - McPresence state, - gboolean custom) +void +gossip_presence_chooser_flash_start (GossipPresenceChooser *chooser, + McPresence state_1, + McPresence state_2) { - GtkWidget *item; - GtkWidget *image; - const gchar *icon_name; - - item = gtk_image_menu_item_new_with_label (str); - icon_name = gossip_icon_name_for_presence_state (state); - - if (custom) { - g_signal_connect ( - item, - "activate", - G_CALLBACK (presence_chooser_custom_activate_cb), - chooser); - } else { - g_signal_connect ( - item, - "activate", - G_CALLBACK (presence_chooser_noncustom_activate_cb), - chooser); - } + GossipPresenceChooserPriv *priv; - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); - gtk_widget_show (image); + g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); - gtk_widget_show (item); + priv = GET_PRIV (chooser); - g_object_set_data_full (G_OBJECT (item), - "status", g_strdup (str), - (GDestroyNotify) g_free); + if (priv->flash_timeout_id != 0) { + return; + } - g_object_set_data (G_OBJECT (item), "state", GINT_TO_POINTER (state)); + priv->flash_state_1 = state_1; + priv->flash_state_2 = state_2; - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + priv->flash_timeout_id = g_timeout_add (FLASH_TIMEOUT, + (GSourceFunc) presence_chooser_flash_timeout_cb, + chooser); } -static void -presence_chooser_menu_align_func (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - GossipPresenceChooser *chooser) +void +gossip_presence_chooser_flash_stop (GossipPresenceChooser *chooser, + McPresence state) { - GtkWidget *widget; - GtkRequisition req; - GdkScreen *screen; - gint screen_height; - - widget = GTK_WIDGET (chooser); - - gtk_widget_size_request (GTK_WIDGET (menu), &req); - - gdk_window_get_origin (widget->window, x, y); + GossipPresenceChooserPriv *priv; - *x += widget->allocation.x + 1; - *y += widget->allocation.y; + g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); - screen = gtk_widget_get_screen (GTK_WIDGET (menu)); - screen_height = gdk_screen_get_height (screen); + priv = GET_PRIV (chooser); - if (req.height > screen_height) { - /* Too big for screen height anyway. */ - *y = 0; - return; + if (priv->flash_timeout_id) { + g_source_remove (priv->flash_timeout_id); + priv->flash_timeout_id = 0; } - if ((*y + req.height + widget->allocation.height) > screen_height) { - /* Can't put it below the button. */ - *y -= req.height; - *y += 1; - } else { - /* Put menu below button. */ - *y += widget->allocation.height; - *y -= 1; - } + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), + gossip_icon_name_for_presence_state (state), + GTK_ICON_SIZE_MENU); - *push_in = FALSE; + priv->last_state = state; } -static void -presence_chooser_menu_selection_done_cb (GtkMenuShell *menushell, - GossipPresenceChooser *chooser) +gboolean +gossip_presence_chooser_is_flashing (GossipPresenceChooser *chooser) { - gtk_widget_destroy (GTK_WIDGET (menushell)); + GossipPresenceChooserPriv *priv; - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chooser), FALSE); + g_return_val_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser), FALSE); + + priv = GET_PRIV (chooser); + + if (priv->flash_timeout_id) { + return TRUE; + } + + return FALSE; } -static void -presence_chooser_menu_destroy_cb (GtkWidget *menu, - GossipPresenceChooser *chooser) +static gboolean +presence_chooser_button_press_event_cb (GtkWidget *chooser, + GdkEventButton *event, + gpointer user_data) { - GossipPresenceChooserPriv *priv; + if (event->button != 1 || event->type != GDK_BUTTON_PRESS) { + return FALSE; + } - priv = GET_PRIV (chooser); + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chooser))) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chooser), TRUE); + return TRUE; + } - priv->menu = NULL; + return FALSE; } static void -presence_chooser_menu_detach (GtkWidget *attach_widget, - GtkMenu *menu) +presence_chooser_toggled_cb (GtkWidget *chooser, + gpointer user_data) { - /* We don't need to do anything, but attaching the menu means - * we don't own the ref count and it is cleaned up properly. - */ + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chooser))) { + presence_chooser_menu_popup (GOSSIP_PRESENCE_CHOOSER (chooser)); + } else { + presence_chooser_menu_popdown (GOSSIP_PRESENCE_CHOOSER (chooser)); + } } static void @@ -603,7 +565,7 @@ presence_chooser_menu_popup (GossipPresenceChooser *chooser) return; } - menu = gossip_presence_chooser_create_menu (chooser); + menu = gossip_presence_chooser_create_menu (); g_signal_connect_after (menu, "selection-done", G_CALLBACK (presence_chooser_menu_selection_done_cb), @@ -640,200 +602,82 @@ presence_chooser_menu_popdown (GossipPresenceChooser *chooser) } static void -presence_chooser_toggled_cb (GtkWidget *chooser, - gpointer user_data) +presence_chooser_menu_selection_done_cb (GtkMenuShell *menushell, + GossipPresenceChooser *chooser) { - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chooser))) { - presence_chooser_menu_popup (GOSSIP_PRESENCE_CHOOSER (chooser)); - } else { - presence_chooser_menu_popdown (GOSSIP_PRESENCE_CHOOSER (chooser)); - } + gtk_widget_destroy (GTK_WIDGET (menushell)); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chooser), FALSE); } -static gboolean -presence_chooser_button_press_event_cb (GtkWidget *chooser, - GdkEventButton *event, - gpointer user_data) +static void +presence_chooser_menu_destroy_cb (GtkWidget *menu, + GossipPresenceChooser *chooser) { - if (event->button != 1 || event->type != GDK_BUTTON_PRESS) { - return FALSE; - } + GossipPresenceChooserPriv *priv; - if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chooser))) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chooser), TRUE); - return TRUE; - } + priv = GET_PRIV (chooser); - return FALSE; + priv->menu = NULL; } -typedef struct { - McPresence state; - const gchar *status; -} StateAndStatus; - -static StateAndStatus * -presence_chooser_state_and_status_new (McPresence state, - const gchar *status) +static void +presence_chooser_menu_detach (GtkWidget *attach_widget, + GtkMenu *menu) { - StateAndStatus *sas; + /* We don't need to do anything, but attaching the menu means + * we don't own the ref count and it is cleaned up properly. + */ +} - sas = g_new0 (StateAndStatus, 1); +static void +presence_chooser_menu_align_func (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + GtkWidget *widget) +{ + GtkRequisition req; + GdkScreen *screen; + gint screen_height; - sas->state = state; - sas->status = status; + gtk_widget_size_request (GTK_WIDGET (menu), &req); - return sas; -} + gdk_window_get_origin (widget->window, x, y); -static GList * -presence_chooser_get_presets (GossipPresenceChooser *chooser) -{ - GList *list = NULL; - guint i; + *x += widget->allocation.x + 1; + *y += widget->allocation.y; - for (i = 0; i < G_N_ELEMENTS (states); i++) { - GList *presets, *p; - StateAndStatus *sas; - const gchar *status; + screen = gtk_widget_get_screen (GTK_WIDGET (menu)); + screen_height = gdk_screen_get_height (screen); - status = gossip_presence_state_get_default_status (states[i]); - sas = presence_chooser_state_and_status_new (states[i], status); - list = g_list_append (list, sas); - - presets = gossip_status_presets_get (states[i], 5); - for (p = presets; p; p = p->next) { - sas = presence_chooser_state_and_status_new (states[i], p->data); - list = g_list_append (list, sas); - } - g_list_free (presets); + if (req.height > screen_height) { + /* Too big for screen height anyway. */ + *y = 0; + return; } - return list; -} - -static gboolean -presence_chooser_scroll_timeout_cb (GossipPresenceChooser *chooser) -{ - GossipPresenceChooserPriv *priv; - - priv = GET_PRIV (chooser); - - g_signal_emit (chooser, signals[CHANGED], 0, - priv->scroll_state, - priv->scroll_status); - - priv->scroll_timeout_id = 0; - - g_free (priv->scroll_status); - priv->scroll_status = NULL; - - return FALSE; -} - -static gboolean -presence_chooser_scroll_event_cb (GtkWidget *chooser, - GdkEventScroll *event, - gpointer user_data) -{ - GossipPresenceChooserPriv *priv; - GList *list, *l; - const gchar *current_status; - StateAndStatus *sas; - gboolean match; - - priv = GET_PRIV (chooser); - - switch (event->direction) { - case GDK_SCROLL_UP: - break; - case GDK_SCROLL_DOWN: - break; - default: - return FALSE; - } - - current_status = gtk_label_get_text (GTK_LABEL (priv->label)); - - /* Get the list of presets, which in this context means all the items - * without a trailing "...". - */ - list = presence_chooser_get_presets (GOSSIP_PRESENCE_CHOOSER (chooser)); - sas = NULL; - match = FALSE; - for (l = list; l; l = l->next) { - sas = l->data; - - if (sas->state == priv->last_state && - strcmp (sas->status, current_status) == 0) { - sas = NULL; - match = TRUE; - if (event->direction == GDK_SCROLL_UP) { - if (l->prev) { - sas = l->prev->data; - } - } - else if (event->direction == GDK_SCROLL_DOWN) { - if (l->next) { - sas = l->next->data; - } - } - break; - } - - sas = NULL; - } - - if (sas) { - presence_chooser_reset_scroll_timeout (GOSSIP_PRESENCE_CHOOSER (chooser)); - - priv->scroll_status = g_strdup (sas->status); - priv->scroll_state = sas->state; - - priv->scroll_timeout_id = - g_timeout_add (500, - (GSourceFunc) presence_chooser_scroll_timeout_cb, - chooser); - - gossip_presence_chooser_set_status (GOSSIP_PRESENCE_CHOOSER (chooser), - sas->status); - gossip_presence_chooser_set_state (GOSSIP_PRESENCE_CHOOSER (chooser), - sas->state); - } - else if (!match) { - /* If we didn't get any match at all, it means the last state - * was a custom one. Just switch to the first one. - */ - presence_chooser_reset_scroll_timeout (GOSSIP_PRESENCE_CHOOSER (chooser)); - g_signal_emit (chooser, signals[CHANGED], 0, - MC_PRESENCE_AVAILABLE, - _("Available")); + if ((*y + req.height + widget->allocation.height) > screen_height) { + /* Can't put it below the button. */ + *y -= req.height; + *y += 1; + } else { + /* Put menu below button. */ + *y += widget->allocation.height; + *y -= 1; } - g_list_foreach (list, (GFunc) g_free, NULL); - g_list_free (list); - - return TRUE; -} - -GtkWidget * -gossip_presence_chooser_new (void) -{ - GtkWidget *chooser; - - chooser = g_object_new (GOSSIP_TYPE_PRESENCE_CHOOSER, NULL); - - return chooser; + *push_in = FALSE; } GtkWidget * -gossip_presence_chooser_create_menu (GossipPresenceChooser *chooser) +gossip_presence_chooser_create_menu (void) { const gchar *status; - GtkWidget *menu; - GtkWidget *item; - GtkWidget *image; - guint i; + GtkWidget *menu; + GtkWidget *item; + GtkWidget *image; + guint i; menu = gtk_menu_new (); @@ -841,24 +685,21 @@ gossip_presence_chooser_create_menu (GossipPresenceChooser *chooser) GList *list, *l; status = gossip_presence_state_get_default_status (states[i]); - presence_chooser_menu_add_item (chooser, - menu, + presence_chooser_menu_add_item (menu, status, states[i], FALSE); list = gossip_status_presets_get (states[i], 5); for (l = list; l; l = l->next) { - presence_chooser_menu_add_item (chooser, - menu, + presence_chooser_menu_add_item (menu, l->data, states[i], FALSE); } g_list_free (list); - presence_chooser_menu_add_item (chooser, - menu, + presence_chooser_menu_add_item (menu, _("Custom message..."), states[i], TRUE); @@ -871,8 +712,7 @@ gossip_presence_chooser_create_menu (GossipPresenceChooser *chooser) /* Offline to disconnect */ status = gossip_presence_state_get_default_status (MC_PRESENCE_OFFLINE); - presence_chooser_menu_add_item (chooser, - menu, + presence_chooser_menu_add_item (menu, status, MC_PRESENCE_OFFLINE, FALSE); @@ -892,133 +732,292 @@ gossip_presence_chooser_create_menu (GossipPresenceChooser *chooser) g_signal_connect (item, "activate", G_CALLBACK (presence_chooser_clear_activate_cb), - chooser); + NULL); return menu; } -void -gossip_presence_chooser_set_state (GossipPresenceChooser *chooser, - McPresence state) +static void +presence_chooser_menu_add_item (GtkWidget *menu, + const gchar *str, + McPresence state, + gboolean custom) { - GossipPresenceChooserPriv *priv; + GtkWidget *item; + GtkWidget *image; + const gchar *icon_name; - g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); + item = gtk_image_menu_item_new_with_label (str); + icon_name = gossip_icon_name_for_presence_state (state); - priv = GET_PRIV (chooser); + if (custom) { + g_signal_connect (item, "activate", + G_CALLBACK (presence_chooser_custom_activate_cb), + NULL); + } else { + g_signal_connect (item, "activate", + G_CALLBACK (presence_chooser_noncustom_activate_cb), + NULL); + } - gossip_presence_chooser_flash_stop (chooser, state); + image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + gtk_widget_show (image); + + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + gtk_widget_show (item); + + g_object_set_data_full (G_OBJECT (item), + "status", g_strdup (str), + (GDestroyNotify) g_free); + + g_object_set_data (G_OBJECT (item), "state", GINT_TO_POINTER (state)); + + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); } -void -gossip_presence_chooser_set_status (GossipPresenceChooser *chooser, - const gchar *status) +static void +presence_chooser_clear_activate_cb (GtkWidget *item, + gpointer user_data) { - GossipPresenceChooserPriv *priv; + GtkWidget *dialog; + GtkWidget *toplevel; + GtkWindow *parent = NULL; - g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); + toplevel = gtk_widget_get_toplevel (item); + if (GTK_WIDGET_TOPLEVEL (toplevel) && + GTK_IS_WINDOW (toplevel)) { + GtkWindow *window; + gboolean visible; - priv = GET_PRIV (chooser); + window = GTK_WINDOW (toplevel); + visible = gossip_window_get_is_visible (window); - gtk_label_set_text (GTK_LABEL (priv->label), status); + if (visible) { + parent = window; + } + } + + dialog = gtk_message_dialog_new (GTK_WINDOW (parent), + 0, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + _("Are you sure you want to clear the list?")); + + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("This will remove any custom messages you have " + "added to the list of preset status messages.")); + + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + _("Clear List"), GTK_RESPONSE_OK, + NULL); + + gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE); + + g_signal_connect (dialog, "response", + G_CALLBACK (presence_chooser_clear_response_cb), + NULL); + + gtk_widget_show (dialog); } -void -gossip_presence_chooser_set_flash_interval (GossipPresenceChooser *chooser, - guint ms) +static void +presence_chooser_clear_response_cb (GtkWidget *widget, + gint response, + gpointer user_data) { - GossipPresenceChooserPriv *priv; + if (response == GTK_RESPONSE_OK) { + gossip_status_presets_reset (); + } - g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); - g_return_if_fail (ms > 1 && ms < 30000); + gtk_widget_destroy (widget); +} - priv = GET_PRIV (chooser); +static void +presence_chooser_noncustom_activate_cb (GtkWidget *item, + gpointer user_data) +{ + McPresence state; + const gchar *status; + + status = g_object_get_data (G_OBJECT (item), "status"); + state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "state")); - priv->flash_interval = ms; + presence_chooser_set_state (state, status, FALSE); } -static gboolean -presence_chooser_flash_timeout_cb (GossipPresenceChooser *chooser) +static void +presence_chooser_set_state (McPresence state, + const gchar *status, + gboolean save) { - GossipPresenceChooserPriv *priv; - McPresence state; - static gboolean on = FALSE; + const gchar *default_status; + MissionControl *mc; - priv = GET_PRIV (chooser); + default_status = gossip_presence_state_get_default_status (state); - if (on) { - state = priv->flash_state_1; + if (G_STR_EMPTY (status)) { + status = default_status; } else { - state = priv->flash_state_2; + /* Only store the value if it differs from the default ones. */ + if (save && strcmp (status, default_status) != 0) { + gossip_status_presets_set_last (state, status); + } } - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - gossip_icon_name_for_presence_state (state), - GTK_ICON_SIZE_MENU); - - on = !on; + gossip_debug (DEBUG_DOMAIN, "Setting presence to %s (%d)", + status, state); - return TRUE; + mc = mission_control_new (tp_get_bus ()); + mission_control_set_presence (mc, state, status, NULL, NULL); + g_object_unref (mc); } -void -gossip_presence_chooser_flash_start (GossipPresenceChooser *chooser, - McPresence state_1, - McPresence state_2) +static void +presence_chooser_custom_activate_cb (GtkWidget *item, + gpointer user_data) { - GossipPresenceChooserPriv *priv; + McPresence state; - g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); + state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "state")); - priv = GET_PRIV (chooser); + presence_chooser_show_dialog (state); +} - if (priv->flash_timeout_id != 0) { - return; +static void +presence_chooser_show_dialog (McPresence state) +{ + static GtkWidget *dialog = NULL; + static GtkListStore *store[LAST_MC_PRESENCE]; + GladeXML *glade; + GtkWidget *image; + GtkWidget *combo; + GtkWidget *entry; + GtkWidget *checkbutton; + const gchar *default_status; + + if (dialog) { + gtk_widget_destroy (dialog); + dialog = NULL; + } else { + guint i; + + for (i = 0; i < LAST_MC_PRESENCE; i++) { + store[i] = NULL; + } } - priv->flash_state_1 = state_1; - priv->flash_state_2 = state_2; + glade = gossip_glade_get_file ("gossip-presence-chooser.glade", + "status_message_dialog", + NULL, + "status_message_dialog", &dialog, + "comboentry_status", &combo, + "image_status", &image, + "checkbutton_add", &checkbutton, + NULL); - priv->flash_timeout_id = g_timeout_add (priv->flash_interval, - (GSourceFunc) presence_chooser_flash_timeout_cb, - chooser); -} + g_object_unref (glade); -void -gossip_presence_chooser_flash_stop (GossipPresenceChooser *chooser, - McPresence state) -{ - GossipPresenceChooserPriv *priv; + g_signal_connect (dialog, "destroy", + G_CALLBACK (gtk_widget_destroyed), + &dialog); + g_signal_connect (dialog, "response", + G_CALLBACK (presence_chooser_dialog_response_cb), + NULL); - g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); + gtk_image_set_from_icon_name (GTK_IMAGE (image), + gossip_icon_name_for_presence_state (state), + GTK_ICON_SIZE_MENU); - priv = GET_PRIV (chooser); + if (!store[state]) { + GList *presets, *l; + GtkTreeIter iter; - if (priv->flash_timeout_id) { - g_source_remove (priv->flash_timeout_id); - priv->flash_timeout_id = 0; + store[state] = gtk_list_store_new (1, G_TYPE_STRING); + + presets = gossip_status_presets_get (state, -1); + for (l = presets; l; l = l->next) { + gtk_list_store_append (store[state], &iter); + gtk_list_store_set (store[state], &iter, 0, l->data, -1); + } + + g_list_free (presets); } - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - gossip_icon_name_for_presence_state (state), - GTK_ICON_SIZE_MENU); + default_status = gossip_presence_state_get_default_status (state); - priv->last_state = state; + entry = GTK_BIN (combo)->child; + gtk_entry_set_text (GTK_ENTRY (entry), default_status); + gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); + gtk_entry_set_width_chars (GTK_ENTRY (entry), 25); + + gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store[state])); + gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo), 0); + + /* FIXME: Set transian for a window ? */ + + g_object_set_data (G_OBJECT (dialog), "store", store[state]); + g_object_set_data (G_OBJECT (dialog), "entry", entry); + g_object_set_data (G_OBJECT (dialog), "checkbutton", checkbutton); + g_object_set_data (G_OBJECT (dialog), "state", GINT_TO_POINTER (state)); + + gtk_widget_show_all (dialog); } -gboolean -gossip_presence_chooser_is_flashing (GossipPresenceChooser *chooser) +static void +presence_chooser_dialog_response_cb (GtkWidget *dialog, + gint response, + gpointer user_data) { - GossipPresenceChooserPriv *priv; + if (response == GTK_RESPONSE_OK) { + GtkWidget *entry; + GtkWidget *checkbutton; + GtkListStore *store; + GtkTreeModel *model; + GtkTreeIter iter; + McPresence state; + const gchar *status; + gboolean save; + gboolean duplicate = FALSE; + gboolean has_next; - g_return_val_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser), FALSE); + entry = g_object_get_data (G_OBJECT (dialog), "entry"); + status = gtk_entry_get_text (GTK_ENTRY (entry)); + store = g_object_get_data (G_OBJECT (dialog), "store"); + model = GTK_TREE_MODEL (store); - priv = GET_PRIV (chooser); + has_next = gtk_tree_model_get_iter_first (model, &iter); + while (has_next) { + gchar *str; - if (priv->flash_timeout_id) { - return TRUE; + gtk_tree_model_get (model, &iter, + 0, &str, + -1); + + if (strcmp (status, str) == 0) { + g_free (str); + duplicate = TRUE; + break; + } + + g_free (str); + + has_next = gtk_tree_model_iter_next (model, &iter); + } + + if (!duplicate) { + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, 0, status, -1); + } + + checkbutton = g_object_get_data (G_OBJECT (dialog), "checkbutton"); + save = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)); + state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "state")); + + presence_chooser_set_state (state, status, save); } - return FALSE; + gtk_widget_destroy (dialog); } diff --git a/libempathy-gtk/gossip-presence-chooser.h b/libempathy-gtk/gossip-presence-chooser.h index a3f9d509..f78c96c1 100644 --- a/libempathy-gtk/gossip-presence-chooser.h +++ b/libempathy-gtk/gossip-presence-chooser.h @@ -50,15 +50,7 @@ struct _GossipPresenceChooserClass { GType gossip_presence_chooser_get_type (void) G_GNUC_CONST; GtkWidget *gossip_presence_chooser_new (void); -GtkWidget *gossip_presence_chooser_create_menu (GossipPresenceChooser *chooser); - -void gossip_presence_chooser_set_state (GossipPresenceChooser *chooser, - McPresence state); -void gossip_presence_chooser_set_status (GossipPresenceChooser *chooser, - const gchar *status); -void gossip_presence_chooser_set_flash_interval (GossipPresenceChooser *chooser, - guint ms); - +GtkWidget *gossip_presence_chooser_create_menu (void); void gossip_presence_chooser_flash_start (GossipPresenceChooser *chooser, McPresence state_1, McPresence state_2); diff --git a/src/empathy-main.c b/src/empathy-main.c index c2cb2ec5..6780ff68 100644 --- a/src/empathy-main.c +++ b/src/empathy-main.c @@ -53,10 +53,6 @@ static void operation_error_cb (MissionControl *mc, guint error_code, gpointer user_data); static void start_mission_control (MissionControl *mc); -static void destroy_cb (GtkWidget *window, - MissionControl *mc); -static void icon_activate_cb (EmpathyStatusIcon *icon, - GtkWidget *window); static void error_cb (MissionControl *mc, @@ -116,28 +112,6 @@ start_mission_control (MissionControl *mc) NULL); } -static void -destroy_cb (GtkWidget *window, - MissionControl *mc) -{ - mission_control_set_presence (mc, - MC_PRESENCE_OFFLINE, - NULL, NULL, NULL); - - gtk_main_quit (); -} - -static void -icon_activate_cb (EmpathyStatusIcon *icon, - GtkWidget *window) -{ - if (GTK_WIDGET_VISIBLE (window)) { - gtk_widget_hide (window); - } else { - gtk_widget_show (window); - } -} - static void new_channel_cb (EmpathyFilter *filter, TpConn *tp_conn, @@ -182,20 +156,9 @@ main (int argc, char *argv[]) NULL); start_mission_control (mc); - /* Setting up the main window */ + /* Setting up UI */ window = empathy_main_window_show (); - g_signal_connect (window, "destroy", - G_CALLBACK (destroy_cb), - mc); - g_signal_connect (window, "delete-event", - G_CALLBACK (gtk_widget_hide_on_delete), - NULL); - - /* Setting up the status icon */ - icon = empathy_status_icon_new (); - g_signal_connect (icon, "activate", - G_CALLBACK (icon_activate_cb), - window); + icon = empathy_status_icon_new (GTK_WINDOW (window)); /* Show the accounts dialog if there is no enabled accounts */ accounts = mc_accounts_list_by_enabled (TRUE); @@ -207,6 +170,10 @@ main (int argc, char *argv[]) gtk_main (); + mission_control_set_presence (mc, + MC_PRESENCE_OFFLINE, + NULL, NULL, NULL); + g_object_unref (monitor); g_object_unref (mc); g_object_unref (icon);