Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 19 Sep 2018, 08:56
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
ROX-Filer 2.11 patched
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 4 [51 Posts]   Goto page: 1, 2, 3, 4 Next
Author Message
radky

Joined: 02 May 2010
Posts: 820

PostPosted: Sat 21 Oct 2017, 01:58    Post subject:  ROX-Filer 2.11 patched  

ROX-Filer 2.11 - jun7 patch for action.c (add Force option to copy/move dialog)

Edit: patched versions of ROX-Filer removed. See below.

_________________
PupMates

Last edited by radky on Mon 23 Oct 2017, 00:00; edited 1 time in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1615
Location: Japan

PostPosted: Sat 21 Oct 2017, 03:28    Post subject:  

Thanks radky.

I've only tested briefly but I feel that the new 'Force' option has the potential to make unwanted overwrites.
Unless the 'Newer' option works properly (which it doesn't in my opinion) the new option will always overwrite newer files by older, no questions asked. The unpatched version at least gave the user a chance to check the date.

I can't select 'Force' by default, no matter if I tick the checkbox in Menu Option > Action windows > Default Settings or not. Is this intended? I admit that I don't understand the tooltip explanation ("Don't confirm deletion of non-writeable items"). Embarassed
Back to top
View user's profile Send private message 
radky

Joined: 02 May 2010
Posts: 820

PostPosted: Sat 21 Oct 2017, 11:52    Post subject:  

Edit: After additional testing, it seems the 'Force' option does not fully integrate with the 'Newer' or 'Quiet' options of the ROX-Filer copy/move dialog.

The test binaries in the first post are now removed.

_________________
PupMates
Back to top
View user's profile Send private message 
woodenshoe-wi

Joined: 28 Jul 2017
Posts: 65
Location: Wisconsin

PostPosted: Wed 11 Apr 2018, 00:42    Post subject: Another try at patching ROX  

Another try at patching ROX

For anyone brave enough to try it, here is a 32bit binary to replace the one in /usr/local/apps/ROX-Filer/
Edit: Newer version posted later.

Compiled from http://distro.ibiblio.org/fatdog/source/700/rox-filer-2015.02.tar.bz2 with the following patch, plus the others at https://github.com/puppylinux-woof-CE/petbuilds/tree/generic/basic/pkgs/rox-filer
Code:

diff -ur rox-filer-2015.02-original/ROX-Filer/src/action.c rox-filer-2015.02/ROX-Filer/src/action.c
--- rox-filer-2015.02-original/ROX-Filer/src/action.c   2015-02-12 09:39:03.000000000 -0600
+++ rox-filer-2015.02/ROX-Filer/src/action.c   2018-04-10 19:07:15.453517881 -0500
@@ -1327,10 +1327,16 @@
    {
       int      err;
       gboolean   merge;
+      gboolean   is_newer;
 
       merge = S_ISDIR(info.st_mode) && S_ISDIR(dest_info.st_mode);
 
-      if (!merge && o_newer && info.st_mtime > dest_info.st_mtime)
+      /* Using greater than or equal because people who tick the
+       * "Newer" checkbox probably don't want to be prompted whether
+       * to overwrite a file that has an identical mtime. */
+      is_newer = info.st_mtime >= dest_info.st_mtime;
+
+      if (!merge && o_newer && is_newer)
       {
          /* Newer; keep going */
       }
@@ -1338,7 +1344,7 @@
       {
          printf_send("<%s", path);
          printf_send(">%s", dest_path);
-         if (!printf_reply(from_parent, merge,
+         if (!printf_reply(from_parent, !o_newer || !is_newer,
                  _("?'%s' already exists - %s?"),
                  dest_path,
                  merge ? _("merge contents")
@@ -1486,6 +1492,7 @@
    {
       struct stat   info;
       int      err;
+      gboolean   is_newer;
 
       if (mc_lstat(dest_path, &info))
       {
@@ -1493,7 +1500,12 @@
          return;
       }
 
-      if (!is_dir && o_newer && info2.st_mtime > info.st_mtime)
+      /* Using greater than or equal because people who tick the
+       * "Newer" checkbox probably don't want to be prompted whether
+       * to overwrite a file that has an identical mtime. */
+      is_newer = info2.st_mtime >= info.st_mtime;
+
+      if (!is_dir && o_newer && is_newer)
       {
          /* Newer; keep going */
       }
@@ -1501,7 +1513,7 @@
       {
          printf_send("<%s", path);
          printf_send(">%s", dest_path);
-         if (!printf_reply(from_parent, TRUE,
+         if (!printf_reply(from_parent, !o_newer || !is_newer,
                    _("?'%s' already exists - overwrite?"),
                    dest_path))
             return;


Pets are also available, but be warned that they will reset your desktop background, overwrite your pin-board and possibly other unwanted changes... They are meant for testing in woof builds, and include fixes for the changed deb and font mime type names. @peebee please DON'T upload to ibiblio unless or until you are confident that they work properly. I am posting them for more thorough testing.
Edit: Newer version posted later.

Last edited by woodenshoe-wi on Sun 29 Apr 2018, 00:52; edited 3 times in total
Back to top
View user's profile Send private message 
peebee


Joined: 21 Sep 2008
Posts: 3464
Location: Worcestershire, UK

PostPosted: Wed 11 Apr 2018, 07:07    Post subject: Re: Another try at patching ROX  

woodenshoe-wi wrote:
and include fixes for the changed deb and font mime type names.

Hi

from /usr/share/mime/packages/freedesktop.org.xml

font/otf
font/woff

have to also be tweaked similar to font/ttf

_________________
LxPup = Puppy + LXDE
Back to top
View user's profile Send private message Visit poster's website 
woodenshoe-wi

Joined: 28 Jul 2017
Posts: 65
Location: Wisconsin

PostPosted: Wed 11 Apr 2018, 22:10    Post subject:  

OK, pets updated.

When I was working on the patch to fix the "Newer" check-box I noticed that the function for copying files had code to merge directories, but the function to move files looks like it will overwrite directories without merging.

It seemed unrelated to fixing the "Newer" check-box, but it might be something to discuss.
Back to top
View user's profile Send private message 
recobayu


Joined: 15 Sep 2010
Posts: 305
Location: indonesia

PostPosted: Wed 11 Apr 2018, 22:24    Post subject:  

Can we add 'new folder' ini toolbar? So when we click that, it can make new directory.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1615
Location: Japan

PostPosted: Wed 11 Apr 2018, 23:49    Post subject: Re: Another try at patching ROX  

woodenshoe-wi wrote:
For anyone brave enough to try it, here is a 32bit binary to replace the one in /usr/local/apps/ROX-Filer/
https://www.dropbox.com/s/8kp6goaktr48lat/ROX-Filer?dl=1
Is the "Newer" checkbox really fixed? ROX-Filer still tries to overwrite newer files.
Back to top
View user's profile Send private message 
woodenshoe-wi

Joined: 28 Jul 2017
Posts: 65
Location: Wisconsin

PostPosted: Thu 12 Apr 2018, 15:52    Post subject:  

@recobayu
Right now I am trying to fix existing bugs and inconsistent behavior. I also want to collect any Puppy specific patches for ROX, so if you have a patch that implements the feature you want I can compile a version with it but I am not going to try to implement new features myself.

@MochiMoppel
My understanding of how the code was supposed to work was:

    - without "Quiet" ROX prompts when starting copy operation

    - with "Quiet" but without "Newer" ROX prompts when copy operation involves overwriting existing files

    - with "Quiet" and "Newer" ROX only prompts when copy would overwrite a newer file with an older one


The same logic applies to "move", except the code for the function to move files lacks the ability to merge directories and will give an error if you try to move a directory over another one with the same name that is not empty.

I think the tool-tip text that reads "Only over-write if source is newer than destination." would be more accurately "Automatically over-write if source is newer than destination." but because this string is translated I am afraid that changing it will break all the translations.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1615
Location: Japan

PostPosted: Thu 12 Apr 2018, 20:39    Post subject:  

To me "quiet" means "quiet" and not "only prompt when". And when I tick the checkbox, telling ROX that it should keep newer files untouched, I don't want ROX to ask me again and again if I really mean it.
Back to top
View user's profile Send private message 
recobayu


Joined: 15 Sep 2010
Posts: 305
Location: indonesia

PostPosted: Thu 12 Apr 2018, 22:52    Post subject:  

woodenshoe-wi wrote:
@recobayu
Right now I am trying to fix existing bugs and inconsistent behavior. I also want to collect any Puppy specific patches for ROX, so if you have a patch that implements the feature you want I can compile a version with it but I am not going to try to implement new features myself.

Thank you @woodenshoe-wi. Is there a tutorial how to make a patch? So I can learn and make it. Is it difficult?

Edit:
I look at http://www.kerofin.demon.co.uk/rox/patch/ and got some file like this, but i still don't understand it:
Code:
Index:rox-1.1.10-selbutton/ROX-Filer/pixmaps/select.xpm
*** rox-1.1.10-patched/ROX-Filer/pixmaps/select.xpm   Thu Jan  1 01:00:00 1970
--- rox-1.1.10-selbutton/ROX-Filer/pixmaps/select.xpm   Wed Jan  2 14:23:30 2002
***************
*** 0 ****
--- 1,24 ----
+ /* XPM */
+ static char * select_xpm[] = {
+ "17 16 5 1",
+ "    c None",
+ ".   c #000000",
+ "+   c #C5CEC5",
+ "@   c #FFFFFF",
+ "#   c #7F7F7F",
+ ".................",
+ ".+++++++++++++++.",
+ ".+@@@@@@@@@@@#.+.",
+ ".+@@@@@@@@@@#..+.",
+ ".+@@@@@@@@@#...+.",
+ ".+@@@@@@@@#....+.",
+ ".+@@@@@@@#.....+.",
+ ".+@@@@@@#......+.",
+ ".+@@@@@#.......+.",
+ ".+@@@@#........+.",
+ ".+@@@#.........+.",
+ ".+@@#..........+.",
+ ".+@#...........+.",
+ ".+#............+.",
+ ".+++++++++++++++.",
+ "................."};
Index:rox-1.1.10-selbutton/ROX-Filer/src/toolbar.c
*** rox-1.1.10-patched/ROX-Filer/src/toolbar.c   Wed Jan  2 13:53:48 2002
--- rox-1.1.10-selbutton/ROX-Filer/src/toolbar.c   Wed Jan  2 14:23:30 2002
***************
*** 81,86 ****
--- 81,88 ----
                  FilerWindow *filer_window);
  static void toolbar_hidden_clicked(GtkWidget *widget,
                 FilerWindow *filer_window);
+ static void toolbar_select_clicked(GtkWidget *widget,
+                FilerWindow *filer_window);
  static GtkWidget *add_button(GtkWidget *box, Tool *tool,
              FilerWindow *filer_window);
  static GtkWidget *create_toolbar(FilerWindow *filer_window);
***************
*** 133,138 ****
--- 135,144 ----
      toolbar_hidden_clicked, DROP_NONE, TRUE,
      NULL, NULL},
     
+    {N_("Select"), "select", N_("Select all/invert selection"),
+     toolbar_select_clicked, DROP_NONE, TRUE,
+     NULL, NULL},
+    
     {N_("Help"), "help", N_("Show ROX-Filer help"),
      toolbar_help_clicked, DROP_NONE, TRUE,
      NULL, NULL},
***************
*** 336,341 ****
--- 342,365 ----
                 FilerWindow *filer_window)
  {
     display_set_hidden(filer_window, !filer_window->show_hidden);
+ }
+
+ static void toolbar_select_clicked(GtkWidget *widget, FilerWindow *filer_window)
+ {
+    GdkEvent   *event;
+
+    event = gtk_get_current_event();
+    if (event->type == GDK_BUTTON_RELEASE &&
+        ((GdkEventButton *) event)->button==2)
+    {
+       collection_invert_selection(filer_window->collection);
+    }
+    else if (event->type == GDK_BUTTON_RELEASE &&
+        ((GdkEventButton *) event)->button==1)
+    {
+       collection_select_all(filer_window->collection);
+    }
+    filer_window->temp_item_selected = FALSE;
  }
 
  static GtkWidget *create_toolbar(FilerWindow *filer_window)
Back to top
View user's profile Send private message 
woodenshoe-wi

Joined: 28 Jul 2017
Posts: 65
Location: Wisconsin

PostPosted: Fri 13 Apr 2018, 23:09    Post subject:  

@MochiMoppel
Well, to me "quiet" even if not completely silent, is still an improvement over not selecting "quiet". Have you tried using ROX without the "quiet" option default? I have because of the "automatic overwriting of newer files with older files" bug and it was very annoying.

From my reading of the source code I think the "Newer" option was meant to trigger automatic overwriting of older files with newer files, not as a way of protecting the newer files in the destination.

Is your goal to have completely silent operation of ROX or do you just want ROX to silently ignore older source files when there are newer destination files?

In the first case maybe a "merge" check-box to make merging directories silent, plus a "no to all" check-box to make the default answer to all questions "no".

In the second case maybe an "ignore older" check-box to cause ROX to silently ignore older source files.


@recobayu
The patch you found looks like a "context" format patch. Here are some links that give an explanation of the format.
https://www.gnu.org/software/diffutils/manual/html_node/Example-Context.html
https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Context.html

I made a "unified" format patch that I posted earlier. I think the "unified" format patches are easier to read.
https://www.gnu.org/software/diffutils/manual/html_node/Example-Unified.html
https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html

The command used to make patch files is "diff", for example:
Code:

diff -c action.c.original action.c > action.patch    # will make a context patch
diff -u action.c.original action.c > action.patch    # will make a unified patch


The first part of the patch you found makes a new "select.xpm" file, it is a text based image format.

I think this part adds a "prototype" for the "toolbar_select_clicked" function:
Code:

+ static void toolbar_select_clicked(GtkWidget *widget,
+                FilerWindow *filer_window);


I think this part adds the "Select all/invert selection" button to the toolbar:
Code:

+    {N_("Select"), "select", N_("Select all/invert selection"),
+     toolbar_select_clicked, DROP_NONE, TRUE,
+     NULL, NULL},
+   


And this part adds the actuall "toolbar_select_clicked" function:
Code:

+ } <- this line was actually not changed, but diff missed the closing } for the new function
+
+ static void toolbar_select_clicked(GtkWidget *widget, FilerWindow *filer_window)
+ {
+    GdkEvent   *event;
+
+    event = gtk_get_current_event();
+    if (event->type == GDK_BUTTON_RELEASE &&
+        ((GdkEventButton *) event)->button==2)
+    {
+       collection_invert_selection(filer_window->collection);
+    }
+    else if (event->type == GDK_BUTTON_RELEASE &&
+        ((GdkEventButton *) event)->button==1)
+    {
+       collection_select_all(filer_window->collection);
+    }
+    filer_window->temp_item_selected = FALSE;

diff sometimes gets confused by identical lines, but as long as the end result is identical it doesn't matter.

So, this patch documents the origin of the "Select all/invert selection" button that is now part of ROX.

If you don't have a patch file that implements the feature you want you would edit the source code until it works properly and then make a patch file against the original unmodified version of the source code. The "Select all/invert selection" patch looks like a good example of how to add a new button to the tool bar.
Back to top
View user's profile Send private message 
woodenshoe-wi

Joined: 28 Jul 2017
Posts: 65
Location: Wisconsin

PostPosted: Mon 23 Apr 2018, 00:59    Post subject:  

Ok, here is a new version.

Edit: Newer version posted later.
md5sum: 5a74f2c1f4eb27f1f0380a107cdf74cf
Source code available at:
https://github.com/woodenshoe-wi/rox-filer

Edit:
You will also need the new version of Options.xml, unzip it and replace the one in /usr/local/apps/ROX-Filer/
Edit again: Not needed with newer pet posted later.

I decided to go with "ignore older" and "merge" check-boxes.

I also managed to get a "New" button added to the toolbar.

I think I fixed the "move" function, so it should act the same as "copy".

For some reason the "copy/paste" functionality doesn't seem to work on a fresh reboot, but does work when started as "rox -n"

I don't know how to debug that, so don't expect it to get fixed any time soon.

Last edited by woodenshoe-wi on Sun 29 Apr 2018, 00:55; edited 2 times in total
Back to top
View user's profile Send private message 
peebee


Joined: 21 Sep 2008
Posts: 3464
Location: Worcestershire, UK

PostPosted: Tue 24 Apr 2018, 05:41    Post subject:  

woodenshoe-wi wrote:
Ok, here is a new version.

Made a ydrv for UpupBB - booted OK (after I changed executable permission)

Copied a file to /tmp, edited the copy to make a newer version, repeated the copy but as far as I could determine, no matter which boxes were ticked, the new version was always overwritten by the old unedited version.....expected behaviour?

Screenie and ydrv with false.gz attached. UPDATED.
ydrv_upupbb_18.04.sfs-false.gz
Description  updated with options.xml
gz

 Download 
Filename  ydrv_upupbb_18.04.sfs-false.gz 
Filesize  228 KB 
Downloaded  81 Time(s) 
Screenshot.png
 Description   
 Filesize   113.2 KB
 Viewed   463 Time(s)

Screenshot.png


_________________
LxPup = Puppy + LXDE

Last edited by peebee on Wed 25 Apr 2018, 02:04; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
woodenshoe-wi

Joined: 28 Jul 2017
Posts: 65
Location: Wisconsin

PostPosted: Tue 24 Apr 2018, 10:30    Post subject:  

Quote:
.....expected behaviour?

Kind of... the check boxes only apply to subsequent files, and will not be remembered for next time.

I forgot that Options.xml also needs to be replaced to allow the default settings to be changed. I added a link in my previous post.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 4 [51 Posts]   Goto page: 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0708s ][ Queries: 13 (0.0048s) ][ GZIP on ]