From: Janek K. <jan...@wp...> - 2008-01-13 21:08:23
|
Thomas Leonard said: (by the date of Sat, 23 Jun 2007 09:16:25 +0000 (UTC)) > On Thu, 21 Jun 2007 10:21:38 +0200, Sabyasachi Ghosh wrote: > > > umm..ok..I guess it would take at least 2-3 months for me as I haven't > > looked at rox code..could someone tell me a good starting point for adding > > this feature? > > You should create a new implementation of the View interface. There are > two already: view_details.c and view_collection.c. back to this very old thread.... I'm trying to do this (wondering if I will succeed), but I need more hints. I have little experience with hacking rox (however I'm very happy that my patch about (not) filtering directories made it into upstream ;) I added a gboolean type, and toggle it in the menu "Display->Label sort fields", when this boolean is turned on, the filer window should draw a horizontal line and write a label. The label will be different depending on by what it is sorted "Sort by ...". This menu option will be just above/below the "Reversed" toggle. So I added this gboolean...: --- ./rox-filer-2.7.1-ORG/ROX-Filer/src/filer.c 2008-01-08 21:02:41.000000000 +0100 +++ ./rox-filer-2.7.1/ROX-Filer/src/filer.c 2008-01-13 21:55:48.000000000 +0100 @@ -103,6 +103,7 @@ DetailsType details_type; DisplayStyle display_style; + gboolean label_sort_types; FilterType filter_type; char *filter; @@ -1459,6 +1460,7 @@ and also in other relevant places. Now I am stuck in this place: --- ./rox-filer-2.7.1-ORG/ROX-Filer/src/filer.c 2008-01-08 21:02:41.000000000 +0100 +++ ./rox-filer-2.7.1/ROX-Filer/src/filer.c 2008-01-13 21:55:48.000000000 +0100 @@ -3268,9 +3287,10 @@ if(set->flags & SET_HIDDEN) filer_set_hidden(filer_window, set->show_hidden); - if(set->flags & (SET_STYLE|SET_DETAILS)) { + if(set->flags & (SET_STYLE|SET_DETAILS|SET_LABEL_SORT_TYPES)) { DisplayStyle style=filer_window->display_style; DetailsType details=filer_window->details_type; + gboolean label_sort_types=filer_window->label_sort_types; if(set->flags & SET_STYLE) style=set->display_style; @@ -3281,9 +3301,12 @@ filer_set_view_type(filer_window, set->view_type); } + + if(set->flags & SET_LABEL_SORT_TYPES) + label_sort_types=set->sort_labels_type; display_set_layout(filer_window, style, - details, FALSE); + details, FALSE, label_sort_types); } What I guess I should do is to add a new argument when calling display_set_layout. The function display_set_layout() calls view_style_changed() which calls style_changed(). And this is where I am lost. style_changed() is set differently depending whether view_collection.c is used or view_details.c. So I want to add a new one, say, view_labelled.c, but how do I add it, so that style_changed() will correctly call it? whatever tips you might give me will be very helpful. -- Janek Kozicki | |