Recent

Author Topic: How to open a directory on default file browser (multiplatform)?  (Read 5481 times)

maaah

  • New Member
  • *
  • Posts: 14
    • Via Mep
On Windows I always use ShellExecute, but how can I do this on Linux?

I want my program to open a folder using default viewer, like Nautilus on Gnome and Dolphin/Konqueror on KDE...
Looking for a new and fast music player? Get Mondego! It's free: http://bit.ly/bnSr58
Mep Texto 8: text editor made with Lazarus :) http://bit.ly/7jWwW0
Ajuda do Mep Installer / Inno Setup em português: http://bit.ly/cKUFqN


Leledumbo

  • Hero Member
  • *****
  • Posts: 8143
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to open a directory on default file browser (multiplatform)?
« Reply #2 on: January 05, 2010, 12:13:43 pm »
Somebody's gotta write a cross platform companion of OpenURL, OpenFile perhaps?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: How to open a directory on default file browser (multiplatform)?
« Reply #3 on: January 05, 2010, 02:00:01 pm »
Somebody's gotta write a cross platform companion of OpenURL, OpenFile perhaps?

See: function OpenURL(AURL: String): Boolean;
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/lclintf.pas?view=markup&revision=22893&root=lazarus&sortby=date

maaah

  • New Member
  • *
  • Posts: 14
    • Via Mep
Re: How to open a directory on default file browser (multiplatform)?
« Reply #4 on: January 05, 2010, 03:46:40 pm »
Hm.... Maybe using (with OpenURL code)

if Find('konqueror', ABrowser)...
or Find('nautilus', ABrowser)...
or Find('...', ABrowser)

I will try it, thanks.
Looking for a new and fast music player? Get Mondego! It's free: http://bit.ly/bnSr58
Mep Texto 8: text editor made with Lazarus :) http://bit.ly/7jWwW0
Ajuda do Mep Installer / Inno Setup em português: http://bit.ly/cKUFqN