Changeset 12036


Ignore:
Timestamp:
Feb 24, 2011, 4:00:34 PM (11 years ago)
Author:
jordan
Message:

(2.2x) backport r11891 -- dead code removal from gtk/file-list.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2x/gtk/file-list.c

    r11837 r12036  
    681681}
    682682
    683 #if 0
    684 static void
    685 fileMenuSetDownload( GtkWidget * item, gpointer gdata )
    686 {
    687     tr_torrent * tor;
    688     FileData * data = gdata;
    689 
    690     if(( tor = tr_torrentFindFromId( tr_core_session( data->core ), data->torrentId )))
    691     {
    692         const tr_bool download_flag = g_object_get_data( G_OBJECT( item ), TR_DOWNLOAD_KEY ) != NULL;
    693         GArray * indices = getSelectedFilesAndDescendants( GTK_TREE_VIEW( data->view ) );
    694 
    695         tr_torrentSetFileDLs( tor,
    696                               (tr_file_index_t *) indices->data,
    697                               (tr_file_index_t) indices->len,
    698                               download_flag );
    699 
    700         refresh( data );
    701         g_array_free( indices, TRUE );
    702     }
    703 }
    704 
    705 static void
    706 fileMenuSetPriority( GtkWidget * item, gpointer gdata )
    707 {
    708     tr_torrent * tor;
    709     FileData * data = gdata;
    710 
    711     if(( tor = tr_torrentFindFromId( tr_core_session( data->core ), data->torrentId )))
    712     {
    713         const int priority = GPOINTER_TO_INT( g_object_get_data( G_OBJECT( item ), TR_PRIORITY_KEY ) );
    714         GArray * indices = getSelectedFilesAndDescendants( GTK_TREE_VIEW( data->view ) );
    715         tr_torrentSetFilePriorities( tor,
    716                                      (tr_file_index_t *) indices->data,
    717                                      (tr_file_index_t) indices->len,
    718                                      priority );
    719         refresh( data );
    720         g_array_free( indices, TRUE );
    721     }
    722 }
    723 
    724 static void
    725 fileMenuPopup( GtkWidget * w, GdkEventButton * event, gpointer filedata )
    726 {
    727     GtkWidget * item;
    728     GtkWidget * menu;
    729 
    730     menu = gtk_menu_new( );
    731     item = gtk_menu_item_new_with_label( _( "Set Priority High" ) );
    732     g_object_set_data( G_OBJECT( item ), TR_PRIORITY_KEY,
    733                        GINT_TO_POINTER( TR_PRI_HIGH ) );
    734     g_signal_connect( item, "activate",
    735                       G_CALLBACK( fileMenuSetPriority ), filedata );
    736     gtk_menu_shell_append( GTK_MENU_SHELL( menu ), item );
    737 
    738     item = gtk_menu_item_new_with_label( _( "Set Priority Normal" ) );
    739     g_object_set_data( G_OBJECT( item ), TR_PRIORITY_KEY,
    740                        GINT_TO_POINTER( TR_PRI_NORMAL ) );
    741     g_signal_connect( item, "activate",
    742                       G_CALLBACK( fileMenuSetPriority ), filedata );
    743     gtk_menu_shell_append( GTK_MENU_SHELL( menu ), item );
    744 
    745     item = gtk_menu_item_new_with_label( _( "Set Priority Low" ) );
    746     g_object_set_data( G_OBJECT( item ), TR_PRIORITY_KEY,
    747                        GINT_TO_POINTER( TR_PRI_LOW ) );
    748     g_signal_connect( item, "activate",
    749                       G_CALLBACK( fileMenuSetPriority ), filedata );
    750     gtk_menu_shell_append( GTK_MENU_SHELL( menu ), item );
    751 
    752     item = gtk_separator_menu_item_new( );
    753     gtk_menu_shell_append( GTK_MENU_SHELL( menu ), item );
    754 
    755     item = gtk_menu_item_new_with_label( _( "Download" ) );
    756     g_object_set_data( G_OBJECT( item ), TR_DOWNLOAD_KEY,
    757                        GINT_TO_POINTER( TRUE ) );
    758     g_signal_connect( item, "activate",
    759                       G_CALLBACK( fileMenuSetDownload ), filedata );
    760     gtk_menu_shell_append( GTK_MENU_SHELL( menu ), item );
    761 
    762     item = gtk_menu_item_new_with_label( _( "Do Not Download" ) );
    763     g_object_set_data( G_OBJECT( item ), TR_DOWNLOAD_KEY,
    764                        GINT_TO_POINTER( FALSE ) );
    765     g_signal_connect( item, "activate",
    766                       G_CALLBACK( fileMenuSetDownload ), filedata );
    767     gtk_menu_shell_append( GTK_MENU_SHELL( menu ), item );
    768 
    769     gtk_widget_show_all( menu );
    770     gtk_menu_attach_to_widget( GTK_MENU( menu ), w, NULL );
    771     gtk_menu_popup( GTK_MENU( menu ), NULL, NULL, NULL, NULL,
    772                     event ? event->button : 0,
    773                     event ? event->time : gtk_get_current_event_time( ) );
    774 }
    775 #endif
    776 
    777683static gboolean
    778684onViewPathToggled( GtkTreeView       * view,
     
    880786        handled = onViewPathToggled( treeview, col, path, data );
    881787    }
    882 #if 0
    883     else if( event->type == GDK_BUTTON_PRESS && event->button == 3
    884              && getAndSelectEventPath( treeview, event, &col, &path ) )
    885     {
    886         GtkTreeSelection * sel = gtk_tree_view_get_selection( treeview );
    887         if( gtk_tree_selection_count_selected_rows( sel ) > 0 )
    888         {
    889             fileMenuPopup( w, event, data );
    890             handled = TRUE;
    891         }
    892     }
    893 #endif
    894788
    895789    gtk_tree_path_free( path );
    896790    return handled;
    897791}
    898 
    899 #if 0
    900 static gboolean
    901 onViewPopupMenu( GtkWidget * w, gpointer gdata )
    902 {
    903     fileMenuPopup( w, NULL, gdata );
    904     return TRUE;
    905 }
    906 #endif
    907792
    908793GtkWidget *
     
    933818    g_signal_connect( view, "button-press-event",
    934819                      G_CALLBACK( onViewButtonPressed ), data );
    935 #if 0
    936     g_signal_connect( view, "popup-menu",
    937                       G_CALLBACK( onViewPopupMenu ), data );
    938 #endif
    939820    g_signal_connect( view, "row_activated",
    940821                      G_CALLBACK( onRowActivated ), data );
Note: See TracChangeset for help on using the changeset viewer.