Changeset 5102


Ignore:
Timestamp:
Feb 24, 2008, 4:10:18 PM (14 years ago)
Author:
charles
Message:

(gtk) add prefs to toggle libnotify notification

Location:
trunk/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr_prefs.c

    r5082 r5102  
    5454    pref_int_set_default    ( PREF_KEY_PORT, TR_DEFAULT_PORT );
    5555
     56    pref_flag_set_default   ( PREF_KEY_NOTIFY, TRUE );
     57
    5658    pref_flag_set_default   ( PREF_KEY_NAT, TRUE );
    5759    pref_flag_set_default   ( PREF_KEY_PEX, TRUE );
     
    234236
    235237    t = hig_workarea_create( );
    236     hig_workarea_add_section_title( t, &row, _( "Location" ) );
     238    hig_workarea_add_section_title( t, &row, _( "Adding" ) );
    237239
    238240        w = new_path_chooser_button( PREF_KEY_DIR_DEFAULT, core );
    239241        hig_workarea_add_row( t, &row, _( "Default download _location:" ), w, NULL );
    240242
    241     hig_workarea_add_section_divider( t, &row );
    242     hig_workarea_add_section_title( t, &row, _( "Adding Torrents" ) );
    243 
    244243        s = _( "Show _options dialog" );
    245244        w = new_check_button( s, PREF_KEY_OPTIONS_PROMPT, core );
     
    253252        w = new_check_button( s, PREF_KEY_DELETE_ORIGINAL, core );
    254253        hig_workarea_add_wide_control( t, &row, w );
     254
     255#ifdef HAVE_LIBNOTIFY
     256    hig_workarea_add_section_divider( t, &row );
     257    hig_workarea_add_section_title( t, &row, _( "Notification" ) );
     258
     259        s = _( "_Popup message when a torrent finishes" );
     260        w = new_check_button( s, PREF_KEY_NOTIFY, core );
     261        hig_workarea_add_wide_control( t, &row, w );
     262#endif
    255263
    256264    hig_workarea_finish( t, &row );
  • trunk/gtk/tr_prefs.h

    r5015 r5102  
    3636#define PREF_KEY_ENCRYPTED_ONLY         "encrypted-connections-only"
    3737#define PREF_KEY_MSGLEVEL               "debug-message-level"
     38#define PREF_KEY_NOTIFY                 "notify-when-complete"
    3839#define PREF_KEY_SORT_MODE              "sort-mode"
    3940#define PREF_KEY_SORT_REVERSED          "sort-reversed"
  • trunk/gtk/tr_torrent.c

    r5100 r5102  
    167167notifyInMainThread( gpointer user_data )
    168168{
    169 g_message( "calling tr_notify_send on %p", user_data );
    170     tr_notify_send( TR_TORRENT( user_data ) );
     169    if( pref_flag_get( PREF_KEY_NOTIFY ) )
     170        tr_notify_send( TR_TORRENT( user_data ) );
    171171    return FALSE;
    172172}
     
    176176                       void         * user_data )
    177177{
    178 g_message( "status changed! new status is %d, user_data is %p", status, user_data );
    179178    if( status == TR_CP_COMPLETE )
    180179        g_idle_add( notifyInMainThread, user_data );
Note: See TracChangeset for help on using the changeset viewer.