shufen
小狐狸
小狐狸
  • UID14718
  • 注册日期2006-09-26
  • 最后登录2006-09-26
  • 发帖数2
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:2424回复:4

linux 下是不是不支持launch功能阿?

楼主#
更多 发布于:2006-09-26 13:37
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"]
        .createInstance(nsIFilePicker);
fp.init(window, "Select a File", nsIFilePicker.modeOpen);
var res = fp.show();
if (res == nsIFilePicker.returnOK){
  var thefile = fp.file;
    thefile.launch();
}
打开一个.txt文件后并不像windows下能launch。
问各位高手,linux下launch应用程序应该怎么办?谢谢谢谢
fiag
管理员
管理员
  • UID1188
  • 注册日期2004-12-21
  • 最后登录2025-08-20
  • 发帖数4681
  • 经验686枚
  • 威望0点
  • 贡献值402点
  • 好评度51点
1楼#
发布于:2006-09-26 13:37
按照作者主页上的说法除了自动检测功能只能在Windows下使用,其他的都是可以在所有OS上使用的。

可以自己编写Launchy.xml文件

The autodetection of applications is a Windows only feature. You can use the launchy.xml feature on all OSes.
fiag
管理员
管理员
  • UID1188
  • 注册日期2004-12-21
  • 最后登录2025-08-20
  • 发帖数4681
  • 经验686枚
  • 威望0点
  • 贡献值402点
  • 好评度51点
2楼#
发布于:2006-09-26 13:37
移动到扩展区
shufen
小狐狸
小狐狸
  • UID14718
  • 注册日期2006-09-26
  • 最后登录2006-09-26
  • 发帖数2
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
3楼#
发布于:2006-09-26 13:37
那个Lauchy和我说的问题好像不是一回事阿。我现在想将我自己写的应用程序嵌在我的xul页面里,就像是html页面里嵌入一个播放器那样的效果,请问该怎么弄啊?谢谢谢谢
fiag
管理员
管理员
  • UID1188
  • 注册日期2004-12-21
  • 最后登录2025-08-20
  • 发帖数4681
  • 经验686枚
  • 威望0点
  • 贡献值402点
  • 好评度51点
4楼#
发布于:2006-09-26 13:37
抱歉,没有认真读楼主的帖,

察看了下lxr
注释说到

135     /** 
136      *  launch
137      *
138      *  Ask the operating system to attempt to open the file. 
139      *  this really just simulates "double clicking" the file on your platform.
140      *  This routine only works on platforms which support this functionality.
141      */
142     void launch();


Firefox Download mgr 的代码是这样写的
348         try {
349           f.launch();
350         } catch (ex) {
351           // if launch fails, try sending it through the system's external
352           // file: URL handler
353           openExternal(f.path);
354         }


希望能有些帮助。
游客

返回顶部