collinss / cinnamon-places-center

Cinnamon Applet to give quick access to comon filesystem locations.
6 stars 1 forks source link

Adding more cool stuff #2

Closed ghost closed 10 years ago

ghost commented 10 years ago

I figured I make one of those annoying wishlists :D

I see on your wishlist is a search tool.Is it technically possible to add an entry that searches files somehow.Would be bloody perfect.

Also would it be possible to browse subfolders within the applet?

collinss commented 10 years ago

@zagortenay333 Sorry it took me so long to respond. I've been rather busy lately. I've spent some time looking into implementing a search tool. First I tried to implement it as part of the applet itself using the cinnamon toolkit, but there were serious problems with it. I don't think it's currently possible, so I've been working on a GTK based search tool in python. I've been having some trouble involving file permissions, so I'm not sure when this will be ready for release, but I am working on it.

In regard to subfolders, given the current state of the available APIs, there is not a good way to implement this due to lack of pop-out sub-menus, and I will not implement any feature that is not well-done. However, I have been working on an expanded toolkit for Cinnamon (as one of the many projects I am currently working on), and one of the widgets I have been thinking about implementing is a pop-out sub-menu. If and when that becomes available, I will definitely consider implementing subfolders.

collinss commented 10 years ago

https://github.com/collinss/cinnamon-places-center/commit/a265a71cdec4d263f4941dd14fe7947196a73f44

I'll probably be uploading the new version to the spices website in a few days (provided I don't find any major bugs between now and then), but I wanted to test it a bit more first. Feel free to try it out, though, and let me know what you think.

Also, this is just my initial version. I already have plans to add options such as following symlinks and selecting the search starting path. Any other ideas that would help improve the search tool will be welcome.

ghost commented 10 years ago

This very nice! I was hoping that the search would be available from inside the the popup. Does the cinnamon API not allow this?

collinss commented 10 years ago

I could have done it in Cinnamon, but it would have locked up Cinnamon while running the search. I don't know of a good way to implement threading in Cinnamon, and the search time is not trivial. Needless to say, it would be very bad to start a search of your entire file system, and not be able to do anything else while you're waiting for the search to finish (several minutes on older systems), then find out that you can't stop the search because Cinnamon wont handle your click until the search is completed. It may be technically possible, but I don't know enough to do it, and the documentation is quite lacking in that regard. Also, python is much better at command line and file system operations than is javascript, which means that my search tool is much faster than it would be if I had implemented it in Cinnamon!

ghost commented 10 years ago

Ah, what a shame :/ The lack of threading is a real bummer...

highwindmx commented 10 years ago

A. About search part. no offence, do you think we are making wheel here? I use this applet for fast accessing the folders I favoured, if I want to search I have two solution:

  1. use apps like synapse;
  2. use nemo action (http://forum.ubuntu.org.cn/viewtopic.php?f=24&t=456785&p=3073844#p3073844), both use gnome-search-tool.

    2.1. action on 3 floor is for search files which have same(related) name as selected file in root; 2.2. action on 6 floor is for search file contain some content in this folder.

B.about sub-folder I prefer not, if I go to one subfolder really often, I will bookmark it and access this directly from you applet. :)

ghost commented 10 years ago

no offence, do you think we are making wheel here?

What does that mean?

I use this applet for fast accessing the folders I favoured, if I want to search I have two solution..

I am not a fan or your argument.It boils down to "I don´t use it that way; therefore, no one should either". The better approach here should be something like the following: Does it make sense to add a search tool here, is it possible to add one, and is it possible to add one while making it opt-in/opt-out?

I think it makes very much sense to add a search tool here. It would be:

However, it appears to be impossible. I do like it that Collins was able to make a tool, but it still isn´t as convenient as the spotlight-like tools.With spotlight you can hit shortcut and start the search whereas here you have to click an icon with the mouse and then start the search.Also, when the search ends, I have to close a window.

highwindmx commented 10 years ago

@zagortenay333 : good point. while what I want to say here is , actually, we can directly use gnome-search-tool. But if we want have better UI of this tool, that is fine to re-build a new one( but it would take some time and effort as what collinss has done).

For synapse(I haven't used spotlight before , does it as same as synapse?), if we really want to do search job in this applet, wouldn't be nice to embed a shortcut of this kind apps in this applet? And if you have used synapse before, after accessing the search result, the window will automatically close.

collinss commented 10 years ago

@zagortenay333 @highwindmx The reason I built my own tool is that Cinnamon is commonly used on a variety of distributions, and none of them are guaranteed to have a given search tool, or even any search tool at all. Many people, for example, don't have gnome-search-tool. The others that you mentioned, I haven't even heard of. The only search tools I had on my machine (Linux Mint 15) were the nemo search, and a command-line search tool (not very convenient to use IMO). Not only can I not be sure a certain tool is installed, I can't even be sure that said tool will even be available on every distribution. There is no good way to ensure that I could implement a search function, without providing my own, that can be packaged within the applet itself.

My goal in making my applets and desklets is to provide a user-friendly and attractive tool that works well for anyone, regardless of system configuration (provided that they are using the Cinnamon DE). Including my own search tool is the best way I know to accomplish that goal. While I wish I could include it as a Cinnamon component, I just can't do it without placing some serious performance limitations on the applet, and perhaps on Cinnamon itself, which (for obvious reasons) I will not do.

highwindmx commented 10 years ago

Thanks for your explaination, and that hits my limitation. Hope to see a nice search tool in cinnamon, and thanks for your effort again.

highwindmx commented 10 years ago

hi, have you tried catfish, it is python-based , I think it may help you for design such tool.

collinss commented 10 years ago

@highwindmx Thanks, I've already developed the tool, and I'm pretty happy with it. I want it to be fairly light-weight and simple. If you want to do a more full-featured and robust search you can just use nemo. That being said, if there is a feature from catfish that you really want to see, open a new issue, and I'll consider adding it if it's not too much trouble and it fits my vision for the project.

highwindmx commented 10 years ago

:) actually I prefer using your tool, while I do find some place need to be improved , but not because catfish(it is quite buggy in my system),

ghost commented 10 years ago

What about this: http://cinnamon-spices.linuxmint.com/applets/view/188 Could that be possibly merged into this applet?

collinss commented 10 years ago

@zagortenay333 The whole reason I implemented my own search tool is that I wanted something quick and easy, without requiring any additional packages. That applet uses an external tool that, AFAIK is not on most (or all) systems by default. Besides that, the main purpose of this applet is to give quick and easy access to your places. While the search tool certainly enhances that capability, it is not the central focus of the applet.