From 563cdc5a284bc85957f60b14048ba6e42a0c7c87 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 2 May 2007 17:39:27 +0000 Subject: [darcs-to-svn @ Autostart] svn path=/trunk/; revision=27 --- src/Makefile.am | 5 ++++- src/empathy-main.c | 39 ++++++++++++++++++--------------------- src/empathy.desktop.in | 11 +++++++++++ 3 files changed, 33 insertions(+), 22 deletions(-) create mode 100644 src/empathy.desktop.in (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 4fe517deb..b9c9ca2e8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,4 +17,7 @@ empathy_LDADD = \ $(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@ diff --git a/src/empathy-main.c b/src/empathy-main.c index 15f4c504f..94e29e2b5 100644 --- a/src/empathy-main.c +++ b/src/empathy-main.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -85,23 +86,19 @@ start_mission_control (MissionControl *mc) 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 @@ -138,6 +135,17 @@ main (int argc, char *argv[]) /* 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", @@ -148,7 +156,7 @@ main (int argc, char *argv[]) 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", @@ -163,17 +171,6 @@ main (int argc, char *argv[]) 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); diff --git a/src/empathy.desktop.in b/src/empathy.desktop.in new file mode 100644 index 000000000..3e0ea16b8 --- /dev/null +++ b/src/empathy.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +_Name=Empathy +_Comment=Gnome Instant Messaging Client +Icon= +Exec=empathy +Terminal=false +Type=Application +Categories=Internet +OnlyShowIn=GNOME + -- cgit v1.2.3