void
tr_notify_send( TrTorrent *tor )
{
- const tr_info * info = tr_torrent_info( tor );
- NotifyNotification * n = notify_notification_new( _(
- "Torrent Complete" ),
- info->name,
- "transmission", NULL );
+ if( pref_flag_get( PREF_KEY_SHOW_DESKTOP_NOTIFICATION ) )
+ {
+ const tr_info * info = tr_torrent_info( tor );
+ NotifyNotification * n;
+
+ n = notify_notification_new( _( "Torrent Complete" ),
+ info->name,
+ "transmission", NULL );
+
+ if( info->fileCount == 1 )
+ notify_notification_add_action(
+ n, "file", _( "Open File" ),
+ NOTIFY_ACTION_CALLBACK( notifyCallback ), tor,
+ NULL );
- 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_show( n, NULL );
+ notify_notification_add_action(
+ n, "folder", _( "Open Folder" ),
+ NOTIFY_ACTION_CALLBACK( notifyCallback ), tor, NULL );
+
+ notify_notification_show( n, NULL );
+ }
}
#endif
cf_check_older_configs( );
-#if HAVE_GIO
+#ifdef HAVE_GIO
str = NULL;
if( !str ) str = g_get_user_special_dir( G_USER_DIRECTORY_DESKTOP );
if( !str ) str = tr_getDefaultDownloadDir( );
pref_flag_set_default ( PREF_KEY_FILTERBAR, TRUE );
pref_flag_set_default ( PREF_KEY_STATUSBAR, TRUE );
pref_flag_set_default ( PREF_KEY_SHOW_TRAY_ICON, FALSE );
+ pref_flag_set_default ( PREF_KEY_SHOW_DESKTOP_NOTIFICATION, TRUE );
pref_string_set_default ( PREF_KEY_STATUSBAR_STATS, "total-ratio" );
pref_flag_set_default ( PREF_KEY_SCHED_LIMIT_ENABLED, FALSE );
w = new_check_button( s, PREF_KEY_SHOW_TRAY_ICON, core );
hig_workarea_add_wide_control( t, &row, w );
+ s = _( "Show desktop _notifications" );
+ w = new_check_button( s, PREF_KEY_SHOW_DESKTOP_NOTIFICATION, core );
+ hig_workarea_add_wide_control( t, &row, w );
+
hig_workarea_finish( t, &row );
return t;
}
#define PREF_KEY_DIR_WATCH "watch-dir"
#define PREF_KEY_DIR_WATCH_ENABLED "watch-dir-enabled"
#define PREF_KEY_SHOW_TRAY_ICON "show-notification-area-icon"
+#define PREF_KEY_SHOW_DESKTOP_NOTIFICATION "show-desktop-notification"
#define PREF_KEY_START "start-added-torrents"
#define PREF_KEY_TRASH_ORIGINAL "trash-original-torrent-files"
#define PREF_KEY_ASKQUIT "prompt-before-exit"