r68: Added full Adjust actions for files/dirs/apps for windows and panels.
[rox-filer.git] / ROX-Filer / src / apps.c
blobfe5beae1a6d7e6731345fc23d217da79fc98eb55
1 /* vi: set cindent:
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@ecs.soton.ac.uk>.
6 */
8 /* apps.c - code for handling application directories */
10 #include <sys/stat.h>
12 #include "stdlib.h"
13 #include "support.h"
14 #include "gui_support.h"
15 #include "filer.h"
17 /* An application has been double-clicked (or run in some other way) */
18 void run_app(char *path)
20 GString *apprun;
21 char *argv[] = {NULL, NULL};
23 apprun = g_string_new(path);
24 argv[0] = g_string_append(apprun, "/AppRun")->str;
26 if (!spawn_full(argv, getenv("HOME"), 0))
27 report_error("ROX-Filer", "Failed to fork() child process");
29 g_string_free(apprun, TRUE);
32 void app_show_help(char *path)
34 char *help_dir;
35 struct stat info;
37 help_dir = g_strconcat(path, "/Help", NULL);
39 if (stat(help_dir, &info))
40 report_error("Application",
41 "This is an application directory - you can "
42 "run it as a program, or open it (hold down "
43 "Shift while you open it). Most applications provide "
44 "their own help here, but this one doesn't.");
45 else
46 filer_opendir(help_dir, FALSE, BOTTOM);