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 Mon 01 Sep 2014, 09:58
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to display Rox-filer options window in command line?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 12 Feb 2010, 09:31    Post subject:  How to display Rox-filer options window in command line?  

Helllo,
All is in the title: Usually this options window is displayed while right clicking on any empty area of a window of Rox. I would like to know the command line that displays it directly, for example <action> exec rox ???? &</action>.
Thank you a lot.
Regards
Back to top
View user's profile Send private message Visit poster's website 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Fri 12 Feb 2010, 16:55    Post subject:  

Argolance,

This has come up before and sadly no one has found a way to do this. Even though there was no documented way, I tried various commands that I hoped might start the Options directly for Roxset using SOAP and none seemed to work.

You could do a workaround using Xdotools by issuing mouse or key commands after the rox session window has opened.

Cheers,
s
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2238

PostPosted: Fri 12 Feb 2010, 17:35    Post subject:  

I just metioned this request to ttuuxxx in a PM about my hacked rox-1.2.2-12 filer. I have added several SOAP methods to it -mostly back-ported from later versions of rox. but, I thnik it may not be too hard to add a SOAP method for doing this. There is, of course, a menu entry for opening the dialog (actually several menu entries), so th code for performing the action is already in there -the window is separate but I'm not sure if it is separate enoguh to run without rox also running. But, assuming that rox is running, then it shouldn't be too hard to create SOAP code to do that... I'll have a look over the next few days and see if I can figure it out -unless someone beats me to it.
It may help to have a look at my rox-1.2.2-12 sources to see how the SOAP methods were added. Another of my patches adds a 'Back' button using the existing code for the menu entry, so that patch should also be informative -half this and half that. The sources which include the patches and some example SOAP scripts are here:
http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/AmigoProjects/AFX-ROX-Filer/AFX-ROX-Filer-1.2.2-12/ROX-Filer-1.2.2-12.tar.bz2
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2238

PostPosted: Sat 13 Feb 2010, 09:34    Post subject:  

Alright, I had a look at this and think I have it working. Here's the patch to the rox-filer_puppy-2.6.1 sources:
Code:
--- ./src/remote.c.00   2006-11-11 13:09:47.000000000 +0100
+++ ./src/remote.c   2010-02-13 14:17:45.000000000 +0100
@@ -50,6 +50,7 @@
 #include "xml.h"
 #include "diritem.h"
 #include "usericons.h"
+#include "options.h"
 
 static GdkAtom filer_atom;   /* _ROX_FILER_EUID_VERSION_HOST */
 static GdkAtom filer_atom_any;   /* _ROX_FILER_EUID_HOST */
@@ -105,6 +106,8 @@
 static xmlNodePtr rpc_SetIcon(GList *args);
 static xmlNodePtr rpc_UnsetIcon(GList *args);
 
+static xmlNodePtr rpc_OpenOptionsUi(GList *args);
+
 /****************************************************************
  *         EXTERNAL INTERFACE         *
  ****************************************************************/
@@ -154,7 +157,8 @@
    soap_register("PanelRemove", rpc_PanelRemove, "Side", "Path,Label");
     soap_register("SetIcon", rpc_SetIcon, "Path,Icon", NULL);
     soap_register("UnsetIcon", rpc_UnsetIcon, "Path", NULL);
-
+   soap_register("OpenOptionsUi", rpc_OpenOptionsUi, NULL, NULL);
+   
    /* Look for a property on the root window giving the IPC window
     * of an already-running copy of this version of the filer, running
     * on the same machine and with the same euid.
@@ -822,6 +826,22 @@
    return reply;
 }
 
+static xmlNodePtr rpc_OpenOptionsUi(GList *args)
+{
+   GtkWidget *win;
+
+   win = options_show();
+
+   if (win)
+   {
+      number_of_windows++;
+      g_signal_connect(win, "destroy",
+            G_CALLBACK(one_less_window), NULL);
+   }
+   
+   return NULL;
+}
+
 static xmlNodePtr rpc_CloseDir(GList *args)
 {
    char      *path;


And here is a SOAP fragment (as a script) which should trigger the action:
Code:
rox --RPC << EOF
<?xml version="1.0"?>
   <env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
      <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
         <OpenOptionsUi>
         </OpenOptionsUi>
      </env:Body>
   </env:Envelope>
EOF


To apply the patch, copy it into the toplevel of the rox sources, cd in there and run:
patch -p1 < name-of-patch (I name it rox-SOAP-OpenOptionsUi.diff)
Then run:
./AppRun --compile
If everything goes alright (as it should), then you'd need to replace your installed version of the rox binary with the new one(be sure to keep a backup of the old one just in case).
Once you have replaced the old binary with the new one, then log out and back in, or restart your desktop -do anything which will cause rox to stop and restart.
Then save the SOAP fragment as soap-test-OpenOptionsUi, make it executable, then open a terminal and cd into the dir where the fragment is and run:
./soap-test-OpenOptionsUi
Hopefully that will open the Options window -I haven't fully tested it as I run a rox-1.2.2 system and the two versions conflict, but I'm fixing to apply the patch to the 1.2.2 version to see if it works there...

Edit: Okay, I just checked and it works as expected with rox-1.2.2. Some of the source patch had to be changed for the old version, but I still expect this the above patch to work for you -I was more worried about whether the SOAP syntax was correct since it compiled okay with the changes. This SOAP command is different from nearly all the supported ones in that it doesn't require or accept any arguments. Of the supported methods only the 'Version' method is like this with no args. Anyway, hope that works for you!
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sat 13 Feb 2010, 10:11    Post subject:  

Thank you a lot, amigo!
I am running Puppy/Toutou 4.31 and was wondering if this could be done properly? Is there any contra-indication or special care to take while?
Regards.
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2238

PostPosted: Sat 13 Feb 2010, 11:48    Post subject:  

No, the filer should be completely normal otherwise -you do know how to compile stuff, right? and have your devx stuff on board?

The script fragment can be pasted as-is into any script/utility you are working with. I am assuming that you are wanting to use it in some integrated look/feel configuration system or from a menu. You could also simply make it executable, name it whatever is convenient, drop it into the PATH and run it as you would any ordinary script -it wouldn't hurt anything to put a shebang at the beginning on the first line:
#!/bin/sh
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sun 21 Feb 2010, 14:42    Post subject:  

Hello amigo!
Thank you a lot for reply!
... Tried to do what you said:
Nothing happens, just this when I launch the first command line in a terminal:
Quote:
# patch -p1 < rox-SOAP-OpenOptionsUi.diff
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ./src/remote.c.00 2006-11-11 13:09:47.000000000 +0100
|+++ ./src/remote.c 2010-02-13 14:17:45.000000000 +0100
--------------------------
File to patch:
Confused
Regards.
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 12 Mar 2010, 06:29    Post subject:  

Hello there?
@amigo
Is my reply so silly that it is not worth thinking over? I tried one more time to do what you said but did not succeed!
Regards.
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2238

PostPosted: Fri 12 Mar 2010, 09:48    Post subject:  

Sorry, I don't get notifications when you post, so I didn't know you had aswered.

You need to copy the patch into the toplevel of the rox sources(after unpacking the tarball) and then cd in there and run the command from there -you should be seeing a directory there called 'src'. The installed ROX-Filer probably does not contain the sources, so you'd need to get them from the puppy sources.
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 12 Mar 2010, 10:33    Post subject:  

Hello amigo,
Quote:
You need to copy the patch into the toplevel of the rox sources (after unpacking the tarball)
... It is what I did not notice... Sorry! One more question: Please, what tarball should I download (from sourcefourge?) for matching with Puppy 4.31?
Anyway, I will try and leave you some feedback later...
Thank you a lot for your kind attention.
Regards
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2238

PostPosted: Fri 12 Mar 2010, 13:50    Post subject:  

You'd want to get the sources for the puppy version. The link I have is:
http://bkhome.org/sources/alphabetical/r/

You can check which version you are running by finding the ROX-Filer AppDir on your system, right-click, choose open folder and then open the AppInfo.xml file to see which version you are running. The link above has sources for 2.5, 2.6.1 and 2.7.1
I think Barry has recently started using 2.9. If you are running a recent puppy with gtk >2.18, you may need to use another patch or workaround in /etc/profile to avoid a bug. Search for threads about rox on BK's blog for details of how he worked around it and the patch which I posted there to fix it the 'right' way. If you are using puppy pre-4.3.1 you'll probably be fine with either rox 2.6.1 or 2.7.1.
The patch I posted in this thread is for 2.6.1, but probably would apply to 2.7.1 as well.
Once you have the rox sources, unpack and patch as I posted before, then from the toplevel of the sources just run:
./AppRun
to compile and run the new filer. To make it your new filer, you'd need to replace your existing ROX-Filer AppDir with the new one by renaming the old one and then moving/renaming the new one to match the old name.
Good luck!
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 12 Mar 2010, 20:15    Post subject:  

Hello amigo!
I downloaded 'rox-filer-2.7.1.tar.bz2' from http://sourceforge.net/projects/rox/files/, uncompressed (folder 'rox-filer-2.7.1'), opened a terminal in there and type the command line 'patch -p1 < rox-SOAP-OpenOptionsUi.diff' (the name I gave to the file where I pasted the code above and duly present at the top-level of this folder)... and still have this message Embarassed :
Quote:
# patch -p1 < rox-SOAP-OpenOptionsUi.diff
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ./src/remote.c.00 2006-11-11 13:09:47.000000000 +0100
|+++ ./src/remote.c 2010-02-13 14:17:45.000000000 +0100
--------------------------
File to patch:
What's going wrong Doctor?
Thanks.
Regards
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 12 Mar 2010, 20:27    Post subject:  

Sorry, i did not understand that the folder was 'Rox-filer' in 'rox-filer-2.7.1'. Now what I get:
Quote:
# patch -p1 < rox-SOAP-OpenOptionsUi.diff
# ./AppRun --compile
Compiling /mnt/sdb3/Desktop/rox-filer-2.7.1/ROX-Filer... please wait...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for GCC version... 4.2.2
checking whether to disable pointer sign warning... yes
checking whether to disable stack protector... yes
checking that pkg-config runs... yes
checking that gtk+-2.0 (version >= 2.4.0) is installed... yes
checking that libxml-2.0 (version >= 2.0.0) is installed... yes
checking that libglade-2.0 (version >= 2.0.0) is installed... yes
checking that shared-mime-info (version >= 0.14) is installed... no
configure: error: Package is not installed
Compile failed
Press Return...

Regards.
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1825
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sun 14 Mar 2010, 05:34    Post subject:  

Hello amigo,
Have you got any idea of what I have to do to solve this problem?
Quote:
checking that shared-mime-info (version >= 0.14) is installed... no
configure: error: Package is not installed
Compile failed

... Found nothing clear (for me!) on the web!
Sorry to ask you so much!
Regards.
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4348

PostPosted: Sun 14 Mar 2010, 13:30    Post subject:  

it means that you need an updated shared-mime-info package .... such as these:

http://distro.ibiblio.org/pub/linux/distributions/puppylinux/pet_packages-woof/shared-mime-info-0.70.pet
http://distro.ibiblio.org/pub/linux/distributions/puppylinux/pet_packages-woof/shared-mime-info_DEV-0.70.pet


Or you can find the shared-mime-info area in the configure script and change "exit" to "echo" in that section - it should still compile

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0940s ][ Queries: 11 (0.0047s) ][ GZIP on ]