&startpaused, _( "Start with all torrents paused" ), NULL },
{ "version", '\0', 0, G_OPTION_ARG_NONE,
&showversion, _( "Show version number and exit" ), NULL },
-#ifdef STATUS_ICON_SUPPORTED
{ "minimized", 'm', 0, G_OPTION_ARG_NONE,
&startminimized,
_( "Start minimized in notification area" ), NULL },
-#endif
{ "config-dir", 'g', 0, G_OPTION_ARG_FILENAME, &configDir,
_( "Where to look for configuration files" ), NULL },
{ NULL, 0, 0, 0, NULL, NULL, NULL }
#define ICON_NAME "transmission"
-#ifndef STATUS_ICON_SUPPORTED
-gpointer gtr_icon_new( TrCore * core UNUSED ) { return NULL; }
-void gtr_icon_refresh( gpointer vicon UNUSED ) { }
-#else
-
#ifdef HAVE_LIBAPPINDICATOR
void
gtr_icon_refresh( gpointer vindicator UNUSED )
return icon_name;
}
-#ifdef HAVE_LIBAPPINDICATOR
gpointer
gtr_icon_new( TrCore * core)
{
+#ifdef HAVE_LIBAPPINDICATOR
GtkWidget * w;
const char * icon_name = getIconName( );
AppIndicator * indicator = app_indicator_new( ICON_NAME, icon_name, APP_INDICATOR_CATEGORY_SYSTEM_SERVICES );
app_indicator_set_menu( indicator, GTK_MENU ( w ) );
g_object_set_qdata( G_OBJECT( indicator ), get_core_quark( ), core );
return indicator;
-}
#else
-gpointer
-gtr_icon_new( TrCore * core )
-{
const char * icon_name = getIconName( );
GtkStatusIcon * icon = gtk_status_icon_new_from_icon_name( icon_name );
g_signal_connect( icon, "activate", G_CALLBACK( activated ), NULL );
g_signal_connect( icon, "popup-menu", G_CALLBACK( popup ), NULL );
g_object_set_qdata( G_OBJECT( icon ), get_core_quark( ), core );
return icon;
-}
-
-#endif
-
#endif
+}
#include <gtk/gtk.h>
#include "tr-core.h"
-#if GTK_CHECK_VERSION( 2,10,0 )
- #define STATUS_ICON_SUPPORTED
-#endif
-
gpointer gtr_icon_new ( TrCore * core );
void gtr_icon_refresh ( gpointer );