Index: nautilus-2.29.92.1/configure.in =================================================================== --- nautilus-2.29.92.1.orig/configure.in 2010-03-10 21:54:56.000000000 +0100 +++ nautilus-2.29.92.1/configure.in 2010-03-10 21:55:08.000000000 +0100 @@ -11,7 +11,7 @@ m4_define(exempi_minver, 1.99.2) m4_define(exempi_minver_newapi, 1.99.5) m4_define(gail_minver, 0.16) - +m4_define(appindicator_minver, 0.0.2) dnl 1. If the library code has changed at all since last release, then increment revision. dnl 2. If any interfaces have been added, then increment current and set revision to 0. @@ -235,6 +235,28 @@ dnl ========================================================================== +AM_CONDITIONAL(HAVE_APP_INDICATOR, false) + +AC_ARG_ENABLE(appindicator, + AC_HELP_STRING([--disable-appindicator], + [build without appindicator support])) + +msg_appindicator=no +if test "x$enable_appindicator" != "xno"; then + PKG_CHECK_MODULES(APP_INDICATOR, + appindicator-0.1 >= appindicator_minver, [ + AM_CONDITIONAL(HAVE_APP_INDICATOR, 1) + AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator]) + ] + msg_appindicator=yes, + [AM_CONDITIONAL(HAVE_APP_INDICATOR, 0) + ]) + AC_SUBST(APP_INDICATOR_CFLAGS) + AC_SUBST(APP_INDICATOR_LIBS) +fi + +dnl ========================================================================== + dnl Turn on the additional warnings last, so -Werror doesn't affect other tests. AC_ARG_ENABLE(more-warnings, @@ -408,7 +430,8 @@ compiler: ${CC} xmp support: $msg_xmp PackageKit support: $msg_packagekit - + AppIndicator support: $msg_appindicator + profiling support: ${profiling_support} nautilus-extension documentation: ${enable_gtk_doc} " Index: nautilus-2.29.92.1/libnautilus-private/Makefile.am =================================================================== --- nautilus-2.29.92.1.orig/libnautilus-private/Makefile.am 2010-03-10 14:59:13.000000000 +0100 +++ nautilus-2.29.92.1/libnautilus-private/Makefile.am 2010-03-10 21:55:08.000000000 +0100 @@ -10,6 +10,7 @@ $(DISABLE_DEPRECATED_CFLAGS) \ $(TRACKER_CFLAGS) \ $(BEAGLE_CFLAGS) \ + $(APP_INDICATOR_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ @@ -32,6 +33,7 @@ $(top_builddir)/eel/libeel-2.la \ $(top_builddir)/libnautilus-extension/libnautilus-extension.la \ $(CORE_LIBS) \ + $(APP_INDICATOR_LIBS) \ $(NULL) marshal_sources = \ Index: nautilus-2.29.92.1/libnautilus-private/Makefile.in =================================================================== --- nautilus-2.29.92.1.orig/libnautilus-private/Makefile.in 2010-03-10 15:07:03.000000000 +0100 +++ nautilus-2.29.92.1/libnautilus-private/Makefile.in 2010-03-10 21:55:08.000000000 +0100 @@ -169,6 +169,8 @@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ +APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -353,6 +355,7 @@ $(DISABLE_DEPRECATED_CFLAGS) \ $(TRACKER_CFLAGS) \ $(BEAGLE_CFLAGS) \ + $(APP_INDICATOR_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ @@ -375,6 +378,7 @@ $(top_builddir)/eel/libeel-2.la \ $(top_builddir)/libnautilus-extension/libnautilus-extension.la \ $(CORE_LIBS) \ + $(APP_INDICATOR_LIBS) \ $(NULL) marshal_sources = \ Index: nautilus-2.29.92.1/libnautilus-private/nautilus-progress-info.c =================================================================== --- nautilus-2.29.92.1.orig/libnautilus-private/nautilus-progress-info.c 2010-03-10 14:59:13.000000000 +0100 +++ nautilus-2.29.92.1/libnautilus-private/nautilus-progress-info.c 2010-03-10 21:55:08.000000000 +0100 @@ -30,6 +30,11 @@ #include #include "nautilus-progress-info.h" + +#ifdef HAVE_APP_INDICATOR +#include +#endif + enum { CHANGED, PROGRESS_CHANGED, @@ -77,7 +82,11 @@ static GList *active_progress_infos = NULL; +#ifdef HAVE_APP_INDICATOR +static AppIndicator *indicator = NULL; +#else static GtkStatusIcon *status_icon = NULL; +#endif static int n_progress_ops = 0; @@ -193,6 +202,14 @@ return TRUE; } +#ifdef HAVE_APP_INDICATOR +static void +indicator_icon_activate_cb (AppIndicator *icon, + GtkWidget *progress_window) +{ + gtk_window_present (GTK_WINDOW (progress_window)); +} +#else static void status_icon_activate_cb (GtkStatusIcon *icon, GtkWidget *progress_window) @@ -203,12 +220,16 @@ gtk_window_present (GTK_WINDOW (progress_window)); } } +#endif static GtkWidget * get_progress_window (void) { static GtkWidget *progress_window = NULL; GtkWidget *vbox; +#ifdef HAVE_APP_INDICATOR + GtkWidget *indicator_menu, *indicator_menuitem; +#endif if (progress_window != NULL) { return progress_window; @@ -240,13 +261,27 @@ "delete_event", (GCallback)delete_event, NULL); +#ifdef HAVE_APP_INDICATOR + indicator = app_indicator_new ("nautilus", "system-file-manager", + APP_INDICATOR_CATEGORY_APPLICATION_STATUS); + + indicator_menu = gtk_menu_new(); + indicator_menuitem = gtk_menu_item_new_with_label (_("Show copy dialog")); + gtk_menu_shell_append (indicator_menu, indicator_menuitem); + g_signal_connect (indicator_menuitem, "activate", + (GCallback)indicator_icon_activate_cb, + progress_window); + app_indicator_set_status (indicator, APP_INDICATOR_STATUS_PASSIVE); + app_indicator_set_menu (indicator, GTK_MENU (indicator_menu)); + gtk_widget_show_all (indicator_menu); +#else status_icon = gtk_status_icon_new_from_icon_name ("system-file-manager"); g_signal_connect (status_icon, "activate", (GCallback)status_icon_activate_cb, progress_window); gtk_status_icon_set_visible (status_icon, FALSE); - +#endif return progress_window; } @@ -296,6 +331,18 @@ } } +#ifdef HAVE_APP_INDICATOR +static void +update_status_icon_and_window (void) +{ + if (n_progress_ops == 0) { + app_indicator_set_status (indicator, APP_INDICATOR_STATUS_PASSIVE); + gtk_widget_hide (get_progress_window ()); + } else { + app_indicator_set_status (indicator, APP_INDICATOR_STATUS_ACTIVE); + } +} +#else static void update_status_icon_and_window (void) { @@ -315,6 +362,7 @@ gtk_status_icon_set_visible (status_icon, TRUE); } } +#endif static void op_finished (ProgressWidgetData *data)