1 #include <WINGs/WINGsP.h>
2 /* #include <WMaker.h> */
5 #include "FSFileButton.h"
6 #include "filebrowser.h"
8 #include "FSFileView.h"
15 static void fsSetViewerMode(FSViewer
*fsViewer
, FSFileViewType mode
);
18 fsGetFSViewerCurrentFileInfo(FSViewer
*fsViewer
)
22 fView
= FSGetFSViewerCurrentView(fsViewer
);
24 return FSGetFileViewFileInfo(fView
);
28 FSQuitCB(WMWidget
*w
, void *data
)
34 FSHideCB(FSViewer
*fsViewer
, int item
, Time time
)
36 WMHideApplication(FSGetFSViewerWMContext(fsViewer
));
40 FSHideOthersCB(FSViewer
*fsViewer
, int item
, Time time
)
42 WMHideOthers(FSGetFSViewerWMContext(fsViewer
));
46 FSInfoPanelCB(FSViewer
*fsViewer
, int item
, Time time
)
48 FSRunInfoPanel(fsViewer
, "FSViewer", _("Info"));
52 FSLegalCB(FSViewer
*fsViewer
, int item
, Time time
)
54 FSRunLegalPanel(fsViewer
, _("Legal"), _("License"));
58 FSPrefCB(FSViewer
*fsViewer
, int item
, Time time
)
60 FSRunPreferencesPanel(fsViewer
, _("Preferences"));
64 FSWMPrefCB(FSViewer
*fsViewer
, int item
, Time time
)
66 FSRunPreferencesPanel(fsViewer
, _("Preferences"));
70 FSRunCB(FSViewer
*fsViewer
, int item
, Time time
)
72 FSLaunchApp(fsViewer
, AppExec
);
76 FSViewCB(FSViewer
*fsViewer
, int item
, Time time
)
78 FSLaunchApp(fsViewer
, AppView
);
82 FSEditCB(FSViewer
*fsViewer
, int item
, Time time
)
84 FSLaunchApp(fsViewer
, AppEdit
);
88 FSInspectorCB(FSViewer
*fsViewer
, int item
, Time time
)
92 fileInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
93 FSShowInspectorWindow(FSGetFSViewerScreen(fsViewer
), fileInfo
);
97 FSBrowseCB(FSViewer
*fsViewer
, int item
, Time time
)
99 fsSetViewerMode(fsViewer
, Browser
);
103 FSIconCB(FSViewer
*fsViewer
, int item
, Time time
)
105 fsSetViewerMode(fsViewer
, Icon
);
109 FSListCB(FSViewer
*fsViewer
, int item
, Time time
)
111 fsSetViewerMode(fsViewer
, List
);
115 fsSetViewerMode(FSViewer
*fsViewer
, FSFileViewType mode
)
119 fView
= FSGetFSViewerCurrentView(fsViewer
);
121 FSSetFileViewMode(fView
, mode
);
125 FSSortOrderCB(FSViewer
*fsViewer
, int item
, Time time
)
128 FSUpdateFileViewPath(FSGetFSViewerCurrentView(fsViewer
),
129 FileSync
, NULL
, NULL
);
133 FSNewViewCB(FSViewer
*fsViewer
, int item
, Time time
)
135 FSFileView
*fView
= FSGetFSViewerCurrentView(fsViewer
);
137 if (!(FSCreateFileView(fsViewer
, FSGetFileViewPath(fView
), False
)))
139 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
,
141 _("Error creating New FileViewer"),
142 _("OK"), NULL
, NULL
);
147 FSDotFilesCB(FSViewer
*fsViewer
, int item
, Time time
)
149 FSToggleDisplayHiddenFiles();
150 FSUpdateFileViewPath(FSGetFSViewerCurrentView(fsViewer
),
151 FileSync
, NULL
, NULL
);
155 FSCopyCB(FSViewer
*fsViewer
, int item
, Time time
)
159 fileInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
160 FSSetFSViewerClip(fsViewer
, fileInfo
);
161 FSSetFSViewerClipAction(fsViewer
, ClipCopy
);
165 FSCutCB(FSViewer
*fsViewer
, int item
, Time time
)
169 fileInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
170 FSSetFSViewerClip(fsViewer
, fileInfo
);
171 FSSetFSViewerClipAction(fsViewer
, ClipCut
);
175 FSPasteCB(FSViewer
*fsViewer
, int item
, Time time
)
177 ClipAction clipAction
;
178 FileInfo
*dest
= NULL
;
179 FileInfo
*src
= NULL
;
181 dest
= fsGetFSViewerCurrentFileInfo(fsViewer
);
182 src
= FSGetFSViewerClip(fsViewer
);
187 clipAction
= FSGetFSViewerClipAction(fsViewer
);
189 if(clipAction
== ClipCopy
)
191 else if(clipAction
== ClipCut
)
194 FSSetFSViewerClip(fsViewer
, NULL
);
198 FSLinkCB(FSViewer
*fsViewer
, int item
, Time time
)
203 FileInfo
*dest
= FSCreateFileInfo();
205 src
= fsGetFSViewerCurrentFileInfo(fsViewer
);
206 old
= GetPathnameFromPathName(src
->path
, src
->name
);
207 new = WMRunInputPanel(FSGetFSViewerScreen(fsViewer
), NULL
,
208 _("Link Name"), _("Link: Enter the link name"),
209 old
, _("OK"), _("Cancel"));
213 dest
->path
= GetPathFromPathname(new);
214 dest
->name
= GetNameFromPathname(new);
225 FSRenameCB(FSViewer
*fsViewer
, int item
, Time time
)
230 FileInfo
*dest
= FSCreateFileInfo();
232 src
= fsGetFSViewerCurrentFileInfo(fsViewer
);
233 old
= GetPathnameFromPathName(src
->path
, src
->name
);
234 new = WMRunInputPanel(FSGetFSViewerScreen(fsViewer
), NULL
,
235 _("Rename File"), _("Rename: Enter the new file name"),
236 old
, _("OK"), _("Cancel"));
240 dest
->path
= GetPathFromPathname(new);
241 dest
->name
= GetNameFromPathname(new);
253 FSDeleteCB(FSViewer
*fsViewer
, int item
, Time time
)
257 fileInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
263 FSNewFileCB(FSViewer
*fsViewer
, int item
, Time time
)
266 char *initPath
= NULL
;
268 mode_t umask
= FSGetUMask();
270 fileInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
272 if(isDirectory(fileInfo
->fileType
))
274 initPath
= GetPathnameFromPathName(fileInfo
->path
, fileInfo
->name
);
278 initPath
= wstrdup(fileInfo
->path
);
281 new = WMRunInputPanel(FSGetFSViewerScreen(fsViewer
), NULL
,
282 _("Create a new file"),
283 _("New File: Enter the new file name"),
284 GetPathnameFromPathName(initPath
, ""),
285 _("OK"), _("Cancel"));
289 if(FSCreateNewFile(new, umask
& 0777))
293 sprintf(s
, _("Error creating file %s"), new);
294 FSErrorDialog(_("File Operation Error"), s
);
298 FileInfo
*src
= FSCreateFileInfo();
299 FileInfo
*dest
= FSGetFileInfo(new);
301 FSUpdateFileView(FileCopy
, src
, dest
);
305 FSFreeFileInfo(dest
);
317 FSNewDirCB(FSViewer
*fsViewer
, int item
, Time time
)
320 char *initPath
= NULL
;
322 mode_t umask
= FSGetUMask();
324 fileInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
326 if(isDirectory(fileInfo
->fileType
))
328 initPath
= GetPathnameFromPathName(fileInfo
->path
, fileInfo
->name
);
332 initPath
= wstrdup(fileInfo
->path
);
335 new = WMRunInputPanel(FSGetFSViewerScreen(fsViewer
), NULL
,
336 _("Create a new directory"),
337 _("New Dir: Enter the new directory name"),
338 GetPathnameFromPathName(initPath
, ""),
339 _("OK"), _("Cancel"));
343 if (FSCreateNewDirectory(new, umask
& 0777))
347 sprintf(s
, _("Error creating folder %s"), new);
348 FSErrorDialog(_("File Operation Error"), s
);
352 FileInfo
*src
= FSCreateFileInfo();
353 FileInfo
*dest
= FSGetFileInfo(new);
355 src
->name
= dest
->name
;
356 dest
->name
= wstrdup("");
357 FSUpdateFileView(FileCopy
, src
, dest
);
361 FSFreeFileInfo(dest
);
372 FSConsoleCB(FSViewer
*fsViewer
, int item
, Time time
)
377 fileInfo
= FSCreateFileInfo();
379 fileInfo
->name
= (char *) wmalloc(8);
380 strcpy(fileInfo
->name
, "CONSOLE");
382 pathInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
384 if(isDirectory(pathInfo
->fileType
))
386 fileInfo
->path
= GetPathnameFromPathName(pathInfo
->path
,
391 fileInfo
->path
= pathInfo
->path
;
394 LaunchApp(fsViewer
, fileInfo
, AppExec
);
397 FSFreeFileInfo(pathInfo
);
399 FSFreeFileInfo(fileInfo
);
404 FSFilterViewCB(FSViewer
*fsViewer
, int item
, Time time
)
408 char *title
= _("Filter Current FileView");
409 char *prompt
= _("Enter Filter Value:");
410 FSFileView
*fView
= NULL
;
412 fView
= FSGetFSViewerCurrentView(fsViewer
);
413 init
= FSGetFileViewFilter(fView
);
414 if((filter
= WMRunInputPanel(FSGetFSViewerScreen(fsViewer
),
415 FSGetFileViewWindow(fView
),
416 title
, prompt
, init
, _("OK"), _("Cancel"))) != NULL
)
418 if(strcmp("", filter
) == 0)
421 FSSetFileViewFilter(fView
, filter
);
429 FSSelectAllCB(FSViewer
*fsViewer
, int item
, Time time
)
431 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
, _("Menu Error"),
432 _("This menu option has not yet been implemented"),
433 _("OK"), NULL
, NULL
);
437 FSDeselectAllCB(FSViewer
*fsViewer
, int item
, Time time
)
439 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
, _("Menu Error"),
440 _("This menu option has not yet been implemented"),
441 _("OK"), NULL
, NULL
);
445 FSMountCB(Disk
*disk
, int item
, Time time
)
448 char *execStr
= NULL
;
449 /* char *cmd = FSGetStringForNameKey("DISKS", "mount"); */
454 /* execStr = FSParseExecString(disk->point, cmd); */
455 execStr
= FSParseExecString(disk
->point
, disk
->mntCmd
);
459 noerror
= execCommand(execStr
);
473 sprintf(s
, "Unable to mount \"%s\"", disk
->name
);
474 WMRunAlertPanel(FSGetFSViewerScreen(disk
->app
), NULL
, _("Exec Error"),
475 s
, _("OK"), NULL
, NULL
);
480 FSUnmountCB(Disk
*disk
, int item
, Time time
)
483 char *execStr
= NULL
;
484 /* char *cmd = FSGetStringForNameKey("DISKS", "umount"); */
489 /* execStr = FSParseExecString(disk->point, cmd); */
490 execStr
= FSParseExecString(disk
->point
, disk
->umntCmd
);
494 noerror
= execCommand(execStr
);
508 sprintf(s
, "Unable to unmount \"%s\"", disk
->name
);
509 WMRunAlertPanel(FSGetFSViewerScreen(disk
->app
), NULL
, _("Exec Error"),
510 s
, _("OK"), NULL
, NULL
);
515 FSEjectCB(Disk
*disk
, int item
, Time time
)
518 char *execStr
= NULL
;
519 /* char *cmd = FSGetStringForNameKey("DISKS", "eject"); */
524 /* execStr = FSParseExecString(disk->device, cmd); */
525 execStr
= FSParseExecString(disk
->device
, disk
->ejectCmd
);
529 noerror
= execCommand(execStr
);
543 sprintf(s
, "Unable to eject \"%s\"", disk
->name
);
544 WMRunAlertPanel(FSGetFSViewerScreen(disk
->app
), NULL
, _("Exec Error"),
545 s
, _("OK"), NULL
, NULL
);
550 FSCloseDiskCB(Disk
*disk
, int item
, Time time
)
553 char *execStr
= NULL
;
554 /* char *cmd = FSGetStringForNameKey("DISKS", "eject"); */
559 /* execStr = FSParseExecString(disk->device, cmd); */
560 execStr
= FSParseExecString(disk
->point
, disk
->closeCmd
);
564 noerror
= execCommand(execStr
);
578 sprintf(s
, "Unable to close \"%s\"", disk
->name
);
579 WMRunAlertPanel(FSGetFSViewerScreen(disk
->app
), NULL
, _("Exec Error"),
580 s
, _("OK"), NULL
, NULL
);
585 FSFinderCB(FSViewer
*fsViewer
, int item
, Time time
)
587 if(!FSGetFSViewerFinder(fsViewer
))
589 if(!FSCreateFinder(fsViewer
))
590 wwarning(_("%s %d: Unable to create FSFinder"),
596 * Should check if the window is minimized or covered
597 * and bring it into view.
604 FSMiniaturizeCB(FSViewer
*fsViewer
, int item
, Time time
)
606 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
, _("Menu Info"),
607 _("This option is only available via the window manager."),
608 _("OK"), NULL
, NULL
);
612 FSOpenAsFolderCB(FSViewer
*fsViewer
, int item
, Time time
)
614 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
, _("Menu Error"),
615 _("This menu option has not yet been implemented"),
616 _("OK"), NULL
, NULL
);
620 FSProcessCB(FSViewer
*fsViewer
, int item
, Time time
)
625 fileInfo
= FSCreateFileInfo();
627 fileInfo
->name
= (char *) wmalloc(8);
628 strcpy(fileInfo
->name
, "PROCESS");
630 pathInfo
= fsGetFSViewerCurrentFileInfo(fsViewer
);
632 if(isDirectory(pathInfo
->fileType
))
634 fileInfo
->path
= GetPathnameFromPathName(pathInfo
->path
,
639 fileInfo
->path
= pathInfo
->path
;
642 LaunchApp(fsViewer
, fileInfo
, AppExec
);
645 FSFreeFileInfo(pathInfo
);
647 FSFreeFileInfo(fileInfo
);
652 FSHelpCB(FSViewer
*fsViewer
, int item
, Time time
)
654 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
, _("Menu Error"),
655 _("This menu option has not yet been implemented"),
656 _("OK"), NULL
, NULL
);
660 FSCloseWindowCB(FSViewer
*fsViewer
, int item
, Time time
)
662 FSFileView
*fView
= NULL
;
664 fView
= FSGetFSViewerCurrentView(fsViewer
);
665 if(!FSIsFileViewPrimary(fView
))
666 WMCloseWindow(FSGetFileViewWindow(fView
));
670 FSUpdateViewCB(FSViewer
*fsViewer
, int item
, Time time
)
672 FSFileView
*fView
= NULL
;
674 fView
= FSGetFSViewerCurrentView(fsViewer
);
675 FSUpdateFileViewPath(fView
, FileSync
, NULL
, NULL
);
679 FSDuplicateCB(FSViewer
*fsViewer
, int item
, Time time
)
681 ClipAction clipAction
;
682 FileInfo
*dest
= FSCreateFileInfo();
683 FileInfo
*src
= NULL
;
685 src
= fsGetFSViewerCurrentFileInfo(fsViewer
);
686 FSCopyFileInfo(src
, dest
);
688 dest
->name
= (char *) wrealloc(dest
->name
, strlen(src
->name
)+7);
689 strcpy(dest
->name
, "copyof");
690 strcat(dest
->name
, src
->name
);
692 if(isDirectory(src
->fileType
))
695 mode_t umask
= FSGetUMask();
697 new = GetPathnameFromPathName(dest
->path
, dest
->name
);
698 if (new && FSCreateNewDirectory(new, umask
& 0777))
702 sprintf(s
, _("Error creating folder %s"), new);
703 FSErrorDialog(_("File Operation Error"), s
);
713 FSCompressCB(FSViewer
*fsViewer
, int item
, Time time
)
716 char *cmd
= FSGetStringForNameKey("COMPRESS", "exec");
717 char *extn
= FSGetStringForNameKey("COMPRESS", "extn");
720 extn
= wstrdup(".tar.gz");
725 char *execStr
= NULL
;
726 char *pathname
= NULL
;
727 FileInfo
*src
= NULL
;
729 src
= fsGetFSViewerCurrentFileInfo(fsViewer
);
730 pathname
= GetPathnameFromPathName(src
->path
, src
->name
);
731 targz
= (char *) wmalloc(strlen(src
->name
)+strlen(extn
)+1);
733 strcpy(targz
, src
->name
);
736 execStr
= (char *) wmalloc(strlen(cmd
) + strlen(src
->name
) +
739 sprintf(execStr
, cmd
, targz
, src
->name
);
743 error
= FSExecCommand(src
->path
, execStr
);
757 sprintf(s
, _("Unable to compress selection."));
758 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
, _("Exec Error"),
759 s
, _("OK"), NULL
, NULL
);
767 FSEmptyRecyclerCB(FSViewer
*fsViewer
, int item
, Time time
)
769 WMRunAlertPanel(FSGetFSViewerScreen(fsViewer
), NULL
, _("Menu Error"),
770 _("This menu option has not yet been implemented"),
771 _("OK"), NULL
, NULL
);
775 FSAddDisksMenu(FSViewer
*fsViewer
, WMMenu
*menu
)
777 WMMenu
*submenu
= NULL
;
779 WMPropList
* devArray
= NULL
;
780 WMPropList
* array
= NULL
;
782 /* devArray = FSGetArrayForNameKey("DISKS", "devices"); */
783 devArray
= FSGetUDObjectForKey(defaultsDB
, "DISCS");
790 numElem
= WMGetPropListItemCount(devArray
);
791 for(i
= 0; i
< numElem
; i
++)
793 array
= WMGetFromPLArray(devArray
, i
);
794 if(array
&& WMIsPLArray(array
))
798 disk
= (Disk
*) wmalloc(sizeof(Disk
));
799 memset(disk
, 0, sizeof(Disk
));
801 disk
->app
= fsViewer
;
802 tmp
= WMGetFromPLArray(array
, 0);
803 if(WMIsPLString(tmp
))
804 disk
->name
= wstrdup(WMGetFromPLString(tmp
));
806 tmp
= WMGetFromPLArray(array
, 1);
807 if(WMIsPLString(tmp
))
808 disk
->point
= wstrdup(WMGetFromPLString(tmp
));
810 tmp
= WMGetFromPLArray(array
, 2);
811 if(WMIsPLString(tmp
))
812 disk
->device
= wstrdup(WMGetFromPLString(tmp
));
814 tmp
= WMGetFromPLArray(array
, 3);
815 if(WMIsPLString(tmp
))
816 disk
->mntCmd
= wstrdup(WMGetFromPLString(tmp
));
818 tmp
= WMGetFromPLArray(array
, 4);
819 if(WMIsPLString(tmp
))
820 disk
->umntCmd
= wstrdup(WMGetFromPLString(tmp
));
822 tmp
= WMGetFromPLArray(array
, 5);
823 if(WMIsPLString(tmp
))
824 disk
->ejectCmd
= wstrdup(WMGetFromPLString(tmp
));
826 tmp
= WMGetFromPLArray(array
, 6);
827 if(WMIsPLString(tmp
))
828 disk
->closeCmd
= wstrdup(WMGetFromPLString(tmp
));
832 submenu
= WMMenuCreate(fsViewer
->wmContext
, disk
->name
);
833 WMMenuAddSubmenu(menu
, disk
->name
, submenu
);
834 WMMenuAddItem(submenu
, _("Mount"),
835 (WMMenuAction
)FSMountCB
, disk
, NULL
, NULL
);
836 WMMenuAddItem(submenu
, _("Unmount"),
837 (WMMenuAction
)FSUnmountCB
, disk
, NULL
, NULL
);
838 WMMenuAddItem(submenu
, _("Eject"),
839 (WMMenuAction
)FSEjectCB
, disk
, NULL
, NULL
);
840 WMMenuAddItem(submenu
, _("Close"),
841 (WMMenuAction
)FSCloseDiskCB
, disk
, NULL
, NULL
);
849 FSCreateMenu(FSViewer
*fsViewer
)
854 fsViewer
->menu
= WMMenuCreate(fsViewer
->wmContext
, "FSViewer");
857 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("Info"));
858 WMMenuAddSubmenu(fsViewer
->menu
, _("Info"), submenu
);
859 WMMenuAddItem(submenu
, _("Info Panel..."),
860 (WMMenuAction
)FSInfoPanelCB
, fsViewer
, NULL
, NULL
);
861 WMMenuAddItem(submenu
, _("Legal..."),
862 (WMMenuAction
)FSLegalCB
, fsViewer
, NULL
, NULL
);
863 WMMenuAddItem(submenu
, _("Preferences..."),
864 (WMMenuAction
)FSPrefCB
, fsViewer
, NULL
, NULL
);
865 /* WMMenuAddItem(submenu, _("WM Preferences..."), */
866 /* (WMMenuAction)FSWMPrefCB, fsViewer, NULL, NULL); */
867 i
= WMMenuAddItem(submenu
, _("Help..."),
868 (WMMenuAction
)FSHelpCB
, fsViewer
, NULL
, "?");
869 /* WMMenuSetEnabled(submenu, i, 0); */
872 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("File"));
873 WMMenuAddSubmenu(fsViewer
->menu
, _("File"), submenu
);
874 i
= WMMenuAddItem(submenu
, _("Open"),
875 (WMMenuAction
)FSViewCB
, fsViewer
, NULL
, "o");
876 /* WMMenuSetEnabled(submenu, i, 0); */
877 i
= WMMenuAddItem(submenu
, _("Open as Folder"),
878 (WMMenuAction
)FSOpenAsFolderCB
, fsViewer
, NULL
, "O");
879 /* WMMenuSetEnabled(submenu, i, 0); */
880 WMMenuAddItem(submenu
, _("New Folder"),
881 (WMMenuAction
)FSNewDirCB
, fsViewer
, NULL
, "n");
882 i
= WMMenuAddItem(submenu
, _("Duplicate"),
883 (WMMenuAction
)FSDuplicateCB
, fsViewer
, NULL
, "d");
884 /* WMMenuSetEnabled(submenu, i, 0); */
885 i
= WMMenuAddItem(submenu
, _("Compress"),
886 (WMMenuAction
)FSCompressCB
, fsViewer
, NULL
, NULL
);
887 /* WMMenuSetEnabled(submenu, i, 0); */
888 i
= WMMenuAddItem(submenu
, _("UnCompress"),
889 (WMMenuAction
)FSViewCB
, fsViewer
, NULL
, NULL
);
890 /* WMMenuSetEnabled(submenu, i, 0); */
891 i
= WMMenuAddItem(submenu
, _("Destroy"),
892 (WMMenuAction
)FSDeleteCB
, fsViewer
, NULL
, "r");
893 /* WMMenuSetEnabled(submenu, i, 0); */
894 i
= WMMenuAddItem(submenu
, _("Empty Recycler"),
895 (WMMenuAction
)FSEmptyRecyclerCB
, fsViewer
, NULL
, NULL
);
896 /* WMMenuSetEnabled(submenu, i, 0); */
899 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("Edit"));
900 WMMenuAddSubmenu(fsViewer
->menu
, _("Edit"), submenu
);
901 WMMenuAddItem(submenu
, _("Cut"),
902 (WMMenuAction
)FSCutCB
, fsViewer
, NULL
, "x");
903 WMMenuAddItem(submenu
, _("Copy"),
904 (WMMenuAction
)FSCopyCB
, fsViewer
, NULL
, "c");
905 WMMenuAddItem(submenu
, _("Paste"),
906 (WMMenuAction
)FSPasteCB
, fsViewer
, NULL
, "v");
907 WMMenuAddItem(submenu
, _("Delete"),
908 (WMMenuAction
)FSDeleteCB
, fsViewer
, NULL
, NULL
);
909 i
= WMMenuAddItem(submenu
, _("Select All"),
910 (WMMenuAction
)FSSelectAllCB
, fsViewer
, NULL
, "a");
911 /* WMMenuSetEnabled(submenu, i, 0); */
912 i
= WMMenuAddItem(submenu
, _("DeSelect All"),
913 (WMMenuAction
)FSDeselectAllCB
, fsViewer
, NULL
, NULL
);
914 /* WMMenuSetEnabled(submenu, i, 0); */
917 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("Disk"));
918 WMMenuAddSubmenu(fsViewer
->menu
, _("Disk"), submenu
);
919 FSAddDisksMenu(fsViewer
, submenu
);
920 /* i = WMMenuAddItem(submenu, _("Eject"), */
921 /* NULL, fsViewer, NULL, "e"); */
922 /* WMMenuSetEnabled(submenu, i, 0); */
923 /* i = WMMenuAddItem(submenu, _("Initialize..."), */
924 /* NULL, fsViewer, NULL, NULL); */
925 /* WMMenuSetEnabled(submenu, i, 0); */
926 /* i = WMMenuAddItem(submenu, _("Check for Disks"), */
927 /* NULL, fsViewer, NULL, NULL); */
928 /* WMMenuSetEnabled(submenu, i, 0); */
931 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("View"));
932 WMMenuAddSubmenu(fsViewer
->menu
, _("View"), submenu
);
933 WMMenuAddItem(submenu
, _("Browse"),
934 (WMMenuAction
)FSBrowseCB
, fsViewer
, NULL
, "B");
935 /* Diabled Icon Menu, because it does nothing then being present */
936 i
= WMMenuAddItem(submenu
, _("Icon"),
937 (WMMenuAction
)FSIconCB
, fsViewer
, NULL
, "I");
938 /* WMMenuSetEnabled(submenu, i, 0); */
939 WMMenuAddItem(submenu
, _("List"),
940 (WMMenuAction
)FSListCB
, fsViewer
, NULL
, "L");
941 WMMenuAddItem(submenu
, _("Sort"),
942 (WMMenuAction
)FSSortOrderCB
, fsViewer
, NULL
, "s");
943 /* i = WMMenuAddItem(submenu, _("Clean Up Icons"), */
944 /* NULL, fsViewer, NULL, NULL); */
945 /* WMMenuSetEnabled(submenu, i, 0); */
946 WMMenuAddItem(submenu
, _("Show .files"),
947 (WMMenuAction
)FSDotFilesCB
, fsViewer
, NULL
, "D");
948 WMMenuAddItem(submenu
, _("Filter..."),
949 (WMMenuAction
)FSFilterViewCB
, fsViewer
, NULL
, "f");
950 WMMenuAddItem(submenu
, _("New Viewer..."),
951 (WMMenuAction
)FSNewViewCB
, fsViewer
, NULL
, "N");
952 WMMenuAddItem(submenu
, _("Update View"),
953 (WMMenuAction
)FSUpdateViewCB
, fsViewer
, NULL
, "u");
956 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("Tools"));
957 WMMenuAddSubmenu(fsViewer
->menu
, _("Tools"), submenu
);
958 WMMenuAddItem(submenu
, _("Inspector..."),
959 (WMMenuAction
)FSInspectorCB
, fsViewer
, NULL
, "i");
960 i
= WMMenuAddItem(submenu
, _("Finder"),
961 (WMMenuAction
)FSFinderCB
, fsViewer
, NULL
, "F");
962 /* WMMenuSetEnabled(submenu, i, 0); */
963 i
= WMMenuAddItem(submenu
, _("Processes..."),
964 (WMMenuAction
)FSProcessCB
, fsViewer
, NULL
, "P");
965 /* WMMenuSetEnabled(submenu, i, 0); */
966 WMMenuAddItem(submenu
, _("Console..."),
967 (WMMenuAction
)FSConsoleCB
, fsViewer
, NULL
, "C");
970 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("Windows"));
971 WMMenuAddSubmenu(fsViewer
->menu
, _("Windows"), submenu
);
972 /* i = WMMenuAddItem(submenu, _("Arrange in Front"), */
973 /* NULL, fsViewer, NULL, NULL); */
974 /* WMMenuSetEnabled(submenu, i, 0); */
976 * This should contain a list of the windows
977 * Problem would be how to foucs them if they are
978 * added to the submenu. Would setting the focus to
982 * This is the standard key binding for miniaturizing windows
983 * under window maker. At this moment I can find a wmlib function
984 * to do this though I should put one together from the X functions
986 i
= WMMenuAddItem(submenu
, _("Miniaturize Window"),
987 (WMMenuAction
)FSMiniaturizeCB
, fsViewer
, NULL
, "m");
988 /* WMMenuSetEnabled(submenu, i, 0); */
989 i
= WMMenuAddItem(submenu
, _("Close Window"),
990 (WMMenuAction
)FSCloseWindowCB
, fsViewer
, NULL
, "w");
991 /* WMMenuSetEnabled(submenu, i, 0); */
993 /* Services Menu <- Custom stuff belongs here :) */
994 submenu
= WMMenuCreate(fsViewer
->wmContext
, _("Services"));
995 WMMenuAddSubmenu(fsViewer
->menu
, _("Services"), submenu
);
996 WMMenuAddItem(submenu
, _("File Edit..."),
997 (WMMenuAction
)FSEditCB
, fsViewer
, NULL
, "E");
998 WMMenuAddItem(submenu
, _("File Link..."),
999 (WMMenuAction
)FSLinkCB
, fsViewer
, NULL
, "l");
1000 WMMenuAddItem(submenu
, _("File New..."),
1001 (WMMenuAction
)FSNewFileCB
, fsViewer
, NULL
, NULL
);
1002 WMMenuAddItem(submenu
, _("File Rename..."),
1003 (WMMenuAction
)FSRenameCB
, fsViewer
, NULL
, NULL
);
1004 WMMenuAddItem(submenu
, _("File Run..."),
1005 (WMMenuAction
)FSRunCB
, fsViewer
, NULL
, "R");
1006 WMMenuAddItem(submenu
, _("Show Image"),
1007 (WMMenuAction
)FSViewCB
, fsViewer
, NULL
, "S");
1008 /* i = WMMenuAddItem(submenu, _("Show PDF"), */
1009 /* (WMMenuAction)FSViewCB, fsViewer, NULL, NULL); */
1010 /* WMMenuSetEnabled(submenu, i, 0); */
1013 WMMenuAddItem(fsViewer
->menu
, _("Hide"),
1014 (WMMenuAction
)FSHideCB
, fsViewer
, NULL
, "h");
1015 WMMenuAddItem(fsViewer
->menu
, _("Hide Others"),
1016 (WMMenuAction
)FSHideOthersCB
, fsViewer
, NULL
, NULL
);
1017 WMMenuAddItem(fsViewer
->menu
, _("Quit"),
1018 (WMMenuAction
)FSQuitCB
, fsViewer
, NULL
, "q");
1020 WMAppSetMainMenu(fsViewer
->wmContext
, fsViewer
->menu
);
1021 WMRealizeMenus(fsViewer
->wmContext
);