Merge lp:~mithunit/pogo/open-containing-folder into lp:~jendrikseipp/pogo/trunk

Proposed by Jendrik Seipp
Status: Merged
Merge reported by: Jendrik Seipp
Merged at revision: not available
Proposed branch: lp:~mithunit/pogo/open-containing-folder
Merge into: lp:~jendrikseipp/pogo/trunk
Diff against target: 54 lines (+27/-1) (has conflicts)
1 file modified
src/modules/FileExplorer.py (+27/-1)
Text conflict in src/modules/FileExplorer.py
To merge this branch: bzr merge lp:~mithunit/pogo/open-containing-folder
Reviewer Review Type Date Requested Status
Jendrik Seipp Approve
Review via email: mp+39410@code.launchpad.net

Description of the change

open-containing-folder

To post a comment you must log in.
Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Thanks for implementing the feature. It works very nicely!

Do you know if there is any way to highlight the selected folder or track in nautilus?

For the next time it would be better not to remove spaces from empty lines. This way the diff looks cleaner and is easier to understand.

But very nicely done, you have perfectly understood how to use the existing code.

review: Needs Information
Revision history for this message
Tim㋡ (tim.h.s) wrote :

...............................................................................................................

  Hi Mithun,

  Thank you very much this nice feature works really good :)

cheers
Tim
<email address hidden>

--
Wissenschaften entfernen sich im Ganzen immer vom Leben und
kehren nur durch einen Umweg wieder dahin zurück.
  -- Goethe, Maximen und Reflektionen, Nr. 825

Revision history for this message
Mithun J. Shitole (mithunit) wrote :

>
> Do you know if there is any way to highlight the selected folder or track in
> nautilus?
I have checked the man pages of xdg-open , unfortunately there isn't a way to do it using xdg-open. We may need to find some other way to do it, but which will make it specific to nautilus

>
> For the next time it would be better not to remove spaces from empty lines.
> This way the diff looks cleaner and is easier to understand.

Really sorry for that, although I haven't removed them manually, maybe my gedit settings done so automatically. Do you want me to commit it again without removing spaces?

> But very nicely done, you have perfectly understood how to use the existing
> code.

Its good to see that my code is usable :)

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

>> Do you know if there is any way to highlight the selected folder or track in
>> nautilus?
> I have checked the man pages of xdg-open , unfortunately there isn't a way to do it using xdg-open. We may need to find some other way to do it, but which will make it specific to nautilus
Could you look into that? This would be a great feature, although I'm
not sure if it can be done.
> Really sorry for that, although I haven't removed them manually, maybe my gedit settings done so automatically. Do you want me to commit it again without removing spaces?
That would probably be good.

Revision history for this message
Mithun J. Shitole (mithunit) wrote :

On Wednesday 27 October 2010 03:52 PM, Jendrik Seipp wrote:
>
>>> Do you know if there is any way to highlight the selected folder or track in
>>> nautilus?
>>>
>> I have checked the man pages of xdg-open , unfortunately there isn't a way to do it using xdg-open. We may need to find some other way to do it, but which will make it specific to nautilus
>>
> Could you look into that? This would be a great feature, although I'm
> not sure if it can be done.
>
I tried to find out a solution, unfortunately I haven't find anything :( .

>> Really sorry for that, although I haven't removed them manually, maybe my gedit settings done so automatically. Do you want me to commit it again without removing spaces?
>>
> That would probably be good.
>
 I will do it asap.

Regards,
Mithun

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

OK, I guess then it's just impossible to highlight the files. BTW, what do you guys think? Would it be best to have the "Open containing folder" feature:

- only for the filebrowser?
- only for the playlist?
- for both?

298. By Mithun Shitole <mithun@mithun-laptop>

Restored whitespaces

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Hi, I just merged your feature. Good work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/FileExplorer.py' (properties changed: -x to +x)
2--- src/modules/FileExplorer.py 2010-11-05 02:31:23 +0000
3+++ src/modules/FileExplorer.py 2010-11-05 05:54:45 +0000
4@@ -17,9 +17,18 @@
5 # along with this program; if not, write to the Free Software
6 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
7
8+<<<<<<< TREE
9 import os
10 import urllib2
11 import itertools
12+=======
13+import re
14+
15+import gtk, media, modules, os, tools,subprocess
16+
17+from tools import consts, prefs, icons
18+from media import playlist
19+>>>>>>> MERGE-SOURCE
20 from gettext import gettext as _
21 from os.path import isdir, isfile
22
23@@ -322,7 +331,14 @@
24 if self.tree.row_expanded(child):
25 idle_add(self.refresh, child)
26
27-
28+ def showFolder(self, folderPath):
29+ """ Show containing folder in default file browser """
30+ if os.name == 'mac':
31+ subprocess.call(('open', folderPath))
32+ elif os.name == 'nt':
33+ subprocess.call(('start', folderPath))
34+ elif os.name == 'posix':
35+ subprocess.call(('xdg-open', folderPath))
36 # --== GTK handlers ==--
37
38
39@@ -385,6 +401,16 @@
40 popup.append(dir)
41
42
43+ popup.append(gtk.SeparatorMenuItem())
44+
45+ #open containing folder
46+ showFolder = gtk.ImageMenuItem(gtk.STOCK_OPEN)
47+ showFolder.set_label(_('Open containing folder'))
48+ folderPaths = [row[ROW_FULLPATH] for row in self.tree.getSelectedRows()]
49+ folderPath = os.path.dirname(folderPaths[0])
50+ showFolder.connect('activate', lambda widget: self.showFolder(folderPath))
51+ popup.append(showFolder)
52+
53 popup.show_all()
54 popup.popup(None, None, None, button, time)
55

Subscribers

People subscribed via source and target branches