GtkTooltips *tooltips;
/* Menu widgets */
- GtkWidget *chat_connect;
- GtkWidget *chat_disconnect;
- GtkWidget *chat_search;
GtkWidget *room;
GtkWidget *room_menu;
GtkWidget *room_sep;
static void main_window_favorite_chatroom_menu_setup (void);
static void main_window_chat_quit_cb (GtkWidget *widget,
EmpathyMainWindow *window);
-static void main_window_chat_connect_cb (GtkWidget *widget,
- EmpathyMainWindow *window);
-static void main_window_chat_disconnect_cb (GtkWidget *widget,
- EmpathyMainWindow *window);
-static void main_window_chat_search_cb (GtkWidget *widget,
- EmpathyMainWindow *window);
static void main_window_chat_new_message_cb (GtkWidget *widget,
EmpathyMainWindow *window);
static void main_window_chat_history_cb (GtkWidget *widget,
NULL,
"main_window", &window->window,
"main_vbox", &window->main_vbox,
- "chat_connect", &window->chat_connect,
- "chat_disconnect", &window->chat_disconnect,
- "chat_search", &window->chat_search,
"chat_show_offline", &show_offline_widget,
"room", &window->room,
"room_sep", &window->room_sep,
"main_window", "destroy", main_window_destroy_cb,
"main_window", "configure_event", main_window_configure_event_cb,
"chat_quit", "activate", main_window_chat_quit_cb,
- "chat_connect", "activate", main_window_chat_connect_cb,
- "chat_disconnect", "activate", main_window_chat_disconnect_cb,
- "chat_search", "activate", main_window_chat_search_cb,
"chat_new_message", "activate", main_window_chat_new_message_cb,
"chat_history", "activate", main_window_chat_history_cb,
"room_join_new", "activate", main_window_room_join_new_cb,
gtk_widget_destroy (window->window);
}
-static void
-main_window_chat_connect_cb (GtkWidget *widget,
- EmpathyMainWindow *window)
-{
-}
-
-static void
-main_window_chat_disconnect_cb (GtkWidget *widget,
- EmpathyMainWindow *window)
-{
-}
-
-static void
-main_window_chat_search_cb (GtkWidget *widget,
- EmpathyMainWindow *window)
-{
-}
-
static void
main_window_chat_new_message_cb (GtkWidget *widget,
EmpathyMainWindow *window)
<child>
<widget class="GtkMenu" id="chat_menu">
- <child>
- <widget class="GtkImageMenuItem" id="chat_connect">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Connect</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image874">
- <property name="visible">True</property>
- <property name="stock">gtk-connect</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="chat_disconnect">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Disconnect</property>
- <property name="use_underline">True</property>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image875">
- <property name="visible">True</property>
- <property name="stock">gtk-disconnect</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator1">
- <property name="visible">True</property>
- </widget>
- </child>
-
<child>
<widget class="GtkImageMenuItem" id="chat_new_message">
<property name="visible">True</property>
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image876">
+ <widget class="GtkImage" id="image885">
<property name="visible">True</property>
<property name="pixbuf">gossip-message.png</property>
<property name="xalign">0.5</property>
<accelerator key="F3" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image877">
+ <widget class="GtkImage" id="image886">
<property name="visible">True</property>
<property name="stock">gtk-justify-left</property>
<property name="icon_size">1</property>
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image878">
+ <widget class="GtkImage" id="image887">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
</widget>
</child>
- <child>
- <widget class="GtkImageMenuItem" id="chat_search">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Search</property>
- <property name="use_underline">True</property>
- <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image879">
- <property name="visible">True</property>
- <property name="stock">gtk-find</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
<child>
<widget class="GtkSeparatorMenuItem" id="separator3">
<property name="visible">True</property>
<accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image880">
+ <widget class="GtkImage" id="image888">
<property name="visible">True</property>
<property name="stock">gtk-quit</property>
<property name="icon_size">1</property>
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image881">
+ <widget class="GtkImage" id="image889">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image882">
+ <widget class="GtkImage" id="image890">
<property name="visible">True</property>
<property name="pixbuf">gossip-group-message.png</property>
<property name="xalign">0.5</property>
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image883">
+ <widget class="GtkImage" id="image891">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
<accelerator key="F1" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image884">
+ <widget class="GtkImage" id="image892">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
<property name="icon_size">1</property>
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image885">
+ <widget class="GtkImage" id="image893">
<property name="visible">True</property>
<property name="stock">gtk-about</property>
<property name="icon_size">1</property>
GtkWidget *
gossip_presence_chooser_create_menu (GossipPresenceChooser *chooser)
{
+ const gchar *status;
GtkWidget *menu;
GtkWidget *item;
+ GtkWidget *image;
guint i;
menu = gtk_menu_new ();
for (i = 0; i < G_N_ELEMENTS (states); i++) {
GList *list, *l;
- const gchar *status;
status = gossip_presence_state_get_default_status (states[i]);
presence_chooser_menu_add_item (chooser,
gtk_widget_show (item);
}
- item = gtk_menu_item_new_with_label (_("Clear List..."));
+ /* Offline to disconnect */
+ status = gossip_presence_state_get_default_status (MC_PRESENCE_OFFLINE);
+ presence_chooser_menu_add_item (chooser,
+ menu,
+ status,
+ MC_PRESENCE_OFFLINE,
+ FALSE);
+ /* Separator. */
+ item = gtk_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show (item);
+
+ /* Clear list */
+ item = gtk_image_menu_item_new_with_label (_("Clear List..."));
+ image = gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show (image);
gtk_widget_show (item);
g_signal_connect (item,
/* Use the default if not set */
if (!default_preset) {
- status_presets_set_default (MC_PRESENCE_AVAILABLE, NULL);
+ status_presets_set_default (MC_PRESENCE_OFFLINE, NULL);
}
gossip_debug (DEBUG_DOMAIN, "Parsed %d status presets", g_list_length (presets));
g_free (file_with_path);
}
-const gchar *
-status_presets_get_state_as_str (McPresence state)
-{
- switch (state) {
- case MC_PRESENCE_AVAILABLE:
- return "available";
- case MC_PRESENCE_DO_NOT_DISTURB:
- return "busy";
- case MC_PRESENCE_AWAY:
- return "away";
- case MC_PRESENCE_EXTENDED_AWAY:
- return "ext_away";
- default:
- return "unknown";
- }
-}
-
static gboolean
status_presets_file_save (void)
{
xmlNodePtr subnode;
xmlChar *state;
- state = (gchar*) status_presets_get_state_as_str (default_preset->state);
+ state = (gchar*) gossip_presence_state_to_str (default_preset->state);
subnode = xmlNewTextChild (root, NULL, "default",
default_preset->status);
xmlChar *state;
sp = l->data;
- state = (gchar*) status_presets_get_state_as_str (sp->state);
+ state = (gchar*) gossip_presence_state_to_str (sp->state);
count[sp->state]++;
if (count[sp->state] > STATUS_PRESETS_MAX_EACH) {
gossip_status_presets_get_default_state (void)
{
if (!default_preset) {
- return MC_PRESENCE_AVAILABLE;
+ return MC_PRESENCE_OFFLINE;
}
return default_preset->state;
<!ELEMENT presets ((default?),status*)>
<!ELEMENT default (#PCDATA)>
-<!ATTLIST default
- presence (available|busy|away|ext_away) "available">
+<!ATTLIST default presence CDATA #REQUIRED>
<!ELEMENT status (#PCDATA)>
-<!ATTLIST status
- presence (available|busy|away|ext_away) "available">
+<!ATTLIST status presence CDATA #REQUIRED>
return _("Unavailable");
case MC_PRESENCE_OFFLINE:
return _("Offline");
+ case MC_PRESENCE_UNSET:
+ return _("Unset");
default:
- return NULL;
+ g_assert_not_reached ();
+ }
+
+ return NULL;
+}
+
+const gchar *
+gossip_presence_state_to_str (McPresence state)
+{
+ switch (state) {
+ case MC_PRESENCE_AVAILABLE:
+ return "available";
+ case MC_PRESENCE_DO_NOT_DISTURB:
+ return "busy";
+ case MC_PRESENCE_AWAY:
+ return "away";
+ case MC_PRESENCE_EXTENDED_AWAY:
+ return "ext_away";
+ case MC_PRESENCE_HIDDEN:
+ return "hidden";
+ case MC_PRESENCE_OFFLINE:
+ return "offline";
+ case MC_PRESENCE_UNSET:
+ return "unset";
+ default:
+ g_assert_not_reached ();
}
return NULL;
return MC_PRESENCE_HIDDEN;
} else if (strcmp (str, "offline") == 0) {
return MC_PRESENCE_OFFLINE;
- } else if (strcmp (str, "chat") == 0) {
- /* We don't support chat, so treat it like available. */
- return MC_PRESENCE_AVAILABLE;
+ } else if (strcmp (str, "unset") == 0) {
+ return MC_PRESENCE_UNSET;
+ } else {
+ g_assert_not_reached ();
}
return MC_PRESENCE_AVAILABLE;
gint gossip_presence_sort_func (gconstpointer a,
gconstpointer b);
const gchar * gossip_presence_state_get_default_status (McPresence state);
+const gchar * gossip_presence_state_to_str (McPresence state);
McPresence gossip_presence_state_from_str (const gchar *str);
G_END_DECLS
$(top_builddir)/libempathy-gtk/libempathy-gtk.la \
$(EMPATHY_LIBS)
-
+autostartdir = $(datadir)/gnome/autostart
+autostart_in_files = empathy.desktop.in
+autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
+@INTLTOOL_DESKTOP_RULE@
#include <libempathy/empathy-session.h>
#include <libempathy/gossip-debug.h>
#include <libempathy-gtk/empathy-main-window.h>
+#include <libempathy-gtk/gossip-status-presets.h>
#include <libempathy-gtk/gossip-stock.h>
#include <libempathy-gtk/gossip-accounts-dialog.h>
presence = mission_control_get_presence_actual (mc, NULL);
- if (presence != MC_PRESENCE_UNSET &&
- presence != MC_PRESENCE_OFFLINE) {
+ if (presence > MC_PRESENCE_OFFLINE) {
/* MC is already running and online, nothing to do */
return;
}
gossip_debug (DEBUG_DOMAIN, "Starting Mission Control...");
- /* FIXME: Save/Restore status message */
- mission_control_set_presence (mc, MC_PRESENCE_AVAILABLE,
- NULL,
+ gossip_status_presets_get_all ();
+ mission_control_set_presence (mc,
+ gossip_status_presets_get_default_state (),
+ gossip_status_presets_get_default_status (),
(McCallback) error_cb,
NULL);
-
- mission_control_connect_all_with_default_presence (mc,
- (McCallback) error_cb,
- NULL);
}
static void
/* FIXME: This is a horrible hack */
gossip_stock_init (gtk_window_new (GTK_WINDOW_TOPLEVEL));
+ /* Setting up MC */
+ monitor = mc_account_monitor_new ();
+ mc = mission_control_new (tp_get_bus ());
+ g_signal_connect (monitor, "account-enabled",
+ G_CALLBACK (account_enabled_cb),
+ mc);
+ g_signal_connect (mc, "ServiceEnded",
+ G_CALLBACK (service_ended_cb),
+ NULL);
+ start_mission_control (mc);
+
/* Setting up the main window */
window = empathy_main_window_show ();
g_signal_connect (window, "destroy",
NULL);
/* Setting up the tray icon */
- icon = gtk_status_icon_new_from_stock (GOSSIP_STOCK_AVAILABLE);
+ icon = gtk_status_icon_new_from_stock (GOSSIP_STOCK_MESSAGE);
gtk_status_icon_set_tooltip (icon, "Empathy - click here to show/hide the main window");
gtk_status_icon_set_visible (icon, TRUE);
g_signal_connect (icon, "activate",
gossip_accounts_dialog_show ();
}
- /* Setting up MC */
- monitor = mc_account_monitor_new ();
- mc = mission_control_new (tp_get_bus ());
- g_signal_connect (monitor, "account-enabled",
- G_CALLBACK (account_enabled_cb),
- mc);
- g_signal_connect (mc, "ServiceEnded",
- G_CALLBACK (service_ended_cb),
- NULL);
- start_mission_control (mc);
-
gtk_main ();
g_object_unref (monitor);
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+_Name=Empathy
+_Comment=Gnome Instant Messaging Client
+Icon=
+Exec=empathy
+Terminal=false
+Type=Application
+Categories=Internet
+OnlyShowIn=GNOME
+