=== modified file 'gtk/notify.c' --- gtk/notify.c 2008-12-01 20:54:19 +0000 +++ gtk/notify.c 2009-02-25 11:28:47 +0000 @@ -57,6 +57,36 @@ } } +static gboolean +can_support_actions () +{ + static gboolean supports_actions = FALSE; + static gboolean have_checked = FALSE; + + if (!have_checked) + { + GList *caps = NULL; + GList *c; + + have_checked = TRUE; + + caps = notify_get_server_caps(); + if( caps != NULL ) + { + for( c = caps; c != NULL; c = c->next ) + { + if( strcmp( (char*)c->data, "actions" ) == 0) + { + supports_actions = TRUE; + break; + } + } + } + } + + return supports_actions; +} + void tr_notify_send( TrTorrent *tor ) { @@ -65,14 +95,17 @@ "Torrent Complete" ), info->name, "transmission", NULL ); - - if( info->fileCount == 1 ) - notify_notification_add_action( n, "file", _( "Open File" ), + if( can_support_actions() ) + { + if( info->fileCount == 1 ) + notify_notification_add_action( n, "file", _( "Open File" ), + NOTIFY_ACTION_CALLBACK( + notifyCallback ), tor, NULL ); + notify_notification_add_action( n, "folder", _( "Open Folder" ), NOTIFY_ACTION_CALLBACK( notifyCallback ), tor, NULL ); - notify_notification_add_action( n, "folder", _( "Open Folder" ), - NOTIFY_ACTION_CALLBACK( - notifyCallback ), tor, NULL ); + } + notify_notification_show( n, NULL ); }