mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk gtk) #1666: Option to disable notification bubbles
This commit is contained in:
parent
bb8451344f
commit
20bc67554e
3 changed files with 27 additions and 14 deletions
33
gtk/notify.c
33
gtk/notify.c
|
@ -60,20 +60,27 @@ notifyCallback( NotifyNotification * n UNUSED,
|
||||||
void
|
void
|
||||||
tr_notify_send( TrTorrent *tor )
|
tr_notify_send( TrTorrent *tor )
|
||||||
{
|
{
|
||||||
const tr_info * info = tr_torrent_info( tor );
|
if( pref_flag_get( PREF_KEY_SHOW_DESKTOP_NOTIFICATION ) )
|
||||||
NotifyNotification * n = notify_notification_new( _(
|
{
|
||||||
"Torrent Complete" ),
|
const tr_info * info = tr_torrent_info( tor );
|
||||||
info->name,
|
NotifyNotification * n;
|
||||||
"transmission", NULL );
|
|
||||||
|
|
||||||
if( info->fileCount == 1 )
|
n = notify_notification_new( _( "Torrent Complete" ),
|
||||||
notify_notification_add_action( n, "file", _( "Open File" ),
|
info->name,
|
||||||
NOTIFY_ACTION_CALLBACK(
|
"transmission", NULL );
|
||||||
notifyCallback ), tor, NULL );
|
|
||||||
notify_notification_add_action( n, "folder", _( "Open Folder" ),
|
if( info->fileCount == 1 )
|
||||||
NOTIFY_ACTION_CALLBACK(
|
notify_notification_add_action(
|
||||||
notifyCallback ), tor, NULL );
|
n, "file", _( "Open File" ),
|
||||||
notify_notification_show( n, NULL );
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -39,7 +39,7 @@ tr_prefs_init_global( void )
|
||||||
|
|
||||||
cf_check_older_configs( );
|
cf_check_older_configs( );
|
||||||
|
|
||||||
#if HAVE_GIO
|
#ifdef HAVE_GIO
|
||||||
str = NULL;
|
str = NULL;
|
||||||
if( !str ) str = g_get_user_special_dir( G_USER_DIRECTORY_DESKTOP );
|
if( !str ) str = g_get_user_special_dir( G_USER_DIRECTORY_DESKTOP );
|
||||||
if( !str ) str = tr_getDefaultDownloadDir( );
|
if( !str ) str = tr_getDefaultDownloadDir( );
|
||||||
|
@ -56,6 +56,7 @@ tr_prefs_init_global( void )
|
||||||
pref_flag_set_default ( PREF_KEY_FILTERBAR, TRUE );
|
pref_flag_set_default ( PREF_KEY_FILTERBAR, TRUE );
|
||||||
pref_flag_set_default ( PREF_KEY_STATUSBAR, 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_TRAY_ICON, FALSE );
|
||||||
|
pref_flag_set_default ( PREF_KEY_SHOW_DESKTOP_NOTIFICATION, TRUE );
|
||||||
pref_string_set_default ( PREF_KEY_STATUSBAR_STATS, "total-ratio" );
|
pref_string_set_default ( PREF_KEY_STATUSBAR_STATS, "total-ratio" );
|
||||||
|
|
||||||
pref_flag_set_default ( PREF_KEY_SCHED_LIMIT_ENABLED, FALSE );
|
pref_flag_set_default ( PREF_KEY_SCHED_LIMIT_ENABLED, FALSE );
|
||||||
|
@ -350,6 +351,10 @@ desktopPage( GObject * core )
|
||||||
w = new_check_button( s, PREF_KEY_SHOW_TRAY_ICON, core );
|
w = new_check_button( s, PREF_KEY_SHOW_TRAY_ICON, core );
|
||||||
hig_workarea_add_wide_control( t, &row, w );
|
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 );
|
hig_workarea_finish( t, &row );
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ GtkWidget * tr_prefs_dialog_new( GObject * core,
|
||||||
#define PREF_KEY_DIR_WATCH "watch-dir"
|
#define PREF_KEY_DIR_WATCH "watch-dir"
|
||||||
#define PREF_KEY_DIR_WATCH_ENABLED "watch-dir-enabled"
|
#define PREF_KEY_DIR_WATCH_ENABLED "watch-dir-enabled"
|
||||||
#define PREF_KEY_SHOW_TRAY_ICON "show-notification-area-icon"
|
#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_START "start-added-torrents"
|
||||||
#define PREF_KEY_TRASH_ORIGINAL "trash-original-torrent-files"
|
#define PREF_KEY_TRASH_ORIGINAL "trash-original-torrent-files"
|
||||||
#define PREF_KEY_ASKQUIT "prompt-before-exit"
|
#define PREF_KEY_ASKQUIT "prompt-before-exit"
|
||||||
|
|
Loading…
Reference in a new issue