Ticket #4607: gtk-expand-less.patch
File gtk-expand-less.patch, 2.9 KB (added by jauthu, 11 years ago) |
---|
-
gtk/conf.c
114 114 tr_bencDictAddStr( d, PREF_KEY_SORT_MODE, "sort-by-name" ); 115 115 tr_bencDictAddBool( d, PREF_KEY_SORT_REVERSED, FALSE ); 116 116 tr_bencDictAddBool( d, PREF_KEY_COMPACT_VIEW, FALSE ); 117 118 tr_bencDictAddBool( d, PREF_KEY_EXPAND_LESS_IN_FILE_TREE, FALSE ); 117 119 } 118 120 119 121 static char* -
gtk/tr-prefs.c
360 360 g_signal_connect( w, "toggled", G_CALLBACK( target_cb ), w2 ); 361 361 hig_workarea_add_row_w( t, &row, w, w2, NULL ); 362 362 363 hig_workarea_add_section_divider( t, &row ); 364 hig_workarea_add_section_title( t, &row, _( "Miscellaneous" ) ); 365 366 s = _( "Expand _less in file tree" ); 367 w = new_check_button( s, PREF_KEY_EXPAND_LESS_IN_FILE_TREE, core ); 368 hig_workarea_add_wide_control( t, &row, w ); 369 370 363 371 hig_workarea_finish( t, &row ); 364 372 return t; 365 373 } -
gtk/tr-prefs.h
50 50 #define PREF_KEY_TORRENT_COMPLETE_SOUND_ENABLED "torrent-complete-sound-enabled" 51 51 #define PREF_KEY_TRASH_CAN_ENABLED "trash-can-enabled" 52 52 #define PREF_KEY_USER_HAS_GIVEN_INFORMED_CONSENT "user-has-given-informed-consent" 53 #define PREF_KEY_EXPAND_LESS_IN_FILE_TREE "expand-less-in-file-tree" 53 54 54 55 enum 55 56 { -
gtk/file-list.c
19 19 #include <libtransmission/transmission.h> 20 20 #include <libtransmission/utils.h> 21 21 22 #include "conf.h" 22 23 #include "file-list.h" 23 24 #include "hig.h" 24 25 #include "icons.h" … … 173 174 int child_priority; 174 175 int64_t child_have, child_size; 175 176 177 176 178 gtk_tree_model_get( model, &child, FC_SIZE, &child_size, 177 179 FC_HAVE, &child_have, 178 180 FC_PRIORITY, &child_priority, … … 566 568 } 567 569 568 570 gtk_tree_view_set_model( GTK_TREE_VIEW( data->view ), data->model ); 569 gtk_tree_view_expand_all( GTK_TREE_VIEW( data->view ) ); 571 if ( gtr_pref_flag_get( PREF_KEY_EXPAND_LESS_IN_FILE_TREE ) ) 572 { 573 GtkTreePath* tree_path = gtk_tree_path_new_first(); 574 gtk_tree_view_expand_row( GTK_TREE_VIEW( data->view ), tree_path, FALSE ); 575 } 576 else 577 { 578 gtk_tree_view_expand_all( GTK_TREE_VIEW( data->view ) ); 579 } 580 570 581 g_object_unref( data->model ); 571 582 } 572 583 … … 911 922 gtr_file_list_set_torrent( ret, torrentId ); 912 923 913 924 pango_font_description_free( pango_font_description ); 925 914 926 return ret; 915 927 }